#include "quiche/quic/core/quic_time_wait_list_manager.h"
#include <errno.h>
#include <memory>
#include <ostream>
#include <utility>
#include <vector>
#include "absl/strings/string_view.h"
#include "quiche/quic/core/crypto/crypto_protocol.h"
#include "quiche/quic/core/crypto/quic_decrypter.h"
#include "quiche/quic/core/crypto/quic_encrypter.h"
#include "quiche/quic/core/quic_clock.h"
#include "quiche/quic/core/quic_connection_id.h"
#include "quiche/quic/core/quic_framer.h"
#include "quiche/quic/core/quic_packets.h"
#include "quiche/quic/core/quic_utils.h"
#include "quiche/quic/platform/api/quic_bug_tracker.h"
#include "quiche/quic/platform/api/quic_flag_utils.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/platform/api/quic_socket_address.h"
#include "quiche/common/quiche_text_utils.h"
namespace quic {
class ConnectionIdCleanUpAlarm : public QuicAlarm::DelegateWithoutContext { … };
TimeWaitConnectionInfo::TimeWaitConnectionInfo(
bool ietf_quic,
std::vector<std::unique_ptr<QuicEncryptedPacket>>* termination_packets,
std::vector<QuicConnectionId> active_connection_ids)
: … { … }
TimeWaitConnectionInfo::TimeWaitConnectionInfo(
bool ietf_quic,
std::vector<std::unique_ptr<QuicEncryptedPacket>>* termination_packets,
std::vector<QuicConnectionId> active_connection_ids, QuicTime::Delta srtt)
: … { … }
QuicTimeWaitListManager::QuicTimeWaitListManager(
QuicPacketWriter* writer, Visitor* visitor, const QuicClock* clock,
QuicAlarmFactory* alarm_factory)
: … { … }
QuicTimeWaitListManager::~QuicTimeWaitListManager() { … }
QuicTimeWaitListManager::ConnectionIdMap::iterator
QuicTimeWaitListManager::FindConnectionIdDataInMap(
const QuicConnectionId& connection_id) { … }
void QuicTimeWaitListManager::AddConnectionIdDataToMap(
const QuicConnectionId& canonical_connection_id, int num_packets,
TimeWaitAction action, TimeWaitConnectionInfo info) { … }
void QuicTimeWaitListManager::RemoveConnectionDataFromMap(
ConnectionIdMap::iterator it) { … }
void QuicTimeWaitListManager::AddConnectionIdToTimeWait(
TimeWaitAction action, TimeWaitConnectionInfo info) { … }
bool QuicTimeWaitListManager::IsConnectionIdInTimeWait(
QuicConnectionId connection_id) const { … }
void QuicTimeWaitListManager::OnBlockedWriterCanWrite() { … }
void QuicTimeWaitListManager::ProcessPacket(
const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address, QuicConnectionId connection_id,
PacketHeaderFormat header_format, size_t received_packet_length,
std::unique_ptr<QuicPerPacketContext> packet_context) { … }
void QuicTimeWaitListManager::SendVersionNegotiationPacket(
QuicConnectionId server_connection_id,
QuicConnectionId client_connection_id, bool ietf_quic,
bool use_length_prefix, const ParsedQuicVersionVector& supported_versions,
const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
std::unique_ptr<QuicPerPacketContext> packet_context) { … }
bool QuicTimeWaitListManager::ShouldSendResponse(int received_packet_count) { … }
void QuicTimeWaitListManager::SendPublicReset(
const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address, QuicConnectionId connection_id,
bool ietf_quic, size_t received_packet_length,
std::unique_ptr<QuicPerPacketContext> packet_context) { … }
void QuicTimeWaitListManager::SendPacket(const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
const QuicEncryptedPacket& packet) { … }
std::unique_ptr<QuicEncryptedPacket> QuicTimeWaitListManager::BuildPublicReset(
const QuicPublicResetPacket& packet) { … }
std::unique_ptr<QuicEncryptedPacket>
QuicTimeWaitListManager::BuildIetfStatelessResetPacket(
QuicConnectionId connection_id, size_t received_packet_length) { … }
bool QuicTimeWaitListManager::SendOrQueuePacket(
std::unique_ptr<QueuedPacket> packet,
const QuicPerPacketContext* ) { … }
bool QuicTimeWaitListManager::WriteToWire(QueuedPacket* queued_packet) { … }
void QuicTimeWaitListManager::SetConnectionIdCleanUpAlarm() { … }
bool QuicTimeWaitListManager::MaybeExpireOldestConnection(
QuicTime expiration_time) { … }
void QuicTimeWaitListManager::CleanUpOldConnectionIds() { … }
void QuicTimeWaitListManager::TrimTimeWaitListIfNeeded() { … }
QuicTimeWaitListManager::ConnectionIdData::ConnectionIdData(
int num_packets, QuicTime time_added, TimeWaitAction action,
TimeWaitConnectionInfo info)
: … { … }
QuicTimeWaitListManager::ConnectionIdData::ConnectionIdData(
ConnectionIdData&& other) = default;
QuicTimeWaitListManager::ConnectionIdData::~ConnectionIdData() = default;
StatelessResetToken QuicTimeWaitListManager::GetStatelessResetToken(
QuicConnectionId connection_id) const { … }
}