VBVX 0.1.0
Header-only C++23 library for safe, zero-copy parsing of packet buffers.
Loading...
Searching...
No Matches
vbvx::EtherHeader Struct Reference

Ethernet frame header (14 bytes). More...

#include <ether.hxx>

Public Member Functions

constexpr auto dst_mac () const noexcept -> std::span< const uint8_t, 6 >
constexpr auto src_mac () const noexcept -> std::span< const uint8_t, 6 >
constexpr auto type () const noexcept -> uint16_t

Public Attributes

uint8_t dst [6]
uint8_t src [6]
uint16_t type_be

Detailed Description

Ethernet frame header (14 bytes).

See also
IANA registry (Ethernet numbers / EtherType): https://www.iana.org/assignments/ethernet-numbers/ethernet-numbers.xhtml
RFC RFC894 (Ethernet encapsulation of IP datagrams): https://datatracker.ietf.org/doc/html/rfc894

Member Function Documentation

◆ dst_mac()

auto vbvx::EtherHeader::dst_mac ( ) const -> std::span< const uint8_t, 6 >
inlineconstexprnoexcept

◆ src_mac()

auto vbvx::EtherHeader::src_mac ( ) const -> std::span< const uint8_t, 6 >
inlineconstexprnoexcept

◆ type()

auto vbvx::EtherHeader::type ( ) const -> uint16_t
inlineconstexprnoexcept

Member Data Documentation

◆ dst

uint8_t vbvx::EtherHeader::dst[6]

◆ src

uint8_t vbvx::EtherHeader::src[6]

◆ type_be

uint16_t vbvx::EtherHeader::type_be

The documentation for this struct was generated from the following file: