Struct option_t¶
Defined in File option.hh
Inheritance Relationships¶
Derived Type¶
public libnokogiri::pcapng::options::end_of_options_t(Struct end_of_options_t)
Struct Documentation¶
-
struct
libnokogiri::pcapng::option_t¶ Base for all pcapng options.
This structure represents the atomic base for all options defined by libnokogiri as well as by the developer if the add custom options.
For documentation on how to add new options to libnokogiri see the
Adding Optionssection inExtending libnokogiriOptions have the following overarching structure:
0 1 2 3 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Type | Option Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / Option Data / / Variable Length padded to 32 bits / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Option Typeis a 16-bit unsigned value describing how to interpret the dataOption Lengthis a 16-bit unsigned value describing how long the option data is without paddingOption Datais optional, and depends onOption Type
Options are collected into a contiguous block which is then suffixed with a special option value to indicate the end of an option block.
The termination option is a single option with the type of
0x0000and the length of0x0000. However, the assumption that this termination option is present can not be made (for some reason, ask the RFC committee, I don’t fucking know).For safety, when you construct a default empty base option_t, it will act the same as an options::end_of_options_t .
Subclassed by libnokogiri::pcapng::options::end_of_options_t
Public Functions
-
constexpr
option_t() noexcept¶
-
option_type_t
type() const noexcept¶ Gets the type of the option
-
std::uint16_t
length() const noexcept¶ Gets the length of the option
-
std::size_t
size() const noexcept¶ Gets the total size of this structure as it would be in the pcap file
-
bool
multiple_allowed() const noexcept¶ Gets if there can be more than one of this type of option per block
Protected Functions
-
constexpr
option_t(option_type_t type, std::uint16_t length, bool multiple) noexcept¶