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