#include "quiche/quic/tools/quic_client_base.h"
#include <algorithm>
#include <cstdint>
#include <memory>
#include <utility>
#include "quiche/quic/core/crypto/quic_random.h"
#include "quiche/quic/core/http/spdy_utils.h"
#include "quiche/quic/core/quic_alarm_factory.h"
#include "quiche/quic/core/quic_config.h"
#include "quiche/quic/core/quic_connection.h"
#include "quiche/quic/core/quic_connection_id.h"
#include "quiche/quic/core/quic_constants.h"
#include "quiche/quic/core/quic_crypto_client_stream.h"
#include "quiche/quic/core/quic_error_codes.h"
#include "quiche/quic/core/quic_packet_writer.h"
#include "quiche/quic/core/quic_path_validator.h"
#include "quiche/quic/core/quic_server_id.h"
#include "quiche/quic/core/quic_session.h"
#include "quiche/quic/core/quic_time.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/core/quic_utils.h"
#include "quiche/quic/core/quic_versions.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_ip_address.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/platform/api/quic_socket_address.h"
#include "quiche/common/platform/api/quiche_logging.h"
namespace quic {
namespace {
class QuicClientSocketMigrationValidationResultDelegate
: public QuicPathValidator::ResultDelegate { … };
class ServerPreferredAddressResultDelegateWithWriter
: public QuicClientSocketMigrationValidationResultDelegate { … };
}
void QuicClientBase::OnSocketMigrationProbingSuccess(
std::unique_ptr<QuicPathValidationContext> context) { … }
QuicClientBase::NetworkHelper::~NetworkHelper() = default;
QuicClientBase::QuicClientBase(
const QuicServerId& server_id,
const ParsedQuicVersionVector& supported_versions, const QuicConfig& config,
QuicConnectionHelperInterface* helper, QuicAlarmFactory* alarm_factory,
std::unique_ptr<NetworkHelper> network_helper,
std::unique_ptr<ProofVerifier> proof_verifier,
std::unique_ptr<SessionCache> session_cache)
: … { … }
QuicClientBase::~QuicClientBase() = default;
bool QuicClientBase::Initialize() { … }
bool QuicClientBase::Connect() { … }
void QuicClientBase::StartConnect() { … }
void QuicClientBase::InitializeSession() { … }
void QuicClientBase::Disconnect() { … }
ProofVerifier* QuicClientBase::proof_verifier() const { … }
bool QuicClientBase::EncryptionBeingEstablished() { … }
bool QuicClientBase::WaitForEvents() { … }
bool QuicClientBase::WaitForEventsPostprocessing() { … }
bool QuicClientBase::MigrateSocket(const QuicIpAddress& new_host) { … }
bool QuicClientBase::MigrateSocketWithSpecifiedPort(
const QuicIpAddress& new_host, int port) { … }
bool QuicClientBase::ValidateAndMigrateSocket(const QuicIpAddress& new_host) { … }
std::unique_ptr<QuicPacketWriter> QuicClientBase::CreateWriterForNewNetwork(
const QuicIpAddress& new_host, int port) { … }
bool QuicClientBase::ChangeEphemeralPort() { … }
QuicSession* QuicClientBase::session() { … }
const QuicSession* QuicClientBase::session() const { … }
QuicClientBase::NetworkHelper* QuicClientBase::network_helper() { … }
const QuicClientBase::NetworkHelper* QuicClientBase::network_helper() const { … }
void QuicClientBase::WaitForStreamToClose(QuicStreamId id) { … }
bool QuicClientBase::WaitForOneRttKeysAvailable() { … }
bool QuicClientBase::WaitForHandshakeConfirmed() { … }
bool QuicClientBase::connected() const { … }
bool QuicClientBase::goaway_received() const { … }
int QuicClientBase::GetNumSentClientHellos() { … }
void QuicClientBase::UpdateStats() { … }
int QuicClientBase::GetNumReceivedServerConfigUpdates() { … }
QuicErrorCode QuicClientBase::connection_error() const { … }
QuicConnectionId QuicClientBase::GetNextConnectionId() { … }
QuicConnectionId QuicClientBase::GenerateNewConnectionId() { … }
QuicConnectionId QuicClientBase::GetClientConnectionId() { … }
bool QuicClientBase::CanReconnectWithDifferentVersion(
ParsedQuicVersion* version) const { … }
bool QuicClientBase::HasPendingPathValidation() { … }
class ValidationResultDelegate : public QuicPathValidator::ResultDelegate { … };
void QuicClientBase::ValidateNewNetwork(const QuicIpAddress& host) { … }
void QuicClientBase::OnServerPreferredAddressAvailable(
const QuicSocketAddress& server_preferred_address) { … }
void QuicClientBase::OnPathDegrading() { … }
}