summaryrefslogtreecommitdiffstats
path: root/sys/net/bpfdesc.h
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-06-15 19:28:44 +0000
committerjkim <jkim@FreeBSD.org>2010-06-15 19:28:44 +0000
commit14f08fd6272b6042eef9e52239ed552feb9c126c (patch)
tree7fbda1d0820b3e7d313b910158875757fdde63ff /sys/net/bpfdesc.h
parent3571902304966f5edad4bceddc7fb3170f4ff982 (diff)
downloadFreeBSD-src-14f08fd6272b6042eef9e52239ed552feb9c126c.zip
FreeBSD-src-14f08fd6272b6042eef9e52239ed552feb9c126c.tar.gz
Implement flexible BPF timestamping framework.
- Allow setting format, resolution and accuracy of BPF time stamps per listener. Previously, we were only able to use microtime(9). Now we can set various resolutions and accuracies with ioctl(2) BIOCSTSTAMP command. Similarly, we can get the current resolution and accuracy with BIOCGTSTAMP command. Document all supported options in bpf(4) and their uses. - Introduce new time stamp 'struct bpf_ts' and header 'struct bpf_xhdr'. The new time stamp has both 64-bit second and fractional parts. bpf_xhdr has this time stamp instead of 'struct timeval' for bh_tstamp. The new structures let us use bh_tstamp of same size on both 32-bit and 64-bit platforms without adding additional shims for 32-bit binaries. On 64-bit platforms, size of BPF header does not change compared to bpf_hdr as its members are already all 64-bit long. On 32-bit platforms, the size may increase by 8 bytes. For backward compatibility, struct bpf_hdr with struct timeval is still the default header unless new time stamp format is explicitly requested. However, the behaviour may change in the future and all relevant code is wrapped around "#ifdef BURN_BRIDGES" for now. - Add experimental support for tagging mbufs with time stamps from a lower layer, e.g., device driver. Currently, mbuf_tags(9) is used to tag mbufs. The time stamps must be uptime in 'struct bintime' format as binuptime(9) and getbinuptime(9) do. Reviewed by: net@
Diffstat (limited to 'sys/net/bpfdesc.h')
-rw-r--r--sys/net/bpfdesc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h
index 03cb20d..14a895c 100644
--- a/sys/net/bpfdesc.h
+++ b/sys/net/bpfdesc.h
@@ -81,6 +81,7 @@ struct bpf_d {
u_char bd_immediate; /* true to return on packet arrival */
int bd_hdrcmplt; /* false to fill in src lladdr automatically */
int bd_direction; /* select packet direction */
+ int bd_tstamp; /* select time stamping function */
int bd_feedback; /* true to feed back sent packets */
int bd_async; /* non-zero if packet reception should generate signal */
int bd_sig; /* signal to send upon packet reception */
OpenPOWER on IntegriCloud