FreeBSD/sys/netpfil/ipfw/ip_fw_table.c
/*
 * Links @tc to @chain table named instance.
 * Sets appropriate type/states in @chain table info.
 */
Links @tc to @chain table named instance.
Sets appropriate type/states in @chain table info.
Links @tc to @chain table named instance . Sets appropriate type / states in @chain table info .
static void
link_table(struct ip_fw_chain *ch, struct table_config *tc)
{
	struct namedobj_instance *ni;
	struct table_info *ti;
	uint16_t kidx;
	IPFW_UH_WLOCK_ASSERT(ch);
	IPFW_WLOCK_ASSERT(ch);
	ni = CHAIN_TO_NI(ch);
	kidx = tc->no.kidx;
	ipfw_objhash_add(ni, &tc->no);
	ti = KIDX_TO_TI(ch, kidx);
	*ti = tc->ti_copy;
	if (tc->ta->change_ti != NULL)
		tc->ta->change_ti(tc->astate, ti);
	tc->linked = 1;
	tc->ta->refcnt++;
}
static void link_table ( struct ip_fw_chain * ch , struct table_config * tc ) { struct namedobj_instance * ni ; struct table_info * ti ; uint16_t kidx ; IPFW_UH_WLOCK_ASSERT ( ch ) ; IPFW_WLOCK_ASSERT ( ch ) ; ni = CHAIN_TO_NI ( ch ) ; kidx = tc -> no . kidx ; ipfw_objhash_add ( ni , & tc -> no ) ; ti = KIDX_TO_TI ( ch , kidx ) ; * ti = tc -> ti_copy ; if ( tc -> ta -> change_ti != NULL ) tc -> ta -> change_ti ( tc -> astate , ti ) ; tc -> linked = 1 ; tc -> ta -> refcnt ++ ; }
Links @tc to @chain table named instance.
Links @tc to @chain table named instance .
/* Notify algo on real @ti address */