20 #ifndef BEAST_NET_IPADDRESS_H_INCLUDED
21 #define BEAST_NET_IPADDRESS_H_INCLUDED
23 #include <ripple/beast/net/IPAddressV4.h>
24 #include <ripple/beast/net/IPAddressV6.h>
25 #include <ripple/beast/hash/hash_append.h>
26 #include <ripple/beast/hash/uhash.h>
27 #include <boost/functional/hash.hpp>
28 #include <boost/asio/ip/address.hpp>
48 return addr.to_string ();
56 return addr.is_loopback();
64 return addr.is_unspecified();
72 return addr.is_multicast();
80 return (addr.is_v4 ())
90 return (addr.is_v4 ())
99 template <
class Hasher>
106 else if (addr.is_v6 ())
117 explicit hash() =
default;
131 explicit hash() =
default;
136 return ::beast::uhash<>{} (addr);
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_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.
bool is_unspecified(Address const &addr)
Returns true if the address is unspecified.