22namespace cid_manager_error
115 uint64_t retire_prior_to,
116 const std::array<uint8_t, 16>& reset_token) ->
VoidResult;
144 const std::array<uint8_t, 16>& token) const ->
bool;
236 -> std::vector<connection_id_entry>::iterator;
Manages peer connection IDs for QUIC connections (RFC 9000 Section 5.1)
auto get_pending_retire_frames() -> std::vector< retire_connection_id_frame >
Get pending RETIRE_CONNECTION_ID frames to send.
auto add_peer_cid(const connection_id &cid, uint64_t sequence, uint64_t retire_prior_to, const std::array< uint8_t, 16 > &reset_token) -> VoidResult
Add a new peer connection ID from NEW_CONNECTION_ID frame.
connection_id_manager(const connection_id_manager &)=delete
auto retire_peer_cid(uint64_t sequence) -> VoidResult
Mark a specific CID sequence as retired.
auto has_peer_cid(const connection_id &cid) const -> bool
Check if a given CID matches any stored peer CID.
auto peer_cid_count() const -> size_t
Get the current number of peer CIDs (including retired)
auto rotate_peer_cid() -> VoidResult
Rotate to a new peer connection ID.
auto operator=(const connection_id_manager &) -> connection_id_manager &=delete
auto active_cid_limit() const -> uint64_t
Get the active connection ID limit.
auto count_active_cids() const -> size_t
Count non-retired CIDs.
connection_id_manager(connection_id_manager &&)=default
std::vector< connection_id_entry > peer_cids_
Peer connection IDs.
void set_active_cid_limit(uint64_t limit)
Set the active connection ID limit.
auto operator=(connection_id_manager &&) -> connection_id_manager &=default
auto is_stateless_reset_token(const std::array< uint8_t, 16 > &token) const -> bool
Check if a stateless reset token matches any stored CID.
auto get_active_peer_cid() const -> const connection_id &
Get the currently active peer connection ID.
std::vector< retire_connection_id_frame > pending_retire_frames_
Pending RETIRE_CONNECTION_ID frames to send.
static const connection_id empty_cid_
Empty CID for error cases.
void set_initial_peer_cid(const connection_id &cid)
Set the initial peer connection ID (from Initial packet)
auto find_by_sequence(uint64_t sequence) -> std::vector< connection_id_entry >::iterator
Find an entry by sequence number.
uint64_t active_cid_limit_
Maximum number of active CIDs.
auto available_peer_cids() const -> size_t
Get the number of available (non-retired, non-active) peer CIDs.
uint64_t largest_retire_prior_to_
Largest retire_prior_to value received.
connection_id_manager(uint64_t active_cid_limit=8)
Construct a connection ID manager.
void retire_cids_prior_to(uint64_t prior_to)
Retire CIDs with sequence numbers less than the given value.
void clear_pending_retire_frames()
Clear the pending retire frames queue.
~connection_id_manager()=default
auto largest_retire_prior_to() const -> uint64_t
Get the largest retire_prior_to value received.
size_t active_index_
Index of the currently active peer CID.
QUIC Connection ID (RFC 9000 Section 5.1)
QUIC connection identifier type.
constexpr int no_available_cid
constexpr int sequence_too_low
constexpr int invalid_retire_prior_to
constexpr int duplicate_sequence
constexpr int cid_not_found
constexpr int active_cid_limit_exceeded
Result< std::monostate > VoidResult
Network-specific error and result type definitions.
Entry for storing a peer's connection ID with metadata.
std::array< uint8_t, 16 > stateless_reset_token
RETIRE_CONNECTION_ID frame (RFC 9000 Section 19.16)