Support QUIC Client connection IDs
This CL is almost exclusively plumbing client connection IDs through the stack now that previous CLs handled the behavior changes. It also adds tests for the new behavior at each layer.
gfe-relnote: support client connection IDs, protected by quic_do_not_override_connection_id
PiperOrigin-RevId: 251599233
Change-Id: I7cda028f8aa56e6da451b6d86877fd0f84d93531
diff --git a/quic/core/quic_framer.h b/quic/core/quic_framer.h
index 57b1ed7..9b9c48f 100644
--- a/quic/core/quic_framer.h
+++ b/quic/core/quic_framer.h
@@ -588,6 +588,14 @@
return expected_server_connection_id_length_;
}
+ // Change the expected destination connection ID length for short headers on
+ // the client.
+ void SetExpectedClientConnectionIdLength(
+ uint8_t expected_client_connection_id_length) {
+ expected_client_connection_id_length_ =
+ expected_client_connection_id_length;
+ }
+
void EnableMultiplePacketNumberSpacesSupport();
// Writes an array of bytes that, if sent as a UDP datagram, will trigger
@@ -967,6 +975,8 @@
QuicPacketNumber largest_decrypted_packet_numbers_[NUM_PACKET_NUMBER_SPACES];
// Last server connection ID seen on the wire.
QuicConnectionId last_serialized_server_connection_id_;
+ // Last client connection ID seen on the wire.
+ QuicConnectionId last_serialized_client_connection_id_;
// The last QUIC version label received.
// TODO(fayang): Remove this when deprecating
// quic_no_framer_object_in_dispatcher.
@@ -1021,10 +1031,11 @@
bool infer_packet_header_type_from_version_;
// IETF short headers contain a destination connection ID but do not
- // encode its length. This variable contains the length we expect to read.
- // This is also used to validate the long header connection ID lengths in
- // older versions of QUIC.
+ // encode its length. These variables contains the length we expect to read.
+ // This is also used to validate the long header destination connection ID
+ // lengths in older versions of QUIC.
uint8_t expected_server_connection_id_length_;
+ uint8_t expected_client_connection_id_length_;
// When this is true, QuicFramer will change
// expected_server_connection_id_length_ to the received destination