Clementine
Public Types | Public Member Functions | Static Public Member Functions | Friends | Related Functions | List of all members
asio::ip::address_v6 Class Reference

Implements IP version 6 style addresses. More...

#include <address_v6.hpp>

Public Types

typedef asio::detail::array< unsigned char, 16 > bytes_type
 The type used to represent an address as an array of bytes. More...
 

Public Member Functions

ASIO_DECL address_v6 () ASIO_NOEXCEPT
 Default constructor.
 
ASIO_DECL address_v6 (const bytes_type &bytes, unsigned long scope_id=0)
 Construct an address from raw bytes and scope ID.
 
ASIO_DECL address_v6 (const address_v6 &other) ASIO_NOEXCEPT
 Copy constructor.
 
ASIO_DECL address_v6operator= (const address_v6 &other) ASIO_NOEXCEPT
 Assign from another address.
 
unsigned long scope_id () const ASIO_NOEXCEPT
 The scope ID of the address. More...
 
void scope_id (unsigned long id) ASIO_NOEXCEPT
 The scope ID of the address. More...
 
ASIO_DECL bytes_type to_bytes () const ASIO_NOEXCEPT
 Get the address in bytes, in network byte order.
 
ASIO_DECL std::string to_string () const
 Get the address as a string.
 
ASIO_DECL std::string to_string (asio::error_code &ec) const
 (Deprecated: Use other overload.) Get the address as a string.
 
ASIO_DECL address_v4 to_v4 () const
 (Deprecated: Use make_address_v4().) Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address. More...
 
ASIO_DECL bool is_loopback () const ASIO_NOEXCEPT
 Determine whether the address is a loopback address.
 
ASIO_DECL bool is_unspecified () const ASIO_NOEXCEPT
 Determine whether the address is unspecified.
 
ASIO_DECL bool is_link_local () const ASIO_NOEXCEPT
 Determine whether the address is link local.
 
ASIO_DECL bool is_site_local () const ASIO_NOEXCEPT
 Determine whether the address is site local.
 
ASIO_DECL bool is_v4_mapped () const ASIO_NOEXCEPT
 Determine whether the address is a mapped IPv4 address.
 
ASIO_DECL bool is_v4_compatible () const
 (Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address. More...
 
ASIO_DECL bool is_multicast () const ASIO_NOEXCEPT
 Determine whether the address is a multicast address.
 
ASIO_DECL bool is_multicast_global () const ASIO_NOEXCEPT
 Determine whether the address is a global multicast address.
 
ASIO_DECL bool is_multicast_link_local () const ASIO_NOEXCEPT
 Determine whether the address is a link-local multicast address.
 
ASIO_DECL bool is_multicast_node_local () const ASIO_NOEXCEPT
 Determine whether the address is a node-local multicast address.
 
ASIO_DECL bool is_multicast_org_local () const ASIO_NOEXCEPT
 Determine whether the address is a org-local multicast address.
 
ASIO_DECL bool is_multicast_site_local () const ASIO_NOEXCEPT
 Determine whether the address is a site-local multicast address.
 

Static Public Member Functions

static address_v6 from_string (const char *str)
 (Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. More...
 
static address_v6 from_string (const char *str, asio::error_code &ec)
 (Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. More...
 
static address_v6 from_string (const std::string &str)
 (Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. More...
 
static address_v6 from_string (const std::string &str, asio::error_code &ec)
 (Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string. More...
 
static address_v6 any () ASIO_NOEXCEPT
 Obtain an address object that represents any address.
 
static ASIO_DECL address_v6 loopback () ASIO_NOEXCEPT
 Obtain an address object that represents the loopback address.
 
static ASIO_DECL address_v6 v4_mapped (const address_v4 &addr)
 (Deprecated: Use make_address_v6().) Create an IPv4-mapped IPv6 address.
 
static ASIO_DECL address_v6 v4_compatible (const address_v4 &addr)
 (Deprecated: No replacement.) Create an IPv4-compatible IPv6 address.
 

Friends

class basic_address_iterator< address_v6 >
 
ASIO_DECL friend bool operator== (const address_v6 &a1, const address_v6 &a2) ASIO_NOEXCEPT
 Compare two addresses for equality.
 
bool operator!= (const address_v6 &a1, const address_v6 &a2) ASIO_NOEXCEPT
 Compare two addresses for inequality.
 
ASIO_DECL friend bool operator< (const address_v6 &a1, const address_v6 &a2) ASIO_NOEXCEPT
 Compare addresses for ordering.
 
bool operator> (const address_v6 &a1, const address_v6 &a2) ASIO_NOEXCEPT
 Compare addresses for ordering.
 
bool operator<= (const address_v6 &a1, const address_v6 &a2) ASIO_NOEXCEPT
 Compare addresses for ordering.
 
bool operator>= (const address_v6 &a1, const address_v6 &a2) ASIO_NOEXCEPT
 Compare addresses for ordering.
 

Related Functions

(Note that these are not member functions.)

address_v6 make_address_v6 (const address_v6::bytes_type &bytes, unsigned long scope_id=0)
 Create an IPv6 address from raw bytes and scope ID.
 
ASIO_DECL address_v6 make_address_v6 (const char *str)
 Create an IPv6 address from an IP address string.
 
ASIO_DECL address_v6 make_address_v6 (const char *str, asio::error_code &ec) ASIO_NOEXCEPT
 Create an IPv6 address from an IP address string.
 
ASIO_DECL address_v6 make_address_v6 (const std::string &str)
 Createan IPv6 address from an IP address string.
 
ASIO_DECL address_v6 make_address_v6 (const std::string &str, asio::error_code &ec) ASIO_NOEXCEPT
 Create an IPv6 address from an IP address string.
 
ASIO_DECL address_v6 make_address_v6 (v4_mapped_t, const address_v4 &v4_addr)
 Create an IPv4-mapped IPv6 address from an IPv4 address.
 
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...
 
network_v6 make_network_v6 (const address_v6 &addr, unsigned short prefix_len)
 Create an IPv6 network from an address and prefix length.
 
template<typename Elem , typename Traits >
std::basic_ostream< Elem, Traits > & operator<< (std::basic_ostream< Elem, Traits > &os, const network_v6 &net)
 Output a network as a string. More...
 

Detailed Description

Implements IP version 6 style addresses.

The asio::ip::address_v6 class provides the ability to use and manipulate IP version 6 addresses.

Thread Safety
Distinct objects: Safe.
Shared objects: Unsafe.

Member Typedef Documentation

◆ bytes_type

The type used to represent an address as an array of bytes.

Note
This type is defined in terms of the C++0x template std::array when it is available. Otherwise, it uses boost:array.

Member Function Documentation

◆ from_string() [1/4]

address_v6 asio::ip::address_v6::from_string ( const char *  str)
inlinestatic

(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string.

◆ from_string() [2/4]

address_v6 asio::ip::address_v6::from_string ( const char *  str,
asio::error_code ec 
)
inlinestatic

(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string.

◆ from_string() [3/4]

address_v6 asio::ip::address_v6::from_string ( const std::string &  str)
inlinestatic

(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string.

◆ from_string() [4/4]

address_v6 asio::ip::address_v6::from_string ( const std::string &  str,
asio::error_code ec 
)
inlinestatic

(Deprecated: Use make_address_v6().) Create an IPv6 address from an IP address string.

◆ is_v4_compatible()

bool asio::ip::address_v6::is_v4_compatible ( ) const

(Deprecated: No replacement.) Determine whether the address is an IPv4-compatible address.

◆ scope_id() [1/2]

unsigned long asio::ip::address_v6::scope_id ( ) const
inline

The scope ID of the address.

Returns the scope ID associated with the IPv6 address.

◆ scope_id() [2/2]

void asio::ip::address_v6::scope_id ( unsigned long  id)
inline

The scope ID of the address.

Modifies the scope ID associated with the IPv6 address.

◆ to_v4()

address_v4 asio::ip::address_v6::to_v4 ( ) const

(Deprecated: Use make_address_v4().) Converts an IPv4-mapped or IPv4-compatible address to an IPv4 address.

Friends And Related Function Documentation

◆ operator<<() [1/2]

template<typename Elem , typename Traits >
std::basic_ostream< Elem, Traits > & operator<< ( std::basic_ostream< Elem, Traits > &  os,
const network_v6 net 
)
related

Output a network as a string.

Used to output a human-readable string for a specified network.

Parameters
osThe output stream to which the string will be written.
netThe network to be written.
Returns
The output stream.

◆ operator<<() [2/2]

template<typename Elem , typename Traits >
std::basic_ostream< Elem, Traits > & operator<< ( std::basic_ostream< Elem, Traits > &  os,
const address_v6 addr 
)
related

Output an address as a string.

Used to output a human-readable string for a specified address.

Parameters
osThe output stream to which the string will be written.
addrThe address to be written.
Returns
The output stream.

The documentation for this class was generated from the following files: