20#ifndef BEAST_NET_IPADDRESS_H_INCLUDED
21#define BEAST_NET_IPADDRESS_H_INCLUDED
23#include <xrpl/beast/hash/hash_append.h>
24#include <xrpl/beast/hash/uhash.h>
25#include <xrpl/beast/net/IPAddressV4.h>
26#include <xrpl/beast/net/IPAddressV6.h>
27#include <xrpl/beast/utility/instrumentation.h>
29#include <boost/asio/ip/address.hpp>
30#include <boost/functional/hash.hpp>
49 return addr.to_string();
56 return addr.is_loopback();
63 return addr.is_unspecified();
70 return addr.is_multicast();
91template <
class Hasher>
98 else if (addr.is_v6())
101 UNREACHABLE(
"beast::hash_append : invalid address type");
114 return ::beast::uhash<>{}(addr);
bool is_multicast(Address const &addr)
Returns true if the address is a multicast address.
bool is_loopback(Address const &addr)
Returns true if this is a loopback address.
bool is_public(Address 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.
boost::asio::ip::address Address
bool is_private(Address const &addr)
Returns true if the address is a private unroutable address.
std::string to_string(Address const &addr)
Returns the address represented as a string.
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.
std::size_t operator()(::beast::IP::Address const &addr) const