Package jpcap.packet
Class ARPPacket
- java.lang.Object
-
- jpcap.packet.Packet
-
- jpcap.packet.ARPPacket
-
- All Implemented Interfaces:
java.io.Serializable
public class ARPPacket extends Packet
This class represents ARP/RARP packet.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static shortARP_REPLYARP replystatic shortARP_REQUESTARP requestshorthardtypeHardware typestatic shortHARDTYPE_ETHERHardware type: Ethernetstatic shortHARDTYPE_FRAMERELAYHardware type: Frame relaystatic shortHARDTYPE_IEEE802Hardware type: Token ringshorthlenHardware address lengthstatic shortINV_REPLYIdentify peer responsestatic shortINV_REQUESTIdentify peer requestshortoperationOperationshortplenProtocol address lengthshortprototypeProtocol typestatic shortPROTOTYPE_IPProtocol type: IPstatic shortRARP_REPLYReverse ARP replystatic shortRARP_REQUESTReverse ARP requestbyte[]sender_hardaddrSender hardware addressbyte[]sender_protoaddrSender protocol addressbyte[]target_hardaddrTarget hardware addressbyte[]target_protoaddrTarget protocol address
-
Constructor Summary
Constructors Constructor Description ARPPacket()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetSenderHardwareAddress()Returns the hardware address (MAC address) of the sender.java.lang.ObjectgetSenderProtocolAddress()Returns the protocol address of the sender.java.lang.ObjectgetTargetHardwareAddress()Returns the hardware address (MAC address) of the target.java.lang.ObjectgetTargetProtocolAddress()Returns the protocol address of the target.java.lang.StringtoString()Returns a string representation of this ARP/RARP packet.
Format: ARP(hardtype:prototype)
-
-
-
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
-
PROTOTYPE_IP
public static final short PROTOTYPE_IP
Protocol type: IP- See Also:
- Constant Field Values
-
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:
- Constant Field Values
-
ARP_REPLY
public static final short ARP_REPLY
ARP reply- See Also:
- Constant Field Values
-
RARP_REQUEST
public static final short RARP_REQUEST
Reverse ARP request- See Also:
- Constant Field Values
-
RARP_REPLY
public static final short RARP_REPLY
Reverse ARP reply- See Also:
- Constant Field Values
-
INV_REQUEST
public static final short INV_REQUEST
Identify peer request- See Also:
- Constant Field Values
-
INV_REPLY
public static final short INV_REPLY
Identify peer response- 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
-
-
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
-
-