|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
QUIC Connection ID (RFC 9000 Section 5.1) More...
#include <connection_id.h>

Public Member Functions | |
| connection_id ()=default | |
| Default constructor creates an empty connection ID. | |
| connection_id (std::span< const uint8_t > data) | |
| Construct from raw bytes. | |
| auto | data () const -> std::span< const uint8_t > |
| Get the raw bytes of the connection ID. | |
| auto | length () const noexcept -> size_t |
| Get the length of the connection ID. | |
| auto | empty () const noexcept -> bool |
| Check if the connection ID is empty. | |
| auto | operator== (const connection_id &other) const noexcept -> bool |
| Equality comparison. | |
| auto | operator!= (const connection_id &other) const noexcept -> bool |
| Inequality comparison. | |
| auto | operator< (const connection_id &other) const noexcept -> bool |
| Less-than comparison for use in ordered containers. | |
| auto | to_string () const -> std::string |
| Convert to hexadecimal string for debugging. | |
Static Public Member Functions | |
| static auto | generate (size_t length=8) -> connection_id |
| Generate a random connection ID. | |
Static Public Attributes | |
| static constexpr size_t | max_length = 20 |
| Maximum length of a connection ID (RFC 9000) | |
Private Attributes | |
| std::array< uint8_t, max_length > | data_ {} |
| uint8_t | length_ {0} |
QUIC Connection ID (RFC 9000 Section 5.1)
A connection ID is used to identify a QUIC connection. Connection IDs are used to route packets to the correct connection and to allow endpoints to change network addresses without breaking the connection.
Key properties (RFC 9000):
Definition at line 43 of file connection_id.h.
|
default |
Default constructor creates an empty connection ID.
Referenced by kcenon::network::protocols::quic::preferred_address_info::operator==().

|
explicit |
Construct from raw bytes.
| data | Span of bytes (max 20) |
Definition at line 15 of file connection_id.cpp.
References data(), data_, length_, and max_length.

|
nodiscard |
Get the raw bytes of the connection ID.
Definition at line 47 of file connection_id.cpp.
References data_, and length_.
Referenced by connection_id().

|
nodiscardnoexcept |
Check if the connection ID is empty.
Definition at line 57 of file connection_id.cpp.
References length_.
|
staticnodiscard |
Generate a random connection ID.
| length | Desired length (1-20, clamped to max_length) |
Definition at line 22 of file connection_id.cpp.
References data_, and length_.
Referenced by kcenon::network::protocols::quic::connection::connection().

|
nodiscardnoexcept |
Get the length of the connection ID.
Definition at line 52 of file connection_id.cpp.
References length_.
|
nodiscardnoexcept |
Inequality comparison.
| other | Connection ID to compare with |
Definition at line 72 of file connection_id.cpp.
|
nodiscardnoexcept |
Less-than comparison for use in ordered containers.
| other | Connection ID to compare with |
Definition at line 77 of file connection_id.cpp.
|
nodiscardnoexcept |
Equality comparison.
| other | Connection ID to compare with |
Definition at line 62 of file connection_id.cpp.
|
nodiscard |
Convert to hexadecimal string for debugging.
Definition at line 89 of file connection_id.cpp.
|
private |
Definition at line 115 of file connection_id.h.
Referenced by connection_id(), data(), generate(), and to_string().
|
private |
Definition at line 116 of file connection_id.h.
Referenced by connection_id(), data(), empty(), generate(), length(), and to_string().
|
staticconstexpr |
Maximum length of a connection ID (RFC 9000)
Definition at line 47 of file connection_id.h.
Referenced by connection_id(), and kcenon::network::protocols::quic::packet_parser::parse_long_header().