#include "quiche/quic/core/quic_buffered_packet_store.h"
#include <cstddef>
#include <cstdint>
#include <list>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/string_view.h"
#include "quiche/quic/core/connection_id_generator.h"
#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_dispatcher_stats.h"
#include "quiche/quic/core/quic_error_codes.h"
#include "quiche/quic/core/quic_framer.h"
#include "quiche/quic/core/quic_packets.h"
#include "quiche/quic/core/quic_time.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/core/quic_versions.h"
#include "quiche/quic/platform/api/quic_ip_address.h"
#include "quiche/quic/platform/api/quic_socket_address.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/first_flight.h"
#include "quiche/quic/test_tools/mock_clock.h"
#include "quiche/quic/test_tools/mock_connection_id_generator.h"
#include "quiche/quic/test_tools/quic_buffered_packet_store_peer.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
namespace quic {
static const size_t kDefaultMaxConnectionsInStore = …;
static const size_t kMaxConnectionsWithoutCHLO = …;
namespace test {
namespace {
const std::optional<ParsedClientHello> kNoParsedChlo;
const std::optional<ParsedClientHello> kDefaultParsedChlo = …;
BufferedPacket;
BufferedPacketList;
EnqueuePacketResult;
A;
Conditional;
Each;
ElementsAre;
Ne;
SizeIs;
Truly;
EnqueuePacketResult EnqueuePacketToStore(
QuicBufferedPacketStore& store, QuicConnectionId connection_id,
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) { … }
class QuicBufferedPacketStoreVisitor
: public QuicBufferedPacketStore::VisitorInterface { … };
class QuicBufferedPacketStoreTest : public QuicTest { … };
TEST_F(QuicBufferedPacketStoreTest, SimpleEnqueueAndDeliverPacket) { … }
TEST_F(QuicBufferedPacketStoreTest, DifferentPacketAddressOnOneConnection) { … }
TEST_F(QuicBufferedPacketStoreTest,
EnqueueAndDeliverMultiplePacketsOnMultipleConnections) { … }
TEST_F(QuicBufferedPacketStoreTest,
FailToBufferTooManyPacketsOnExistingConnection) { … }
TEST_F(QuicBufferedPacketStoreTest, ReachNonChloConnectionUpperLimit) { … }
TEST_F(QuicBufferedPacketStoreTest,
FullStoreFailToBufferDataPacketOnNewConnection) { … }
TEST_F(QuicBufferedPacketStoreTest, BasicGeneratorBuffering) { … }
TEST_F(QuicBufferedPacketStoreTest, GeneratorIgnoredForNonChlo) { … }
TEST_F(QuicBufferedPacketStoreTest, EnqueueChloOnTooManyDifferentConnections) { … }
TEST_F(QuicBufferedPacketStoreTest, PacketQueueExpiredBeforeDelivery) { … }
TEST_F(QuicBufferedPacketStoreTest, SimpleDiscardPackets) { … }
TEST_F(QuicBufferedPacketStoreTest, DiscardWithCHLOs) { … }
TEST_F(QuicBufferedPacketStoreTest, MultipleDiscardPackets) { … }
TEST_F(QuicBufferedPacketStoreTest, DiscardPacketsEmpty) { … }
TEST_F(QuicBufferedPacketStoreTest, IngestPacketForTlsChloExtraction) { … }
TEST_F(QuicBufferedPacketStoreTest, DeliverInitialPacketsFirst) { … }
TEST_F(QuicBufferedPacketStoreTest, BufferedPacketRetainsEcn) { … }
TEST_F(QuicBufferedPacketStoreTest, EmptyBufferedPacketList) { … }
}
}
}