Module org.jnetpcap

Enum Class PcapDirection

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

public enum PcapDirection extends Enum<PcapDirection> implements IntSupplier
Specifies the packet direction on a live capture, relative to the network interface.
Author:
Sly Technologies, repos@slytechs.com
  • Enum Constant Details

    • DIRECTION_INOUT

      public static final PcapDirection DIRECTION_INOUT
      Packet's direction is in either direction.
    • DIRECTION_IN

      public static final PcapDirection DIRECTION_IN
      Packet's direction is being received.
    • DIRECTION_OUT

      public static final PcapDirection DIRECTION_OUT
      Packet's direction is being transmitted.
  • Field Details

    • PCAP_DIRECTION_INOUT

      public static final int PCAP_DIRECTION_INOUT
      Packet's direction is in either direction.
      See Also:
    • PCAP_DIRECTION_IN

      public static final int PCAP_DIRECTION_IN
      Packet's direction is being received.
      See Also:
    • PCAP_DIRECTION_OUT

      public static final int PCAP_DIRECTION_OUT
      Packet's direction is being transmitted.
      See Also:
  • Method Details

    • values

      public static PcapDirection[] 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 PcapDirection 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
    • valueOf

      public static PcapDirection valueOf(int direction) throws IllegalArgumentException
      Converts integer pcap direction value to an enum.
      Parameters:
      direction - an integer PCAP direction constant
      Returns:
      the pcap direction enum
      Throws:
      IllegalArgumentException - thrown if not found
    • toEnum

      public static Optional<PcapDirection> toEnum(int direction)
      Converts integer pcap direction value to an enum.
      Parameters:
      direction - the direction
      Returns:
      the optional
    • getAsInt

      public int getAsInt()
      Gets the as int.
      Specified by:
      getAsInt in interface IntSupplier
      Returns:
      the as int
      See Also: