FreeBSD/sys/netpfil/ipfw/ip_fw_sockopt.c
/*
 * Requests @needed contiguous bytes from @sd buffer.
 * Function is used to notify subsystem that we are
 * interesed in first @needed bytes (request header)
 * and the rest buffer can be safely zeroed.
 *
 * Returns pointer to requested space or NULL.
 */
Requests @needed contiguous bytes from @sd buffer.
Function is used to notify subsystem that we are
interesed in first @needed bytes (request header)
and the rest buffer can be safely zeroed.

Returns pointer to requested space or NULL.
Requests @needed contiguous bytes from @sd buffer . Function is used to notify subsystem that we are interesed in first @needed bytes ( request header ) and the rest buffer can be safely zeroed . Returns pointer to requested space or NULL .
caddr_t
ipfw_get_sopt_header(struct sockopt_data *sd, size_t needed)
{
	caddr_t addr;
	if ((addr = ipfw_get_sopt_space(sd, needed)) == NULL)
		return (NULL);
	if (sd->kavail > 0)
		memset(sd->kbuf + sd->koff, 0, sd->kavail);
	return (addr);
}
caddr_t ipfw_get_sopt_header ( struct sockopt_data * sd , size_t needed ) { caddr_t addr ; if ( ( addr = ipfw_get_sopt_space ( sd , needed ) ) == NULL ) return ( NULL ) ; if ( sd -> kavail > 0 ) memset ( sd -> kbuf + sd -> koff , 0 , sd -> kavail ) ; return ( addr ) ; }
Requests @needed contiguous bytes from @sd buffer.
Requests @needed contiguous bytes from @sd buffer .