FreeBSD/sys/netpfil/ipfw/ip_fw_sockopt.c
/*
 * Runs @func for each found named object.
 * It is safe to delete objects from callback
 */
Runs @func for each found named object.
It is safe to delete objects from callback
Runs @func for each found named object . It is safe to delete objects from callback
int
ipfw_objhash_foreach(struct namedobj_instance *ni, objhash_cb_t *f, void *arg)
{
	struct named_object *no, *no_tmp;
	int i, ret;
	for (i = 0; i < ni->nn_size; i++) {
		TAILQ_FOREACH_SAFE(no, &ni->names[i], nn_next, no_tmp) {
			ret = f(ni, no, arg);
			if (ret != 0)
				return (ret);
		}
	}
	return (0);
}
int ipfw_objhash_foreach ( struct namedobj_instance * ni , objhash_cb_t * f , void * arg ) { struct named_object * no , * no_tmp ; int i , ret ; for ( i = 0 ; i < ni -> nn_size ; i ++ ) { TAILQ_FOREACH_SAFE ( no , & ni -> names [ i ] , nn_next , no_tmp ) { ret = f ( ni , no , arg ) ; if ( ret != 0 ) return ( ret ) ; } } return ( 0 ) ; }
Runs @func for each found named object.
Runs @func for each found named object .