#include <folly/IPAddress.h>
#include <limits>
#include <ostream>
#include <string>
#include <vector>
#include <fmt/core.h>
#include <folly/String.h>
#include <folly/detail/IPAddressSource.h>
#include <folly/small_vector.h>
ostream;
string;
vector;
namespace folly {
size_t hash_value(const IPAddress& addr) { … }
ostream& operator<<(ostream& os, const IPAddress& addr) { … }
void toAppend(IPAddress addr, string* result) { … }
void toAppend(IPAddress addr, fbstring* result) { … }
bool IPAddress::validate(StringPiece ip) noexcept { … }
IPAddressV4 IPAddress::createIPv4(const IPAddress& addr) { … }
IPAddressV6 IPAddress::createIPv6(const IPAddress& addr) { … }
namespace {
auto splitIpSlashCidr(StringPiece ipSlashCidr) { … }
}
CIDRNetwork IPAddress::createNetwork(
StringPiece ipSlashCidr,
int defaultCidr,
bool applyMask ) { … }
Expected<CIDRNetwork, CIDRNetworkError> IPAddress::tryCreateNetwork(
StringPiece ipSlashCidr, int defaultCidr, bool applyMask) { … }
std::string IPAddress::networkToString(const CIDRNetwork& network) { … }
IPAddress IPAddress::fromBinary(ByteRange bytes) { … }
Expected<IPAddress, IPAddressFormatError> IPAddress::tryFromBinary(
ByteRange bytes) noexcept { … }
IPAddress IPAddress::fromLong(uint32_t src) { … }
IPAddress IPAddress::fromLongHBO(uint32_t src) { … }
IPAddress::IPAddress() : … { … }
IPAddress::IPAddress(StringPiece str) : … { … }
Expected<IPAddress, IPAddressFormatError> IPAddress::tryFromString(
StringPiece str) noexcept { … }
IPAddress::IPAddress(const sockaddr* addr) : … { … }
folly::Expected<IPAddress, IPAddressFormatError> IPAddress::tryFromSockAddr(
const sockaddr* addr) noexcept { … }
IPAddress::IPAddress(const IPAddressV4 ipV4Addr) noexcept
: … { … }
IPAddress::IPAddress(const in_addr ipV4Addr) noexcept
: … { … }
IPAddress::IPAddress(const IPAddressV6& ipV6Addr) noexcept
: … { … }
IPAddress::IPAddress(const in6_addr& ipV6Addr) noexcept
: … { … }
IPAddress& IPAddress::operator=(const IPAddressV4& ipv4_addr) noexcept { … }
IPAddress& IPAddress::operator=(const IPAddressV6& ipv6_addr) noexcept { … }
bool IPAddress::inSubnet(StringPiece cidrNetwork) const { … }
bool IPAddress::inSubnet(const IPAddress& subnet, uint8_t cidr) const { … }
bool IPAddress::inSubnetWithMask(
const IPAddress& subnet, ByteRange mask) const { … }
uint8_t IPAddress::getNthMSByte(size_t byteIndex) const { … }
bool operator==(const IPAddress& addr1, const IPAddress& addr2) { … }
bool operator<(const IPAddress& addr1, const IPAddress& addr2) { … }
CIDRNetwork IPAddress::longestCommonPrefix(
const CIDRNetwork& one, const CIDRNetwork& two) { … }
[[noreturn]] void IPAddress::asV4Throw() const { … }
[[noreturn]] void IPAddress::asV6Throw() const { … }
}