An IPv4 network.
More...
#include <IPRange.h>
An IPv4 network.
Definition at line 718 of file IPRange.h.
◆ IP4Net() [1/2]
Construct from addr and mask.
- Parameters
-
| addr | An address in the network. |
| mask | The mask for the network. |
The network is based on the mask, and the resulting network address is chosen such that the network will contain addr. For a given addr and mask there is only one network that satisifies these criteria.
Definition at line 2120 of file IPRange.h.
◆ IP4Net() [2/2]
◆ as_range()
| IP4Range swoc::IP4Net::as_range |
( |
| ) |
const |
|
inline |
- Returns
- A range that exactly covers the network.
Definition at line 2143 of file IPRange.h.
◆ assign()
Assign an addr and mask to this.
- Parameters
-
| addr | Network addres. |
| mask | Network mask. |
- Returns
- this.
Definition at line 2158 of file IPRange.h.
◆ clear()
Reset network to invalid state.
Definition at line 769 of file IPRange.h.
◆ empty()
| bool swoc::IP4Net::empty |
( |
| ) |
const |
|
inline |
- Returns
true if the network contains no addresses (is invalid).
Definition at line 2128 of file IPRange.h.
◆ load()
Parse network as text.
- Parameters
-
| text | String describing the network in CIDR format. |
- Returns
true if a valid string, false if not.
Definition at line 851 of file swoc_ip.cc.
◆ mask()
| IPMask const & swoc::IP4Net::mask |
( |
| ) |
const |
|
inline |
- Returns
- The mask for the network.
Definition at line 2123 of file IPRange.h.
◆ max()
| IP4Addr swoc::IP4Net::max |
( |
| ) |
const |
|
inline |
- Returns
- The largest address in the network.
Definition at line 2138 of file IPRange.h.
◆ min()
| IP4Addr swoc::IP4Net::min |
( |
| ) |
const |
|
inline |
- Returns
- Network address - smallest address in the network.
Definition at line 2133 of file IPRange.h.
◆ operator!=()
| bool swoc::IP4Net::operator!= |
( |
self_type const & | that | ) |
const |
|
inline |
◆ operator==()
| bool swoc::IP4Net::operator== |
( |
self_type const & | that | ) |
const |
|
inline |
◆ _addr
Network address (also lower_node).
Definition at line 781 of file IPRange.h.
◆ _mask
The documentation for this class was generated from the following files: