xnu-4903.241.1/bsd/security/audit/audit_bsm_token.c
/*
 * token ID                1 byte
 * path length             2 bytes
 * path                    N bytes + 1 terminating NULL byte
 */
token ID                1 byte
path length             2 bytes
path                    N bytes + 1 terminating NULL byte
token ID 1 byte path length 2 bytes path N bytes + 1 terminating NULL byte
token_t *
au_to_path(const char *text)
{
	token_t *t;
	u_char *dptr = NULL;
	u_int16_t textlen;
	textlen = strlen(text);
	textlen += 1;
	GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + textlen);
	ADD_U_CHAR(dptr, AUT_PATH);
	ADD_U_INT16(dptr, textlen);
	ADD_STRING(dptr, text, textlen);
	return (t);
}
token_t * au_to_path ( const char * text ) { token_t * t ; u_char * dptr = NULL ; u_int16_t textlen ; textlen = strlen ( text ) ; textlen += 1 ; GET_TOKEN_AREA ( t , dptr , sizeof ( u_char ) + sizeof ( u_int16_t ) + textlen ) ; ADD_U_CHAR ( dptr , AUT_PATH ) ; ADD_U_INT16 ( dptr , textlen ) ; ADD_STRING ( dptr , text , textlen ) ; return ( t ) ; }
token ID                1 byte
 path length             2 bytes
 path                    N bytes + 1 terminating NULL byte
token ID 1 byte path length 2 bytes path N bytes + 1 terminating NULL byte