Package jpcap.packet
Class ARPPacket
java.lang.Object
jpcap.packet.Packet
jpcap.packet.ARPPacket
- All Implemented Interfaces:
Serializable
This class represents ARP/RARP packet.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortARP replystatic final shortARP requestshortHardware typestatic final shortHardware type: Ethernetstatic final shortHardware type: Frame relaystatic final shortHardware type: Token ringshortHardware address lengthstatic final shortIdentify peer responsestatic final shortIdentify peer requestshortOperationshortProtocol address lengthshortProtocol typestatic final shortProtocol type: IPstatic final shortReverse ARP replystatic final shortReverse ARP requestbyte[]Sender hardware addressbyte[]Sender protocol addressbyte[]Target hardware addressbyte[]Target protocol address -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the hardware address (MAC address) of the sender.Returns the protocol address of the sender.Returns the hardware address (MAC address) of the target.Returns the protocol address of the target.toString()Returns a string representation of this ARP/RARP packet.
Format: ARP(hardtype:prototype)
-
Field Details
-
hardtype
public short hardtypeHardware type -
HARDTYPE_ETHER
public static final short HARDTYPE_ETHERHardware type: Ethernet- See Also:
-
HARDTYPE_IEEE802
public static final short HARDTYPE_IEEE802Hardware type: Token ring- See Also:
-
HARDTYPE_FRAMERELAY
public static final short HARDTYPE_FRAMERELAYHardware type: Frame relay- See Also:
-
prototype
public short prototypeProtocol type -
PROTOTYPE_IP
public static final short PROTOTYPE_IPProtocol type: IP- See Also:
-
hlen
public short hlenHardware address length -
plen
public short plenProtocol address length -
operation
public short operationOperation -
ARP_REQUEST
public static final short ARP_REQUESTARP request- See Also:
-
ARP_REPLY
public static final short ARP_REPLYARP reply- See Also:
-
RARP_REQUEST
public static final short RARP_REQUESTReverse ARP request- See Also:
-
RARP_REPLY
public static final short RARP_REPLYReverse ARP reply- See Also:
-
INV_REQUEST
public static final short INV_REQUESTIdentify peer request- See Also:
-
INV_REPLY
public static final short INV_REPLYIdentify peer response- See Also:
-
sender_hardaddr
public byte[] sender_hardaddrSender hardware address -
sender_protoaddr
public byte[] sender_protoaddrSender protocol address -
target_hardaddr
public byte[] target_hardaddrTarget hardware address -
target_protoaddr
public byte[] target_protoaddrTarget protocol address
-
-
Constructor Details
-
ARPPacket
public ARPPacket()
-
-
Method Details
-
getSenderHardwareAddress
Returns the hardware address (MAC address) of the sender.- Returns:
- Hardware address of the sender
-
getTargetHardwareAddress
Returns the hardware address (MAC address) of the target.- Returns:
- Hardware address of the target
-
getSenderProtocolAddress
Returns the protocol address of the sender.- Returns:
- Protocol address of the sender
-
getTargetProtocolAddress
Returns the protocol address of the target.- Returns:
- Protocol address of the target
-
toString
Returns a string representation of this ARP/RARP packet.
Format: ARP(hardtype:prototype)
-