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 short
ARP_REPLY
ARP replystatic short
ARP_REQUEST
ARP requestshort
hardtype
Hardware typestatic short
HARDTYPE_ETHER
Hardware type: Ethernetstatic short
HARDTYPE_FRAMERELAY
Hardware type: Frame relaystatic short
HARDTYPE_IEEE802
Hardware type: Token ringshort
hlen
Hardware address lengthstatic short
INV_REPLY
Identify peer responsestatic short
INV_REQUEST
Identify peer requestshort
operation
Operationshort
plen
Protocol address lengthshort
prototype
Protocol typestatic short
PROTOTYPE_IP
Protocol type: IPstatic short
RARP_REPLY
Reverse ARP replystatic short
RARP_REQUEST
Reverse ARP requestbyte[]
sender_hardaddr
Sender hardware addressbyte[]
sender_protoaddr
Sender protocol addressbyte[]
target_hardaddr
Target hardware addressbyte[]
target_protoaddr
Target protocol address
-
Constructor Summary
Constructors Constructor Description ARPPacket()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getSenderHardwareAddress()
Returns the hardware address (MAC address) of the sender.java.lang.Object
getSenderProtocolAddress()
Returns the protocol address of the sender.java.lang.Object
getTargetHardwareAddress()
Returns the hardware address (MAC address) of the target.java.lang.Object
getTargetProtocolAddress()
Returns the protocol address of the target.java.lang.String
toString()
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
-
-