UdpHeader

UdpHeader

class

Represents an Udp header, to be used with the Udp module.

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
TransportHeaderBase class

This base class provides an abstraction for different transport layer packets.

Fields

Name Type Description
srcPort unsigned short
destPort unsigned short
chunkLength b
totalLengthField B

UDP header + payload in bytes

crc uint16_t
crcMode CrcMode
sourcePort unsigned int
destinationPort unsigned int
id int
mutable bool
complete bool
correct bool
properlyRepresented bool
rawBin string[]
rawHex string[]
regionTags SharingRegionTagSet::TagBaseRegionTag[]

Source code

//
// Represents an Udp header, to be used with the ~Udp module.
//
class UdpHeader extends TransportHeaderBase
{
    unsigned short srcPort;
    unsigned short destPort;
    chunkLength = UDP_HEADER_LENGTH;
    B totalLengthField = B(-1);   // UDP header + payload in bytes
    uint16_t crc @toString(utils::hex($)) @fromString(utils::uhex($)) = 0;
    CrcMode crcMode = CRC_MODE_UNDEFINED;
}

File: src/inet/transportlayer/udp/UdpHeader.msg