#include "net/quic/quic_event_logger.h"
#include "base/containers/span.h"
#include "base/strings/string_number_conversions.h"
#include "net/cert/x509_certificate.h"
#include "net/log/net_log_values.h"
#include "net/quic/address_utils.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_socket_address_coder.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
namespace net {
namespace {
base::Value::Dict NetLogQuicPacketParams(
const quic::QuicSocketAddress& self_address,
const quic::QuicSocketAddress& peer_address,
size_t packet_size) { … }
base::Value::Dict NetLogQuicPacketSentParams(
quic::QuicPacketNumber packet_number,
quic::QuicPacketLength packet_length,
quic::TransmissionType transmission_type,
quic::EncryptionLevel encryption_level,
quic::QuicTime sent_time,
uint32_t batch_id) { … }
base::Value::Dict NetLogQuicPacketLostParams(
quic::QuicPacketNumber packet_number,
quic::TransmissionType transmission_type,
quic::QuicTime detection_time) { … }
base::Value::Dict NetLogQuicConfigProcessed(
const quic::QuicSentPacketManager::DebugDelegate::SendParameters&
parameters) { … }
base::Value::Dict NetLogQuicDuplicatePacketParams(
quic::QuicPacketNumber packet_number) { … }
base::Value::Dict NetLogReceivedQuicPacketHeaderParams(
const quic::QuicPacketHeader& header,
const quic::ParsedQuicVersion& session_version,
const quic::QuicConnectionId& connection_id,
const quic::QuicConnectionId& client_connection_id) { … }
base::Value::Dict NetLogQuicStreamFrameParams(
const quic::QuicStreamFrame& frame) { … }
base::Value::Dict NetLogQuicAckFrameParams(const quic::QuicAckFrame* frame) { … }
base::Value::Dict NetLogQuicRstStreamFrameParams(
const quic::QuicRstStreamFrame* frame) { … }
base::Value::Dict NetLogQuicConnectionCloseFrameParams(
const quic::QuicConnectionCloseFrame* frame) { … }
base::Value::Dict NetLogQuicWindowUpdateFrameParams(
const quic::QuicWindowUpdateFrame& frame) { … }
base::Value::Dict NetLogQuicBlockedFrameParams(
const quic::QuicBlockedFrame& frame) { … }
base::Value::Dict NetLogQuicGoAwayFrameParams(
const quic::QuicGoAwayFrame* frame) { … }
base::Value::Dict NetLogQuicStopWaitingFrameParams(
const quic::QuicStopWaitingFrame* frame) { … }
base::Value::Dict NetLogQuicVersionNegotiationPacketParams(
const quic::QuicVersionNegotiationPacket* packet) { … }
base::Value::Dict NetLogQuicPathData(const quic::QuicPathFrameBuffer& buffer) { … }
base::Value::Dict NetLogQuicCryptoHandshakeMessageParams(
const quic::CryptoHandshakeMessage* message) { … }
base::Value::Dict NetLogQuicTransportParametersParams(
const quic::TransportParameters& transport_parameters) { … }
base::Value::Dict NetLogQuicZeroRttRejectReason(int reason) { … }
base::Value::Dict NetLogQuicOnConnectionClosedParams(
quic::QuicErrorCode error,
std::string error_details,
quic::ConnectionCloseSource source) { … }
base::Value::Dict NetLogQuicCertificateVerifiedParams(
scoped_refptr<X509Certificate> cert) { … }
base::Value::Dict NetLogQuicCryptoFrameParams(
const quic::QuicCryptoFrame* frame,
bool has_buffer) { … }
base::Value::Dict NetLogQuicStopSendingFrameParams(
const quic::QuicStopSendingFrame& frame) { … }
base::Value::Dict NetLogQuicStreamsBlockedFrameParams(
const quic::QuicStreamsBlockedFrame& frame) { … }
base::Value::Dict NetLogQuicMaxStreamsFrameParams(
const quic::QuicMaxStreamsFrame& frame) { … }
base::Value::Dict NetLogQuicNewConnectionIdFrameParams(
const quic::QuicNewConnectionIdFrame* frame) { … }
base::Value::Dict NetLogQuicRetireConnectionIdFrameParams(
const quic::QuicRetireConnectionIdFrame* frame) { … }
base::Value::Dict NetLogQuicNewTokenFrameParams(
const quic::QuicNewTokenFrame* frame) { … }
}
QuicEventLogger::QuicEventLogger(quic::QuicSession* session,
const NetLogWithSource& net_log)
: … { … }
void QuicEventLogger::OnFrameAddedToPacket(const quic::QuicFrame& frame) { … }
void QuicEventLogger::OnStreamFrameCoalesced(
const quic::QuicStreamFrame& frame) { … }
void QuicEventLogger::OnPacketSent(
quic::QuicPacketNumber packet_number,
quic::QuicPacketLength packet_length,
bool ,
quic::TransmissionType transmission_type,
quic::EncryptionLevel encryption_level,
const quic::QuicFrames& ,
const quic::QuicFrames& ,
quic::QuicTime sent_time,
uint32_t batch_id) { … }
void QuicEventLogger::OnIncomingAck(
quic::QuicPacketNumber ack_packet_number,
quic::EncryptionLevel ,
const quic::QuicAckFrame& frame,
quic::QuicTime ack_receive_time,
quic::QuicPacketNumber largest_observed,
bool rtt_updated,
quic::QuicPacketNumber least_unacked_sent_packet) { … }
void QuicEventLogger::OnPacketLoss(quic::QuicPacketNumber lost_packet_number,
quic::EncryptionLevel ,
quic::TransmissionType transmission_type,
quic::QuicTime detection_time) { … }
void QuicEventLogger::OnConfigProcessed(
const quic::QuicSentPacketManager::DebugDelegate::SendParameters&
parameters) { … }
void QuicEventLogger::OnPacketReceived(
const quic::QuicSocketAddress& self_address,
const quic::QuicSocketAddress& peer_address,
const quic::QuicEncryptedPacket& packet) { … }
void QuicEventLogger::OnUnauthenticatedHeader(
const quic::QuicPacketHeader& header) { … }
void QuicEventLogger::OnUndecryptablePacket(
quic::EncryptionLevel decryption_level,
bool dropped) { … }
void QuicEventLogger::OnAttemptingToProcessUndecryptablePacket(
quic::EncryptionLevel decryption_level) { … }
void QuicEventLogger::OnDuplicatePacket(quic::QuicPacketNumber packet_number) { … }
void QuicEventLogger::OnPacketHeader(const quic::QuicPacketHeader& header,
quic::QuicTime ,
quic::EncryptionLevel ) { … }
void QuicEventLogger::OnStreamFrame(const quic::QuicStreamFrame& frame) { … }
void QuicEventLogger::OnPathChallengeFrame(
const quic::QuicPathChallengeFrame& frame) { … }
void QuicEventLogger::OnPathResponseFrame(
const quic::QuicPathResponseFrame& frame) { … }
void QuicEventLogger::OnCryptoFrame(const quic::QuicCryptoFrame& frame) { … }
void QuicEventLogger::OnStopSendingFrame(
const quic::QuicStopSendingFrame& frame) { … }
void QuicEventLogger::OnStreamsBlockedFrame(
const quic::QuicStreamsBlockedFrame& frame) { … }
void QuicEventLogger::OnMaxStreamsFrame(
const quic::QuicMaxStreamsFrame& frame) { … }
void QuicEventLogger::OnRstStreamFrame(const quic::QuicRstStreamFrame& frame) { … }
void QuicEventLogger::OnConnectionCloseFrame(
const quic::QuicConnectionCloseFrame& frame) { … }
void QuicEventLogger::OnWindowUpdateFrame(
const quic::QuicWindowUpdateFrame& frame,
const quic::QuicTime& receive_time) { … }
void QuicEventLogger::OnBlockedFrame(const quic::QuicBlockedFrame& frame) { … }
void QuicEventLogger::OnGoAwayFrame(const quic::QuicGoAwayFrame& frame) { … }
void QuicEventLogger::OnPingFrame(
const quic::QuicPingFrame& frame,
quic::QuicTime::Delta ) { … }
void QuicEventLogger::OnPaddingFrame(const quic::QuicPaddingFrame& frame) { … }
void QuicEventLogger::OnNewConnectionIdFrame(
const quic::QuicNewConnectionIdFrame& frame) { … }
void QuicEventLogger::OnNewTokenFrame(const quic::QuicNewTokenFrame& frame) { … }
void QuicEventLogger::OnRetireConnectionIdFrame(
const quic::QuicRetireConnectionIdFrame& frame) { … }
void QuicEventLogger::OnMessageFrame(const quic::QuicMessageFrame& frame) { … }
void QuicEventLogger::OnHandshakeDoneFrame(
const quic::QuicHandshakeDoneFrame& frame) { … }
void QuicEventLogger::OnCoalescedPacketSent(
const quic::QuicCoalescedPacket& coalesced_packet,
size_t length) { … }
void QuicEventLogger::OnVersionNegotiationPacket(
const quic::QuicVersionNegotiationPacket& packet) { … }
void QuicEventLogger::OnCryptoHandshakeMessageReceived(
const quic::CryptoHandshakeMessage& message) { … }
void QuicEventLogger::OnCryptoHandshakeMessageSent(
const quic::CryptoHandshakeMessage& message) { … }
void QuicEventLogger::OnConnectionClosed(
const quic::QuicConnectionCloseFrame& frame,
quic::ConnectionCloseSource source) { … }
void QuicEventLogger::OnSuccessfulVersionNegotiation(
const quic::ParsedQuicVersion& version) { … }
void QuicEventLogger::OnCertificateVerified(const CertVerifyResult& result) { … }
void QuicEventLogger::OnTransportParametersSent(
const quic::TransportParameters& transport_parameters) { … }
void QuicEventLogger::OnTransportParametersReceived(
const quic::TransportParameters& transport_parameters) { … }
void QuicEventLogger::OnTransportParametersResumed(
const quic::TransportParameters& transport_parameters) { … }
void QuicEventLogger::OnZeroRttRejected(int reason) { … }
void QuicEventLogger::OnEncryptedClientHelloSent(
std::string_view client_hello) { … }
}