xnu-4903.241.1/bsd/security/audit/audit_bsm_token.c
/*
 * token ID                1 byte
 * trailer magic number    2 bytes
 * record byte count       4 bytes
 */
token ID                1 byte
trailer magic number    2 bytes
record byte count       4 bytes
token ID 1 byte trailer magic number 2 bytes record byte count 4 bytes
token_t *
au_to_trailer(int rec_size)
{
	token_t *t;
	u_char *dptr = NULL;
	u_int16_t magic = AUT_TRAILER_MAGIC;
	GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) +
	    sizeof(u_int32_t));
	ADD_U_CHAR(dptr, AUT_TRAILER);
	ADD_U_INT16(dptr, magic);
	ADD_U_INT32(dptr, rec_size);
	return (t);
}
token_t * au_to_trailer ( int rec_size ) { token_t * t ; u_char * dptr = NULL ; u_int16_t magic = AUT_TRAILER_MAGIC ; GET_TOKEN_AREA ( t , dptr , sizeof ( u_char ) + sizeof ( u_int16_t ) + sizeof ( u_int32_t ) ) ; ADD_U_CHAR ( dptr , AUT_TRAILER ) ; ADD_U_INT16 ( dptr , magic ) ; ADD_U_INT32 ( dptr , rec_size ) ; return ( t ) ; }
token ID                1 byte
 trailer magic number    2 bytes
 record byte count       4 bytes
token ID 1 byte trailer magic number 2 bytes record byte count 4 bytes