Module org.jnetpcap
Package org.jnetpcap

Class SockAddr.LinkSockAddr

java.lang.Object
org.jnetpcap.SockAddr
org.jnetpcap.SockAddr.LinkSockAddr
Enclosing class:
SockAddr

public static final class SockAddr.LinkSockAddr extends SockAddr
The structure of sockaddr_dl, used with AF_LINK sockets on macOS to access link-layer information.
  • Method Details

    • data

      public byte[] data()
      Variable-length data containing, interface name (null-terminated), Link-layer address Link-layer and selector (if any).
      Overrides:
      data in class SockAddr
      Returns:
      data field value
    • index

      public int index()
      Interface index of the network device.
      Returns:
      index field value
    • addressType

      public int addressType()
      Link-layer address type (e.g., IFT_ETHER for Ethernet).
      Returns:
      type field value
    • nameLength

      public int nameLength()
      Length of the interface name string.
      Returns:
      nlen field value
    • addressLength

      public int addressLength()
      Length of the link-layer address in bytes.
      Returns:
      alen field value
    • selectorLength

      public int selectorLength()
      Selector length.
      Returns:
      type field value
    • address

      public Optional<byte[]> address()
      Length of the link-layer selector (usually 0).
      Returns:
      address field value
    • name

      public Optional<String> name()
      interface name.
      Returns:
      name field value
    • selector

      public OptionalInt selector()
      Link-layer selector.
      Returns:
      selector field value
    • toString

      public String toString()
      String representation of the structure field values.
      Overrides:
      toString in class SockAddr
      Returns:
      the string
      See Also: