Add datatypes needed for IETF CONNECTION_CLOSE support.
This CL adds datatypes that are needed to support IETF QUIC's CONNECTION_CLOSE.
The types are
- union QuicConnectionCloseErrorCode: a union that allows the frame's error
code field to be accessed using the correct type (QuicErrorCode,
QuicIetfTransportErrorCode, or uint16_t), and
- enum QuicConnectionCloseType: indicates the type of connection close
(Google-QUIC, IETF QUIC Connection Close/Application, or IETF QUIC
Connection Close/Transport).
QuicConnectionCloseFrame is updated to include these fields.
QuicFramer is updated to set them to reasonable defaults/etc.
Code that refers to QuicConnectionCloseFrame::error_code has been
modified to get the error code value from the QuicErrorCode member
of the QuicConnectionCloseErrorCode union.
There are no logic or functional changes. Additional CLs will add the necessary functionality.
gfe-relnote: Not flag protected, all code changes due to field name/etc changes.
ENUM_VALUE_OK=This value change is OK, it is the maximum value/limit of the enum
The design, including rationale and approximate plan for Cls is in
https://docs.google.com/document/d/1LB1Dhyw7tVLmFFEqmW6_xxnNiExNtlShJXrNU3CDM0M/edit?usp=sharing
PiperOrigin-RevId: 242647040
Change-Id: I3e45879777d83e7a8aeb2e19257b8bafcd0101bd
diff --git a/quic/core/quic_ietf_framer_test.cc b/quic/core/quic_ietf_framer_test.cc
index c1ada6b..9c30e9c 100644
--- a/quic/core/quic_ietf_framer_test.cc
+++ b/quic/core/quic_ietf_framer_test.cc
@@ -798,9 +798,9 @@
// empty string,
std::string test_string = "Ich Bin Ein Jelly Donut?";
QuicConnectionCloseFrame sent_frame;
- sent_frame.error_code = static_cast<QuicErrorCode>(0);
+ sent_frame.quic_error_code = static_cast<QuicErrorCode>(0);
sent_frame.error_details = test_string;
- sent_frame.frame_type = 123;
+ sent_frame.transport_close_frame_type = 123;
// write the frame to the packet buffer.
EXPECT_TRUE(QuicFramerPeer::AppendIetfConnectionCloseFrame(
&framer_, sent_frame, &writer));
@@ -814,11 +814,11 @@
// a QuicConnectionCloseFrame to hold the results.
QuicConnectionCloseFrame sink_frame;
- EXPECT_TRUE(QuicFramerPeer::ProcessIetfConnectionCloseFrame(&framer_, &reader,
- &sink_frame));
+ EXPECT_TRUE(QuicFramerPeer::ProcessIetfConnectionCloseFrame(
+ &framer_, &reader, IETF_QUIC_TRANSPORT_CONNECTION_CLOSE, &sink_frame));
// Now check that received == sent
- EXPECT_EQ(sink_frame.error_code, static_cast<QuicErrorCode>(0));
+ EXPECT_EQ(sink_frame.quic_error_code, static_cast<QuicErrorCode>(0));
EXPECT_EQ(sink_frame.error_details, test_string);
}