Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
kcenon::network::protocols::quic::long_header Struct Reference

QUIC Long Header format (RFC 9000 Section 17.2) More...

#include <packet.h>

Collaboration diagram for kcenon::network::protocols::quic::long_header:
Collaboration graph

Public Member Functions

auto type () const noexcept -> packet_type
 Get the packet type from first byte.
 
auto is_retry () const noexcept -> bool
 Check if this is a Retry packet (has integrity tag, no packet number)
 

Public Attributes

uint8_t first_byte {0}
 Header form, fixed bit, type, reserved, PN length.
 
uint32_t version {0}
 QUIC version.
 
connection_id dest_conn_id
 Destination Connection ID.
 
connection_id src_conn_id
 Source Connection ID.
 
std::vector< uint8_t > token
 Token (Initial and Retry only)
 
uint64_t packet_number {0}
 Packet number (after header protection removal)
 
size_t packet_number_length {0}
 Packet number length (1-4 bytes)
 
std::array< uint8_t, 16 > retry_integrity_tag {}
 Retry integrity tag (Retry packets only, 16 bytes)
 

Detailed Description

QUIC Long Header format (RFC 9000 Section 17.2)

Long headers are used during connection establishment. They include source and destination connection IDs.

Format: +-+-+-+-+-+-+-+-+ |1|1|T T|X X X X| First byte: Header Form (1), Fixed Bit (1), +-+-+-+-+-+-+-+-+ Long Packet Type (2), Type-Specific Bits (4) | Version (32) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |DCID Len (8)| +-+-+-+-+-+-+-+-+ |Destination Connection ID (0..160)| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |SCID Len (8)| +-+-+-+-+-+-+-+-+ |Source Connection ID (0..160)| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Definition at line 94 of file packet.h.

Member Function Documentation

◆ is_retry()

auto kcenon::network::protocols::quic::long_header::is_retry ( ) const -> bool
nodiscardnoexcept

Check if this is a Retry packet (has integrity tag, no packet number)

Definition at line 65 of file packet.cpp.

66{
67 return type() == packet_type::retry;
68}
auto type() const noexcept -> packet_type
Get the packet type from first byte.
Definition packet.cpp:60

References kcenon::network::protocols::quic::retry, and type().

Here is the call graph for this function:

◆ type()

auto kcenon::network::protocols::quic::long_header::type ( ) const -> packet_type
nodiscardnoexcept

Get the packet type from first byte.

Returns
Packet type (Initial, 0-RTT, Handshake, or Retry)

Definition at line 60 of file packet.cpp.

61{
62 return static_cast<packet_type>((first_byte >> 4) & 0x03);
63}
packet_type
QUIC packet types (RFC 9000 Section 17)
Definition packet.h:55
uint8_t first_byte
Header form, fixed bit, type, reserved, PN length.
Definition packet.h:96

References first_byte.

Referenced by is_retry(), and kcenon::network::protocols::quic::packet_parser::parse_long_header().

Here is the caller graph for this function:

Member Data Documentation

◆ dest_conn_id

connection_id kcenon::network::protocols::quic::long_header::dest_conn_id

Destination Connection ID.

Definition at line 98 of file packet.h.

Referenced by kcenon::network::protocols::quic::packet_parser::parse_long_header().

◆ first_byte

uint8_t kcenon::network::protocols::quic::long_header::first_byte {0}

Header form, fixed bit, type, reserved, PN length.

Definition at line 96 of file packet.h.

96{0};

Referenced by kcenon::network::protocols::quic::packet_parser::parse_long_header(), and type().

◆ packet_number

uint64_t kcenon::network::protocols::quic::long_header::packet_number {0}

Packet number (after header protection removal)

Definition at line 103 of file packet.h.

103{0};

◆ packet_number_length

size_t kcenon::network::protocols::quic::long_header::packet_number_length {0}

Packet number length (1-4 bytes)

Definition at line 104 of file packet.h.

104{0};

Referenced by kcenon::network::protocols::quic::packet_parser::parse_long_header().

◆ retry_integrity_tag

std::array<uint8_t, 16> kcenon::network::protocols::quic::long_header::retry_integrity_tag {}

Retry integrity tag (Retry packets only, 16 bytes)

Definition at line 107 of file packet.h.

107{};

◆ src_conn_id

connection_id kcenon::network::protocols::quic::long_header::src_conn_id

Source Connection ID.

Definition at line 99 of file packet.h.

Referenced by kcenon::network::protocols::quic::packet_parser::parse_long_header().

◆ token

std::vector<uint8_t> kcenon::network::protocols::quic::long_header::token

Token (Initial and Retry only)

Definition at line 102 of file packet.h.

Referenced by kcenon::network::protocols::quic::packet_parser::parse_long_header().

◆ version

uint32_t kcenon::network::protocols::quic::long_header::version {0}

QUIC version.

Definition at line 97 of file packet.h.

97{0};

Referenced by kcenon::network::protocols::quic::packet_parser::parse_long_header().


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