FreeBSD/sys/netpfil/ipfw/ip_fw_sockopt.c
/*
 * Flushes rules counters and/or log values on matching range.
 *
 * Returns number of items cleared.
 */
Flushes rules counters and/or log values on matching range.
Returns number of items cleared.
Flushes rules counters and / or log values on matching range . Returns number of items cleared .
static int
clear_range(struct ip_fw_chain *chain, ipfw_range_tlv *rt, int log_only)
{
	struct ip_fw *rule;
	int num;
	int i;
	num = 0;
	rt->flags |= IPFW_RCFLAG_DEFAULT;
	IPFW_UH_WLOCK(chain);	
	for (i = 0; i < chain->n_rules; i++) {
		rule = chain->map[i];
		if (ipfw_match_range(rule, rt) == 0)
			continue;
		clear_counters(rule, log_only);
		num++;
	}
	IPFW_UH_WUNLOCK(chain);
	return (num);
}
static int clear_range ( struct ip_fw_chain * chain , ipfw_range_tlv * rt , int log_only ) { struct ip_fw * rule ; int num ; int i ; num = 0 ; rt -> flags |= IPFW_RCFLAG_DEFAULT ; IPFW_UH_WLOCK ( chain ) ; for ( i = 0 ; i < chain -> n_rules ; i ++ ) { rule = chain -> map [ i ] ; if ( ipfw_match_range ( rule , rt ) == 0 ) continue ; clear_counters ( rule , log_only ) ; num ++ ; } IPFW_UH_WUNLOCK ( chain ) ; return ( num ) ; }
Flushes rules counters and/or log values on matching range.
Flushes rules counters and / or log values on matching range .
/* arbitrate writers */