diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-11-16 20:43:16 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-11-16 20:43:34 -0800 |
commit | bf0a7f8c86b95fc25a441cbc7969b4e2be2cbfaa (patch) | |
tree | 16a489b40307d888f40f1074c453beb3fd8b1069 /pcap/pcap.h | |
parent | 71fc9405b66ca1833f565bffff415e646e67d7cd (diff) |
Make "{un}synced with the system clock" a property of more time stamp types.
Define PCAP_TSTAMP_HOST_{LOW,HI}PREC as synced with the system clock;
add a new PCAP_TSTAMP_HOST_HIPREC_UNSYNCED type for high-precision time
stamps not necessarily synced with the system clock.
This should better match Npcap, including a proposed future "high
precision and synced with the system clock" time stamps for Npcap on
Windows 8 and later.
(This may still not match what FreeBSD offers, but at least it removes
an Npcap mismatch.)
Diffstat (limited to 'pcap/pcap.h')
-rw-r--r-- | pcap/pcap.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/pcap/pcap.h b/pcap/pcap.h index 96519fae..0f139137 100644 --- a/pcap/pcap.h +++ b/pcap/pcap.h @@ -360,8 +360,7 @@ PCAP_API int pcap_set_protocol_linux(pcap_t *, int); * * A system that supports PCAP_TSTAMP_HOST is offering time stamps * provided by the host machine, rather than by the capture device, - * but not committing to any characteristics of the time stamp; - * it will not offer any of the PCAP_TSTAMP_HOST_ subtypes. + * but not committing to any characteristics of the time stamp. * * PCAP_TSTAMP_HOST_LOWPREC is a time stamp, provided by the host machine, * that's low-precision but relatively cheap to fetch; it's normally done @@ -369,10 +368,15 @@ PCAP_API int pcap_set_protocol_linux(pcap_t *, int); * fetch from system calls. * * PCAP_TSTAMP_HOST_HIPREC is a time stamp, provided by the host machine, - * that's high-precision; it might be more expensive to fetch. It might - * or might not be synchronized with the system clock, and might have + * that's high-precision; it might be more expensive to fetch. It is + * synchronized with the system clock. + * + * PCAP_TSTAMP_HOST_HIPREC_UNSYNCED is a time stamp, provided by the host + * machine, that's high-precision; it might be more expensive to fetch. + * It is not synchronized with the system clock, and might have * problems with time stamps for packets received on different CPUs, - * depending on the platform. + * depending on the platform. It might be more likely to be strictly + * monotonic than PCAP_TSTAMP_HOST_HIPREC. * * PCAP_TSTAMP_ADAPTER is a high-precision time stamp supplied by the * capture device; it's synchronized with the system clock. @@ -392,11 +396,12 @@ PCAP_API int pcap_set_protocol_linux(pcap_t *, int); * the packet is received by the network adapter, due to batching * of interrupts for packet arrival, queueing delays, etc.. */ -#define PCAP_TSTAMP_HOST 0 /* host-provided, unknown characteristics */ -#define PCAP_TSTAMP_HOST_LOWPREC 1 /* host-provided, low precision */ -#define PCAP_TSTAMP_HOST_HIPREC 2 /* host-provided, high precision */ -#define PCAP_TSTAMP_ADAPTER 3 /* device-provided, synced with the system clock */ -#define PCAP_TSTAMP_ADAPTER_UNSYNCED 4 /* device-provided, not synced with the system clock */ +#define PCAP_TSTAMP_HOST 0 /* host-provided, unknown characteristics */ +#define PCAP_TSTAMP_HOST_LOWPREC 1 /* host-provided, low precision, synced with the system clock */ +#define PCAP_TSTAMP_HOST_HIPREC 2 /* host-provided, high precision, synced with the system clock */ +#define PCAP_TSTAMP_ADAPTER 3 /* device-provided, synced with the system clock */ +#define PCAP_TSTAMP_ADAPTER_UNSYNCED 4 /* device-provided, not synced with the system clock */ +#define PCAP_TSTAMP_HOST_HIPREC_UNSYNCED 5 /* host-provided, high precision, not synced with the system clock */ /* * Time stamp resolution types. |