Implements IP version 6 style addresses. More...
#include <address_v6.hpp>
Public Types | |
typedef boost::asio::detail::array < unsigned char, 16 > | bytes_type |
The type used to represent an address as an array of bytes. More... | |
Public Member Functions | |
BOOST_ASIO_DECL | address_v6 () |
Default constructor. More... | |
BOOST_ASIO_DECL | address_v6 (const bytes_type &bytes, unsigned long scope_id=0) |
Construct an address from raw bytes and scope ID. More... | |
BOOST_ASIO_DECL | address_v6 (const address_v6 &other) |
Copy constructor. More... | |
BOOST_ASIO_DECL address_v6 & | operator= (const address_v6 &other) |
Assign from another address. More... | |
unsigned long | scope_id () const |
The scope ID of the address. More... | |
void | scope_id (unsigned long id) |
The scope ID of the address. More... | |
BOOST_ASIO_DECL bytes_type | to_bytes () const |
Get the address in bytes, in network byte order. More... | |
BOOST_ASIO_DECL std::string | to_string () const |
Get the address as a string. More... | |
BOOST_ASIO_DECL std::string | to_string (boost::system::error_code &ec) const |
Get the address as a string. More... | |
BOOST_ASIO_DECL address_v4 | to_v4 () const |
Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. More... | |
BOOST_ASIO_DECL bool | is_loopback () const |
Determine whether the address is a loopback address. More... | |
BOOST_ASIO_DECL bool | is_unspecified () const |
Determine whether the address is unspecified. More... | |
BOOST_ASIO_DECL bool | is_link_local () const |
Determine whether the address is link local. More... | |
BOOST_ASIO_DECL bool | is_site_local () const |
Determine whether the address is site local. More... | |
BOOST_ASIO_DECL bool | is_v4_mapped () const |
Determine whether the address is a mapped IPv4 address. More... | |
BOOST_ASIO_DECL bool | is_v4_compatible () const |
Determine whether the address is an IPv4-compatible address. More... | |
BOOST_ASIO_DECL bool | is_multicast () const |
Determine whether the address is a multicast address. More... | |
BOOST_ASIO_DECL bool | is_multicast_global () const |
Determine whether the address is a global multicast address. More... | |
BOOST_ASIO_DECL bool | is_multicast_link_local () const |
Determine whether the address is a link-local multicast address. More... | |
BOOST_ASIO_DECL bool | is_multicast_node_local () const |
Determine whether the address is a node-local multicast address. More... | |
BOOST_ASIO_DECL bool | is_multicast_org_local () const |
Determine whether the address is a org-local multicast address. More... | |
BOOST_ASIO_DECL bool | is_multicast_site_local () const |
Determine whether the address is a site-local multicast address. More... | |
Static Public Member Functions | |
static BOOST_ASIO_DECL address_v6 | from_string (const char *str) |
Create an address from an IP address string. More... | |
static BOOST_ASIO_DECL address_v6 | from_string (const char *str, boost::system::error_code &ec) |
Create an address from an IP address string. More... | |
static BOOST_ASIO_DECL address_v6 | from_string (const std::string &str) |
Create an address from an IP address string. More... | |
static BOOST_ASIO_DECL address_v6 | from_string (const std::string &str, boost::system::error_code &ec) |
Create an address from an IP address string. More... | |
static address_v6 | any () |
Obtain an address object that represents any address. More... | |
static BOOST_ASIO_DECL address_v6 | loopback () |
Obtain an address object that represents the loopback address. More... | |
static BOOST_ASIO_DECL address_v6 | v4_mapped (const address_v4 &addr) |
Create an IPv4-mapped IPv6 address. More... | |
static BOOST_ASIO_DECL address_v6 | v4_compatible (const address_v4 &addr) |
Create an IPv4-compatible IPv6 address. More... | |
Friends | |
BOOST_ASIO_DECL friend bool | operator== (const address_v6 &a1, const address_v6 &a2) |
Compare two addresses for equality. More... | |
bool | operator!= (const address_v6 &a1, const address_v6 &a2) |
Compare two addresses for inequality. More... | |
BOOST_ASIO_DECL friend bool | operator< (const address_v6 &a1, const address_v6 &a2) |
Compare addresses for ordering. More... | |
bool | operator> (const address_v6 &a1, const address_v6 &a2) |
Compare addresses for ordering. More... | |
bool | operator<= (const address_v6 &a1, const address_v6 &a2) |
Compare addresses for ordering. More... | |
bool | operator>= (const address_v6 &a1, const address_v6 &a2) |
Compare addresses for ordering. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<typename Elem , typename Traits > | |
std::basic_ostream< Elem, Traits > & | operator<< (std::basic_ostream< Elem, Traits > &os, const address_v6 &addr) |
Output an address as a string. More... | |
Implements IP version 6 style addresses.
The boost::asio::ip::address_v6 class provides the ability to use and manipulate IP version 6 addresses.
typedef boost::asio::detail::array<unsigned char, 16> boost::asio::ip::address_v6::bytes_type |
The type used to represent an address as an array of bytes.
std::array
when it is available. Otherwise, it uses boost:array
. BOOST_ASIO_DECL boost::asio::ip::address_v6::address_v6 | ( | ) |
Default constructor.
Referenced by any().
|
explicit |
Construct an address from raw bytes and scope ID.
BOOST_ASIO_DECL boost::asio::ip::address_v6::address_v6 | ( | const address_v6 & | other | ) |
Copy constructor.
|
inlinestatic |
Obtain an address object that represents any address.
References address_v6().
|
static |
Create an address from an IP address string.
|
static |
Create an address from an IP address string.
|
static |
Create an address from an IP address string.
|
static |
Create an address from an IP address string.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_link_local | ( | ) | const |
Determine whether the address is link local.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_loopback | ( | ) | const |
Determine whether the address is a loopback address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_multicast | ( | ) | const |
Determine whether the address is a multicast address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_multicast_global | ( | ) | const |
Determine whether the address is a global multicast address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_multicast_link_local | ( | ) | const |
Determine whether the address is a link-local multicast address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_multicast_node_local | ( | ) | const |
Determine whether the address is a node-local multicast address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_multicast_org_local | ( | ) | const |
Determine whether the address is a org-local multicast address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_multicast_site_local | ( | ) | const |
Determine whether the address is a site-local multicast address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_site_local | ( | ) | const |
Determine whether the address is site local.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_unspecified | ( | ) | const |
Determine whether the address is unspecified.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_v4_compatible | ( | ) | const |
Determine whether the address is an IPv4-compatible address.
BOOST_ASIO_DECL bool boost::asio::ip::address_v6::is_v4_mapped | ( | ) | const |
Determine whether the address is a mapped IPv4 address.
|
static |
Obtain an address object that represents the loopback address.
BOOST_ASIO_DECL address_v6& boost::asio::ip::address_v6::operator= | ( | const address_v6 & | other | ) |
Assign from another address.
|
inline |
The scope ID of the address.
Returns the scope ID associated with the IPv6 address.
|
inline |
The scope ID of the address.
Modifies the scope ID associated with the IPv6 address.
BOOST_ASIO_DECL bytes_type boost::asio::ip::address_v6::to_bytes | ( | ) | const |
Get the address in bytes, in network byte order.
BOOST_ASIO_DECL std::string boost::asio::ip::address_v6::to_string | ( | ) | const |
Get the address as a string.
BOOST_ASIO_DECL std::string boost::asio::ip::address_v6::to_string | ( | boost::system::error_code & | ec | ) | const |
Get the address as a string.
BOOST_ASIO_DECL address_v4 boost::asio::ip::address_v6::to_v4 | ( | ) | const |
Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address.
|
static |
Create an IPv4-compatible IPv6 address.
|
static |
Create an IPv4-mapped IPv6 address.
|
friend |
Compare two addresses for inequality.
|
friend |
Compare addresses for ordering.
|
related |
Output an address as a string.
Used to output a human-readable string for a specified address.
os | The output stream to which the string will be written. |
addr | The address to be written. |
|
friend |
Compare addresses for ordering.
|
friend |
Compare two addresses for equality.
|
friend |
Compare addresses for ordering.
|
friend |
Compare addresses for ordering.