1#ifndef BEAST_NET_IPENDPOINT_H_INCLUDED
2#define BEAST_NET_IPENDPOINT_H_INCLUDED
4#include <xrpl/beast/hash/hash_append.h>
5#include <xrpl/beast/hash/uhash.h>
6#include <xrpl/beast/net/IPAddress.h>
114 template <
class Hasher>
118 using ::beast::hash_append;
176template <
typename OutputStream>
203 return ::beast::uhash<>{}(endpoint);
218 return ::beast::uhash<>{}(endpoint);
A version-independent IP address and port combination.
Address const & address() const
Returns the address portion of this endpoint.
static std::optional< Endpoint > from_string_checked(std::string const &s)
Create an Endpoint from a string.
friend bool operator>(Endpoint const &lhs, Endpoint const &rhs)
Endpoint()
Create an unspecified endpoint.
friend bool operator!=(Endpoint const &lhs, Endpoint const &rhs)
friend bool operator<(Endpoint const &lhs, Endpoint const &rhs)
friend void hash_append(Hasher &h, Endpoint const &endpoint)
Endpoint at_port(Port port) const
Returns a new Endpoint with a different port.
AddressV4 const to_v4() const
bool is_v4() const
Convenience accessors for the address part.
AddressV6 const to_v6() const
friend bool operator<=(Endpoint const &lhs, Endpoint const &rhs)
static Endpoint from_string(std::string const &s)
Port port() const
Returns the port number on the endpoint.
std::string to_string() const
Returns a string representing the endpoint.
friend bool operator>=(Endpoint const &lhs, Endpoint const &rhs)
friend bool operator==(Endpoint const &lhs, Endpoint const &rhs)
Arithmetic comparison.
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.
boost::asio::ip::address_v6 AddressV6
bool is_public(Address const &addr)
Returns true if the address is a public routable address.
OutputStream & operator<<(OutputStream &os, Endpoint const &endpoint)
Output stream conversion.
bool is_unspecified(Address const &addr)
Returns true if the address is unspecified.
std::istream & operator>>(std::istream &is, Endpoint &endpoint)
Input stream conversion.
boost::asio::ip::address_v4 AddressV4
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::size_t operator()(::beast::IP::Endpoint const &endpoint) const
std::size_t operator()(::beast::IP::Endpoint const &endpoint) const