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

Static Public Member Functions | |
| static auto | encode (uint64_t full_pn, uint64_t largest_acked) -> std::pair< std::vector< uint8_t >, size_t > |
| Encode a packet number for transmission. | |
| static auto | decode (uint64_t truncated_pn, size_t pn_length, uint64_t largest_pn) noexcept -> uint64_t |
| Decode a packet number from received data. | |
| static auto | encoded_length (uint64_t full_pn, uint64_t largest_acked) noexcept -> size_t |
| Get the minimum number of bytes needed to encode a packet number. | |
QUIC packet number utilities (RFC 9000 Section 17.1)
Packet numbers are encoded using a variable-length encoding based on the difference from the largest acknowledged packet number.
|
staticnodiscardnoexcept |
Decode a packet number from received data.
| truncated_pn | Truncated packet number from packet |
| pn_length | Length of the truncated packet number (1-4) |
| largest_pn | Largest packet number received so far |
Definition at line 103 of file packet.cpp.
Referenced by kcenon::network::internal::quic_socket::handle_packet().

|
staticnodiscard |
Encode a packet number for transmission.
| full_pn | Full packet number to encode |
| largest_acked | Largest acknowledged packet number (0 if none) |
Definition at line 88 of file packet.cpp.
Referenced by kcenon::network::protocols::quic::packet_builder::build_handshake(), kcenon::network::protocols::quic::packet_builder::build_initial(), kcenon::network::protocols::quic::packet_builder::build_short(), and kcenon::network::protocols::quic::packet_builder::build_zero_rtt().

|
staticnodiscardnoexcept |
Get the minimum number of bytes needed to encode a packet number.
| full_pn | Full packet number |
| largest_acked | Largest acknowledged packet number |
Definition at line 127 of file packet.cpp.
Referenced by kcenon::network::protocols::quic::packet_builder::build_handshake(), kcenon::network::protocols::quic::packet_builder::build_initial(), kcenon::network::protocols::quic::packet_builder::build_short(), and kcenon::network::protocols::quic::packet_builder::build_zero_rtt().
