FreeBSD/sys/netpfil/ipfw/ip_fw_sockopt.c
/*
 * Removes index from given set.
 * Returns 0 on success.
 */
Removes index from given set.
Returns 0 on success.
Removes index from given set . Returns 0 on success .
int
ipfw_objhash_free_idx(struct namedobj_instance *ni, uint16_t idx)
{
	u_long *mask;
	int i, v;
	i = idx / BLOCK_ITEMS;
	v = idx % BLOCK_ITEMS;
	if (i >= ni->max_blocks)
		return (1);
	mask = &ni->idx_mask[i];
	if ((*mask & ((u_long)1 << v)) != 0)
		return (1);
	*mask |= (u_long)1 << v;
	if (ni->free_off[0] > i)
		ni->free_off[0] = i;
	return (0);
}
int ipfw_objhash_free_idx ( struct namedobj_instance * ni , uint16_t idx ) { u_long * mask ; int i , v ; i = idx / BLOCK_ITEMS ; v = idx % BLOCK_ITEMS ; if ( i >= ni -> max_blocks ) return ( 1 ) ; mask = & ni -> idx_mask [ i ] ; if ( ( * mask & ( ( u_long ) 1 << v ) ) != 0 ) return ( 1 ) ; * mask |= ( u_long ) 1 << v ; if ( ni -> free_off [ 0 ] > i ) ni -> free_off [ 0 ] = i ; return ( 0 ) ; }
Removes index from given set.
Removes index from given set .
/* Mark as free */ /* Update free offset */