Program Listing for File section_header.hh¶
↰ Return to documentation for file (pcapng/blocks/section_header.hh)
// SPDX-License-Identifier: LGPL-3.0-or-later
/* pcapng/blocks/section_header.hh - pcapng section header block */
#if !defined(LIBNOKOGIRI_PCAPNG_BLOCKS_SECTION_HEADER_HH)
#define LIBNOKOGIRI_PCAPNG_BLOCKS_SECTION_HEADER_HH
#include <cstdint>
#include <libnokogiri/common.hh>
#include <libnokogiri/pcapng/block.hh>
namespace libnokogiri::pcapng::blocks {
struct section_header_t final : public block_t {
public:
constexpr static std::uint32_t magic = 0x1A2B3C4D;
private:
std::uint32_t _bom;
version_t _version;
std::int64_t _section_length;
// std::vector<libnokogiri::pcapng::option_t> _options;
public:
constexpr section_header_t() noexcept :
block_t(block_type_t::SectionHeader),
_bom{section_header_t::magic}, _version{1U, 0U}, _section_length{-1} //, _options{}
{ /* NOP */ }
constexpr section_header_t(std::uint32_t bom, version_t version, std::int64_t length) noexcept :
block_t(block_type_t::SectionHeader),
_bom{bom}, _version{version}, _section_length{length} //, _options{}
{ /* NOP */ }
[[nodiscard]]
std::uint32_t bom() const noexcept { return _bom; }
[[nodiscard]]
version_t version() const noexcept { return _version; }
[[nodiscard]]
std::int64_t section_length() const noexcept { return _section_length; }
};
}
#endif /* LIBNOKOGIRI_PCAPNG_BLOCKS_SECTION_HEADER_HH */