libtins  4.0
Public Member Functions | List of all members
Tins::Utils::RadioTapWriter Class Reference

Writes RadioTap options into a buffer. More...

#include <radiotap_writer.h>

Public Member Functions

 RadioTapWriter (std::vector< uint8_t > &buffer)
 Constructs a RadioTapWriter object. More...
 
void write_option (const RadioTap::option &option)
 Writes an option, adding/removing padding as needed. More...
 

Detailed Description

Writes RadioTap options into a buffer.

This class can write RadioTap options into a buffer, respecting the alignment of each of them.

Note that RadioTap options are ordered. Writing multiple of them in a non ascending order will involve several memory moves around the buffer so it will be less efficient.

Constructor & Destructor Documentation

Tins::Utils::RadioTapWriter::RadioTapWriter ( std::vector< uint8_t > &  buffer)

Constructs a RadioTapWriter object.

Note that a reference to the buffer will be kept and updated so it must be kept in scope while writing options to it

Member Function Documentation

void Tins::Utils::RadioTapWriter::write_option ( const RadioTap::option option)

Writes an option, adding/removing padding as needed.

The function returns true iff the option was added successfully. This will always be the case, unless an option having that type is already set.

Parameters
optionThe option to be written

The documentation for this class was generated from the following files: