118 [[nodiscard]] auto
is_retry() const noexcept ->
bool;
148 [[nodiscard]]
auto spin_bit() const noexcept ->
bool;
154 [[nodiscard]] auto key_phase() const noexcept ->
bool;
182 [[nodiscard]]
static auto encode(uint64_t full_pn, uint64_t largest_acked)
183 -> std::pair<std::vector<uint8_t>,
size_t>;
192 [[nodiscard]]
static auto decode(uint64_t truncated_pn,
size_t pn_length,
193 uint64_t largest_pn)
noexcept -> uint64_t;
201 [[nodiscard]]
static auto encoded_length(uint64_t full_pn,
202 uint64_t largest_acked)
noexcept -> size_t;
225 [[nodiscard]]
static constexpr auto is_long_header(uint8_t first_byte)
noexcept ->
bool
227 return (first_byte & 0x80) != 0;
237 return (first_byte & 0x40) != 0;
247 [[nodiscard]]
static auto parse_header(std::span<const uint8_t> data)
255 [[nodiscard]]
static auto parse_long_header(std::span<const uint8_t> data)
264 [[nodiscard]]
static auto parse_short_header(std::span<const uint8_t> data,
265 size_t conn_id_length)
276 return static_cast<packet_type>((first_byte >> 4) & 0x03);
284 [[nodiscard]]
static auto is_version_negotiation(std::span<const uint8_t> data)
noexcept
311 [[nodiscard]]
static auto build_initial(
314 const std::vector<uint8_t>& token,
316 uint32_t
version = quic_version::version_1) -> std::vector<uint8_t>;
326 [[nodiscard]]
static auto build_handshake(
330 uint32_t
version = quic_version::version_1) -> std::vector<uint8_t>;
340 [[nodiscard]]
static auto build_zero_rtt(
344 uint32_t
version = quic_version::version_1) -> std::vector<uint8_t>;
355 [[nodiscard]]
static auto build_retry(
358 const std::vector<uint8_t>& token,
359 const std::array<uint8_t, 16>& integrity_tag,
360 uint32_t
version = quic_version::version_1) -> std::vector<uint8_t>;
370 [[nodiscard]]
static auto build_short(
373 bool key_phase =
false,
374 bool spin_bit =
false) -> std::vector<uint8_t>;
381 [[nodiscard]]
static auto build(
const long_header& header) -> std::vector<uint8_t>;
388 [[nodiscard]]
static auto build(
const short_header& header) -> std::vector<uint8_t>;
392 static void append_bytes(std::vector<uint8_t>& buffer,
393 std::span<const uint8_t> data);
QUIC Connection ID (RFC 9000 Section 5.1)
Builder for QUIC packet headers (RFC 9000 Section 17)
QUIC packet number utilities (RFC 9000 Section 17.1)
Parser for QUIC packet headers (RFC 9000 Section 17)
static constexpr auto has_valid_fixed_bit(uint8_t first_byte) noexcept -> bool
Check if the fixed bit is set correctly.
static constexpr auto is_long_header(uint8_t first_byte) noexcept -> bool
Check if a packet has a long header.
static constexpr auto get_long_packet_type(uint8_t first_byte) noexcept -> packet_type
Get the packet type from long header's first byte.
QUIC connection identifier type.
constexpr uint32_t version_2
QUIC version 2 (RFC 9369)
constexpr uint32_t negotiation
Version Negotiation (special value)
constexpr uint32_t version_1
QUIC version 1 (RFC 9000)
auto packet_type_to_string(packet_type type) -> std::string
Convert packet type to string for debugging.
@ handshake
Handshake encryption.
@ zero_rtt
0-RTT early data encryption
packet_type
QUIC packet types (RFC 9000 Section 17)
std::variant< long_header, short_header > packet_header
Variant type for packet headers.
constexpr const char * version() noexcept
Get the network system version string.
Network-specific error and result type definitions.