UdpHeader

Namespace: inet

class UdpHeader

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

Usage diagram

Inheritance diagram

Extends

Name

Type

Description

TransportHeaderBase

class

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

Fields

Name

Type

Description

id

int

mutable

bool

complete

bool

correct

bool

properlyRepresented

bool

chunkLength

b

rawBin

string[]

rawHex

string[]

regionTags

SharingRegionTagSet::TagBaseRegionTag[]

sourcePort

unsigned int

destinationPort

unsigned int

srcPort

unsigned short

destPort

unsigned short

chunkLength

totalLengthField

B

UDP header + payload in bytes

checksum

uint16_t

checksumMode

ChecksumMode

Properties

Name

Value

Description

beforeChange

handleChange()

descriptor

readonly

existingClass

packetData

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 checksum = 0 @toString(utils::hex($)) @fromString(utils::uhex($));
    ChecksumMode checksumMode = CHECKSUM_MODE_UNDEFINED;
}

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