#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <folly/SocketAddress.h>
#include <cassert>
#include <cerrno>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <string>
#include <system_error>
#include <type_traits>
#include <boost/functional/hash.hpp>
#include <fmt/core.h>
#include <folly/Exception.h>
#include <folly/hash/Hash.h>
#include <folly/net/NetOps.h>
#include <folly/net/NetworkSocket.h>
namespace {
struct ScopedAddrInfo { … };
struct HostAndPort { … };
struct GetAddrInfoError { … };
}
namespace folly {
bool SocketAddress::isPrivateAddress() const { … }
bool SocketAddress::isLoopbackAddress() const { … }
void SocketAddress::setFromHostPort(const char* host, uint16_t port) { … }
void SocketAddress::setFromIpPort(const char* ip, uint16_t port) { … }
void SocketAddress::setFromIpAddrPort(const IPAddress& ipAddr, uint16_t port) { … }
void SocketAddress::setFromLocalPort(uint16_t port) { … }
void SocketAddress::setFromLocalPort(const char* port) { … }
void SocketAddress::setFromLocalIpPort(const char* addressAndPort) { … }
void SocketAddress::setFromIpPort(const char* addressAndPort) { … }
void SocketAddress::setFromHostPort(const char* hostAndPort) { … }
int SocketAddress::getPortFrom(const struct sockaddr* address) { … }
const char* SocketAddress::getFamilyNameFrom(
const struct sockaddr* address, const char* defaultResult) { … }
void SocketAddress::setFromPath(StringPiece path) { … }
void SocketAddress::setFromPeerAddress(NetworkSocket socket) { … }
void SocketAddress::setFromLocalAddress(NetworkSocket socket) { … }
void SocketAddress::setFromSockaddr(const struct sockaddr* address) { … }
void SocketAddress::setFromSockaddr(
const struct sockaddr* address, socklen_t addrlen) { … }
void SocketAddress::setFromSockaddr(const struct sockaddr_in* address) { … }
void SocketAddress::setFromSockaddr(const struct sockaddr_in6* address) { … }
void SocketAddress::setFromSockaddr(
const struct sockaddr_un* address, socklen_t addrlen) { … }
const folly::IPAddress& SocketAddress::getIPAddress() const { … }
socklen_t SocketAddress::getActualSize() const { … }
std::string SocketAddress::getFullyQualified() const { … }
std::string SocketAddress::getAddressStr() const { … }
bool SocketAddress::isFamilyInet() const { … }
void SocketAddress::getAddressStr(char* buf, size_t buflen) const { … }
uint16_t SocketAddress::getPort() const { … }
void SocketAddress::setPort(uint16_t port) { … }
void SocketAddress::convertToIPv4() { … }
bool SocketAddress::tryConvertToIPv4() { … }
bool SocketAddress::mapToIPv6() { … }
std::string SocketAddress::getHostStr() const { … }
std::string SocketAddress::getPath() const { … }
std::string SocketAddress::describe() const { … }
bool SocketAddress::operator==(const SocketAddress& other) const { … }
bool SocketAddress::prefixMatch(
const SocketAddress& other, unsigned prefixLength) const { … }
size_t SocketAddress::hash() const { … }
struct addrinfo* SocketAddress::getAddrInfo(
const char* host, uint16_t port, int flags) { … }
struct addrinfo* SocketAddress::getAddrInfo(
const char* host, const char* port, int flags) { … }
void SocketAddress::setFromAddrInfo(const struct addrinfo* info) { … }
void SocketAddress::setFromLocalAddr(const struct addrinfo* info) { … }
void SocketAddress::setFromSocket(
NetworkSocket socket,
int (*fn)(NetworkSocket, struct sockaddr*, socklen_t*)) { … }
std::string SocketAddress::getIpString(int flags) const { … }
void SocketAddress::getIpString(char* buf, size_t buflen, int flags) const { … }
void SocketAddress::updateUnixAddressLength(socklen_t addrlen) { … }
bool SocketAddress::operator<(const SocketAddress& other) const { … }
size_t hash_value(const SocketAddress& address) { … }
std::ostream& operator<<(std::ostream& os, const SocketAddress& addr) { … }
}