#include <address.hpp>
Public Member Functions | |
| address () | |
| Default constructor. | |
| address (const asio::ip::address_v4 &ipv4_address) | |
| Construct an address from an IPv4 address. | |
| address (const asio::ip::address_v6 &ipv6_address) | |
| Construct an address from an IPv6 address. | |
| address (const address &other) | |
| Copy constructor. | |
| address & | operator= (const address &other) |
| Assign from another address. | |
| address & | operator= (const asio::ip::address_v4 &ipv4_address) |
| Assign from an IPv4 address. | |
| address & | operator= (const asio::ip::address_v6 &ipv6_address) |
| Assign from an IPv6 address. | |
| bool | is_v4 () const |
| Get whether the address is an IP version 4 address. | |
| bool | is_v6 () const |
| Get whether the address is an IP version 6 address. | |
| asio::ip::address_v4 | to_v4 () const |
| Get the address as an IP version 4 address. | |
| asio::ip::address_v6 | to_v6 () const |
| Get the address as an IP version 6 address. | |
| std::string | to_string () const |
| Get the address as a string in dotted decimal format. | |
| std::string | to_string (asio::error_code &ec) const |
| Get the address as a string in dotted decimal format. | |
Static Public Member Functions | |
| static address | from_string (const char *str) |
| static address | from_string (const char *str, asio::error_code &ec) |
| static address | from_string (const std::string &str) |
| static address | from_string (const std::string &str, asio::error_code &ec) |
Private Types | |
| enum | { ipv4, ipv6 } |
Private Attributes | |
| enum asio::ip::address:: { ... } | type_ |
| asio::ip::address_v4 | ipv4_address_ |
| asio::ip::address_v6 | ipv6_address_ |
Friends | |
| bool | operator== (const address &a1, const address &a2) |
| Compare two addresses for equality. | |
| bool | operator!= (const address &a1, const address &a2) |
| Compare two addresses for inequality. | |
| bool | operator< (const address &a1, const address &a2) |
| Compare addresses for ordering. | |
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 &addr) |
| Output an address as a string. | |
The asio::ip::address class provides the ability to use either IP version 4 or version 6 addresses.
Definition at line 43 of file address.hpp.
anonymous enum [private] |
| asio::ip::address::address | ( | ) | [inline] |
| asio::ip::address::address | ( | const asio::ip::address_v4 & | ipv4_address | ) | [inline] |
| asio::ip::address::address | ( | const asio::ip::address_v6 & | ipv6_address | ) | [inline] |
| asio::ip::address::address | ( | const address & | other | ) | [inline] |
Assign from another address.
Definition at line 79 of file address.hpp.
References ipv4_address_, ipv6_address_, and type_.
| address& asio::ip::address::operator= | ( | const asio::ip::address_v4 & | ipv4_address | ) | [inline] |
Assign from an IPv4 address.
Definition at line 88 of file address.hpp.
References ipv4, ipv4_address_, ipv6_address_, and type_.
| address& asio::ip::address::operator= | ( | const asio::ip::address_v6 & | ipv6_address | ) | [inline] |
Assign from an IPv6 address.
Definition at line 97 of file address.hpp.
References ipv4_address_, ipv6, ipv6_address_, and type_.
| bool asio::ip::address::is_v4 | ( | ) | const [inline] |
Get whether the address is an IP version 4 address.
Definition at line 106 of file address.hpp.
Referenced by libtorrent::ip_filter::access(), libtorrent::ip_filter::add_rule(), asio::ip::basic_endpoint< InternetProtocol >::basic_endpoint(), libtorrent::udp_tracker_connection::name_lookup(), libtorrent::http_tracker_connection::name_lookup(), asio::ip::basic_endpoint< InternetProtocol >::operator<<(), and libtorrent::detail::write_address().
| bool asio::ip::address::is_v6 | ( | ) | const [inline] |
Get whether the address is an IP version 6 address.
Definition at line 112 of file address.hpp.
Referenced by libtorrent::ip_filter::access(), libtorrent::ip_filter::add_rule(), asio::ip::detail::socket_option::multicast_request< IPv4_Level, IPv4_Name, IPv6_Level, IPv6_Name >::multicast_request(), and libtorrent::detail::write_address().
| asio::ip::address_v4 asio::ip::address::to_v4 | ( | ) | const [inline] |
Get the address as an IP version 4 address.
Definition at line 118 of file address.hpp.
References asio::detail::error_base< T >::address_family_not_supported, simple_client::e, ipv4, ipv4_address_, throw_exception(), and type_.
Referenced by libtorrent::ip_filter::access(), libtorrent::ip_filter::add_rule(), asio::ip::basic_endpoint< InternetProtocol >::basic_endpoint(), asio::ip::detail::socket_option::multicast_request< IPv4_Level, IPv4_Name, IPv6_Level, IPv6_Name >::multicast_request(), and libtorrent::detail::write_address().
| asio::ip::address_v6 asio::ip::address::to_v6 | ( | ) | const [inline] |
Get the address as an IP version 6 address.
Definition at line 130 of file address.hpp.
References asio::detail::error_base< T >::address_family_not_supported, simple_client::e, ipv6, ipv6_address_, throw_exception(), and type_.
Referenced by libtorrent::ip_filter::access(), libtorrent::ip_filter::add_rule(), asio::ip::basic_endpoint< InternetProtocol >::basic_endpoint(), asio::ip::detail::socket_option::multicast_request< IPv4_Level, IPv4_Name, IPv6_Level, IPv6_Name >::multicast_request(), and libtorrent::detail::write_address().
| std::string asio::ip::address::to_string | ( | ) | const [inline] |
Get the address as a string in dotted decimal format.
Definition at line 142 of file address.hpp.
References ipv4_address_, ipv6, ipv6_address_, asio::ip::address_v4::to_string(), asio::ip::address_v6::to_string(), and type_.
Referenced by vmsBtSessionImpl::_threadSession(), libtorrent::peer_connection::connect(), libtorrent::torrent::connect_to_peer(), libtorrent::aux::session_impl::connection_failed(), libtorrent::dht::node_impl::generate_token(), vmsBtDownloadPeerInfoImpl::get_Ip(), libtorrent::peer_connection::on_connection_complete(), libtorrent::aux::session_impl::open_listen_port(), asio::ip::basic_endpoint< InternetProtocol >::operator<<(), operator<<(), libtorrent::policy::peer_from_tracker(), libtorrent::dht::node_impl::verify_token(), and libtorrent::torrent_handle::write_resume_data().
| std::string asio::ip::address::to_string | ( | asio::error_code & | ec | ) | const [inline] |
Get the address as a string in dotted decimal format.
Definition at line 150 of file address.hpp.
References ipv4_address_, ipv6, ipv6_address_, asio::ip::address_v4::to_string(), asio::ip::address_v6::to_string(), and type_.
| static address asio::ip::address::from_string | ( | const char * | str | ) | [inline, static] |
Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
Definition at line 159 of file address.hpp.
References asio::detail::throw_error().
Referenced by from_string(), libtorrent::aux::session_impl::listen_on(), libtorrent::aux::piece_checker_data::parse_resume_data(), libtorrent::torrent::tracker_response(), and libtorrent::torrent::use_interface().
| static address asio::ip::address::from_string | ( | const char * | str, | |
| asio::error_code & | ec | |||
| ) | [inline, static] |
Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
Definition at line 169 of file address.hpp.
References address(), asio::ip::address_v4::from_string(), asio::ip::address_v6::from_string(), ipv4, ipv4_address_, ipv6, ipv6_address_, and type_.
| static address asio::ip::address::from_string | ( | const std::string & | str | ) | [inline, static] |
Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
Definition at line 196 of file address.hpp.
References from_string().
| static address asio::ip::address::from_string | ( | const std::string & | str, | |
| asio::error_code & | ec | |||
| ) | [inline, static] |
Create an address from an IPv4 address string in dotted decimal form, or from an IPv6 address in hexadecimal notation.
Definition at line 203 of file address.hpp.
References from_string().
| std::basic_ostream< Elem, Traits > & operator<< | ( | std::basic_ostream< Elem, Traits > & | os, | |
| const address & | addr | |||
| ) | [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. |
Definition at line 265 of file address.hpp.
References to_string().
enum { ... } asio::ip::address::type_ [private] |
Referenced by from_string(), is_v4(), is_v6(), operator=(), to_string(), to_v4(), and to_v6().
Definition at line 246 of file address.hpp.
Referenced by from_string(), operator=(), to_string(), and to_v4().
Definition at line 249 of file address.hpp.
Referenced by from_string(), operator=(), to_string(), and to_v6().
1.5.6