Package jpcap.packet

Class ARPPacket

  • All Implemented Interfaces:
    java.io.Serializable

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

      • hardtype

        public short hardtype
        Hardware type
      • HARDTYPE_ETHER

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

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

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

        public short prototype
        Protocol type
      • hlen

        public short hlen
        Hardware address length
      • plen

        public short plen
        Protocol address length
      • operation

        public short operation
        Operation
      • RARP_REQUEST

        public static final short RARP_REQUEST
        Reverse ARP request
        See Also:
        Constant Field Values
      • INV_REQUEST

        public static final short INV_REQUEST
        Identify peer request
        See Also:
        Constant Field Values
      • 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 Detail

      • ARPPacket

        public ARPPacket()
    • Method Detail

      • getSenderHardwareAddress

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

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

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

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

        public java.lang.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