Struct block_t¶
Defined in File block.hh
Inheritance Relationships¶
Derived Types¶
public libnokogiri::pcapng::blocks::interface_description_t(Struct interface_description_t)public libnokogiri::pcapng::blocks::section_header_t(Struct section_header_t)
Struct Documentation¶
-
struct
libnokogiri::pcapng::block_t¶ Base for all pcapng blocks.
This structure represents the atomic base for all blocks defined by libnokogiri as well as by the developer if they add custom blocks.
For documentation on how to add new blocks to libnokogiri see the
Adding Blockssection inExtending libnokogiriBlock 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Block Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Total Block Size | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / Block Data / / Variable Length padded to 32 bits / +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Total Block Size | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Block Typeis a 32-bit unsigned value that indicates the type of block.Total Block Sizeis a 32-bit unsigned value that indicates the size of the blockBlock Datais the actual data for the block, its length isTotal Block Size- 12
The reason for the trailing
Total Block Sizefield is to allow for bidirectional seeking in the pcap file.All blocks share this format.
NOTE:** The most significant bit (MSB) of the
Block Typefield indicates if the block if reserved for local use. An MSB of0b1indicates that it is a local block, where as an MSB of0b0indicates that the type is standard.Subclassed by libnokogiri::pcapng::blocks::interface_description_t, libnokogiri::pcapng::blocks::section_header_t
Public Functions
-
constexpr
block_t() noexcept¶
-
block_type_t
type() const noexcept¶ Gets the type of the block
Protected Functions
-
constexpr
block_t(block_type_t type) noexcept¶