#ifdef UNSAFE_BUFFERS_BUILD
#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
namespace net {
namespace {
const addrinfo* Next(const addrinfo* ai) { … }
}
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 { … }
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;
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 { … }
AddressInfo::AddressInfo(std::unique_ptr<addrinfo, FreeAddrInfoFunc> ai,
std::unique_ptr<AddrInfoGetter> getter)
: … { … }
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) { … }
}