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

Inclusive range of IPv6 addresses. More...

#include <IPRange.h>

Inheritance diagram for swoc::IP6Range:
Inheritance graph
Collaboration diagram for swoc::IP6Range:
Collaboration graph

Classes

class  NetSource
 

Public Member Functions

 IP6Range (super_type const &r)
 
 IP6Range (string_view const &text)
 
self_typeassign (IP6Addr const &addr, IPMask const &mask)
 < Import super class constructors.
 
bool load (string_view text)
 < Import assign methods.
 
IPMask network_mask () const
 
sa_family_t family () const
 
NetSource networks () const
 
self_typeassign (metric_type const &min, metric_type const &max)
 
self_typeassign (metric_type const &value)
 
- Public Member Functions inherited from swoc::DiscreteRange< IP6Addr >
constexpr DiscreteRange ()
 
constexpr DiscreteRange (IP6Addr const &value)
 
constexpr DiscreteRange (IP6Addr const &min, IP6Addr const &max)
 
bool empty () const
 
self_typeassign (metric_type const &min, metric_type const &max)
 
self_typeassign (metric_type const &value)
 
self_typeassign_min (metric_type const &min)
 
self_typeassign_max (metric_type const &max)
 
self_typeclip_max ()
 
metric_type const & min () const
 
metric_type const & max () const
 
bool operator== (self_type const &that) const
 Equality.
 
bool operator!= (self_type const &that) const
 Inequality.
 
bool contains (metric_type const &value) const
 
bool has_intersection_with (self_type const &that) const
 
self_type intersection (self_type const &that) const
 
bool is_adjacent_to (self_type const &that) const
 
bool is_left_adjacent_to (self_type const &that) const
 
bool has_union (self_type const &that) const
 
bool is_superset_of (self_type const &that) const
 
bool is_subset_of (self_type const &that) const
 
bool is_strict_superset_of (self_type const &that) const
 
bool is_strict_subset_of (self_type const &that) const
 
Relation relationship (self_type const &that) const
 
EdgeRelation left_edge_relationship (self_type const &that) const
 
self_type hull (self_type const &that) const
 
bool is_singleton () const
 Check if the interval is exactly one element.
 
bool operator! () const
 
 operator bool () const
 
bool is_maximal () const
 
self_typeoperator&= (self_type const &that)
 
self_typeoperator|= (self_type const &that)
 
self_typeclear ()
 Make the range empty.
 
constexpr DiscreteRange ()
 
constexpr DiscreteRange (IP6Addr const &value)
 
constexpr DiscreteRange (IP6Addr const &min, IP6Addr const &max)
 
bool empty () const
 
self_typeassign (metric_type const &min, metric_type const &max)
 
self_typeassign (metric_type const &value)
 
self_typeassign_min (metric_type const &min)
 
self_typeassign_max (metric_type const &max)
 
self_typeclip_max ()
 
metric_type const & min () const
 
metric_type const & max () const
 
bool operator== (self_type const &that) const
 Equality.
 
bool operator!= (self_type const &that) const
 Inequality.
 
bool contains (metric_type const &value) const
 
bool has_intersection_with (self_type const &that) const
 
self_type intersection (self_type const &that) const
 
bool is_adjacent_to (self_type const &that) const
 
bool is_left_adjacent_to (self_type const &that) const
 
bool has_union (self_type const &that) const
 
bool is_superset_of (self_type const &that) const
 
bool is_subset_of (self_type const &that) const
 
bool is_strict_superset_of (self_type const &that) const
 
bool is_strict_subset_of (self_type const &that) const
 
Relation relationship (self_type const &that) const
 
EdgeRelation left_edge_relationship (self_type const &that) const
 
self_type hull (self_type const &that) const
 
bool is_singleton () const
 Check if the interval is exactly one element.
 
bool operator! () const
 
 operator bool () const
 
bool is_maximal () const
 
self_typeoperator&= (self_type const &that)
 
self_typeoperator|= (self_type const &that)
 
self_typeclear ()
 Make the range empty.
 

Additional Inherited Members

- Public Types inherited from swoc::DiscreteRange< IP6Addr >
using metric_type
 Export metric type.
 
using Relation
 Import type for convenience.
 
using EdgeRelation
 Import type for convenience.
 
- Protected Attributes inherited from swoc::DiscreteRange< IP6Addr >
IP6Addr _min
 The minimum value in the interval.
 
IP6Addr _max
 the maximum value in the interval
 
IP6Addr _min
 The minimum value in the interval.
 
IP6Addr _max
 the maximum value in the interval
 

Detailed Description

Inclusive range of IPv6 addresses.

Definition at line 179 of file IPRange.h.

Constructor & Destructor Documentation

◆ IP6Range() [1/2]

swoc::IP6Range::IP6Range ( super_type const & r)
inline

Construct from super type.

Definition at line 186 of file IPRange.h.

◆ IP6Range() [2/2]

swoc::IP6Range::IP6Range ( string_view const & text)
inline

Construct range from text.

Parameters
textRange text.
See also
IP6Range::load

This results in an empty range if text is not a valid string. If this should be checked, use load.

Definition at line 1901 of file IPRange.h.

Member Function Documentation

◆ assign() [1/3]

IP6Range & swoc::IP6Range::assign ( IP6Addr const & addr,
IPMask const & mask )

< Import super class constructors.

Set this range.

Parameters
addrMinimum address.
maskCIDR mask to compute maximum adddress from addr.
Returns
this

Definition at line 1047 of file swoc_ip.cc.

◆ assign() [2/3]

self_type & swoc::DiscreteRange< IP6Addr >::assign ( metric_type const & min,
metric_type const & max )

Update the range.

Parameters
minNew minimum value.
maxNew maximum value.
Returns
this.

◆ assign() [3/3]

self_type & swoc::DiscreteRange< IP6Addr >::assign ( metric_type const & value)

Update the range.

Parameters
valueThe new minimum and maximum value.
Returns
this.

The range will contain the single value value.

◆ family()

sa_family_t swoc::IP6Range::family ( ) const
inline
Returns
The range family.

Definition at line 231 of file IPRange.h.

◆ load()

bool swoc::IP6Range::load ( std::string_view text)

< Import assign methods.

Assign to this range from text.

Parameters
textRange text.

The text must be in one of three formats.

  • A dashed range, "addr1-addr2"
  • A singleton, "addr". This is treated as if it were "addr-addr", a range of size 1.
  • CIDR notation, "addr/cidr" where "cidr" is a number from 0 to the number of bits in the address.

Definition at line 1075 of file swoc_ip.cc.

◆ network_mask()

IPMask swoc::IP6Range::network_mask ( ) const

Compute the mask for this as a network.

Returns
If this is a network, the mask for that network. Otherwise an invalid mask.
See also
IPMask::is_valid

Definition at line 1192 of file swoc_ip.cc.

◆ networks()

auto swoc::IP6Range::networks ( ) const
inline

Generate a list of networks covering this range.

Returns
A network generator.

The returned object can be used as an iterator, or as a container to iterating over the unique minimal set of networks that cover this range.

void (IP6Range const& range) {
for ( auto const& net : range ) {
net.addr(); // network address.
net.mask(); // network mask;
}
}
IP6Range(super_type const &r)
Definition IPRange.h:186

Definition at line 1906 of file IPRange.h.


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