Module org.jnetpcap

Enum Class PcapTstampType

java.lang.Object
java.lang.Enum<PcapTstampType>
org.jnetpcap.constant.PcapTstampType
All Implemented Interfaces:
Serializable, Comparable<PcapTstampType>, Constable, IntSupplier

public enum PcapTstampType extends Enum<PcapTstampType> implements 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
  • Enum Constant Details

    • TSTAMP_TYPE_HOST

      public static final PcapTstampType TSTAMP_TYPE_HOST
      host-provided, unknown characteristics.
    • TSTAMP_TYPE_HOST_LOWPREC

      public static final PcapTstampType TSTAMP_TYPE_HOST_LOWPREC
      host-provided, low precision, synced with the system clock.
    • TSTAMP_TYPE_HOST_HIPREC

      public static final PcapTstampType TSTAMP_TYPE_HOST_HIPREC
      host-provided, high precision, synced with the system clock.
    • TSTAMP_TYPE_ADAPTER

      public static final PcapTstampType TSTAMP_TYPE_ADAPTER
      device-provided, synced with the system clock.
    • TSTAMP_TYPE_ADAPTER_UNSYNCED

      public static final PcapTstampType TSTAMP_TYPE_ADAPTER_UNSYNCED
      device-provided, not synced with the system clock.
    • TSTAMP_TYPE_HOST_HIPREC_UNSYNCED

      public static final PcapTstampType 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_HOST
      host-provided, unknown characteristics.
      See Also:
    • PCAP_TSTAMP_HOST_LOWPREC

      public static final int PCAP_TSTAMP_HOST_LOWPREC
      host-provided, low precision, synced with the system clock.
      See Also:
    • PCAP_TSTAMP_HOST_HIPREC

      public static final int PCAP_TSTAMP_HOST_HIPREC
      host-provided, high precision, synced with the system clock.
      See Also:
    • PCAP_TSTAMP_ADAPTER

      public static final int PCAP_TSTAMP_ADAPTER
      device-provided, synced with the system clock.
      See Also:
    • PCAP_TSTAMP_ADAPTER_UNSYNCED

      public static final int PCAP_TSTAMP_ADAPTER_UNSYNCED
      device-provided, not synced with the system clock.
      See Also:
    • PCAP_TSTAMP_HOST_HIPREC_UNSYNCED

      public static final int PCAP_TSTAMP_HOST_HIPREC_UNSYNCED
      host-provided, high precision, not synced with the system clock.
      See Also:
  • Method Details

    • values

      public static PcapTstampType[] 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

      public static PcapTstampType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • toEnum

      public static Optional<PcapTstampType> toEnum(int tstampType)
      Converts numerical TSTAMP_TYPE constant to an enum, if found.
      Parameters:
      tstampType - the PCAP integer timestamp type constant
      Returns:
      the optional enum constant
    • valueOf

      public static PcapTstampType valueOf(int tstampType) throws IllegalArgumentException
      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 interface IntSupplier
      Returns:
      the timestamp type constant
      See Also: