#include "quiche/quic/core/quic_packets.h"
#include <algorithm>
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/quic_connection_id.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_flags.h"
namespace quic {
QuicConnectionId GetServerConnectionIdAsRecipient(
const QuicPacketHeader& header, Perspective perspective) { … }
QuicConnectionId GetClientConnectionIdAsRecipient(
const QuicPacketHeader& header, Perspective perspective) { … }
QuicConnectionId GetServerConnectionIdAsSender(const QuicPacketHeader& header,
Perspective perspective) { … }
QuicConnectionIdIncluded GetServerConnectionIdIncludedAsSender(
const QuicPacketHeader& header, Perspective perspective) { … }
QuicConnectionId GetClientConnectionIdAsSender(const QuicPacketHeader& header,
Perspective perspective) { … }
QuicConnectionIdIncluded GetClientConnectionIdIncludedAsSender(
const QuicPacketHeader& header, Perspective perspective) { … }
uint8_t GetIncludedConnectionIdLength(
QuicConnectionId connection_id,
QuicConnectionIdIncluded connection_id_included) { … }
uint8_t GetIncludedDestinationConnectionIdLength(
const QuicPacketHeader& header) { … }
uint8_t GetIncludedSourceConnectionIdLength(const QuicPacketHeader& header) { … }
size_t GetPacketHeaderSize(QuicTransportVersion version,
const QuicPacketHeader& header) { … }
size_t GetPacketHeaderSize(
QuicTransportVersion version, uint8_t destination_connection_id_length,
uint8_t source_connection_id_length, bool include_version,
bool include_diversification_nonce,
QuicPacketNumberLength packet_number_length,
quiche::QuicheVariableLengthIntegerLength retry_token_length_length,
QuicByteCount retry_token_length,
quiche::QuicheVariableLengthIntegerLength length_length) { … }
size_t GetStartOfEncryptedData(QuicTransportVersion version,
const QuicPacketHeader& header) { … }
size_t GetStartOfEncryptedData(
QuicTransportVersion version, uint8_t destination_connection_id_length,
uint8_t source_connection_id_length, bool include_version,
bool include_diversification_nonce,
QuicPacketNumberLength packet_number_length,
quiche::QuicheVariableLengthIntegerLength retry_token_length_length,
QuicByteCount retry_token_length,
quiche::QuicheVariableLengthIntegerLength length_length) { … }
QuicPacketHeader::QuicPacketHeader()
: … { … }
QuicPacketHeader::QuicPacketHeader(const QuicPacketHeader& other) = default;
QuicPacketHeader::~QuicPacketHeader() { … }
QuicPacketHeader& QuicPacketHeader::operator=(const QuicPacketHeader& other) =
default;
QuicPublicResetPacket::QuicPublicResetPacket()
: … { … }
QuicPublicResetPacket::QuicPublicResetPacket(QuicConnectionId connection_id)
: … { … }
QuicVersionNegotiationPacket::QuicVersionNegotiationPacket()
: … { … }
QuicVersionNegotiationPacket::QuicVersionNegotiationPacket(
QuicConnectionId connection_id)
: … { … }
QuicVersionNegotiationPacket::QuicVersionNegotiationPacket(
const QuicVersionNegotiationPacket& other) = default;
QuicVersionNegotiationPacket::~QuicVersionNegotiationPacket() { … }
QuicIetfStatelessResetPacket::QuicIetfStatelessResetPacket()
: … { … }
QuicIetfStatelessResetPacket::QuicIetfStatelessResetPacket(
const QuicPacketHeader& header, StatelessResetToken token)
: … { … }
QuicIetfStatelessResetPacket::QuicIetfStatelessResetPacket(
const QuicIetfStatelessResetPacket& other) = default;
QuicIetfStatelessResetPacket::~QuicIetfStatelessResetPacket() { … }
std::ostream& operator<<(std::ostream& os, const QuicPacketHeader& header) { … }
QuicData::QuicData(const char* buffer, size_t length)
: … { … }
QuicData::QuicData(const char* buffer, size_t length, bool owns_buffer)
: … { … }
QuicData::QuicData(absl::string_view packet_data)
: … { … }
QuicData::~QuicData() { … }
QuicPacket::QuicPacket(
char* buffer, size_t length, bool owns_buffer,
uint8_t destination_connection_id_length,
uint8_t source_connection_id_length, bool includes_version,
bool includes_diversification_nonce,
QuicPacketNumberLength packet_number_length,
quiche::QuicheVariableLengthIntegerLength retry_token_length_length,
QuicByteCount retry_token_length,
quiche::QuicheVariableLengthIntegerLength length_length)
: … { … }
QuicPacket::QuicPacket(QuicTransportVersion , char* buffer,
size_t length, bool owns_buffer,
const QuicPacketHeader& header)
: … { … }
QuicEncryptedPacket::QuicEncryptedPacket(const char* buffer, size_t length)
: … { … }
QuicEncryptedPacket::QuicEncryptedPacket(const char* buffer, size_t length,
bool owns_buffer)
: … { … }
QuicEncryptedPacket::QuicEncryptedPacket(absl::string_view data)
: … { … }
std::unique_ptr<QuicEncryptedPacket> QuicEncryptedPacket::Clone() const { … }
std::ostream& operator<<(std::ostream& os, const QuicEncryptedPacket& s) { … }
QuicReceivedPacket::QuicReceivedPacket(const char* buffer, size_t length,
QuicTime receipt_time)
: … { … }
QuicReceivedPacket::QuicReceivedPacket(const char* buffer, size_t length,
QuicTime receipt_time, bool owns_buffer)
: … { … }
QuicReceivedPacket::QuicReceivedPacket(const char* buffer, size_t length,
QuicTime receipt_time, bool owns_buffer,
int ttl, bool ttl_valid)
: … { … }
QuicReceivedPacket::QuicReceivedPacket(const char* buffer, size_t length,
QuicTime receipt_time, bool owns_buffer,
int ttl, bool ttl_valid,
char* packet_headers,
size_t headers_length,
bool owns_header_buffer)
: … { … }
QuicReceivedPacket::QuicReceivedPacket(
const char* buffer, size_t length, QuicTime receipt_time, bool owns_buffer,
int ttl, bool ttl_valid, char* packet_headers, size_t headers_length,
bool owns_header_buffer, QuicEcnCodepoint ecn_codepoint)
: … { … }
QuicReceivedPacket::~QuicReceivedPacket() { … }
std::unique_ptr<QuicReceivedPacket> QuicReceivedPacket::Clone() const { … }
std::ostream& operator<<(std::ostream& os, const QuicReceivedPacket& s) { … }
absl::string_view QuicPacket::AssociatedData(
QuicTransportVersion version) const { … }
absl::string_view QuicPacket::Plaintext(QuicTransportVersion version) const { … }
SerializedPacket::SerializedPacket(QuicPacketNumber packet_number,
QuicPacketNumberLength packet_number_length,
const char* encrypted_buffer,
QuicPacketLength encrypted_length,
bool has_ack, bool has_stop_waiting)
: … { … }
SerializedPacket::SerializedPacket(SerializedPacket&& other)
: … { … }
SerializedPacket::~SerializedPacket() { … }
SerializedPacket* CopySerializedPacket(const SerializedPacket& serialized,
quiche::QuicheBufferAllocator* allocator,
bool copy_buffer) { … }
char* CopyBuffer(const SerializedPacket& packet) { … }
char* CopyBuffer(const char* encrypted_buffer,
QuicPacketLength encrypted_length) { … }
ReceivedPacketInfo::ReceivedPacketInfo(const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
const QuicReceivedPacket& packet)
: … { … }
ReceivedPacketInfo::~ReceivedPacketInfo() { … }
std::string ReceivedPacketInfo::ToString() const { … }
std::ostream& operator<<(std::ostream& os,
const ReceivedPacketInfo& packet_info) { … }
bool QuicPacketHeader::operator==(const QuicPacketHeader& other) const { … }
bool QuicPacketHeader::operator!=(const QuicPacketHeader& other) const { … }
}