Module org.jnetpcap

Enum Class PcapSrc

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

public enum PcapSrc extends Enum<PcapSrc> implements IntSupplier
Internal representation of the type of source in use (file, remote/local interface).
Author:
Sly Technologies Inc, repos@slytechs.com, mark
  • Enum Constant Details

    • SRC_FILE

      public static final PcapSrc SRC_FILE
      Internal representation of the type of source in use (file, remote/local interface).
    • SRC_IFLOCAL

      public static final PcapSrc SRC_IFLOCAL
      local network interface.
    • SRC_IFREMOTE

      public static final PcapSrc SRC_IFREMOTE
      interface on a remote host, using RPCAP.
  • Field Details

    • PCAP_SRC_FILE

      public static final int PCAP_SRC_FILE
      local savefile.
      See Also:
    • PCAP_SRC_IFLOCAL

      public static final int PCAP_SRC_IFLOCAL
      local network interface.
      See Also:
    • PCAP_SRC_IFREMOTE

      public static final int PCAP_SRC_IFREMOTE
      interface on a remote host, using RPCAP.
      See Also:
  • Method Details

    • values

      public static PcapSrc[] 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 PcapSrc 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 PcapSrc valueOf(int src) throws IllegalArgumentException
      Converts PCAP src numerical constant to an enum constant.
      Parameters:
      src - the PCAP src numerical constant
      Returns:
      the PCAP src enum constant
      Throws:
      IllegalArgumentException - thrown if not found
    • toEnum

      public static Optional<PcapSrc> toEnum(int src) throws IllegalArgumentException
      Converts PCAP src numerical constant to an enum constant, if found.
      Parameters:
      src - the PCAP src numerical constant
      Returns:
      the PCAP src enum constant
      Throws:
      IllegalArgumentException - thrown if not found
    • getAsInt

      public int getAsInt()
      Get int value of type.
      Specified by:
      getAsInt in interface IntSupplier
      Returns:
      The type of input source, passed to pcap_open
      See Also: