Class UDPHeader

Class Documentation

class UDPHeader

Public Functions

UDPHeader()

Construct a new UDPHeader object.Initialises packet values by calling ska::pst::recv::PacketStructure::configure_packet_defaults(cbf_psr_header_t * header)

~UDPHeader() = default

Destroy the UDPHeader object.

void configure(const ska::pst::common::AsciiHeader &config, const ska::pst::recv::UDPFormat &format)

Configures private PacketStructure struct cbf_psr_header header using the input parameters config and format.

Parameters
  • config – AsciiHeader object containing PacketStructure definitions

  • formatUDPFormat object packet format definitions.

void set_timestamp(ska::pst::common::Time &start_timestamp)

Set the timestamp object.

Parameters

start_timestamp – timestamp assigned to the packet.

void set_packet_sequence_number(uint64_t psn)

Set the packet sequence number object.

Parameters

psn – sequence number assigned to the packet.

void set_scan_id(uint64_t scan_id)

Set the scan id object.

Parameters

scan_id – scan id assigned to the packet.

void set_beam_id(uint64_t beam_id)

Set the beam id object.

Parameters

beam_id – beam id assigned to the packet.

void encode_header(char *buf)

Copies the contents of the header into the parameter buf.

Parameters

buf – socket buffer to be encoded using the local header

void increment_packet()

increments header packet_sequence number and updateds header timestamp.

size_t gen_packet(char *buf)

passes param buf to encode_header method and calls increment_packet. Returns packet_size.

Parameters

buf – socket buffer

Returns

size_t size of the packet

size_t gen_packet_failure(char *buf, FailureType failure_type)

Used for testing. Generates a packet with induced failure.

Parameters
  • buf – socket buffer

  • failure_type – type of error to be induced

Returns

size_t size of the packet