INet6 network prefix. More...
#include <senf/Socket/Protocols/INet/INet6Address.hh>
Public Member Functions | |
INet6Address const & | address () const |
Get the network address. More... | |
unsigned | prefix_len () const |
Get the network prefix length. More... | |
bool | boolean_test () const |
true , if INet6Network is non-empty More... | |
bool | operator== (INet6Network const &other) const |
Compare two networks for equality. More... | |
bool | match (INet6Address const &addr) const |
true , if the network includes addr More... | |
bool | match (INet6Network const &net) const |
true , if the network includes net More... | |
INet6Address | host (boost::uint64_t id) |
Return the host with the given id. More... | |
INet6Network | subnet (boost::uint64_t net, unsigned prefix_len) |
Return the given subnet of this . More... | |
Public Member Functions inherited from senf::comparable_safe_bool< INet6Network > | |
operator bool_type () const | |
bool | operator! () const |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &os, INet6Network const &addr) |
Output INet6Network instance as it's string representation. More... | |
std::istream & | operator>> (std::istream &is, INet6Network &addr) |
Try to initialize INet6Network instance from a string representation. More... | |
Structors and default members | |
INet6Network () | |
Construct empty (::/0) network. More... | |
INet6Network (INet6Address const &address, unsigned prefix_len) | |
Construct network from given address and prefix length. More... | |
INet6Network (std::string const &s) | |
Construct network from CIDR notation. More... | |
Additional Inherited Members | |
Protected Types inherited from senf::safe_bool_base | |
typedef void(safe_bool_base::* | bool_type) () const |
Protected Member Functions inherited from senf::comparable_safe_bool< INet6Network > | |
~comparable_safe_bool () | |
Protected Member Functions inherited from senf::safe_bool_base | |
void | this_type_does_not_support_comparisons () const |
safe_bool_base () | |
safe_bool_base (const safe_bool_base &) | |
safe_bool_base & | operator= (const safe_bool_base &) |
~safe_bool_base () | |
INet6 network prefix.
This class represents an INet6 network prefix in CIDR notation.
Definition at line 335 of file INet6Address.hh.
senf::INet6Network::INet6Network | ( | ) |
Construct empty (::/0) network.
senf::INet6Network::INet6Network | ( | INet6Address const & | address, |
unsigned | prefix_len | ||
) |
Construct network from given address and prefix length.
|
explicit |
Construct network from CIDR notation.
Definition at line 152 of file INet6Address.cc.
INet6Address const& senf::INet6Network::address | ( | ) | const |
Get the network address.
bool senf::INet6Network::boolean_test | ( | ) | const |
true
, if INet6Network is non-empty
INet6Address senf::INet6Network::host | ( | boost::uint64_t | id | ) |
Return the host with the given id.
Returns the host with the given number within the network. This call replaces the lower 64 bits of the network address with the given id.
bool senf::INet6Network::match | ( | INet6Address const & | addr | ) | const |
true
, if the network includes addr
bool senf::INet6Network::match | ( | INet6Network const & | net | ) | const |
true
, if the network includes net
The is true, if net is sub-network (or the same as) this
.
bool senf::INet6Network::operator== | ( | INet6Network const & | other | ) | const |
Compare two networks for equality.
unsigned senf::INet6Network::prefix_len | ( | ) | const |
Get the network prefix length.
INet6Network senf::INet6Network::subnet | ( | boost::uint64_t | net, |
unsigned | prefix_len | ||
) |
Return the given subnet of this
.
The returned INet6Network will be a subnet of this
with the given network number. The network number is comprised by the bits above prefix_len:
[in] | net | network number |
[in] | prefix_len | length of subnet prefix |
|
related |
Output INet6Network instance as it's string representation.
|
related |
Try to initialize INet6Network instance from a string representation.
sets std::ios::failbit on the stream if an error occurred