Representation of the UDP header. More...

#include <headers.hpp>

Public Member Functions

void setSrcPort (uint16_t p)
 Set the source port. More...
 
void setDstPort (uint16_t p)
 Set the destination port. More...
 
uint16_t getSrcPort () const
 Get the source port. More...
 
uint16_t getDstPort () const
 Get the destination port. More...
 
uint16_t getPayloadLength () const
 Get the length of the L4-SDU (UDP payload) More...
 
void setPayloadLength (uint16_t length)
 Set the length of the L4-SDU (UDP payload) More...
 
void * getPayload ()
 Get the SDU. More...
 

Public Attributes

uint16_t srcPort
 Source port. More...
 
uint16_t dstPort
 Destination port. More...
 
uint16_t len
 Length. More...
 
uint16_t checksum
 Checksum. More...
 

Detailed Description

Representation of the UDP header.

Definition at line 209 of file headers.hpp.

Member Function Documentation

◆ getDstPort()

uint16_t Headers::Udp::getDstPort ( ) const
inline

Get the destination port.

Returns
Destination port in host byte order

Definition at line 233 of file headers.hpp.

◆ getPayload()

void* Headers::Udp::getPayload ( )
inline

Get the SDU.

Returns
Pointer to the payload

Definition at line 248 of file headers.hpp.

◆ getPayloadLength()

uint16_t Headers::Udp::getPayloadLength ( ) const
inline

Get the length of the L4-SDU (UDP payload)

Returns
Length of the payload (host byte order)

Definition at line 238 of file headers.hpp.

◆ getSrcPort()

uint16_t Headers::Udp::getSrcPort ( ) const
inline

Get the source port.

Returns
Source port in host byte order

Definition at line 228 of file headers.hpp.

◆ setDstPort()

void Headers::Udp::setDstPort ( uint16_t  p)
inline

Set the destination port.

Parameters
pDestination port in host byte order

Definition at line 223 of file headers.hpp.

◆ setPayloadLength()

void Headers::Udp::setPayloadLength ( uint16_t  length)
inline

Set the length of the L4-SDU (UDP payload)

Parameters
lengthof the payload (host byte order)

Definition at line 243 of file headers.hpp.

◆ setSrcPort()

void Headers::Udp::setSrcPort ( uint16_t  p)
inline

Set the source port.

Parameters
pSource port in host byte order

Definition at line 218 of file headers.hpp.

Member Data Documentation

◆ checksum

uint16_t Headers::Udp::checksum

Checksum.

Definition at line 213 of file headers.hpp.

◆ dstPort

uint16_t Headers::Udp::dstPort

Destination port.

Definition at line 211 of file headers.hpp.

◆ len

uint16_t Headers::Udp::len

Length.

Definition at line 212 of file headers.hpp.

◆ srcPort

uint16_t Headers::Udp::srcPort

Source port.

Definition at line 210 of file headers.hpp.


The documentation for this struct was generated from the following file: