cvs commit: src/sys/net bpf.c bpfdesc.h
Christian S.J. Peron
csjp at FreeBSD.org
Sun Jul 24 17:21:18 GMT 2005
csjp 2005-07-24 17:21:18 UTC
FreeBSD src repository
sys/net bpf.c bpfdesc.h
Introduce new sysctl variable: net.bpf.stats. This sysctl variable can
be used to pass statistics regarding dropped, matched and received
packet counts from the kernel to user-space. While we are here
introduce a new counter for filtered or matched packets. We currently
keep track of packets received or dropped by the bpf device, but not
how many packets actually matched the bpf filter.
-Introduce net.bpf.stats sysctl OID
-Move sysctl variables after the function prototypes so we can
reference bpf_stats_sysctl(9) without build errors.
-Introduce bpf descriptor counter which is used mainly for sizing
of the xbpf_d array.
-Introduce a xbpf_d structure which will act as an external
representation of the bpf_d structure.
-Add a the following members to the bpfd structure:
bd_fcount - Number of packets which matched bpf filter
bd_pid - PID which opened the bpf device
bd_pcomm - Process name which opened the device.
It should be noted that it's possible that the process which opened
the device could be long gone at the time of stats collection. An
example might be a process that opens the bpf device forks then exits
leaving the child process with the bpf fd.
Reviewed by: mdodd
Revision Changes Path
1.154 +91 -14 src/sys/net/bpf.c
1.30 +26 -0 src/sys/net/bpfdesc.h
More information about the cvs-src