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 java.util.Map<java.lang.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(java.lang.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)  | 
java.lang.String | 
toString()  | 
clone, getParent, getPayload, setParent, setPayloadpublic static final java.util.Map<java.lang.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()
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 BasePacketpublic static Deserializer<UDP> deserializer()
public java.lang.String toString()
toString in class java.lang.Object