Class PacketCaptureFile

Inheritance Relationships

Base Type

Class Documentation

class PacketCaptureFile : public ska::pst::common::PacketGenerator

Generates packet streams from a recorded PCAP file.

Public Functions

explicit PacketCaptureFile(std::shared_ptr<PacketLayout> layout)

Construct a new PacketCaptureFile object.

~PacketCaptureFile()

Destroy the PacketCaptureFile object.

virtual void configure(const ska::pst::common::AsciiHeader &config) override

Configure the streams written to data + weights.

Parameters

config – contains the PCAP_FILE_NAME keyword/value pair to extract the filename to be used.

virtual void fill_data(char *buf, uint64_t size) override

Fill the buffer with a sequence of data.

Parameters
  • buf – base memory address of the buffer to be filled

  • size – number of bytes to be written to buffer

virtual auto test_data(char *buf, uint64_t size) -> bool override

Verify the data stream in the provided buffer.

Parameters
  • buf – pointer to buffer containing sequence of data to be verified

  • size – number of bytes in buffer to be tested

Returns

true if data match expectations

virtual void fill_weights(char *buf, uint64_t size) override

Fill the buffer with weights from the packet.

Parameters
  • buf – base memory address of the buffer to be filled

  • size – number of bytes to be written to buffer

virtual void fill_scales(char *buf, uint64_t size) override

Fill the buffer with a scale factor from the packet.

Parameters
  • buf – base memory address of the buffer to be filled

  • size – number of bytes to be written to buffer

virtual auto test_weights(char *buf, uint64_t size) -> bool override

Verify the weights stream in the provided buffer.

Parameters
  • buf – pointer to buffer containing sequence of weights to be verified

  • size – number of bytes in buffer to be tested

Returns

true if weights match expectations

virtual auto test_scales(char *buf, uint64_t size) -> bool override

Verify the scales stream in the provided buffer.

Parameters
  • buf – pointer to buffer containing the scale factor to be verified

  • size – number of bytes in buffer to be tested

Returns

true if scales match expectations

virtual void reset() override

Reset the sequence of packets being read from the PCAP file. The next call to fill_block or test_block will behave as per the first call to these functions.