198 constexpr
auto zero = ByteArray4{{}};
199 return 0 == std::memcmp(
bytes(), zero.data(), zero.size());
203 return (INADDR_BROADCAST ==
toLongHBO());
221 memset(&addr, 0,
sizeof(sockaddr_in));
222 addr.sin_family = AF_INET;
223 memcpy(&addr.sin_addr, &
addr_.
inAddr_,
sizeof(in_addr));
229 std::memcpy(ba.data(),
bytes(), 4);
254 static const ByteArray4
fetchMask(
size_t numBits);
259 const CIDRNetworkV4& one,
260 const CIDRNetworkV4& two);
280 const unsigned char*
bytes()
const {
287 sizeof(in_addr) ==
sizeof(ByteArray4),
288 "size of in_addr and ByteArray4 are different");
IPAddressV4 mask(size_t numBits) const
bool getNthMSBitImpl(const IPAddrType &ip, size_t bitIndex, sa_family_t family)
static uint32_t toLong(StringPiece ip)
bool operator>(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
std::string toInverseArpaName() const
size_t operator()(const folly::IPAddressV4 addr) const
static CIDRNetworkV4 longestCommonPrefix(const CIDRNetworkV4 &one, const CIDRNetworkV4 &two)
std::string toFullyQualified() const
bool isNonroutable() const
static constexpr size_t kMaxToFullyQualifiedSize
static size_t byteCount()
static IPAddressV4 fromBinary(ByteRange bytes)
—— Concurrent Priority Queue Implementation ——
uint8_t getNthMSByte(size_t byteIndex) const
requires E e noexcept(noexcept(s.error(std::move(e))))
ByteRange toBinary() const
AddressStorage(const ByteArray4 bytes)
static Expected< IPAddressV4, IPAddressFormatError > tryFromString(StringPiece str) noexcept
ByteArray4 toByteArray() const
sockaddr_in toSockAddr() const
static Expected< IPAddressV4, IPAddressFormatError > tryFromBinary(ByteRange bytes) noexcept
union folly::IPAddressV4::AddressStorage addr_
bool operator!=(const Unexpected< Error > &lhs, const Unexpected< Error > &rhs)
bool inSubnetWithMask(const IPAddressV4 &subnet, const ByteArray4 mask) const
uint32_t fnv32_buf(const void *buf, size_t n, uint32_t hash=FNV_32_HASH_START) noexcept
static IPAddressV4 fromLong(uint32_t src)
size_t hash_combine(const T &t, const Ts &...ts) noexcept(noexcept(hash_combine_generic(StdHasher{}, t, ts...)))
static const ByteArray4 fetchMask(size_t numBits)
IPAddressV6 getIPv6For6To4() const
size_t hash_value(const IPAddress &addr)
const unsigned char * bytes() const
std::pair< IPAddressV4, uint8_t > CIDRNetworkV4
void toFullyQualifiedAppend(std::string &out) const
bool getNthMSBit(size_t bitIndex) const
void toAppend(char value, Tgt *result)
Expected< Unit, IPAddressFormatError > trySetFromBinary(ByteRange bytes) noexcept
bool operator>=(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
bool getNthLSBit(size_t bitIndex) const
std::string toJson() const
bool operator==(const Unexpected< Error > &lhs, const Unexpected< Error > &rhs)
uint32_t toLongHBO() const
bool operator<=(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
Range< const unsigned char * > ByteRange
static IPAddressV4 fromLongHBO(uint32_t src)
static bool validate(StringPiece ip) noexcept
bool inSubnet(StringPiece cidrNetwork) const
uint8_t getNthLSByte(size_t byteIndex) const
static uint32_t toLongHBO(StringPiece ip)
std::array< uint8_t, 4 > ByteArray4
static constexpr size_t bitCount()
bool isLinkLocalBroadcast() const
static IPAddressV4 fromInverseArpaName(const std::string &arpaname)
ThreadPoolListHook * addr
IPAddressV6 createIPv6() const
bool inSubnet(const IPAddressV4 &subnet, uint8_t cidr) const
std::enable_if< IsLessThanComparable< Value >::value, bool >::type operator<(const Expected< Value, Error > &lhs, const Expected< Value, Error > &rhs)
AddressStorage(const in_addr addr)
std::ostream & operator<<(std::ostream &out, dynamic const &d)