Class UDPPacket

Inheritance Relationships

Base Type

Class Documentation

class UDPPacket : public ska::pst::recv::PacketBuffer

UDP Packet Interface to raw data stored in memory.

Public Functions

UDPPacket() = default

Construct a new UDPPacket object.

UDPPacket(char *ptr, size_t size)

Construct a new UDPPacket object from an existing address and size.

Parameters
  • ptr – memory address of the packet

  • size – length of the packet

inline uint16_t source_port() const

Return the source UDP port in the packet header.

Returns

uint16_t source UDP port

inline uint16_t destination_port() const

Return the destination UDP port in the packet header.

Returns

uint16_t destination UDP port

inline uint16_t length() const

Return the length in the packet header.

Returns

uint16_t packet length

inline uint16_t checksum() const

Return the UDP checksum of the packet header.

Returns

uint16_t UDP checksum

PacketBuffer payload() const

Return the UDP packet payload as a PacketBuffer.

Returns

PacketBuffer UDP packet payload

Public Static Attributes

static constexpr size_t min_size = 8

minimum size of the packet

static constexpr uint8_t protocol = 0x11

definition of the UDP protocol in the packet