In `QuicBufferedPacketStoreTest`, pass `long_packet_type` to `QuicBufferedPacketStore::EnqueuePacket`. This change alone has no behavior change. It's separated from cl/641294174 to make that change smaller. PiperOrigin-RevId: 648358023
diff --git a/quiche/quic/core/quic_buffered_packet_store_test.cc b/quiche/quic/core/quic_buffered_packet_store_test.cc index 77abde3..7f38170 100644 --- a/quiche/quic/core/quic_buffered_packet_store_test.cc +++ b/quiche/quic/core/quic_buffered_packet_store_test.cc
@@ -18,6 +18,7 @@ #include "quiche/quic/core/crypto/transport_parameters.h" #include "quiche/quic/core/quic_connection_id.h" #include "quiche/quic/core/quic_constants.h" +#include "quiche/quic/core/quic_dispatcher.h" #include "quiche/quic/core/quic_error_codes.h" #include "quiche/quic/core/quic_framer.h" #include "quiche/quic/core/quic_packets.h" @@ -58,14 +59,15 @@ EnqueuePacketResult EnqueuePacketToStore( QuicBufferedPacketStore& store, QuicConnectionId connection_id, - PacketHeaderFormat form, const QuicReceivedPacket& packet, - QuicSocketAddress self_address, QuicSocketAddress peer_address, - const ParsedQuicVersion& version, + PacketHeaderFormat form, QuicLongHeaderType long_packet_type, + const QuicReceivedPacket& packet, QuicSocketAddress self_address, + QuicSocketAddress peer_address, const ParsedQuicVersion& version, std::optional<ParsedClientHello> parsed_chlo, ConnectionIdGeneratorInterface* connection_id_generator) { ReceivedPacketInfo packet_info(self_address, peer_address, packet); packet_info.destination_connection_id = connection_id; packet_info.form = form; + packet_info.long_packet_type = long_packet_type; packet_info.version = version; return store.EnqueuePacket(packet_info, std::move(parsed_chlo), connection_id_generator); @@ -116,9 +118,9 @@ TEST_F(QuicBufferedPacketStoreTest, SimpleEnqueueAndDeliverPacket) { QuicConnectionId connection_id = TestConnectionId(1); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); auto packets = store_.DeliverPackets(connection_id); const std::list<BufferedPacket>& queue = packets.buffered_packets; @@ -139,12 +141,13 @@ TEST_F(QuicBufferedPacketStoreTest, DifferentPacketAddressOnOneConnection) { QuicSocketAddress addr_with_new_port(QuicIpAddress::Any4(), 256); QuicConnectionId connection_id = TestConnectionId(1); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, addr_with_new_port, invalid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + addr_with_new_port, invalid_version_, kNoParsedChlo, + nullptr); std::list<BufferedPacket> queue = store_.DeliverPackets(connection_id).buffered_packets; ASSERT_EQ(2u, queue.size()); @@ -158,12 +161,12 @@ size_t num_connections = 10; for (uint64_t conn_id = 1; conn_id <= num_connections; ++conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore( + store_, connection_id, GOOGLE_QUIC_PACKET, INVALID_PACKET_TYPE, packet_, + self_address_, peer_address_, invalid_version_, kNoParsedChlo, nullptr); + EnqueuePacketToStore( + store_, connection_id, GOOGLE_QUIC_PACKET, INVALID_PACKET_TYPE, packet_, + self_address_, peer_address_, invalid_version_, kNoParsedChlo, nullptr); } // Deliver packets in reversed order. @@ -185,13 +188,14 @@ // keep. EXPECT_EQ(QuicBufferedPacketStore::SUCCESS, EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, - packet_, self_address_, peer_address_, - valid_version_, kDefaultParsedChlo, nullptr)); + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, valid_version_, + kDefaultParsedChlo, nullptr)); for (size_t i = 1; i <= num_packets; ++i) { // Only first |kDefaultMaxUndecryptablePackets packets| will be buffered. EnqueuePacketResult result = EnqueuePacketToStore( - store_, connection_id, GOOGLE_QUIC_PACKET, packet_, self_address_, - peer_address_, invalid_version_, kNoParsedChlo, nullptr); + store_, connection_id, GOOGLE_QUIC_PACKET, INVALID_PACKET_TYPE, packet_, + self_address_, peer_address_, invalid_version_, kNoParsedChlo, nullptr); if (i <= kDefaultMaxUndecryptablePackets) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, result); } else { @@ -212,8 +216,8 @@ for (uint64_t conn_id = 1; conn_id <= kNumConnections; ++conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); EnqueuePacketResult result = EnqueuePacketToStore( - store_, connection_id, GOOGLE_QUIC_PACKET, packet_, self_address_, - peer_address_, invalid_version_, kNoParsedChlo, nullptr); + store_, connection_id, GOOGLE_QUIC_PACKET, INVALID_PACKET_TYPE, packet_, + self_address_, peer_address_, invalid_version_, kNoParsedChlo, nullptr); if (conn_id <= kMaxConnectionsWithoutCHLO) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, result); } else { @@ -241,10 +245,10 @@ kDefaultMaxConnectionsInStore - kMaxConnectionsWithoutCHLO + 1; for (uint64_t conn_id = 1; conn_id <= num_chlos; ++conn_id) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, - EnqueuePacketToStore(store_, TestConnectionId(conn_id), - GOOGLE_QUIC_PACKET, packet_, self_address_, - peer_address_, valid_version_, - kDefaultParsedChlo, nullptr)); + EnqueuePacketToStore( + store_, TestConnectionId(conn_id), GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, peer_address_, + valid_version_, kDefaultParsedChlo, nullptr)); } // Send data packets on another |kMaxConnectionsWithoutCHLO| connections. @@ -253,8 +257,9 @@ conn_id <= (kDefaultMaxConnectionsInStore + 1); ++conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); EnqueuePacketResult result = EnqueuePacketToStore( - store_, connection_id, GOOGLE_QUIC_PACKET, packet_, self_address_, - peer_address_, valid_version_, kDefaultParsedChlo, nullptr); + store_, connection_id, GOOGLE_QUIC_PACKET, INVALID_PACKET_TYPE, packet_, + self_address_, peer_address_, valid_version_, kDefaultParsedChlo, + nullptr); if (conn_id <= kDefaultMaxConnectionsInStore) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, result); } else { @@ -266,9 +271,9 @@ TEST_F(QuicBufferedPacketStoreTest, BasicGeneratorBuffering) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, EnqueuePacketToStore( - store_, TestConnectionId(1), GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, valid_version_, - kDefaultParsedChlo, &connection_id_generator_)); + store_, TestConnectionId(1), GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, peer_address_, + valid_version_, kDefaultParsedChlo, &connection_id_generator_)); QuicConnectionId delivered_conn_id; BufferedPacketList packet_list = store_.DeliverPacketsForNextConnection(&delivered_conn_id); @@ -278,11 +283,11 @@ } TEST_F(QuicBufferedPacketStoreTest, NullGeneratorOk) { - EXPECT_EQ( - EnqueuePacketResult::SUCCESS, - EnqueuePacketToStore(store_, TestConnectionId(1), GOOGLE_QUIC_PACKET, - packet_, self_address_, peer_address_, - valid_version_, kDefaultParsedChlo, nullptr)); + EXPECT_EQ(EnqueuePacketResult::SUCCESS, + EnqueuePacketToStore(store_, TestConnectionId(1), + GOOGLE_QUIC_PACKET, INVALID_PACKET_TYPE, + packet_, self_address_, peer_address_, + valid_version_, kDefaultParsedChlo, nullptr)); QuicConnectionId delivered_conn_id; BufferedPacketList packet_list = store_.DeliverPacketsForNextConnection(&delivered_conn_id); @@ -295,14 +300,14 @@ MockConnectionIdGenerator generator2; EXPECT_EQ(EnqueuePacketResult::SUCCESS, EnqueuePacketToStore( - store_, TestConnectionId(1), GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, valid_version_, - kDefaultParsedChlo, &connection_id_generator_)); - EXPECT_EQ( - EnqueuePacketResult::SUCCESS, - EnqueuePacketToStore(store_, TestConnectionId(1), GOOGLE_QUIC_PACKET, - packet_, self_address_, peer_address_, - valid_version_, kNoParsedChlo, &generator2)); + store_, TestConnectionId(1), GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, peer_address_, + valid_version_, kDefaultParsedChlo, &connection_id_generator_)); + EXPECT_EQ(EnqueuePacketResult::SUCCESS, + EnqueuePacketToStore(store_, TestConnectionId(1), + GOOGLE_QUIC_PACKET, INVALID_PACKET_TYPE, + packet_, self_address_, peer_address_, + valid_version_, kNoParsedChlo, &generator2)); QuicConnectionId delivered_conn_id; BufferedPacketList packet_list = store_.DeliverPacketsForNextConnection(&delivered_conn_id); @@ -315,23 +320,23 @@ // Buffer data packets on different connections upto limit. for (uint64_t conn_id = 1; conn_id <= kMaxConnectionsWithoutCHLO; ++conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); - EXPECT_EQ( - EnqueuePacketResult::SUCCESS, - // connection_id_generator_ will be ignored because the chlo has - // not been parsed. - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, &connection_id_generator_)); + EXPECT_EQ(EnqueuePacketResult::SUCCESS, + // connection_id_generator_ will be ignored because the chlo has + // not been parsed. + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, + kNoParsedChlo, &connection_id_generator_)); } // Buffer CHLOs on other connections till store is full. for (size_t i = kMaxConnectionsWithoutCHLO + 1; i <= kDefaultMaxConnectionsInStore + 1; ++i) { QuicConnectionId connection_id = TestConnectionId(i); - EnqueuePacketResult rs = - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, valid_version_, - kDefaultParsedChlo, &connection_id_generator_); + EnqueuePacketResult rs = EnqueuePacketToStore( + store_, connection_id, GOOGLE_QUIC_PACKET, INVALID_PACKET_TYPE, packet_, + self_address_, peer_address_, valid_version_, kDefaultParsedChlo, + &connection_id_generator_); if (i <= kDefaultMaxConnectionsInStore) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, rs); EXPECT_TRUE(store_.HasChloForConnection(connection_id)); @@ -347,9 +352,9 @@ // delivered at last. EXPECT_EQ(EnqueuePacketResult::SUCCESS, EnqueuePacketToStore( - store_, TestConnectionId(1), GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, valid_version_, - kDefaultParsedChlo, &connection_id_generator_)); + store_, TestConnectionId(1), GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, peer_address_, + valid_version_, kDefaultParsedChlo, &connection_id_generator_)); EXPECT_TRUE(store_.HasChloForConnection(TestConnectionId(1))); QuicConnectionId delivered_conn_id; @@ -376,20 +381,21 @@ // connections both with and without CHLOs. TEST_F(QuicBufferedPacketStoreTest, PacketQueueExpiredBeforeDelivery) { QuicConnectionId connection_id = TestConnectionId(1); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, &connection_id_generator_); - EXPECT_EQ( - EnqueuePacketResult::SUCCESS, - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, valid_version_, - kDefaultParsedChlo, &connection_id_generator_)); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, + &connection_id_generator_); + EXPECT_EQ(EnqueuePacketResult::SUCCESS, + EnqueuePacketToStore( + store_, connection_id, GOOGLE_QUIC_PACKET, INVALID_PACKET_TYPE, + packet_, self_address_, peer_address_, valid_version_, + kDefaultParsedChlo, &connection_id_generator_)); QuicConnectionId connection_id2 = TestConnectionId(2); - EXPECT_EQ( - EnqueuePacketResult::SUCCESS, - EnqueuePacketToStore(store_, connection_id2, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, &connection_id_generator_)); + EXPECT_EQ(EnqueuePacketResult::SUCCESS, + EnqueuePacketToStore(store_, connection_id2, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, + &connection_id_generator_)); // CHLO on connection 3 arrives 1ms later. clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); @@ -397,8 +403,9 @@ // Use different client address to differentiate packets from different // connections. QuicSocketAddress another_client_address(QuicIpAddress::Any4(), 255); - EnqueuePacketToStore(store_, connection_id3, GOOGLE_QUIC_PACKET, packet_, - self_address_, another_client_address, valid_version_, + EnqueuePacketToStore(store_, connection_id3, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + another_client_address, valid_version_, kDefaultParsedChlo, &connection_id_generator_); // Advance clock to the time when connection 1 and 2 expires. @@ -433,12 +440,12 @@ // Test the alarm is reset by enqueueing 2 packets for 4th connection and wait // for them to expire. QuicConnectionId connection_id4 = TestConnectionId(4); - EnqueuePacketToStore(store_, connection_id4, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id4, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id4, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id4, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); clock_.AdvanceTime( QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline() - clock_.ApproximateNow()); @@ -452,12 +459,12 @@ QuicConnectionId connection_id = TestConnectionId(1); // Enqueue some packets - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); @@ -480,15 +487,16 @@ QuicConnectionId connection_id = TestConnectionId(1); // Enqueue some packets, which include a CHLO - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, valid_version_, - kDefaultParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, valid_version_, kDefaultParsedChlo, + nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); EXPECT_TRUE(store_.HasChlosBuffered()); @@ -512,19 +520,19 @@ QuicConnectionId connection_id_2 = TestConnectionId(2); // Enqueue some packets for two connection IDs - EnqueuePacketToStore(store_, connection_id_1, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id_1, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, invalid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id_1, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id_1, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, invalid_version_, kNoParsedChlo, nullptr); ParsedClientHello parsed_chlo; parsed_chlo.alpns.push_back("h3"); parsed_chlo.sni = TestHostname(); - EnqueuePacketToStore(store_, connection_id_2, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, valid_version_, - parsed_chlo, nullptr); + EnqueuePacketToStore(store_, connection_id_2, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, valid_version_, parsed_chlo, nullptr); EXPECT_TRUE(store_.HasBufferedPackets(connection_id_1)); EXPECT_TRUE(store_.HasBufferedPackets(connection_id_2)); EXPECT_TRUE(store_.HasChlosBuffered()); @@ -575,9 +583,9 @@ std::optional<uint8_t> tls_alert; EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, valid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, packet_, self_address_, + peer_address_, valid_version_, kNoParsedChlo, nullptr); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); // The packet in 'packet_' is not a TLS CHLO packet. @@ -596,12 +604,12 @@ auto packets = GetFirstFlightOfPackets(valid_version_, config); ASSERT_EQ(packets.size(), 2u); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, *packets[0], - self_address_, peer_address_, valid_version_, - kNoParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, *packets[1], - self_address_, peer_address_, valid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, *packets[0], self_address_, + peer_address_, valid_version_, kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, *packets[1], self_address_, + peer_address_, valid_version_, kNoParsedChlo, nullptr); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.IngestPacketForTlsChloExtraction( @@ -656,7 +664,7 @@ }))); QuicLongHeaderType long_packet_type = INVALID_PACKET_TYPE; - PacketHeaderFormat unused_format; + PacketHeaderFormat packet_format; bool unused_version_flag; bool unused_use_length_prefix; QuicVersionLabel unused_version_label; @@ -669,7 +677,7 @@ // Verify that packet_ is not an INITIAL packet. error_code = QuicFramer::ParsePublicHeaderDispatcher( - packet_, kQuicDefaultConnectionIdLength, &unused_format, + packet_, kQuicDefaultConnectionIdLength, &packet_format, &long_packet_type, &unused_version_flag, &unused_use_length_prefix, &unused_version_label, &unused_parsed_version, &unused_destination_connection_id, &unused_source_connection_id, @@ -677,15 +685,15 @@ EXPECT_THAT(error_code, IsQuicNoError()); EXPECT_NE(long_packet_type, INITIAL); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, packet_, - self_address_, peer_address_, valid_version_, + EnqueuePacketToStore(store_, connection_id, packet_format, long_packet_type, + packet_, self_address_, peer_address_, valid_version_, kNoParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, - *initial_packets[0], self_address_, peer_address_, - valid_version_, kNoParsedChlo, nullptr); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, - *initial_packets[1], self_address_, peer_address_, - valid_version_, kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, IETF_QUIC_LONG_HEADER_PACKET, + INITIAL, *initial_packets[0], self_address_, + peer_address_, valid_version_, kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, IETF_QUIC_LONG_HEADER_PACKET, + INITIAL, *initial_packets[1], self_address_, + peer_address_, valid_version_, kNoParsedChlo, nullptr); BufferedPacketList delivered_packets = store_.DeliverPackets(connection_id); EXPECT_THAT(delivered_packets.buffered_packets, SizeIs(3)); @@ -693,7 +701,7 @@ QuicLongHeaderType previous_packet_type = INITIAL; for (const auto& packet : delivered_packets.buffered_packets) { error_code = QuicFramer::ParsePublicHeaderDispatcher( - *packet.packet, kQuicDefaultConnectionIdLength, &unused_format, + *packet.packet, kQuicDefaultConnectionIdLength, &packet_format, &long_packet_type, &unused_version_flag, &unused_use_length_prefix, &unused_version_label, &unused_parsed_version, &unused_destination_connection_id, &unused_source_connection_id, @@ -714,9 +722,9 @@ QuicReceivedPacket ect1_packet(packet_content_.data(), packet_content_.size(), packet_time_, false, 0, true, nullptr, 0, false, ECN_ECT1); - EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, ect1_packet, - self_address_, peer_address_, valid_version_, - kNoParsedChlo, nullptr); + EnqueuePacketToStore(store_, connection_id, GOOGLE_QUIC_PACKET, + INVALID_PACKET_TYPE, ect1_packet, self_address_, + peer_address_, valid_version_, kNoParsedChlo, nullptr); BufferedPacketList delivered_packets = store_.DeliverPackets(connection_id); EXPECT_THAT(delivered_packets.buffered_packets, SizeIs(1)); for (const auto& packet : delivered_packets.buffered_packets) {