Module org.jnetpcap

Enum Class SockAddrFamily

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

public enum SockAddrFamily extends Enum<SockAddrFamily> implements IntSupplier
The socket address protocol family constants. Each protocol family has a different layout for physical addresses in SockAddr structure and is essential to decoding those addresses correctly.
  • Enum Constant Details

  • Method Details

    • values

      public static SockAddrFamily[] 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 SockAddrFamily 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
    • lookup

      public static Optional<SockAddrFamily> lookup(int family)
      Lookup a constant AF using numerical, platform dependent value.
      Parameters:
      family - the AF value
      Returns:
      optional constant
    • checkIfContains

      public boolean checkIfContains(PcapIf dev)
      Check if a PcapIf (pcap device) contains this specific socket AF type.
      Parameters:
      dev - the pcap dev
      Returns:
      true, if successful
    • getAsInt

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

      public boolean isMatch(int family)
      Checks if is match.
      Parameters:
      family - the family
      Returns:
      true, if is match
    • totalLength

      public OptionalInt totalLength()
      The total length of the socket address structure in bytes. The value is only returned on certain platforms (BSD style sockets)..
      Returns:
      the length of the address structure if available on this particular platform