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

Classes

struct  enable_bitmask_operators< some::TestFlags >
struct  ArpHeader
 Address Resolution Protocol (ARP) header. More...
class  BufferView
 A view over a packet buffer providing access to various protocol headers. More...
struct  EtherHeader
 Ethernet frame header (14 bytes). More...
struct  VlanTci
 VLAN Tag Control Information (TCI) helpers and layout. More...
struct  VlanHeader
 VLAN (802.1Q) header (4 bytes after Ethernet header). More...
struct  enable_bitmask_operators
 Enable bitwise operators for an enum class. More...
class  ConstFlagsView
 A zero-copy const view for a bitmask enum. More...
class  FlagsView
 A zero-copy mutable view for a bitmask enum. More...
class  HeaderView
 A lightweight view over a header inside a packet buffer. More...
struct  ICMPv4Header
 ICMP header (type, code, checksum) (4 bytes). More...
struct  ICMPv6Header
 ICMPv6 header (type, code, checksum) (4 bytes). More...
struct  enable_bitmask_operators< IPv4Flags >
struct  IPv4Header
 IPv4 header (minimum 20 bytes). More...
struct  IPv6Header
 IPv6 header (40 bytes). More...
struct  SRv6Header
 IPv6 Segment Routing Header (SRH) as defined in RFC 8754. More...
struct  SRv6Tlv
 TLV view returned by the iterator. More...
class  SRv6TlvIterator
 Iterator over TLVs in an SRH's TLV area. Does not allocate. More...
struct  SRv6HmacTlvView
 HMAC TLV view for type==5 (HMAC). The 'value' pointer is the TLV variable data where the first two bytes are D/reserved, followed by a 4-octet HMAC Key ID, then the HMAC bytes. More...
struct  enable_bitmask_operators< TCPFlags >
struct  TCPHeader
 TCP header (minimum 20 bytes). More...
struct  UDPHeader
 UDP header (8 bytes). More...

Concepts

concept  WireHeader

Enumerations

enum class  ArpHType : uint16_t { Ethernet = 1 }
 ARP hardware type values. More...
enum class  ArpOpCode : uint16_t { Request = 1 , Reply = 2 }
 ARP opcode values. More...
enum class  EtherType : uint16_t { IPv4 = 0x0800 , ARP = 0x0806 , VLAN = 0x8100 , IPv6 = 0x86DD }
 Ethernet frame EtherType values (network byte order). More...
enum class  VlanPcp : uint8_t {
  p0 = 0 , p1 = 1 , p2 = 2 , p3 = 3 ,
  p4 = 4 , p5 = 5 , p6 = 6 , p7 = 7
}
 VLAN Priority Code Point (PCP) values (3 bits). More...
enum class  ICMPv4Type : uint8_t {
  EchoReply = 0 , DestinationUnreachable = 3 , SourceQuench = 4 , Redirect = 5 ,
  AlternateHostAddress = 6 , EchoRequest = 8 , RouterAdvertisement = 9 , RouterSolicitation = 10 ,
  TimeExceeded = 11 , ParameterProblem = 12 , Timestamp = 13 , TimestampReply = 14 ,
  InformationRequest = 15 , InformationReply = 16 , AddressMaskRequest = 17 , AddressMaskReply = 18 ,
  ReservedForSecurity = 19 , Traceroute = 30 , DatagramConversionError = 31 , MobileHostRedirect = 32 ,
  IPv6WhereAreYou = 33 , IPv6IamHere = 34 , MobileRegistrationRequest = 35 , MobileRegistrationReply = 36 ,
  DomainNameRequest = 37 , DomainNameReply = 38 , SKIP = 39 , Photuris = 40 ,
  MobilityExperimental = 41 , ExtendedEchoRequest = 42 , ExtendedEchoReply = 43 , Experiment1 = 253 ,
  Experiment2 = 254 , Reserved = 255
}
 ICMPv4 Type Numbers. More...
enum class  ICMPv6Type : uint8_t {
  DestinationUnreachable = 1 , PacketTooBig = 2 , TimeExceeded = 3 , ParameterProblem = 4 ,
  PrivateExperiment100 = 100 , PrivateExperiment101 = 101 , EchoRequest = 128 , EchoReply = 129 ,
  MulticastListenerQuery = 130 , MulticastListenerReport = 131 , MulticastListenerDone = 132 , RouterSolicitation = 133 ,
  RouterAdvertisement = 134 , NeighborSolicitation = 135 , NeighborAdvertisement = 136 , RedirectMessage = 137 ,
  RouterRenumbering = 138 , NodeInformationQuery = 139 , NodeInformationResponse = 140 , InverseNeighborDiscoverySolicitation = 141 ,
  InverseNeighborDiscoveryAdvertisement = 142 , Version2MulticastListenerReport = 143 , HomeAgentAddressDiscoveryRequest = 144 , HomeAgentAddressDiscoveryReply = 145 ,
  MobilePrefixSolicitation = 146 , MobilePrefixAdvertisement = 147 , MobilityExperimental = 150 , MulticastRouterAdvertisement = 151 ,
  MulticastRouterSolicitation = 152 , MulticastRouterTermination = 153 , FMIPv6 = 154 , RPLControlMessage = 155 ,
  ILNPv6LocatorUpdate = 156 , DuplicateAddressRequest = 157 , DuplicateAddressConfirmation = 158 , MPLControlMessage = 159 ,
  ExtendedEchoRequest = 160 , ExtendedEchoReply = 161 , PrivateExperiment200 = 200 , PrivateExperiment201 = 201 ,
  Reserved = 255
}
 ICMPv6 Type Numbers. More...
enum class  IPv4Flags : uint16_t { None = 0 , MF = 0x2000 , DF = 0x4000 , RFU = 0x8000 }
 IPv4 fragmentation flags. More...
enum class  IpProtocol : uint8_t {
  HOPOPT = 0 , ICMPv4 = 1 , IGMP = 2 , GGP = 3 ,
  IPv4 = 4 , ST = 5 , TCP = 6 , CBT = 7 ,
  EGP = 8 , IGP = 9 , BBN_RCC_MON = 10 , NVP_II = 11 ,
  PUP = 12 , ARGUS = 13 , EMCON = 14 , XNET = 15 ,
  CHAOS = 16 , UDP = 17 , MUX = 18 , DCN_MEAS = 19 ,
  HMP = 20 , PRM = 21 , XNS_IDP = 22 , TRUNK_1 = 23 ,
  TRUNK_2 = 24 , LEAF_1 = 25 , LEAF_2 = 26 , RDP = 27 ,
  IRTP = 28 , ISO_TP4 = 29 , NETBLT = 30 , MFE_NSP = 31 ,
  MERIT_INP = 32 , DCCP = 33 , THREE_PC = 34 , IDPR = 35 ,
  XTP = 36 , DDP = 37 , IDPR_CMTP = 38 , TP_PLUS = 39 ,
  IL = 40 , IPv6 = 41 , SDRP = 42 , IPv6_Route = 43 ,
  IPv6_Frag = 44 , IDRP = 45 , RSVP = 46 , GRE = 47 ,
  DSR = 48 , BNA = 49 , ESP = 50 , AH = 51 ,
  I_NLSP = 52 , SWIPE = 53 , NARP = 54 , MIN_IPV4 = 55 ,
  TLSP = 56 , SKIP = 57 , ICMPv6 = 58 , IPv6_ICMP = 58 ,
  IPv6_NoNxt = 59 , IPv6_Opts = 60 , HOST_INTERNAL = 61 , CFTP = 62 ,
  LOCAL_NETWORK = 63 , SAT_EXPAK = 64 , KRYPTOLAN = 65 , RVD = 66 ,
  IPPC = 67 , DISTRIBUTED_FS = 68 , SAT_MON = 69 , VISA = 70 ,
  IPCV = 71 , CPNX = 72 , CPHB = 73 , WSN = 74 ,
  PVP = 75 , BR_SAT_MON = 76 , SUN_ND = 77 , WB_MON = 78 ,
  WB_EXPAK = 79 , ISO_IP = 80 , VMTP = 81 , SECURE_VMTP = 82 ,
  VINES = 83 , IPTM = 84 , NSFNET_IGP = 85 , DGP = 86 ,
  TCF = 87 , EIGRP = 88 , OSPFIGP = 89 , SPRITE_RPC = 90 ,
  LARP = 91 , MTP = 92 , AX25 = 93 , IPIP = 94 ,
  MICP = 95 , SCC_SP = 96 , ETHERIP = 97 , ENCAP = 98 ,
  PRIVATE_ENCRYPTION = 99 , GMTP = 100 , IFMP = 101 , PNNI = 102 ,
  PIM = 103 , ARIS = 104 , SCPS = 105 , QNX = 106 ,
  A_N = 107 , IPCOMP = 108 , SNP = 109 , COMPAQ_PEER = 110 ,
  IPX_IN_IP = 111 , VRRP = 112 , PGM = 113 , ANY_0HOP = 114 ,
  L2TP = 115 , DDX = 116 , IATP = 117 , STP = 118 ,
  SRP = 119 , UTI = 120 , SMP = 121 , SM = 122 ,
  PTP = 123 , ISIS = 124 , FIRE = 125 , CRTP = 126 ,
  CRUDP = 127 , SSCOPMCE = 128 , IPLT = 129 , SPS = 130 ,
  PIPE = 131 , SCTP = 132 , FC = 133 , RSVP_E2E_IGNORE = 134 ,
  MOBILITY = 135 , UDPLite = 136 , MPLS_in_IP = 137 , MANET = 138 ,
  HIP = 139 , SHIM6 = 140 , WESP = 141 , ROHC = 142 ,
  Ethernet = 143 , AGGFRAG = 144 , NSH = 145 , Homa = 146 ,
  BIT_EMU = 147 , EXPERIMENTATION_1 = 253 , EXPERIMENTATION_2 = 254 , RESERVED = 255
}
 IP protocol (Next Header) numbers. More...
enum class  SRv6TlvType : uint8_t { Pad1 = 0u , PadN = 4u , Hmac = 5u }
 SRv6 Segment Routing Header (SRH) TLV types. More...
enum class  TCPFlags : uint8_t {
  None = 0 , FIN = 0x01 , SYN = 0x02 , RST = 0x04 ,
  PSH = 0x08 , ACK = 0x10 , URG = 0x20 , ECE = 0x40 ,
  CWR = 0x80
}

Functions

template<typename E>
constexpr E operator| (E lhs, E rhs)
template<typename E>
constexpr E operator& (E lhs, E rhs)
template<typename E>
constexpr E operator^ (E lhs, E rhs)
template<typename E>
constexpr E operator~ (E val)
template<typename E>
constexpr E & operator|= (E &lhs, E rhs)
template<typename E>
constexpr E & operator&= (E &lhs, E rhs)
template<typename E>
constexpr E & operator^= (E &lhs, E rhs)
template<typename E, std::integral U>
constexpr E operator<< (E lhs, U shift)
template<typename E, std::integral U>
constexpr E operator>> (E lhs, U shift)
template<typename _Tp>
constexpr _Tp autoswap (_Tp tp)
 Byte-swap a value if the host is little-endian.
template<typename _Tp>
constexpr _Tp read_from_bytes (const uint8_t *src)
 Read a trivially copyable type from a byte array.

Variables

template<typename _Tp>
constexpr bool enable_bitmask_operators_v

Enumeration Type Documentation

◆ ArpHType

enum class vbvx::ArpHType : uint16_t
strong

ARP hardware type values.

Enumerator
Ethernet 

◆ ArpOpCode

enum class vbvx::ArpOpCode : uint16_t
strong

ARP opcode values.

Enumerator
Request 
Reply 

◆ EtherType

enum class vbvx::EtherType : uint16_t
strong

Ethernet frame EtherType values (network byte order).

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

◆ ICMPv4Type

enum class vbvx::ICMPv4Type : uint8_t
strong

ICMPv4 Type Numbers.

See also
IANA "ICMP Type Numbers" registry: https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
RFC 792: https://datatracker.ietf.org/doc/html/rfc792
Enumerator
EchoReply 
DestinationUnreachable 
SourceQuench 
Redirect 
AlternateHostAddress 
EchoRequest 
RouterAdvertisement 
RouterSolicitation 
TimeExceeded 
ParameterProblem 
Timestamp 
TimestampReply 
InformationRequest 
InformationReply 
AddressMaskRequest 
AddressMaskReply 
ReservedForSecurity 
Traceroute 
DatagramConversionError 
MobileHostRedirect 
IPv6WhereAreYou 
IPv6IamHere 
MobileRegistrationRequest 
MobileRegistrationReply 
DomainNameRequest 
DomainNameReply 
SKIP 
Photuris 
MobilityExperimental 
ExtendedEchoRequest 
ExtendedEchoReply 
Experiment1 
Experiment2 
Reserved 

◆ ICMPv6Type

enum class vbvx::ICMPv6Type : uint8_t
strong

ICMPv6 Type Numbers.

See also
IANA "ICMPv6 Parameters" registry: https://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
RFC 4443: https://datatracker.ietf.org/doc/html/rfc4443
Enumerator
DestinationUnreachable 
PacketTooBig 
TimeExceeded 
ParameterProblem 
PrivateExperiment100 
PrivateExperiment101 
EchoRequest 
EchoReply 
MulticastListenerQuery 
MulticastListenerReport 
MulticastListenerDone 
RouterSolicitation 
RouterAdvertisement 
NeighborSolicitation 
NeighborAdvertisement 
RedirectMessage 
RouterRenumbering 
NodeInformationQuery 
NodeInformationResponse 
InverseNeighborDiscoverySolicitation 
InverseNeighborDiscoveryAdvertisement 
Version2MulticastListenerReport 
HomeAgentAddressDiscoveryRequest 
HomeAgentAddressDiscoveryReply 
MobilePrefixSolicitation 
MobilePrefixAdvertisement 
MobilityExperimental 
MulticastRouterAdvertisement 
MulticastRouterSolicitation 
MulticastRouterTermination 
FMIPv6 
RPLControlMessage 
ILNPv6LocatorUpdate 
DuplicateAddressRequest 
DuplicateAddressConfirmation 
MPLControlMessage 
ExtendedEchoRequest 
ExtendedEchoReply 
PrivateExperiment200 
PrivateExperiment201 
Reserved 

◆ IpProtocol

enum class vbvx::IpProtocol : uint8_t
strong

IP protocol (Next Header) numbers.

See also
IANA Protocol Numbers registry for full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IM6 
WESP 
ROHC 
Ethernet 
AGGFRAG 
NSH 
Homa 
BIT_EMU 
EXPERIMENTATION_1 
EXPERIMENTATION_2 
RESERVED 

◆ IPv4Flags

enum class vbvx::IPv4Flags : uint16_t
strong

IPv4 fragmentation flags.

Enumerator
None 
MF 
DF 
RFU 

◆ SRv6TlvType

enum class vbvx::SRv6TlvType : uint8_t
strong

SRv6 Segment Routing Header (SRH) TLV types.

Enumerator
Pad1 
PadN 
Hmac 

◆ TCPFlags

enum class vbvx::TCPFlags : uint8_t
strong
Enumerator
None 
FIN 
SYN 
RST 
PSH 
ACK 
URG 
ECE 
CWR 

◆ VlanPcp

enum class vbvx::VlanPcp : uint8_t
strong

VLAN Priority Code Point (PCP) values (3 bits).

See also
IEEE 802.1Q and IANA Ethernet numbers. IANA: https://www.iana.org/assignments/ethernet-numbers/ethernet-numbers.xhtml
IEEE 802.1Q: https://standards.ieee.org/standard/802_1Q-2018.html
Enumerator
p0 
p1 
p2 
p3 
p4 
p5 
p6 
p7 

Function Documentation

◆ autoswap()

template<typename _Tp>
_Tp vbvx::autoswap ( _Tp tp)
constexpr

Byte-swap a value if the host is little-endian.

◆ operator&()

template<typename E>
E vbvx::operator& ( E lhs,
E rhs )
constexpr

◆ operator&=()

template<typename E>
E & vbvx::operator&= ( E & lhs,
E rhs )
constexpr

◆ operator<<()

template<typename E, std::integral U>
E vbvx::operator<< ( E lhs,
U shift )
constexpr

◆ operator>>()

template<typename E, std::integral U>
E vbvx::operator>> ( E lhs,
U shift )
constexpr

◆ operator^()

template<typename E>
E vbvx::operator^ ( E lhs,
E rhs )
constexpr

◆ operator^=()

template<typename E>
E & vbvx::operator^= ( E & lhs,
E rhs )
constexpr

◆ operator|()

template<typename E>
E vbvx::operator| ( E lhs,
E rhs )
constexpr

◆ operator|=()

template<typename E>
E & vbvx::operator|= ( E & lhs,
E rhs )
constexpr

◆ operator~()

template<typename E>
E vbvx::operator~ ( E val)
constexpr

◆ read_from_bytes()

template<typename _Tp>
_Tp vbvx::read_from_bytes ( const uint8_t * src)
constexpr

Read a trivially copyable type from a byte array.

Variable Documentation

◆ enable_bitmask_operators_v

template<typename _Tp>
bool vbvx::enable_bitmask_operators_v
constexpr
Initial value:
=
Enable bitwise operators for an enum class.
Definition flags_view.hxx:25