chromium/net/dns/https_record_rdata.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/dns/https_record_rdata.h"

#include <stdint.h>

#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#include "base/big_endian.h"
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/dcheck_is_on.h"
#include "base/immediate_crash.h"
#include "base/memory/ptr_util.h"
#include "base/numerics/byte_conversions.h"
#include "net/base/ip_address.h"
#include "net/dns/dns_names_util.h"
#include "net/dns/public/dns_protocol.h"

namespace net {

namespace {

bool ReadNextServiceParam(std::optional<uint16_t> last_key,
                          base::SpanReader<const uint8_t>& reader,
                          uint16_t* out_param_key,
                          std::string_view* out_param_value) {}

bool ParseMandatoryKeys(std::string_view param_value,
                        std::set<uint16_t>* out_parsed) {}

bool ParseAlpnIds(std::string_view param_value,
                  std::vector<std::string>* out_parsed) {}

template <size_t ADDRESS_SIZE>
bool ParseIpAddresses(std::string_view param_value,
                      std::vector<IPAddress>* out_addresses) {}

}  // namespace

// static
std::unique_ptr<HttpsRecordRdata> HttpsRecordRdata::Parse(
    std::string_view data) {}

HttpsRecordRdata::~HttpsRecordRdata() = default;

bool HttpsRecordRdata::IsEqual(const RecordRdata* other) const {}

uint16_t HttpsRecordRdata::Type() const {}

AliasFormHttpsRecordRdata* HttpsRecordRdata::AsAliasForm() {}

const AliasFormHttpsRecordRdata* HttpsRecordRdata::AsAliasForm() const {}

ServiceFormHttpsRecordRdata* HttpsRecordRdata::AsServiceForm() {}

const ServiceFormHttpsRecordRdata* HttpsRecordRdata::AsServiceForm() const {}

AliasFormHttpsRecordRdata::AliasFormHttpsRecordRdata(std::string alias_name)
    :{}

// static
std::unique_ptr<AliasFormHttpsRecordRdata> AliasFormHttpsRecordRdata::Parse(
    std::string_view data) {}

bool AliasFormHttpsRecordRdata::IsEqual(const HttpsRecordRdata* other) const {}

bool AliasFormHttpsRecordRdata::IsAlias() const {}

// static
constexpr uint16_t ServiceFormHttpsRecordRdata::kSupportedKeys[];

ServiceFormHttpsRecordRdata::ServiceFormHttpsRecordRdata(
    HttpsRecordPriority priority,
    std::string service_name,
    std::set<uint16_t> mandatory_keys,
    std::vector<std::string> alpn_ids,
    bool default_alpn,
    std::optional<uint16_t> port,
    std::vector<IPAddress> ipv4_hint,
    std::string ech_config,
    std::vector<IPAddress> ipv6_hint,
    std::map<uint16_t, std::string> unparsed_params)
    :{}

ServiceFormHttpsRecordRdata::~ServiceFormHttpsRecordRdata() = default;

bool ServiceFormHttpsRecordRdata::IsEqual(const HttpsRecordRdata* other) const {}

bool ServiceFormHttpsRecordRdata::IsAlias() const {}

// static
std::unique_ptr<ServiceFormHttpsRecordRdata> ServiceFormHttpsRecordRdata::Parse(
    std::string_view data) {}

bool ServiceFormHttpsRecordRdata::IsCompatible() const {}

// static
bool ServiceFormHttpsRecordRdata::IsSupportedKey(uint16_t key) {}

}  // namespace net