public class UDP extends BasePacket
| Modifier and Type | Field and Description |
|---|---|
protected short |
checksum |
static java.util.Map<java.lang.Short,java.lang.Class<? extends IPacket>> |
decodeMap |
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(java.lang.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 java.util.Map<java.lang.Short,java.lang.Class<? extends IPacket>> decodeMap
public static short DHCP_SERVER_PORT
public static 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(java.lang.Object obj)
equals in class BasePacket