chromium/net/dns/address_info.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif

#include "net/dns/address_info.h"

#include <memory>
#include <optional>

#include "base/logging.h"
#include "base/notreached.h"
#include "base/sys_byteorder.h"
#include "build/build_config.h"
#include "net/base/address_list.h"
#include "net/base/net_errors.h"
#include "net/base/sys_addrinfo.h"

#if BUILDFLAG(IS_ANDROID)
#include "net/android/network_library.h"
#endif  // BUILDFLAG(IS_ANDROID)

namespace net {

namespace {

const addrinfo* Next(const addrinfo* ai) {}

}  // namespace

//// iterator

AddressInfo::const_iterator::const_iterator(const addrinfo* ai) :{}

bool AddressInfo::const_iterator::operator!=(
    const AddressInfo::const_iterator& o) const {}

AddressInfo::const_iterator& AddressInfo::const_iterator::operator++() {}

const addrinfo* AddressInfo::const_iterator::operator->() const {}

const addrinfo& AddressInfo::const_iterator::operator*() const {}

//// constructors

AddressInfo::AddressInfoAndResult AddressInfo::Get(
    const std::string& host,
    const addrinfo& hints,
    std::unique_ptr<AddrInfoGetter> getter,
    handles::NetworkHandle network) {}

AddressInfo::AddressInfo(AddressInfo&& other) = default;

AddressInfo& AddressInfo::operator=(AddressInfo&& other) = default;

AddressInfo::~AddressInfo() = default;

//// public methods

AddressInfo::const_iterator AddressInfo::begin() const {}

AddressInfo::const_iterator AddressInfo::end() const {}

std::optional<std::string> AddressInfo::GetCanonicalName() const {}

bool AddressInfo::IsAllLocalhostOfOneFamily() const {}

AddressList AddressInfo::CreateAddressList() const {}

//// private methods

AddressInfo::AddressInfo(std::unique_ptr<addrinfo, FreeAddrInfoFunc> ai,
                         std::unique_ptr<AddrInfoGetter> getter)
    :{}

//// AddrInfoGetter

AddrInfoGetter::AddrInfoGetter() = default;
AddrInfoGetter::~AddrInfoGetter() = default;

std::unique_ptr<addrinfo, FreeAddrInfoFunc> AddrInfoGetter::getaddrinfo(
    const std::string& host,
    const addrinfo* hints,
    int* out_os_error,
    handles::NetworkHandle network) {}

}  // namespace net