|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
Parser for QUIC packet headers (RFC 9000 Section 17) More...
#include <packet.h>

Static Public Member Functions | |
| static constexpr auto | is_long_header (uint8_t first_byte) noexcept -> bool |
| Check if a packet has a long header. | |
| static constexpr auto | has_valid_fixed_bit (uint8_t first_byte) noexcept -> bool |
| Check if the fixed bit is set correctly. | |
| static auto | parse_header (std::span< const uint8_t > data) -> Result< std::pair< packet_header, size_t > > |
| Parse a packet header (without header protection removal) | |
| static auto | parse_long_header (std::span< const uint8_t > data) -> Result< std::pair< long_header, size_t > > |
| Parse a long header packet. | |
| static auto | parse_short_header (std::span< const uint8_t > data, size_t conn_id_length) -> Result< std::pair< short_header, size_t > > |
| Parse a short header packet. | |
| static constexpr auto | get_long_packet_type (uint8_t first_byte) noexcept -> packet_type |
| Get the packet type from long header's first byte. | |
| static auto | is_version_negotiation (std::span< const uint8_t > data) noexcept -> bool |
| Check if this is a version negotiation packet. | |
Parser for QUIC packet headers (RFC 9000 Section 17)
Parses raw bytes into QUIC packet header structures. Note that this parser handles the unprotected header format; header protection must be removed before parsing packet numbers.
|
inlinestaticnodiscardconstexprnoexcept |
Get the packet type from long header's first byte.
| first_byte | First byte of a long header packet |
|
inlinestaticnodiscardconstexprnoexcept |
|
inlinestaticnodiscardconstexprnoexcept |
Check if a packet has a long header.
| first_byte | First byte of the packet |
Definition at line 225 of file packet.h.
Referenced by kcenon::network::protocols::quic::connection::receive_packet().

|
staticnodiscardnoexcept |
Check if this is a version negotiation packet.
| data | Input buffer (at least 5 bytes) |
Definition at line 150 of file packet.cpp.
References kcenon::network::version().

|
staticnodiscard |
Parse a packet header (without header protection removal)
| data | Input buffer containing the packet |
Definition at line 168 of file packet.cpp.
References kcenon::network::error_codes::common_errors::invalid_argument, and kcenon::network::ok().
Referenced by kcenon::network::core::messaging_quic_server::handle_packet(), and kcenon::network::internal::quic_socket::handle_packet().


|
staticnodiscard |
Parse a long header packet.
| data | Input buffer |
Definition at line 199 of file packet.cpp.
References kcenon::network::protocols::quic::varint::decode(), kcenon::network::protocols::quic::long_header::dest_conn_id, kcenon::network::protocols::quic::long_header::first_byte, kcenon::network::protocols::quic::handshake, kcenon::network::protocols::quic::initial, kcenon::network::error_codes::common_errors::invalid_argument, kcenon::network::protocols::quic::connection_id::max_length, kcenon::network::ok(), kcenon::network::protocols::quic::long_header::packet_number_length, kcenon::network::protocols::quic::retry, kcenon::network::protocols::quic::long_header::src_conn_id, kcenon::network::protocols::quic::long_header::token, kcenon::network::protocols::quic::long_header::type(), kcenon::network::protocols::quic::long_header::version, and kcenon::network::protocols::quic::zero_rtt.
Referenced by kcenon::network::protocols::quic::connection::receive_packet().


|
staticnodiscard |
Parse a short header packet.
| data | Input buffer |
| conn_id_length | Expected destination connection ID length |
Definition at line 360 of file packet.cpp.
References kcenon::network::protocols::quic::short_header::dest_conn_id, kcenon::network::protocols::quic::short_header::first_byte, kcenon::network::error_codes::common_errors::invalid_argument, kcenon::network::ok(), and kcenon::network::protocols::quic::short_header::packet_number_length.
Referenced by kcenon::network::protocols::quic::connection::receive_packet().

