public class UDP extends BasePacket
Modifier and Type | Field and Description |
---|---|
protected short |
checksum |
protected int |
destinationPort |
static int |
DHCP_CLIENT_PORT |
static int |
DHCP_SERVER_PORT |
static int |
DHCP_V6_CLIENT_PORT |
static int |
DHCP_V6_SERVER_PORT |
protected short |
length |
static Map<Integer,Deserializer<? extends IPacket>> |
PORT_DESERIALIZER_MAP |
static int |
RIP_PORT |
static int |
RIPNG_PORT |
protected int |
sourcePort |
static int |
VXLAN_UDP_PORT |
parent, payload
Constructor and Description |
---|
UDP() |
Modifier and Type | Method and Description |
---|---|
static Deserializer<UDP> |
deserializer()
Deserializer function for UDP packets.
|
boolean |
equals(Object obj) |
short |
getChecksum() |
int |
getDestinationPort() |
short |
getLength() |
int |
getSourcePort() |
int |
hashCode() |
void |
resetChecksum()
Reset any checksum as needed, and call resetChecksum on all parents.
|
byte[] |
serialize()
Serializes the packet.
|
UDP |
setChecksum(short checksum) |
UDP |
setDestinationPort(int destinationPort) |
UDP |
setSourcePort(int sourcePort) |
String |
toString() |
clone, getParent, getPayload, setParent, setPayload
public static final Map<Integer,Deserializer<? extends IPacket>> PORT_DESERIALIZER_MAP
public static final int DHCP_SERVER_PORT
public static final int DHCP_CLIENT_PORT
public static final int DHCP_V6_SERVER_PORT
public static final int DHCP_V6_CLIENT_PORT
public static final int VXLAN_UDP_PORT
public static final int RIP_PORT
public static final int RIPNG_PORT
protected int sourcePort
protected int destinationPort
protected short length
protected short checksum
public int getSourcePort()
public UDP setSourcePort(int sourcePort)
sourcePort
- the sourcePort to set (16 bits unsigned integer)public int getDestinationPort()
public UDP setDestinationPort(int destinationPort)
destinationPort
- the destinationPort to set (16 bits unsigned integer)public short getLength()
public short getChecksum()
public UDP setChecksum(short checksum)
checksum
- the checksum to setpublic void resetChecksum()
IPacket
resetChecksum
in interface IPacket
resetChecksum
in class BasePacket
public byte[] serialize()
public int hashCode()
hashCode
in class BasePacket
public boolean equals(Object obj)
equals
in class BasePacket
public static Deserializer<UDP> deserializer()