20 #ifndef BEAST_NET_IPADDRESS_H_INCLUDED
21 #define BEAST_NET_IPADDRESS_H_INCLUDED
23 #include <ripple/beast/hash/hash_append.h>
24 #include <ripple/beast/hash/uhash.h>
25 #include <ripple/beast/net/IPAddressV4.h>
26 #include <ripple/beast/net/IPAddressV6.h>
27 #include <boost/asio/ip/address.hpp>
28 #include <boost/functional/hash.hpp>
47 return addr.to_string();
54 return addr.is_loopback();
61 return addr.is_unspecified();
68 return addr.is_multicast();
89 template <
class Hasher>
96 else if (addr.is_v6())
107 explicit hash() =
default;
112 return ::beast::uhash<>{}(addr);
std::size_t operator()(::beast::IP::Address const &addr) const
bool is_loopback(Address const &addr)
Returns true if this is a loopback address.
bool is_multicast(Address const &addr)
Returns true if the address is a multicast address.
bool is_private(AddressV4 const &addr)
Returns true if the address is a private unroutable address.
boost::asio::ip::address Address
std::string to_string(Address const &addr)
Returns the address represented as a string.
bool is_public(AddressV4 const &addr)
Returns true if the address is a public routable address.
std::enable_if_t< is_contiguously_hashable< T, Hasher >::value > hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
bool is_unspecified(Address const &addr)
Returns true if the address is unspecified.