FreeBSD/sys/netpfil/ipfw/ip_fw_sockopt.c
/*
 * Builds skipto cache on rule set @map.
 */
Builds skipto cache on rule set @map.
Builds skipto cache on rule set @map .
static void
update_skipto_cache(struct ip_fw_chain *chain, struct ip_fw **map)
{
	int *smap, rulenum;
	int i, mi;
	IPFW_UH_WLOCK_ASSERT(chain);
	mi = 0;
	rulenum = map[mi]->rulenum;
	smap = chain->idxmap_back;
	if (smap == NULL)
		return;
	for (i = 0; i < 65536; i++) {
		smap[i] = mi;
		if (i != rulenum || i == 65535)
			continue;
		rulenum = map[++mi]->rulenum;
		while (rulenum == i)
			rulenum = map[++mi]->rulenum;
	}
}
static void update_skipto_cache ( struct ip_fw_chain * chain , struct ip_fw * * map ) { int * smap , rulenum ; int i , mi ; IPFW_UH_WLOCK_ASSERT ( chain ) ; mi = 0 ; rulenum = map [ mi ] -> rulenum ; smap = chain -> idxmap_back ; if ( smap == NULL ) return ; for ( i = 0 ; i < 65536 ; i ++ ) { smap [ i ] = mi ; if ( i != rulenum || i == 65535 ) continue ; rulenum = map [ ++ mi ] -> rulenum ; while ( rulenum == i ) rulenum = map [ ++ mi ] -> rulenum ; } }
Builds skipto cache on rule set @map.
Builds skipto cache on rule set @map .
/* Use the same rule index until i < rulenum */ /* Find next rule with num > i */