FreeBSD/sys/net/bpf.c
/*
 * Zero out the various packet counters associated with all of the bpf
 * descriptors.  At some point, we will probably want to get a bit more
 * granular and allow the user to specify descriptors to be zeroed.
 */
Zero out the various packet counters associated with all of the bpf
descriptors.  At some point, we will probably want to get a bit more
granular and allow the user to specify descriptors to be zeroed.
Zero out the various packet counters associated with all of the bpf descriptors . At some point we will probably want to get a bit more granular and allow the user to specify descriptors to be zeroed .
static void
bpf_zero_counters(void)
{
	struct bpf_if *bp;
	struct bpf_d *bd;
	BPF_LOCK();
	LIST_FOREACH(bp, &bpf_iflist, bif_next) {
		BPFIF_RLOCK(bp);
		LIST_FOREACH(bd, &bp->bif_dlist, bd_next) {
			BPFD_LOCK(bd);
			bd->bd_rcount = 0;
			bd->bd_dcount = 0;
			bd->bd_fcount = 0;
			bd->bd_wcount = 0;
			bd->bd_wfcount = 0;
			bd->bd_zcopy = 0;
			BPFD_UNLOCK(bd);
		}
		BPFIF_RUNLOCK(bp);
	}
	BPF_UNLOCK();
}
static void bpf_zero_counters ( void ) { struct bpf_if * bp ; struct bpf_d * bd ; BPF_LOCK ( ) ; LIST_FOREACH ( bp , & bpf_iflist , bif_next ) { BPFIF_RLOCK ( bp ) ; LIST_FOREACH ( bd , & bp -> bif_dlist , bd_next ) { BPFD_LOCK ( bd ) ; bd -> bd_rcount = 0 ; bd -> bd_dcount = 0 ; bd -> bd_fcount = 0 ; bd -> bd_wcount = 0 ; bd -> bd_wfcount = 0 ; bd -> bd_zcopy = 0 ; BPFD_UNLOCK ( bd ) ; } BPFIF_RUNLOCK ( bp ) ; } BPF_UNLOCK ( ) ; }
Zero out the various packet counters associated with all of the bpf
 descriptors.
Zero out the various packet counters associated with all of the bpf descriptors .