LibSWOC++ 1.5.14
Solid Wall of C++
Loading...
Searching...
No Matches
swoc::IP6Net Class Reference

IPv6 network. More...

#include <IPRange.h>

Collaboration diagram for swoc::IP6Net:
Collaboration graph

Public Member Functions

 IP6Net ()=default
 Construct invalid network.
 
 IP6Net (self_type const &that)=default
 Copy constructor.
 
 IP6Net (IP6Addr addr, IPMask mask)
 
 IP6Net (TextView text)
 
bool load (swoc::TextView text)
 
bool empty () const
 
IP6Addr min () const
 
IP6Addr max () const
 
IPMask const & mask () const
 
IP6Range as_range () const
 
self_typeassign (IP6Addr const &addr, IPMask const &mask)
 
self_typeclear ()
 Reset network to invalid state.
 
bool operator== (self_type const &that) const
 Equality.
 
bool operator!= (self_type const &that) const
 Inequality.
 

Protected Attributes

IP6Addr _addr
 Network address (also lower_node).
 
IPMask _mask
 Network mask.
 

Detailed Description

IPv6 network.

Definition at line 786 of file IPRange.h.

Constructor & Destructor Documentation

◆ IP6Net() [1/2]

swoc::IP6Net::IP6Net ( swoc::IP6Addr addr,
swoc::IPMask mask )
inline

Construct from addr and mask.

Parameters
addrAn address in the network.
maskThe 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 2164 of file IPRange.h.

◆ IP6Net() [2/2]

swoc::IP6Net::IP6Net ( TextView text)
inline

Construct from text.

Parameters
textNetwork description.

The format must be "addr/mask" where "addr" is a valid address and mask is either a single number for the mask width (CIDR) or a mask in address notation.

Definition at line 810 of file IPRange.h.

Member Function Documentation

◆ as_range()

IP6Range swoc::IP6Net::as_range ( ) const
inline
Returns
A range that exactly covers the network.

Definition at line 2187 of file IPRange.h.

◆ assign()

IP6Net::self_type & swoc::IP6Net::assign ( IP6Addr const & addr,
IPMask const & mask )
inline

Assign an addr and mask to this.

Parameters
addrNetwork addres.
maskNetwork mask.
Returns
this.

Definition at line 2202 of file IPRange.h.

◆ clear()

self_type & swoc::IP6Net::clear ( )
inline

Reset network to invalid state.

Definition at line 844 of file IPRange.h.

◆ empty()

bool swoc::IP6Net::empty ( ) const
inline
Returns
true if the network contains no addresses (is invalid).

Definition at line 2172 of file IPRange.h.

◆ load()

bool swoc::IP6Net::load ( swoc::TextView text)

Parse network as text.

Parameters
textString describing the network in CIDR format.
Returns
true if a valid string, false if not.

Definition at line 874 of file swoc_ip.cc.

◆ mask()

IPMask const & swoc::IP6Net::mask ( ) const
inline
Returns
The mask for the network.

Definition at line 2167 of file IPRange.h.

◆ max()

IP6Addr swoc::IP6Net::max ( ) const
inline
Returns
Largest address in the network.

Definition at line 2182 of file IPRange.h.

◆ min()

IP6Addr swoc::IP6Net::min ( ) const
inline
Returns
Network address - smallest address in the network.

Definition at line 2177 of file IPRange.h.

◆ operator!=()

bool swoc::IP6Net::operator!= ( self_type const & that) const
inline

Inequality.

Definition at line 2197 of file IPRange.h.

◆ operator==()

bool swoc::IP6Net::operator== ( self_type const & that) const
inline

Equality.

Definition at line 2192 of file IPRange.h.

Member Data Documentation

◆ _addr

IP6Addr swoc::IP6Net::_addr
protected

Network address (also lower_node).

Definition at line 856 of file IPRange.h.

◆ _mask

IPMask swoc::IP6Net::_mask
protected

Network mask.

Definition at line 857 of file IPRange.h.


The documentation for this class was generated from the following files: