#include "quiche/quic/core/crypto/transport_parameters.h"
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <forward_list>
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "openssl/digest.h"
#include "openssl/sha.h"
#include "quiche/quic/core/quic_connection_id.h"
#include "quiche/quic/core/quic_data_reader.h"
#include "quiche/quic/core/quic_data_writer.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_ip_address.h"
namespace quic {
enum TransportParameters::TransportParameterId : uint64_t { … };
namespace {
constexpr QuicVersionLabel kReservedVersionMask = …;
constexpr QuicVersionLabel kReservedVersionBits = …;
constexpr uint64_t kMinMaxPacketSizeTransportParam = …;
constexpr uint64_t kMaxAckDelayExponentTransportParam = …;
constexpr uint64_t kDefaultAckDelayExponentTransportParam = …;
constexpr uint64_t kMaxMaxAckDelayTransportParam = …;
constexpr uint64_t kDefaultMaxAckDelayTransportParam = …;
constexpr uint64_t kMinActiveConnectionIdLimitTransportParam = …;
constexpr uint64_t kDefaultActiveConnectionIdLimitTransportParam = …;
std::string TransportParameterIdToString(
TransportParameters::TransportParameterId param_id) { … }
bool TransportParameterIdIsKnown(
TransportParameters::TransportParameterId param_id) { … }
}
TransportParameters::IntegerParameter::IntegerParameter(
TransportParameters::TransportParameterId param_id, uint64_t default_value,
uint64_t min_value, uint64_t max_value)
: … { … }
TransportParameters::IntegerParameter::IntegerParameter(
TransportParameters::TransportParameterId param_id)
: … { … }
void TransportParameters::IntegerParameter::set_value(uint64_t value) { … }
uint64_t TransportParameters::IntegerParameter::value() const { … }
bool TransportParameters::IntegerParameter::IsValid() const { … }
bool TransportParameters::IntegerParameter::Write(
QuicDataWriter* writer) const { … }
bool TransportParameters::IntegerParameter::Read(QuicDataReader* reader,
std::string* error_details) { … }
std::string TransportParameters::IntegerParameter::ToString(
bool for_use_in_list) const { … }
std::ostream& operator<<(std::ostream& os,
const TransportParameters::IntegerParameter& param) { … }
TransportParameters::PreferredAddress::PreferredAddress()
: … { … }
TransportParameters::PreferredAddress::~PreferredAddress() { … }
bool TransportParameters::PreferredAddress::operator==(
const PreferredAddress& rhs) const { … }
bool TransportParameters::PreferredAddress::operator!=(
const PreferredAddress& rhs) const { … }
std::ostream& operator<<(
std::ostream& os,
const TransportParameters::PreferredAddress& preferred_address) { … }
std::string TransportParameters::PreferredAddress::ToString() const { … }
TransportParameters::LegacyVersionInformation::LegacyVersionInformation()
: … { … }
bool TransportParameters::LegacyVersionInformation::operator==(
const LegacyVersionInformation& rhs) const { … }
bool TransportParameters::LegacyVersionInformation::operator!=(
const LegacyVersionInformation& rhs) const { … }
std::string TransportParameters::LegacyVersionInformation::ToString() const { … }
std::ostream& operator<<(std::ostream& os,
const TransportParameters::LegacyVersionInformation&
legacy_version_information) { … }
TransportParameters::VersionInformation::VersionInformation()
: … { … }
bool TransportParameters::VersionInformation::operator==(
const VersionInformation& rhs) const { … }
bool TransportParameters::VersionInformation::operator!=(
const VersionInformation& rhs) const { … }
std::string TransportParameters::VersionInformation::ToString() const { … }
std::ostream& operator<<(
std::ostream& os,
const TransportParameters::VersionInformation& version_information) { … }
std::ostream& operator<<(std::ostream& os, const TransportParameters& params) { … }
std::string TransportParameters::ToString() const { … }
TransportParameters::TransportParameters()
: … { … }
TransportParameters::TransportParameters(const TransportParameters& other)
: … { … }
bool TransportParameters::operator==(const TransportParameters& rhs) const { … }
bool TransportParameters::operator!=(const TransportParameters& rhs) const { … }
bool TransportParameters::AreValid(std::string* error_details) const { … }
TransportParameters::~TransportParameters() = default;
bool SerializeTransportParameters(const TransportParameters& in,
std::vector<uint8_t>* out) { … }
bool ParseTransportParameters(ParsedQuicVersion version,
Perspective perspective, const uint8_t* in,
size_t in_len, TransportParameters* out,
std::string* error_details) { … }
namespace {
bool DigestUpdateIntegerParam(
EVP_MD_CTX* hash_ctx, const TransportParameters::IntegerParameter& param) { … }
}
bool SerializeTransportParametersForTicket(
const TransportParameters& in, const std::vector<uint8_t>& application_data,
std::vector<uint8_t>* out) { … }
void DegreaseTransportParameters(TransportParameters& parameters) { … }
}