s2n_quic_core/frame/ping.rs
1// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4//= https://www.rfc-editor.org/rfc/rfc9000#section-19.2
5//# Endpoints can use PING frames (type=0x01) to verify that their peers
6//# are still alive or to check reachability to the peer.
7
8macro_rules! ping_tag {
9 () => {
10 0x01u8
11 };
12}
13
14//= https://www.rfc-editor.org/rfc/rfc9000#section-19.2
15//# PING Frame {
16//# Type (i) = 0x01,
17//# }
18
19#[derive(Copy, Clone, Debug, PartialEq, Eq)]
20pub struct Ping;
21
22impl Ping {
23 pub const fn tag(self) -> u8 {
24 ping_tag!()
25 }
26}
27
28simple_frame_codec!(Ping {}, ping_tag!());