- All Implemented Interfaces:
Serializable
,Comparable<PcapTstampType>
,Constable
,IntSupplier
Time stamp types. Not all systems and interfaces will necessarily support all
of these.
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.
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 using
the system clock, so it's normally synchronized with times you'd 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 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. 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.
PCAP_TSTAMP_ADAPTER_UNSYNCED is a high-precision time stamp supplied by the
capture device; it's not synchronized with the system clock.
Note that time stamps synchronized with the system clock can go backwards, as
the system clock can go backwards. If a clock is not in sync with the system
clock, that could be because the system clock isn't keeping accurate time,
because the other clock isn't keeping accurate time, or both.
Note that host-provided time stamps generally correspond to the time when the
time-stamping full sees the packet; this could be some unknown amount of time
after the first or last bit of 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, 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
- Author:
- mark
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptiondevice-provided, synced with the system clock.device-provided, not synced with the system clock.host-provided, unknown characteristics.host-provided, high precision, synced with the system clock.host-provided, high precision, not synced with the system clock.host-provided, low precision, synced with the system clock. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
device-provided, synced with the system clock.static final int
device-provided, not synced with the system clock.static final int
host-provided, unknown characteristics.static final int
host-provided, high precision, synced with the system clock.static final int
host-provided, high precision, not synced with the system clock.static final int
host-provided, low precision, synced with the system clock. -
Method Summary
Modifier and TypeMethodDescriptionint
getAsInt()
Get TSTAMP_TYPE numerical constant.static Optional
<PcapTstampType> toEnum
(int tstampType) Converts numerical TSTAMP_TYPE constant to an enum, if found.static PcapTstampType
valueOf
(int tstampType) Converts numerical TSTAMP_TYPE constant to an enum.static PcapTstampType
Returns the enum constant of this class with the specified name.static PcapTstampType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TSTAMP_TYPE_HOST
host-provided, unknown characteristics. -
TSTAMP_TYPE_HOST_LOWPREC
host-provided, low precision, synced with the system clock. -
TSTAMP_TYPE_HOST_HIPREC
host-provided, high precision, synced with the system clock. -
TSTAMP_TYPE_ADAPTER
device-provided, synced with the system clock. -
TSTAMP_TYPE_ADAPTER_UNSYNCED
device-provided, not synced with the system clock. -
TSTAMP_TYPE_HOST_HIPREC_UNSYNCED
host-provided, high precision, not synced with the system clock.
-
-
Field Details
-
PCAP_TSTAMP_HOST
public static final int PCAP_TSTAMP_HOSThost-provided, unknown characteristics.- See Also:
-
PCAP_TSTAMP_HOST_LOWPREC
public static final int PCAP_TSTAMP_HOST_LOWPREChost-provided, low precision, synced with the system clock.- See Also:
-
PCAP_TSTAMP_HOST_HIPREC
public static final int PCAP_TSTAMP_HOST_HIPREChost-provided, high precision, synced with the system clock.- See Also:
-
PCAP_TSTAMP_ADAPTER
public static final int PCAP_TSTAMP_ADAPTERdevice-provided, synced with the system clock.- See Also:
-
PCAP_TSTAMP_ADAPTER_UNSYNCED
public static final int PCAP_TSTAMP_ADAPTER_UNSYNCEDdevice-provided, not synced with the system clock.- See Also:
-
PCAP_TSTAMP_HOST_HIPREC_UNSYNCED
public static final int PCAP_TSTAMP_HOST_HIPREC_UNSYNCEDhost-provided, high precision, not synced with the system clock.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toEnum
Converts numerical TSTAMP_TYPE constant to an enum, if found.- Parameters:
tstampType
- the PCAP integer timestamp type constant- Returns:
- the optional enum constant
-
valueOf
Converts numerical TSTAMP_TYPE constant to an enum.- Parameters:
tstampType
- the PCAP integer timestamp type constant- Returns:
- the PCAP timestamp type enum constant
- Throws:
IllegalArgumentException
- thrown if not found
-
getAsInt
public int getAsInt()Get TSTAMP_TYPE numerical constant.- Specified by:
getAsInt
in interfaceIntSupplier
- Returns:
- the timestamp type constant
- See Also:
-