net.floodlightcontroller.packet
Class UDP
java.lang.Object
net.floodlightcontroller.packet.BasePacket
net.floodlightcontroller.packet.UDP
- All Implemented Interfaces:
- IPacket
public class UDP
- extends BasePacket
- Author:
- David Erickson (daviderickson@cs.stanford.edu)
Constructor Summary |
UDP()
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
decodeMap
public static java.util.Map<java.lang.Short,java.lang.Class<? extends IPacket>> decodeMap
DHCP_SERVER_PORT
public static short DHCP_SERVER_PORT
DHCP_CLIENT_PORT
public static short DHCP_CLIENT_PORT
sourcePort
protected short sourcePort
destinationPort
protected short destinationPort
length
protected short length
checksum
protected short checksum
UDP
public UDP()
getSourcePort
public short getSourcePort()
- Returns:
- the sourcePort
setSourcePort
public UDP setSourcePort(short sourcePort)
- Parameters:
sourcePort
- the sourcePort to set
getDestinationPort
public short getDestinationPort()
- Returns:
- the destinationPort
setDestinationPort
public UDP setDestinationPort(short destinationPort)
- Parameters:
destinationPort
- the destinationPort to set
getLength
public short getLength()
- Returns:
- the length
getChecksum
public short getChecksum()
- Returns:
- the checksum
setChecksum
public UDP setChecksum(short checksum)
- Parameters:
checksum
- the checksum to set
resetChecksum
public void resetChecksum()
- Description copied from interface:
IPacket
- Reset any checksums as needed, and call resetChecksum on all parents
- Specified by:
resetChecksum
in interface IPacket
- Overrides:
resetChecksum
in class BasePacket
serialize
public byte[] serialize()
- Serializes the packet. Will compute and set the following fields if they
are set to specific values at the time serialize is called:
-checksum : 0
-length : 0
- Returns:
- a byte[] containing this packet and payloads
hashCode
public int hashCode()
- Overrides:
hashCode
in class BasePacket
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class BasePacket
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