xnu-4903.241.1/bsd/security/audit/audit_bsm_token.c
/*
 * token ID                1 byte
 * object ID type          1 byte
 * object ID               4 bytes
 */
token ID                1 byte
object ID type          1 byte
object ID               4 bytes
token ID 1 byte object ID type 1 byte object ID 4 bytes
token_t *
au_to_ipc(char type, int id)
{
	token_t *t;
	u_char *dptr = NULL;
	GET_TOKEN_AREA(t, dptr, 2 * sizeof(u_char) + sizeof(u_int32_t));
	ADD_U_CHAR(dptr, AUT_IPC);
	ADD_U_CHAR(dptr, type);
	ADD_U_INT32(dptr, id);
	return (t);
}
token_t * au_to_ipc ( char type , int id ) { token_t * t ; u_char * dptr = NULL ; GET_TOKEN_AREA ( t , dptr , 2 * sizeof ( u_char ) + sizeof ( u_int32_t ) ) ; ADD_U_CHAR ( dptr , AUT_IPC ) ; ADD_U_CHAR ( dptr , type ) ; ADD_U_INT32 ( dptr , id ) ; return ( t ) ; }
token ID                1 byte
 object ID type          1 byte
 object ID               4 bytes
token ID 1 byte object ID type 1 byte object ID 4 bytes