#include "quiche/quic/core/chlo_extractor.h"
#include <memory>
#include <optional>
#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/crypto/crypto_framer.h"
#include "quiche/quic/core/crypto/crypto_handshake.h"
#include "quiche/quic/core/crypto/crypto_handshake_message.h"
#include "quiche/quic/core/crypto/quic_decrypter.h"
#include "quiche/quic/core/crypto/quic_encrypter.h"
#include "quiche/quic/core/frames/quic_ack_frequency_frame.h"
#include "quiche/quic/core/frames/quic_reset_stream_at_frame.h"
#include "quiche/quic/core/quic_framer.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/core/quic_utils.h"
namespace quic {
namespace {
class ChloFramerVisitor : public QuicFramerVisitorInterface,
public CryptoFramerVisitorInterface { … };
ChloFramerVisitor::ChloFramerVisitor(
QuicFramer* framer, const QuicTagVector& create_session_tag_indicators,
ChloExtractor::Delegate* delegate)
: … { … }
bool ChloFramerVisitor::OnProtocolVersionMismatch(ParsedQuicVersion version) { … }
bool ChloFramerVisitor::OnUnauthenticatedPublicHeader(
const QuicPacketHeader& header) { … }
bool ChloFramerVisitor::OnUnauthenticatedHeader(
const QuicPacketHeader& ) { … }
bool ChloFramerVisitor::OnPacketHeader(const QuicPacketHeader& ) { … }
void ChloFramerVisitor::OnCoalescedPacket(
const QuicEncryptedPacket& ) { … }
void ChloFramerVisitor::OnUndecryptablePacket(
const QuicEncryptedPacket& , EncryptionLevel ,
bool ) { … }
bool ChloFramerVisitor::OnStreamFrame(const QuicStreamFrame& frame) { … }
bool ChloFramerVisitor::OnCryptoFrame(const QuicCryptoFrame& frame) { … }
bool ChloFramerVisitor::OnHandshakeData(absl::string_view data) { … }
bool ChloFramerVisitor::OnAckFrameStart(QuicPacketNumber ,
QuicTime::Delta ) { … }
bool ChloFramerVisitor::OnResetStreamAtFrame(
const QuicResetStreamAtFrame& ) { … }
bool ChloFramerVisitor::OnAckRange(QuicPacketNumber ,
QuicPacketNumber ) { … }
bool ChloFramerVisitor::OnAckTimestamp(QuicPacketNumber ,
QuicTime ) { … }
bool ChloFramerVisitor::OnAckFrameEnd(
QuicPacketNumber ,
const std::optional<QuicEcnCounts>& ) { … }
bool ChloFramerVisitor::OnStopWaitingFrame(
const QuicStopWaitingFrame& ) { … }
bool ChloFramerVisitor::OnPingFrame(const QuicPingFrame& ) { … }
bool ChloFramerVisitor::OnRstStreamFrame(const QuicRstStreamFrame& ) { … }
bool ChloFramerVisitor::OnConnectionCloseFrame(
const QuicConnectionCloseFrame& ) { … }
bool ChloFramerVisitor::OnStopSendingFrame(
const QuicStopSendingFrame& ) { … }
bool ChloFramerVisitor::OnPathChallengeFrame(
const QuicPathChallengeFrame& ) { … }
bool ChloFramerVisitor::OnPathResponseFrame(
const QuicPathResponseFrame& ) { … }
bool ChloFramerVisitor::OnGoAwayFrame(const QuicGoAwayFrame& ) { … }
bool ChloFramerVisitor::OnWindowUpdateFrame(
const QuicWindowUpdateFrame& ) { … }
bool ChloFramerVisitor::OnBlockedFrame(const QuicBlockedFrame& ) { … }
bool ChloFramerVisitor::OnNewConnectionIdFrame(
const QuicNewConnectionIdFrame& ) { … }
bool ChloFramerVisitor::OnRetireConnectionIdFrame(
const QuicRetireConnectionIdFrame& ) { … }
bool ChloFramerVisitor::OnNewTokenFrame(const QuicNewTokenFrame& ) { … }
bool ChloFramerVisitor::OnPaddingFrame(const QuicPaddingFrame& ) { … }
bool ChloFramerVisitor::OnMessageFrame(const QuicMessageFrame& ) { … }
bool ChloFramerVisitor::OnHandshakeDoneFrame(
const QuicHandshakeDoneFrame& ) { … }
bool ChloFramerVisitor::OnAckFrequencyFrame(
const QuicAckFrequencyFrame& ) { … }
bool ChloFramerVisitor::IsValidStatelessResetToken(
const StatelessResetToken& ) const { … }
bool ChloFramerVisitor::OnMaxStreamsFrame(
const QuicMaxStreamsFrame& ) { … }
bool ChloFramerVisitor::OnStreamsBlockedFrame(
const QuicStreamsBlockedFrame& ) { … }
void ChloFramerVisitor::OnKeyUpdate(KeyUpdateReason ) { … }
void ChloFramerVisitor::OnDecryptedFirstPacketInKeyPhase() { … }
std::unique_ptr<QuicDecrypter>
ChloFramerVisitor::AdvanceKeysAndCreateCurrentOneRttDecrypter() { … }
std::unique_ptr<QuicEncrypter>
ChloFramerVisitor::CreateCurrentOneRttEncrypter() { … }
void ChloFramerVisitor::OnError(CryptoFramer* ) { … }
void ChloFramerVisitor::OnHandshakeMessage(
const CryptoHandshakeMessage& message) { … }
}
bool ChloExtractor::Extract(const QuicEncryptedPacket& packet,
ParsedQuicVersion version,
const QuicTagVector& create_session_tag_indicators,
Delegate* delegate, uint8_t connection_id_length) { … }
}