s2n_quic_core/frame/retire_connection_id.rs
1// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::varint::VarInt;
5
6//= https://www.rfc-editor.org/rfc/rfc9000#section-19.16
7//# An endpoint sends a RETIRE_CONNECTION_ID frame (type=0x19) to
8//# indicate that it will no longer use a connection ID that was issued
9//# by its peer.
10
11macro_rules! retire_connection_id_tag {
12 () => {
13 0x19u8
14 };
15}
16
17//= https://www.rfc-editor.org/rfc/rfc9000#section-19.16
18//# RETIRE_CONNECTION_ID Frame {
19//# Type (i) = 0x19,
20//# Sequence Number (i),
21//# }
22
23//= https://www.rfc-editor.org/rfc/rfc9000#section-19.16
24//# RETIRE_CONNECTION_ID frames contain the following fields:
25//#
26//# Sequence Number: The sequence number of the connection ID being
27//# retired; see Section 5.1.2.
28
29#[derive(Copy, Clone, Debug, PartialEq, Eq)]
30pub struct RetireConnectionId {
31 pub sequence_number: VarInt,
32}
33
34impl RetireConnectionId {
35 pub const fn tag(self) -> u8 {
36 retire_connection_id_tag!()
37 }
38}
39
40simple_frame_codec!(
41 RetireConnectionId { sequence_number },
42 retire_connection_id_tag!()
43);