xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/frames/quic_streams_blocked_frame.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright (c) 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef QUICHE_QUIC_CORE_FRAMES_QUIC_STREAMS_BLOCKED_FRAME_H_
6 #define QUICHE_QUIC_CORE_FRAMES_QUIC_STREAMS_BLOCKED_FRAME_H_
7 
8 #include <ostream>
9 
10 #include "quiche/quic/core/frames/quic_inlined_frame.h"
11 #include "quiche/quic/core/quic_constants.h"
12 #include "quiche/quic/core/quic_types.h"
13 #include "quiche/quic/platform/api/quic_export.h"
14 
15 namespace quic {
16 
17 // IETF format STREAMS_BLOCKED frame.
18 // The sender uses this to inform the peer that the sender wished to
19 // open a new stream, exceeding the limit on the number of streams.
20 struct QUICHE_EXPORT QuicStreamsBlockedFrame
21     : public QuicInlinedFrame<QuicStreamsBlockedFrame> {
22   QuicStreamsBlockedFrame();
23   QuicStreamsBlockedFrame(QuicControlFrameId control_frame_id,
24                           QuicStreamCount stream_count, bool unidirectional);
25 
26   friend QUICHE_EXPORT std::ostream& operator<<(
27       std::ostream& os, const QuicStreamsBlockedFrame& frame);
28 
29   QuicFrameType type;
30 
31   // A unique identifier of this control frame. 0 when this frame is received,
32   // and non-zero when sent.
33   QuicControlFrameId control_frame_id = kInvalidControlFrameId;
34 
35   // The number of streams that the sender wishes to exceed
36   QuicStreamCount stream_count = 0;
37 
38   // Whether uni- or bi-directional streams
39   bool unidirectional = false;
40 };
41 
42 }  // namespace quic
43 
44 #endif  // QUICHE_QUIC_CORE_FRAMES_QUIC_STREAMS_BLOCKED_FRAME_H_
45