libtins
4.0
|
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... | |
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.
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
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.
option | The option to be written |