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_MAX_STREAMS_FRAME_H_ 6 #define QUICHE_QUIC_CORE_FRAMES_QUIC_MAX_STREAMS_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 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. 20 struct QUICHE_EXPORT QuicMaxStreamsFrame 21 : public QuicInlinedFrame<QuicMaxStreamsFrame> { 22 QuicMaxStreamsFrame(); 23 QuicMaxStreamsFrame(QuicControlFrameId control_frame_id, 24 QuicStreamCount stream_count, bool unidirectional); 25 26 friend QUICHE_EXPORT std::ostream& operator<<( 27 std::ostream& os, const QuicMaxStreamsFrame& 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 may be opened. 36 QuicStreamCount stream_count = 0; 37 // Whether uni- or bi-directional streams 38 bool unidirectional = false; 39 }; 40 41 } // namespace quic 42 43 #endif // QUICHE_QUIC_CORE_FRAMES_QUIC_MAX_STREAMS_FRAME_H_ 44