summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf.h
diff options
context:
space:
mode:
authorlstewart <lstewart@FreeBSD.org>2011-11-21 04:17:24 +0000
committerlstewart <lstewart@FreeBSD.org>2011-11-21 04:17:24 +0000
commit1ce25155b2d01208512db186340fcee21173a4c8 (patch)
tree5b5d10522551ac013935e99d594da8cbc53c83a4 /sys/net/bpf.h
parentbda11ecfe1fe5a397eca69e769e9a3e1fcf1cfff (diff)
downloadFreeBSD-src-1ce25155b2d01208512db186340fcee21173a4c8.zip
FreeBSD-src-1ce25155b2d01208512db186340fcee21173a4c8.tar.gz
- When feed-forward clock support is compiled in, change the BPF header to
contain both a regular timestamp obtained from the system clock and the current feed-forward ffcounter value. This enables new possibilities including comparison of timekeeping performance and timestamp correction during post processing. - Add the net.bpf.ffclock_tstamp sysctl to provide a choice between timestamping packets using the feedback or feed-forward system clock. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au)
Diffstat (limited to 'sys/net/bpf.h')
-rw-r--r--sys/net/bpf.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/net/bpf.h b/sys/net/bpf.h
index d4c369d..8a80514 100644
--- a/sys/net/bpf.h
+++ b/sys/net/bpf.h
@@ -1,12 +1,17 @@
/*-
* Copyright (c) 1990, 1991, 1993
- * The Regents of the University of California. All rights reserved.
+ * The Regents of the University of California.
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
*
* This code is derived from the Stanford/CMU enet packet filter,
* (net/enet.c) distributed as part of 4.3BSD, and code contributed
* to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
* Berkeley Laboratory.
*
+ * Portions of this software were developed by Julien Ridoux at the University
+ * of Melbourne under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -170,11 +175,21 @@ enum bpf_direction {
#define BPF_T_MONOTONIC 0x0200
#define BPF_T_MONOTONIC_FAST (BPF_T_FAST | BPF_T_MONOTONIC)
#define BPF_T_FLAG_MASK 0x0300
+#ifdef FFCLOCK
+#define BPF_T_FFCLOCK 0x8000
+#define BPF_T_CLOCK_MASK 0x8000
+#endif
#define BPF_T_FORMAT(t) ((t) & BPF_T_FORMAT_MASK)
#define BPF_T_FLAG(t) ((t) & BPF_T_FLAG_MASK)
+#ifdef FFCLOCK
+#define BPF_T_VALID(t) \
+ ((t) == BPF_T_NONE || (BPF_T_FORMAT(t) != BPF_T_NONE && \
+ ((t) & ~(BPF_T_FORMAT_MASK | BPF_T_FLAG_MASK | BPF_T_CLOCK_MASK)) == 0))
+#else
#define BPF_T_VALID(t) \
((t) == BPF_T_NONE || (BPF_T_FORMAT(t) != BPF_T_NONE && \
((t) & ~(BPF_T_FORMAT_MASK | BPF_T_FLAG_MASK)) == 0))
+#endif
#define BPF_T_MICROTIME_FAST (BPF_T_MICROTIME | BPF_T_FAST)
#define BPF_T_NANOTIME_FAST (BPF_T_NANOTIME | BPF_T_FAST)
@@ -199,6 +214,9 @@ struct bpf_xhdr {
bpf_u_int32 bh_datalen; /* original length of packet */
u_short bh_hdrlen; /* length of bpf header (this struct
plus alignment padding) */
+#ifdef FFCLOCK
+ ffcounter ffcount_stamp; /* feed-forward counter timestamp */
+#endif
};
/* Obsolete */
struct bpf_hdr {
@@ -207,6 +225,9 @@ struct bpf_hdr {
bpf_u_int32 bh_datalen; /* original length of packet */
u_short bh_hdrlen; /* length of bpf header (this struct
plus alignment padding) */
+#ifdef FFCLOCK
+ ffcounter ffcount_stamp; /* feed-forward counter timestamp */
+#endif
};
#ifdef _KERNEL
#define MTAG_BPF 0x627066
OpenPOWER on IntegriCloud