FreeBSD/sys/security/audit/bsm_token.c
/*
 * token ID                1 byte
 * zonename length         2 bytes
 * zonename                N bytes + 1 terminating NULL byte
 */
token ID                1 byte
zonename length         2 bytes
zonename                N bytes + 1 terminating NULL byte
token ID 1 byte zonename length 2 bytes zonename N bytes + 1 terminating NULL byte
token_t *
au_to_zonename(const char *zonename)
{
	u_char *dptr = NULL;
	u_int16_t textlen;
	token_t *t;
	textlen = strlen(zonename) + 1;
	GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + textlen);
	ADD_U_CHAR(dptr, AUT_ZONENAME);
	ADD_U_INT16(dptr, textlen);
	ADD_STRING(dptr, zonename, textlen);
	return (t);
}
token_t * au_to_zonename ( const char * zonename ) { u_char * dptr = NULL ; u_int16_t textlen ; token_t * t ; textlen = strlen ( zonename ) + 1 ; GET_TOKEN_AREA ( t , dptr , sizeof ( u_char ) + sizeof ( u_int16_t ) + textlen ) ; ADD_U_CHAR ( dptr , AUT_ZONENAME ) ; ADD_U_INT16 ( dptr , textlen ) ; ADD_STRING ( dptr , zonename , textlen ) ; return ( t ) ; }
token ID                1 byte
 zonename length         2 bytes
 zonename                N bytes + 1 terminating NULL byte
token ID 1 byte zonename length 2 bytes zonename N bytes + 1 terminating NULL byte