public class UDP extends BasePacket
| Modifier and Type | Field and Description |
|---|---|
protected short |
checksum |
static Map<Short,Class<? extends IPacket>> |
DECODE_MAP |
protected short |
destinationPort |
static short |
DHCP_CLIENT_PORT |
static short |
DHCP_SERVER_PORT |
protected short |
length |
protected short |
sourcePort |
parent, payload| Constructor and Description |
|---|
UDP() |
| Modifier and Type | Method and Description |
|---|---|
IPacket |
deserialize(byte[] data,
int offset,
int length)
Deserializes this packet layer and all possible payloads.
|
boolean |
equals(Object obj) |
short |
getChecksum() |
short |
getDestinationPort() |
short |
getLength() |
short |
getSourcePort() |
int |
hashCode() |
void |
resetChecksum()
Reset any checksums as needed, and call resetChecksum on all parents.
|
byte[] |
serialize()
Serializes the packet.
|
UDP |
setChecksum(short checksum) |
UDP |
setDestinationPort(short destinationPort) |
UDP |
setSourcePort(short sourcePort) |
clone, getParent, getPayload, setParent, setPayloadpublic static final short DHCP_SERVER_PORT
public static final short DHCP_CLIENT_PORT
protected short sourcePort
protected short destinationPort
protected short length
protected short checksum
public short getSourcePort()
public UDP setSourcePort(short sourcePort)
sourcePort - the sourcePort to setpublic short getDestinationPort()
public UDP setDestinationPort(short destinationPort)
destinationPort - the destinationPort to setpublic short getLength()
public short getChecksum()
public UDP setChecksum(short checksum)
checksum - the checksum to setpublic void resetChecksum()
IPacketresetChecksum in interface IPacketresetChecksum in class BasePacketpublic byte[] serialize()
public int hashCode()
hashCode in class BasePacketpublic boolean equals(Object obj)
equals in class BasePacketpublic IPacket deserialize(byte[] data, int offset, int length)
IPacketdata - bytes to deserializeoffset - offset to start deserializing fromlength - length of the data to deserializeCopyright © 2014. All rights reserved.