#include "net/base/ip_endpoint.h"
#include <string.h>
#include <optional>
#include <ostream>
#include <tuple>
#include <utility>
#include "base/check.h"
#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/sys_byteorder.h"
#include "base/values.h"
#include "build/build_config.h"
#include "net/base/ip_address.h"
#include "net/base/sys_addrinfo.h"
#if BUILDFLAG(IS_WIN)
#include <winsock2.h>
#include <ws2bth.h>
#include "net/base/winsock_util.h"
#endif
namespace net {
namespace {
constexpr std::string_view kValueAddressKey = …;
constexpr std::string_view kValuePortKey = …;
}
std::optional<IPEndPoint> IPEndPoint::FromValue(const base::Value& value) { … }
IPEndPoint::IPEndPoint() = default;
IPEndPoint::~IPEndPoint() = default;
IPEndPoint::IPEndPoint(const IPAddress& address, uint16_t port)
: … { … }
IPEndPoint::IPEndPoint(const IPEndPoint& endpoint) = default;
uint16_t IPEndPoint::port() const { … }
AddressFamily IPEndPoint::GetFamily() const { … }
int IPEndPoint::GetSockAddrFamily() const { … }
bool IPEndPoint::ToSockAddr(struct sockaddr* address,
socklen_t* address_length) const { … }
bool IPEndPoint::FromSockAddr(const struct sockaddr* sock_addr,
socklen_t sock_addr_len) { … }
std::string IPEndPoint::ToString() const { … }
std::string IPEndPoint::ToStringWithoutPort() const { … }
bool IPEndPoint::operator<(const IPEndPoint& other) const { … }
bool IPEndPoint::operator==(const IPEndPoint& other) const { … }
bool IPEndPoint::operator!=(const IPEndPoint& that) const { … }
base::Value IPEndPoint::ToValue() const { … }
std::ostream& operator<<(std::ostream& os, const IPEndPoint& ip_endpoint) { … }
}