net.floodlightcontroller.packet
Class ARP
java.lang.Object
net.floodlightcontroller.packet.BasePacket
net.floodlightcontroller.packet.ARP
- All Implemented Interfaces:
- IPacket
public class ARP
- extends BasePacket
- Author:
- David Erickson (daviderickson@cs.stanford.edu)
Constructor Summary |
ARP()
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
HW_TYPE_ETHERNET
public static short HW_TYPE_ETHERNET
PROTO_TYPE_IP
public static short PROTO_TYPE_IP
OP_REQUEST
public static short OP_REQUEST
OP_REPLY
public static short OP_REPLY
OP_RARP_REQUEST
public static short OP_RARP_REQUEST
OP_RARP_REPLY
public static short OP_RARP_REPLY
hardwareType
protected short hardwareType
protocolType
protected short protocolType
hardwareAddressLength
protected byte hardwareAddressLength
protocolAddressLength
protected byte protocolAddressLength
opCode
protected short opCode
senderHardwareAddress
protected byte[] senderHardwareAddress
senderProtocolAddress
protected byte[] senderProtocolAddress
targetHardwareAddress
protected byte[] targetHardwareAddress
targetProtocolAddress
protected byte[] targetProtocolAddress
ARP
public ARP()
getHardwareType
public short getHardwareType()
- Returns:
- the hardwareType
setHardwareType
public ARP setHardwareType(short hardwareType)
- Parameters:
hardwareType
- the hardwareType to set
getProtocolType
public short getProtocolType()
- Returns:
- the protocolType
setProtocolType
public ARP setProtocolType(short protocolType)
- Parameters:
protocolType
- the protocolType to set
getHardwareAddressLength
public byte getHardwareAddressLength()
- Returns:
- the hardwareAddressLength
setHardwareAddressLength
public ARP setHardwareAddressLength(byte hardwareAddressLength)
- Parameters:
hardwareAddressLength
- the hardwareAddressLength to set
getProtocolAddressLength
public byte getProtocolAddressLength()
- Returns:
- the protocolAddressLength
setProtocolAddressLength
public ARP setProtocolAddressLength(byte protocolAddressLength)
- Parameters:
protocolAddressLength
- the protocolAddressLength to set
getOpCode
public short getOpCode()
- Returns:
- the opCode
setOpCode
public ARP setOpCode(short opCode)
- Parameters:
opCode
- the opCode to set
getSenderHardwareAddress
public byte[] getSenderHardwareAddress()
- Returns:
- the senderHardwareAddress
setSenderHardwareAddress
public ARP setSenderHardwareAddress(byte[] senderHardwareAddress)
- Parameters:
senderHardwareAddress
- the senderHardwareAddress to set
getSenderProtocolAddress
public byte[] getSenderProtocolAddress()
- Returns:
- the senderProtocolAddress
setSenderProtocolAddress
public ARP setSenderProtocolAddress(byte[] senderProtocolAddress)
- Parameters:
senderProtocolAddress
- the senderProtocolAddress to set
setSenderProtocolAddress
public ARP setSenderProtocolAddress(int address)
getTargetHardwareAddress
public byte[] getTargetHardwareAddress()
- Returns:
- the targetHardwareAddress
setTargetHardwareAddress
public ARP setTargetHardwareAddress(byte[] targetHardwareAddress)
- Parameters:
targetHardwareAddress
- the targetHardwareAddress to set
getTargetProtocolAddress
public byte[] getTargetProtocolAddress()
- Returns:
- the targetProtocolAddress
isGratuitous
public boolean isGratuitous()
- Returns:
- True if gratuitous ARP (SPA = TPA), false otherwise
setTargetProtocolAddress
public ARP setTargetProtocolAddress(byte[] targetProtocolAddress)
- Parameters:
targetProtocolAddress
- the targetProtocolAddress to set
setTargetProtocolAddress
public ARP setTargetProtocolAddress(int address)
serialize
public byte[] serialize()
- Description copied from interface:
IPacket
- Sets all payloads parent packet if applicable, then serializes this
packet and all payloads
- Returns:
- a byte[] containing this packet and payloads
deserialize
public IPacket deserialize(byte[] data,
int offset,
int length)
throws PacketParsingException
- Description copied from interface:
IPacket
- Deserializes this packet layer and all possible payloads
offset
- offset to start deserializing fromlength
- length of the data to deserialize
- Returns:
- the deserialized data
- Throws:
PacketParsingException
hashCode
public int hashCode()
- Overrides:
hashCode
in class BasePacket
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class BasePacket
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object