FreeBSD/sys/netpfil/ipfw/ip_fw_table.c
/*
 * Allow external consumers to read table entries in standard format.
 */
Allow external consumers to read table entries in standard format.
Allow external consumers to read table entries in standard format .
int
ipfw_foreach_table_tentry(struct ip_fw_chain *ch, uint16_t kidx,
    ta_foreach_f *f, void *arg)
{
	struct namedobj_instance *ni;
	struct table_config *tc;
	struct table_algo *ta;
	struct dump_args da;
	ni = CHAIN_TO_NI(ch);
	tc = (struct table_config *)ipfw_objhash_lookup_kidx(ni, kidx);
	if (tc == NULL)
		return (ESRCH);
	ta = tc->ta;
	memset(&da, 0, sizeof(da));
	da.ch = ch;
	da.ti = KIDX_TO_TI(ch, tc->no.kidx);
	da.tc = tc;
	da.f = f;
	da.farg = arg;
	ta->foreach(tc->astate, da.ti, prepare_table_tentry, &da);
	return (0);
}
int ipfw_foreach_table_tentry ( struct ip_fw_chain * ch , uint16_t kidx , ta_foreach_f * f , void * arg ) { struct namedobj_instance * ni ; struct table_config * tc ; struct table_algo * ta ; struct dump_args da ; ni = CHAIN_TO_NI ( ch ) ; tc = ( struct table_config * ) ipfw_objhash_lookup_kidx ( ni , kidx ) ; if ( tc == NULL ) return ( ESRCH ) ; ta = tc -> ta ; memset ( & da , 0 , sizeof ( da ) ) ; da . ch = ch ; da . ti = KIDX_TO_TI ( ch , tc -> no . kidx ) ; da . tc = tc ; da . f = f ; da . farg = arg ; ta -> foreach ( tc -> astate , da . ti , prepare_table_tentry , & da ) ; return ( 0 ) ; }
Allow external consumers to read table entries in standard format.
Allow external consumers to read table entries in standard format .