public class ARP extends BasePacket
| Modifier and Type | Field and Description |
|---|---|
protected byte |
hardwareAddressLength |
protected short |
hardwareType |
static short |
HW_TYPE_ETHERNET |
static short |
OP_RARP_REPLY |
static short |
OP_RARP_REQUEST |
static short |
OP_REPLY |
static short |
OP_REQUEST |
protected short |
opCode |
static short |
PROTO_TYPE_IP |
protected byte |
protocolAddressLength |
protected short |
protocolType |
protected byte[] |
senderHardwareAddress |
protected byte[] |
senderProtocolAddress |
protected byte[] |
targetHardwareAddress |
protected byte[] |
targetProtocolAddress |
parent, payload| Constructor and Description |
|---|
ARP() |
| Modifier and Type | Method and Description |
|---|---|
IPacket |
deserialize(byte[] data,
int offset,
int length)
Deserializes this packet layer and all possible payloads
|
boolean |
equals(java.lang.Object obj) |
byte |
getHardwareAddressLength() |
short |
getHardwareType() |
short |
getOpCode() |
byte |
getProtocolAddressLength() |
short |
getProtocolType() |
byte[] |
getSenderHardwareAddress() |
byte[] |
getSenderProtocolAddress() |
byte[] |
getTargetHardwareAddress() |
byte[] |
getTargetProtocolAddress() |
int |
hashCode() |
boolean |
isGratuitous() |
byte[] |
serialize()
Sets all payloads parent packet if applicable, then serializes this
packet and all payloads
|
ARP |
setHardwareAddressLength(byte hardwareAddressLength) |
ARP |
setHardwareType(short hardwareType) |
ARP |
setOpCode(short opCode) |
ARP |
setProtocolAddressLength(byte protocolAddressLength) |
ARP |
setProtocolType(short protocolType) |
ARP |
setSenderHardwareAddress(byte[] senderHardwareAddress) |
ARP |
setSenderProtocolAddress(byte[] senderProtocolAddress) |
ARP |
setSenderProtocolAddress(int address) |
ARP |
setTargetHardwareAddress(byte[] targetHardwareAddress) |
ARP |
setTargetProtocolAddress(byte[] targetProtocolAddress) |
ARP |
setTargetProtocolAddress(int address) |
java.lang.String |
toString() |
clone, getParent, getPayload, resetChecksum, setParent, setPayloadpublic static short HW_TYPE_ETHERNET
public static short PROTO_TYPE_IP
public static short OP_REQUEST
public static short OP_REPLY
public static short OP_RARP_REQUEST
public static short OP_RARP_REPLY
protected short hardwareType
protected short protocolType
protected byte hardwareAddressLength
protected byte protocolAddressLength
protected short opCode
protected byte[] senderHardwareAddress
protected byte[] senderProtocolAddress
protected byte[] targetHardwareAddress
protected byte[] targetProtocolAddress
public short getHardwareType()
public ARP setHardwareType(short hardwareType)
hardwareType - the hardwareType to setpublic short getProtocolType()
public ARP setProtocolType(short protocolType)
protocolType - the protocolType to setpublic byte getHardwareAddressLength()
public ARP setHardwareAddressLength(byte hardwareAddressLength)
hardwareAddressLength - the hardwareAddressLength to setpublic byte getProtocolAddressLength()
public ARP setProtocolAddressLength(byte protocolAddressLength)
protocolAddressLength - the protocolAddressLength to setpublic short getOpCode()
public ARP setOpCode(short opCode)
opCode - the opCode to setpublic byte[] getSenderHardwareAddress()
public ARP setSenderHardwareAddress(byte[] senderHardwareAddress)
senderHardwareAddress - the senderHardwareAddress to setpublic byte[] getSenderProtocolAddress()
public ARP setSenderProtocolAddress(byte[] senderProtocolAddress)
senderProtocolAddress - the senderProtocolAddress to setpublic ARP setSenderProtocolAddress(int address)
public byte[] getTargetHardwareAddress()
public ARP setTargetHardwareAddress(byte[] targetHardwareAddress)
targetHardwareAddress - the targetHardwareAddress to setpublic byte[] getTargetProtocolAddress()
public boolean isGratuitous()
public ARP setTargetProtocolAddress(byte[] targetProtocolAddress)
targetProtocolAddress - the targetProtocolAddress to setpublic ARP setTargetProtocolAddress(int address)
public byte[] serialize()
IPacketpublic IPacket deserialize(byte[] data, int offset, int length)
IPacketoffset - offset to start deserializing fromlength - length of the data to deserializepublic int hashCode()
hashCode in class BasePacketpublic boolean equals(java.lang.Object obj)
equals in class BasePacketpublic java.lang.String toString()
toString in class java.lang.Object