1 // 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_GOAWAY_FRAME_H_ 6 #define QUICHE_QUIC_CORE_FRAMES_QUIC_GOAWAY_FRAME_H_ 7 8 #include <ostream> 9 #include <string> 10 11 #include "quiche/quic/core/quic_constants.h" 12 #include "quiche/quic/core/quic_error_codes.h" 13 #include "quiche/quic/core/quic_types.h" 14 15 namespace quic { 16 17 struct QUICHE_EXPORT QuicGoAwayFrame { 18 QuicGoAwayFrame() = default; 19 QuicGoAwayFrame(QuicControlFrameId control_frame_id, QuicErrorCode error_code, 20 QuicStreamId last_good_stream_id, const std::string& reason); 21 22 friend QUICHE_EXPORT std::ostream& operator<<(std::ostream& os, 23 const QuicGoAwayFrame& g); 24 25 bool operator==(const QuicGoAwayFrame& rhs) const; 26 bool operator!=(const QuicGoAwayFrame& rhs) const; 27 28 // A unique identifier of this control frame. 0 when this frame is received, 29 // and non-zero when sent. 30 QuicControlFrameId control_frame_id = kInvalidControlFrameId; 31 QuicErrorCode error_code = QUIC_NO_ERROR; 32 QuicStreamId last_good_stream_id = 0; 33 std::string reason_phrase; 34 }; 35 36 } // namespace quic 37 38 #endif // QUICHE_QUIC_CORE_FRAMES_QUIC_GOAWAY_FRAME_H_ 39