#include <senf/Socket/Protocols/INet/INet6Address.hh>
This class represents an INet6 network prefix in CIDR notation.
Definition at line 345 of file INet6Address.hh.
Public Member Functions |
|
INet6Address const & | address () const |
Get the network address. |
|
unsigned | prefix_len () const |
Get the network prefix length. |
|
bool | boolean_test () const |
true , if INet6Network is non-empty |
|
bool | operator== (INet6Network const &other) const |
Compare two networks for equality. |
|
bool | match (INet6Address const &addr) const |
true , if the network includes addr |
|
bool | match (INet6Network const &net) const |
true , if the network includes net |
|
INet6Address | host (boost::uint64_t id) |
Return the host with the given id. |
|
INet6Network | subnet (boost::uint64_t net, unsigned prefix_len) |
Return the given subnet of this . |
|
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. |
|
std::istream & | operator>> (std::istream &is, INet6Network &addr) |
Try to initialize INet6Network instance from a string representation. |
|
Structors and default members |
|
INet6Network () | |
Construct empty (::/0) network. |
|
INet6Network (INet6Address const &address, unsigned prefix_len) | |
Construct network from given address and prefix length. |
|
INet6Network (std::string const &s) | |
Construct network from CIDR notation. |
senf::INet6Network:: | ||||
INet6Network | () | |||
Construct empty (::/0) network.
Definition at line 207 of file INet6Address.cci.
senf::INet6Network:: | ||||
INet6Network | ( | INet6Address const & | address, | |
unsigned | prefix_len | ) | ||
Construct network from given address and prefix length.
Definition at line 211 of file INet6Address.cci.
senf::INet6Network:: | ||||
INet6Network | ( | std::string const & | s | ) |
Construct network from CIDR notation.
Definition at line 162 of file INet6Address.cc.
senf::INet6Address const & senf::INet6Network:: | ||||
address | () | |||
Get the network address.
Definition at line 219 of file INet6Address.cci.
bool senf::INet6Network:: | ||||
boolean_test | () | |||
true
, if INet6Network is non-empty
Definition at line 231 of file INet6Address.cci.
senf::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.
Definition at line 259 of file INet6Address.cci.
bool senf::INet6Network:: | ||||
match | ( | INet6Network const & | net | ) |
true
, if the network includes net
The is true, if net is sub-network (or the same as) this
.
Definition at line 253 of file INet6Address.cci.
bool senf::INet6Network:: | ||||
match | ( | INet6Address const & | addr | ) |
true
, if the network includes addr
Definition at line 243 of file INet6Address.cci.
bool senf::INet6Network:: | ||||
operator== | ( | INet6Network const & | other | ) |
Compare two networks for equality.
Definition at line 237 of file INet6Address.cci.
unsigned senf::INet6Network:: | ||||
prefix_len | () | |||
Get the network prefix length.
Definition at line 225 of file INet6Address.cci.
senf::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:
INet6Network("2001:db8::/32").subnet(0x12u,40u) == INet6Network("2001:db8:1200::/40") INet6Network("2001:db8:1200::/40").subnet(0x2345,64u) == INet6Network("2001:db8:1200:2345::/64")
[in] | net | network number |
[in] | prefix_len | length of subnet prefix |
Definition at line 266 of file INet6Address.cci.
std::ostream & | ||||
operator<< | ( | std::ostream & | os, | |
INet6Network const & | addr | ) | ||
Output INet6Network instance as it's string representation.
std::istream & | ||||
operator>> | ( | std::istream & | is, | |
INet6Network & | addr | ) | ||
Try to initialize INet6Network instance from a string representation.
sets std::ios::failbit on the stream if an error occurred