12 #ifndef ASIO_IP_NETWORK_V6_HPP 13 #define ASIO_IP_NETWORK_V6_HPP 15 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 17 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 19 #include "asio/detail/config.hpp" 21 #include "asio/detail/string_view.hpp" 22 #include "asio/error_code.hpp" 23 #include "asio/ip/address_v6_range.hpp" 25 #include "asio/detail/push_options.hpp" 51 unsigned short prefix_len);
55 : address_(other.address_),
56 prefix_length_(other.prefix_length_)
60 #if defined(ASIO_HAS_MOVE) 63 : address_(ASIO_MOVE_CAST(
address_v6)(other.address_)),
64 prefix_length_(other.prefix_length_)
67 #endif // defined(ASIO_HAS_MOVE) 70 network_v6&
operator=(
const network_v6& other) ASIO_NOEXCEPT
72 address_ = other.address_;
73 prefix_length_ = other.prefix_length_;
77 #if defined(ASIO_HAS_MOVE) 78 network_v6&
operator=(network_v6&& other) ASIO_NOEXCEPT
81 address_ = ASIO_MOVE_CAST(
address_v6)(other.address_);
82 prefix_length_ = other.prefix_length_;
85 #endif // defined(ASIO_HAS_MOVE) 97 return prefix_length_;
115 return prefix_length_ == 128;
119 ASIO_DECL
bool is_subnet_of(
const network_v6& other)
const;
128 friend bool operator==(
const network_v6& a,
const network_v6& b)
130 return a.address_ == b.address_ && a.prefix_length_ == b.prefix_length_;
134 friend bool operator!=(
const network_v6& a,
const network_v6& b)
141 unsigned short prefix_length_;
149 const address_v6& addr,
unsigned short prefix_len)
184 #if defined(ASIO_HAS_STRING_VIEW) \ 185 || defined(GENERATING_DOCUMENTATION) 202 #endif // defined(ASIO_HAS_STRING_VIEW) 205 #if !defined(ASIO_NO_IOSTREAM) 219 template <
typename Elem,
typename Traits>
220 std::basic_ostream<Elem, Traits>& operator<<(
221 std::basic_ostream<Elem, Traits>& os,
const network_v6& net);
223 #endif // !defined(ASIO_NO_IOSTREAM) 228 #include "asio/detail/pop_options.hpp" 230 #include "asio/ip/impl/network_v6.hpp" 231 #if defined(ASIO_HEADER_ONLY) 232 # include "asio/ip/impl/network_v6.ipp" 233 #endif // defined(ASIO_HEADER_ONLY) 235 #endif // ASIO_IP_NETWORK_V6_HPP Represents an IPv6 network.
Definition: network_v6.hpp:39
friend bool operator!=(const network_v6 &a, const network_v6 &b)
Compare two networks for inequality.
Definition: network_v6.hpp:134
network_v6 & operator=(const network_v6 &other) ASIO_NOEXCEPT
Assign from another network.
Definition: network_v6.hpp:70
bool is_host() const ASIO_NOEXCEPT
Test if network is a valid host address.
Definition: network_v6.hpp:113
address_v6 address() const ASIO_NOEXCEPT
Obtain the address object specified when the network object was created.
Definition: network_v6.hpp:88
ASIO_DECL address_v6_range hosts() const ASIO_NOEXCEPT
Obtain an address range corresponding to the hosts in the network.
Definition: network_v6.ipp:58
network_v6 canonical() const ASIO_NOEXCEPT
Obtain the true network address, omitting any host bits.
Definition: network_v6.hpp:107
friend bool operator==(const network_v6 &a, const network_v6 &b)
Compare two networks for equality.
Definition: network_v6.hpp:128
unsigned short prefix_length() const ASIO_NOEXCEPT
Obtain the prefix length that was specified when the network object was created.
Definition: network_v6.hpp:95
Represents a range of IPv6 addresses.
Definition: address_v6_range.hpp:35
Class to represent an error code value.
Definition: error_code.hpp:80
Implements IP version 6 style addresses.
Definition: address_v6.hpp:47
ASIO_DECL bool is_subnet_of(const network_v6 &other) const
Test if a network is a real subnet of another network.
Definition: network_v6.ipp:80
network_v6() ASIO_NOEXCEPT
Default constructor.
Definition: network_v6.hpp:43
ASIO_DECL std::string to_string() const
Get the network as an address in dotted decimal format.
Definition: network_v6.ipp:88
network_v6 make_network_v6(const address_v6 &addr, unsigned short prefix_len)
Create an IPv6 network from an address and prefix length.
Definition: network_v6.hpp:148
ASIO_DECL network_v6 make_network_v6(const char *str)
Create an IPv6 network from a string containing IP address and prefix length.
Definition: network_v6.ipp:109
Definition: any_io_executor.hpp:28
network_v6(const network_v6 &other) ASIO_NOEXCEPT
Copy constructor.
Definition: network_v6.hpp:54
ASIO_DECL address_v6 network() const ASIO_NOEXCEPT
Obtain an address object that represents the network address.
Definition: network_v6.ipp:45