3#include <xrpl/beast/hash/hash_append.h>
4#include <xrpl/beast/hash/uhash.h>
5#include <xrpl/beast/net/IPAddress.h>
6#include <xrpl/beast/net/IPAddressV4.h>
7#include <xrpl/beast/net/IPAddressV6.h>
101 return addr_.to_v6();
130 template <
class Hasher>
206template <
typename OutputStream>
236 return ::beast::Uhash<>{}(endpoint);
253 return ::beast::Uhash<>{}(endpoint);
A version-independent IP address and port combination.
friend bool operator>(Endpoint const &lhs, Endpoint const &rhs)
std::string toString() const
Returns a string representing the endpoint.
Endpoint()
Create an unspecified endpoint.
friend bool operator<(Endpoint const &lhs, Endpoint const &rhs)
static std::optional< Endpoint > fromStringChecked(std::string const &s)
Create an Endpoint from a string.
friend void hash_append(Hasher &h, Endpoint const &endpoint)
bool isV4() const
Convenience accessors for the address part.
Endpoint atPort(Port port) const
Returns a new Endpoint with a different port.
static Endpoint fromString(std::string const &s)
friend bool operator<=(Endpoint const &lhs, Endpoint const &rhs)
Port port() const
Returns the port number on the endpoint.
Address const & address() const
Returns the address portion of this endpoint.
friend bool operator>=(Endpoint const &lhs, Endpoint const &rhs)
friend bool operator==(Endpoint const &lhs, Endpoint const &rhs)
Arithmetic comparison.
bool isLoopback(Address const &addr)
Returns true if this is a loopback address.
boost::asio::ip::address Address
bool isPublic(Address const &addr)
Returns true if the address is a public routable address.
boost::asio::ip::address_v6 AddressV6
bool isUnspecified(Address const &addr)
Returns true if the address is unspecified.
boost::asio::ip::address_v4 AddressV4
bool isPrivate(Address const &addr)
Returns true if the address is a private unroutable address.
bool isMulticast(Address const &addr)
Returns true if the address is a multicast address.
std::string to_string(Address const &addr)
Returns the address represented as a string.
OutputStream & operator<<(OutputStream &os, Endpoint const &endpoint)
Output stream conversion.
std::istream & operator>>(std::istream &is, Endpoint &endpoint)
Input stream conversion.
void hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
std::size_t operator()(::beast::ip::Endpoint const &endpoint) const
std::size_t operator()(::beast::ip::Endpoint const &endpoint) const