blob: f8c78f9afd41dcb9a41ab8c99d4c313e96f0ec40 [file] [log] [blame]
fkastenholz3c4eabf2019-04-22 07:49:59 -07001// 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_MAX_STREAMS_FRAME_H_
6#define QUICHE_QUIC_CORE_FRAMES_QUIC_MAX_STREAMS_FRAME_H_
7
8#include <ostream>
9
10#include "net/third_party/quiche/src/quic/core/frames/quic_inlined_frame.h"
11#include "net/third_party/quiche/src/quic/core/quic_constants.h"
12#include "net/third_party/quiche/src/quic/core/quic_types.h"
13#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
14
15namespace quic {
16
17// IETF format MAX_STREAMS frame.
18// This frame is used by the sender to inform the peer of the number of
19// streams that the peer may open and that the sender will accept.
20struct QUIC_EXPORT_PRIVATE QuicMaxStreamsFrame
21 : public QuicInlinedFrame<QuicMaxStreamsFrame> {
22 QuicMaxStreamsFrame();
23 QuicMaxStreamsFrame(QuicControlFrameId control_frame_id,
24 QuicStreamCount stream_count,
25 bool unidirectional);
26
27 friend QUIC_EXPORT_PRIVATE std::ostream& operator<<(
28 std::ostream& os,
29 const QuicMaxStreamsFrame& frame);
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;
34
35 // The number of streams that may be opened.
36 QuicStreamCount stream_count;
37 // Whether uni- or bi-directional streams
38 bool unidirectional;
39};
40
41} // namespace quic
42
43#endif // QUICHE_QUIC_CORE_FRAMES_QUIC_MAX_STREAMS_FRAME_H_