|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <IPAddr.h>

Public Types | |
| using | raw_type = uint8_t |
| Storage for mask width. | |
Public Member Functions | |
| IPMask ()=default | |
| Default construct to invalid mask. | |
| IPMask (raw_type width) | |
| bool | is_valid () const |
| bool | load (string_view const &text) |
| self_type & | clear () |
| Change to default constructed state (invalid). | |
| raw_type | width () const |
| The width of the mask. | |
| self_type & | operator<<= (raw_type n) |
| self_type & | operator>>= (raw_type n) |
| IP4Addr | as_ip4 () const |
| IP6Addr | as_ip6 () const |
Static Public Member Functions | |
| static self_type | mask_for (IPAddr const &addr) |
| static self_type | mask_for (IP4Addr const &addr) |
| static self_type | mask_for (IP6Addr const &addr) |
Static Protected Member Functions | |
| static raw_type | mask_for_quad (IP6Addr::quad_type q) |
| Compute a partial IPv6 mask, sized for the basic storage type. | |
Protected Attributes | |
| raw_type | _cidr = INVALID |
| Mask width in bits. | |
Static Protected Attributes | |
| static constexpr auto | INVALID = std::numeric_limits<raw_type>::max() |
| Marker value for an invalid mask. | |
Friends | |
| class | IP4Addr |
| class | IP6Addr |
An IP address mask.
This is essentially a width for a bit mask.
| using swoc::IPMask::raw_type = uint8_t |
|
inlineexplicit |
|
inline |
| IP6Addr swoc::IPMask::as_ip6 | ( | ) | const |
The mask as an IPv6 address.
If the mask is wider than an IPv6 address, the maximum mask is returned.
Definition at line 724 of file swoc_ip.cc.
|
inline |
|
inline |
| bool swoc::IPMask::load | ( | string_view const & | text | ) |
Parse mask from text.
| text | A number in string format. |
false if not. Definition at line 663 of file swoc_ip.cc.
Copmute a mask for the network at addr.
| addr | Lower bound of network. |
Definition at line 698 of file swoc_ip.cc.
Copmute a mask for the network at addr.
| addr | Lower bound of network. |
Definition at line 710 of file swoc_ip.cc.
Copmute a mask for the network at addr.
| addr | Lower bound of network. |
Definition at line 674 of file swoc_ip.cc.
|
staticprotected |
Compute a partial IPv6 mask, sized for the basic storage type.
Definition at line 684 of file swoc_ip.cc.
|
inline |
|
inline |
|
inline |
|
staticconstexprprotected |