sys/security/audit/audit_bsm_token.c
/*
 * token ID                1 byte
 * number groups           2 bytes
 * group list              count * 4 bytes
 */
token ID                1 byte
number groups           2 bytes
group list              count * 4 bytes
token ID 1 byte number groups 2 bytes group list count * 4 bytes
token_t *
au_to_newgroups(u_int16_t n, gid_t *groups)
{
	token_t *t;
	u_char *dptr = NULL;
	int i;
	GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) +
	    n * sizeof(u_int32_t));
	ADD_U_CHAR(dptr, AUT_NEWGROUPS);
	ADD_U_INT16(dptr, n);
	for (i = 0; i < n; i++)
		ADD_U_INT32(dptr, groups[i]);
	return (t);
}
token_t * au_to_newgroups ( u_int16_t n , gid_t * groups ) { token_t * t ; u_char * dptr = NULL ; int i ; GET_TOKEN_AREA ( t , dptr , sizeof ( u_char ) + sizeof ( u_int16_t ) + n * sizeof ( u_int32_t ) ) ; ADD_U_CHAR ( dptr , AUT_NEWGROUPS ) ; ADD_U_INT16 ( dptr , n ) ; for ( i = 0 ; i < n ; i ++ ) ADD_U_INT32 ( dptr , groups [ i ] ) ; return ( t ) ; }
token ID                1 byte
 number groups           2 bytes
 group list              count * 4 bytes
token ID 1 byte number groups 2 bytes group list count * 4 bytes