Package jpcap.packet

Class ARPPacket

java.lang.Object
jpcap.packet.Packet
jpcap.packet.ARPPacket
All Implemented Interfaces:
Serializable

public class ARPPacket extends Packet
This class represents ARP/RARP packet.
See Also:
  • Field Details

    • hardtype

      public short hardtype
      Hardware type
    • HARDTYPE_ETHER

      public static final short HARDTYPE_ETHER
      Hardware type: Ethernet
      See Also:
    • HARDTYPE_IEEE802

      public static final short HARDTYPE_IEEE802
      Hardware type: Token ring
      See Also:
    • HARDTYPE_FRAMERELAY

      public static final short HARDTYPE_FRAMERELAY
      Hardware type: Frame relay
      See Also:
    • prototype

      public short prototype
      Protocol type
    • PROTOTYPE_IP

      public static final short PROTOTYPE_IP
      Protocol type: IP
      See Also:
    • hlen

      public short hlen
      Hardware address length
    • plen

      public short plen
      Protocol address length
    • operation

      public short operation
      Operation
    • ARP_REQUEST

      public static final short ARP_REQUEST
      ARP request
      See Also:
    • ARP_REPLY

      public static final short ARP_REPLY
      ARP reply
      See Also:
    • RARP_REQUEST

      public static final short RARP_REQUEST
      Reverse ARP request
      See Also:
    • RARP_REPLY

      public static final short RARP_REPLY
      Reverse ARP reply
      See Also:
    • INV_REQUEST

      public static final short INV_REQUEST
      Identify peer request
      See Also:
    • INV_REPLY

      public static final short INV_REPLY
      Identify peer response
      See Also:
    • sender_hardaddr

      public byte[] sender_hardaddr
      Sender hardware address
    • sender_protoaddr

      public byte[] sender_protoaddr
      Sender protocol address
    • target_hardaddr

      public byte[] target_hardaddr
      Target hardware address
    • target_protoaddr

      public byte[] target_protoaddr
      Target protocol address
  • Constructor Details

    • ARPPacket

      public ARPPacket()
  • Method Details

    • getSenderHardwareAddress

      public Object getSenderHardwareAddress()
      Returns the hardware address (MAC address) of the sender.
      Returns:
      Hardware address of the sender
    • getTargetHardwareAddress

      public Object getTargetHardwareAddress()
      Returns the hardware address (MAC address) of the target.
      Returns:
      Hardware address of the target
    • getSenderProtocolAddress

      public Object getSenderProtocolAddress()
      Returns the protocol address of the sender.
      Returns:
      Protocol address of the sender
    • getTargetProtocolAddress

      public Object getTargetProtocolAddress()
      Returns the protocol address of the target.
      Returns:
      Protocol address of the target
    • toString

      public String toString()
      Returns a string representation of this ARP/RARP packet.

      Format: ARP(hardtype:prototype)
      Overrides:
      toString in class Packet
      Returns:
      a string representation of this ARP/RARP packet