blob: a4be66411d3024db1e3db9fb0d656644bd71f7d7 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// Copyright (c) 2016 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_BLOCKED_FRAME_H_
6#define QUICHE_QUIC_CORE_FRAMES_QUIC_BLOCKED_FRAME_H_
7
8#include <ostream>
9
10#include "net/third_party/quiche/src/quic/core/quic_types.h"
11
12namespace quic {
13
14// The BLOCKED frame is used to indicate to the remote endpoint that this
15// endpoint believes itself to be flow-control blocked but otherwise ready to
16// send data. The BLOCKED frame is purely advisory and optional.
17// Based on SPDY's BLOCKED frame (undocumented as of 2014-01-28).
18struct QUIC_EXPORT_PRIVATE QuicBlockedFrame {
19 QuicBlockedFrame();
20 QuicBlockedFrame(QuicControlFrameId control_frame_id, QuicStreamId stream_id);
21 QuicBlockedFrame(QuicControlFrameId control_frame_id,
22 QuicStreamId stream_id,
23 QuicStreamOffset offset);
24
25 friend QUIC_EXPORT_PRIVATE std::ostream& operator<<(
26 std::ostream& os,
27 const QuicBlockedFrame& b);
28
29 // A unique identifier of this control frame. 0 when this frame is received,
30 // and non-zero when sent.
31 QuicControlFrameId control_frame_id;
32
33 // The stream this frame applies to. 0 is a special case meaning the overall
34 // connection rather than a specific stream.
35 //
36 // For IETF QUIC, the stream_id controls whether an IETF QUIC
37 // BLOCKED or STREAM_BLOCKED frame is generated.
38 // If stream_id is 0 then a BLOCKED frame is generated and transmitted,
39 // if non-0, a STREAM_BLOCKED.
40 // TODO(fkastenholz): This should be converted to use
41 // QuicUtils::GetInvalidStreamId to get the correct invalid stream id value
42 // and not rely on 0.
43 QuicStreamId stream_id;
44
45 // For Google QUIC, the offset is ignored.
46 QuicStreamOffset offset;
47};
48
49} // namespace quic
50
51#endif // QUICHE_QUIC_CORE_FRAMES_QUIC_BLOCKED_FRAME_H_