16namespace swoc {
inline namespace SWOC_VERSION_NS {
18using std::string_view;
40 IP4Range(super_type
const &r) : super_type(r) {}
54 using super_type::super_type;
64 using super_type::assign;
75 bool load(string_view text);
83 IPMask network_mask()
const;
109 NetSource networks()
const;
173 void search_narrower();
198 using super_type::super_type;
208 using super_type::assign;
219 bool load(string_view text);
227 IPMask network_mask()
const;
253 NetSource networks()
const;
314 void search_narrower();
316 bool is_valid(
IPMask const &mask);
386 IPRange(string_view
const &text);
423 bool is(sa_family_t family)
const;
433 bool load(std::string_view
const &text);
440 bool contains(
IPAddr const& addr)
const;
447 bool contains(
IP6Addr const& addr)
const;
454 bool contains(
IP4Addr const& addr)
const;
475 sa_family_t family()
const;
483 IPMask network_mask()
const;
504 NetSource networks()
const;
520 } _range{std::monostate{}};
647 bool is(sa_family_t family)
const;
705 storage_type
_raw = {std::monostate()};
746 IPMask const &mask()
const;
821 IPMask const &mask()
const;
856 using self_type =
IPNet;
859 IPNet(self_type
const &that) =
default;
909 return _addr.is_ip4();
915 return _addr.is_ip6();
921 return _addr.family();
936 self_type &assign(
IPAddr const &addr,
IPMask const &mask);
971template <
typename PAYLOAD>
struct ip_space_const_value_type {
972 using self_type = ip_space_const_value_type;
977 ip_space_const_value_type() =
default;
1003 self_type &
assign(self_type
const &that);
1006 std::tuple<IPRangeView, PAYLOAD &>
1012 bool operator==(std::tuple<swoc::IPRange, PAYLOAD>
const &t)
const;
1047 using super_type = ip_space_const_value_type<PAYLOAD>;
1056template <
typename PAYLOAD>
1064template <
typename PAYLOAD>
1072template <
typename PAYLOAD>
1080template <
typename PAYLOAD>
1088template <
typename PAYLOAD>
1091 return _rv == std::get<0>(t) && std::get<1>(t) == *
_payload;
1192 template <
typename F,
typename U = PAYLOAD> self_type &
blend(
IPRange const &range, U
const &color, F &&blender);
1194 template <
typename F,
typename U = PAYLOAD> self_type &
blend(
IP4Range const &range, U
const &color, F &&blender);
1196 template <
typename F,
typename U = PAYLOAD> self_type &
blend(
IP6Range const &range, U
const &color, F &&blender);
1240 friend class IPSpace;
1246 using pointer = value_type
const *;
1247 using reference = value_type
const &;
1248 using difference_type = int;
1311 const_iterator(
typename IP4Space::const_iterator
const &iter4,
typename IP6Space::const_iterator
const &iter6);
1338 friend class IPSpace;
1341 using super_type::super_type;
1468 const_iterator
begin(sa_family_t family)
const;
1471 const_iterator
end(sa_family_t family)
const;
1478 std::pair<iterator, iterator>
1481 return {this->iterator_at(
begin), this->iterator_at(
end)};
1489 std::pair<iterator, iterator>
1492 return {this->iterator_at(
begin), this->iterator_at(
end)};
1500 std::pair<iterator, iterator>
1507 return {this->
end(), this->
end()};
1515 iterator_at(
typename IP4Space::const_iterator
const &spot) {
1516 return iterator(spot,
_ip6.begin());
1519 iterator_at(
typename IP6Space::const_iterator
const &spot) {
1520 return iterator(_ip4.
end(), spot);
1523 friend class IPRangeSet;
1540 static inline constexpr struct Mark {
1541 using self_type = Mark;
1584 size_t count()
const;
1594 using super_type = Space::const_iterator;
1595 friend class IPRangeSet;
1600 using iterator_category = std::bidirectional_iterator_tag;
1601 using pointer = value_type
const *;
1602 using reference = value_type
const &;
1603 using difference_type = int;
1643 bool operator==(self_type
const &that)
const;
1646 bool operator!=(self_type
const &that)
const;
1702IPRangeSet::empty()
const {
1703 return _addrs.empty();
1712IPRangeSet::Mark::operator==(IPRangeSet::Mark::self_type
const &) {
1717IPRangeSet::Mark::operator!=(IPRangeSet::Mark::self_type
const &) {
1721template <
typename PAYLOAD>
1723 typename IP6Space::const_iterator
const &iter6)
1727 _value.assign(this->r4(), _iter_4->payload());
1728 }
else if (
_iter_6.has_next()) {
1729 _value.assign(this->r6(), _iter_6->payload());
1733template <
typename PAYLOAD>
1738 _value.assign(that._value);
1742template <
typename PAYLOAD>
1745 bool incr_p =
false;
1756 if (incr_p || (++
_iter_6).has_next()) {
1765template <
typename PAYLOAD>
1768 self_type zret(*
this);
1773template <
typename PAYLOAD>
1790template <
typename PAYLOAD>
1793 self_type zret(*
this);
1798template <
typename PAYLOAD>
1804template <
typename PAYLOAD>
1818template <
typename PAYLOAD>
1824template <
typename PAYLOAD>
1830template <
typename PAYLOAD>
1837template <
typename PAYLOAD>
1839IPSpace<PAYLOAD>::iterator::value() const ->
value_type & {
1840 return reinterpret_cast<value_type &
>(
const_cast<self_type *
>(
this)->_value);
1843template <
typename PAYLOAD>
1846 return &(this->value());
1849template <
typename PAYLOAD>
1852 return this->value();
1855template <
typename PAYLOAD>
1862template <
typename PAYLOAD>
1865 self_type zret{*
this};
1870template <
typename PAYLOAD>
1877template <
typename PAYLOAD>
1880 self_type zret{*
this};
1908 _range._ip4 = range;
1912 _range._ip6 = range;
1928 if (AF_INET == view.
_family) {
1929 *
this = *view.
_raw._4;
1930 }
else if (AF_INET6 == view.
_family) {
1931 *
this = *view.
_raw._6;
1937 _range._ip4.assign(
min,
max);
1944 _range._ip6.assign(
min,
max);
1951 if (AF_INET == rv._family) {
1952 *
this = *rv._raw._4;
1953 }
else if (AF_INET6 == rv._family) {
1954 *
this = *rv._raw._6;
1977 return !(*
this == that);
2008IPRangeView::empty()
const {
2011 }
else if (AF_INET ==
_family) {
2038 return _range._ip4.contains(addr.
ip4());
2039 }
else if (this->
is_ip6()) {
2040 return _range._ip6.contains(addr.
ip6());
2046 return this->
is_ip6() && _range._ip6.contains(addr);
2050 return this->
is_ip4() && _range._ip4.contains(addr);
2084 return !(*
this == that);
2108 return this->
is_ip6() &&
_raw._6->contains(addr);
2112 return this->
is_ip4() &&
_raw._4->contains(addr);
2126 return !
_mask.is_valid();
2141 return {this->
min(), this->
max()};
2154inline IP4Net::self_type &
2170 return !
_mask.is_valid();
2185 return {this->
min(), this->
max()};
2198inline IP6Net::self_type &
2213 return !
_mask.is_valid();
2228 return _mask.width();
2238 return {this->
min(), this->
max()};
2241inline IPNet::self_type &
2260 return lhs.
is_ip4() && lhs.
ip4() == rhs;
2264operator==(IP4Net
const &lhs, IPNet
const &rhs) {
2265 return rhs.is_ip4() && rhs.ip4() == lhs;
2270 return lhs.is_ip6() && lhs.ip6() == rhs;
2275 return rhs.is_ip6() && rhs.ip6() == lhs;
2343 return !(*
this == that);
2372IP6Range::NetSource::is_valid(
IPMask const &mask) {
2373 return ((_range.min() & mask) == _range.min()) && ((_range.min() | mask) <= _range.max());
2383 return !(*
this == that);
2400 }
else if (range.
is_ip6()) {
2410 }
else if (rv.
is_ip6()) {
2430 }
else if (AF_INET6 ==
_family) {
2440 }
else if (AF_INET6 ==
_family) {
2448 return {this->
addr(), this->mask()};
2455 }
else if (AF_INET6 ==
_family) {
2473 }
else if (AF_INET6 ==
_family) {
2475 }
else if (AF_UNSPEC ==
_family) {
2483 return !(*
this == that);
2488template <
typename PAYLOAD>
2491 _ip4.mark_bulk(range_payloads, size, is_sorted);
2495template <
typename PAYLOAD>
2498 _ip6.mark_bulk(range_payloads, size, is_sorted);
2502template <
typename PAYLOAD>
2505 _ip4.mark_bulk(range_payloads, is_sorted);
2509template <
typename PAYLOAD>
2512 _ip6.mark_bulk(range_payloads, is_sorted);
2516template <
typename PAYLOAD>
2519 if (range.is(AF_INET)) {
2520 _ip4.mark(range.ip4(), payload);
2521 }
else if (range.is(AF_INET6)) {
2522 _ip6.mark(range.ip6(), payload);
2527template <
typename PAYLOAD>
2530 if (range.is(AF_INET6)) {
2531 _ip6.fill(range.ip6(), payload);
2532 }
else if (range.is(AF_INET)) {
2533 _ip4.fill(range.ip4(), payload);
2538template <
typename PAYLOAD>
2541 if (range.is(AF_INET)) {
2542 _ip4.erase(range.ip4());
2543 }
else if (range.is(AF_INET6)) {
2544 _ip6.erase(range.ip6());
2549template <
typename PAYLOAD>
2550template <
typename F,
typename U>
2553 if (range.is(AF_INET)) {
2554 _ip4.blend(range.ip4(), color, blender);
2555 }
else if (range.is(AF_INET6)) {
2556 _ip6.blend(range.ip6(), color, blender);
2561template <
typename PAYLOAD>
2562template <
typename F,
typename U>
2565 _ip4.blend(range, color, std::forward<F>(blender));
2569template <
typename PAYLOAD>
2570template <
typename F,
typename U>
2573 _ip6.blend(range, color, std::forward<F>(blender));
2577template <
typename PAYLOAD>
2584template <
typename PAYLOAD>
2590template <
typename PAYLOAD>
2593 return const_cast<self_type *
>(
this)->
begin();
2596template <
typename PAYLOAD>
2602template <
typename PAYLOAD>
2605 return const_cast<self_type *
>(
this)->
end();
2608template <
typename PAYLOAD>
2611 return this->
begin();
2614template <
typename PAYLOAD>
2617 return this->
begin();
2620template <
typename PAYLOAD>
2626template <
typename PAYLOAD>
2629 return const_cast<self_type *
>(
this)->
end_ip4();
2632template <
typename PAYLOAD>
2638template <
typename PAYLOAD>
2641 return const_cast<self_type *
>(
this)->
begin_ip6();
2644template <
typename PAYLOAD>
2650template <
typename PAYLOAD>
2656template <
typename PAYLOAD>
2659 if (addr.is_ip4()) {
2660 return this->
find(addr.ip4());
2661 }
else if (addr.is_ip6()) {
2662 return this->
find(addr.ip6());
2667template <
typename PAYLOAD>
2670 if (addr.is_ip4()) {
2671 return this->
find(addr.ip4());
2672 }
else if (addr.is_ip6()) {
2673 return this->
find(addr.ip6());
2678template <
typename PAYLOAD>
2681 if (
auto spot =
_ip4.find(addr); spot !=
_ip4.end()) {
2682 return {spot,
_ip6.begin()};
2687template <
typename PAYLOAD>
2690 if (
auto spot =
_ip4.find(addr); spot !=
_ip4.end()) {
2691 return {spot,
_ip6.begin()};
2696template <
typename PAYLOAD>
2699 return {
_ip4.end(),
_ip6.find(addr)};
2702template <
typename PAYLOAD>
2708template <
typename PAYLOAD>
2713 }
else if (AF_INET6 ==
family) {
2719template <
typename PAYLOAD>
2724 }
else if (AF_INET6 ==
family) {
2730template <
typename PAYLOAD>
2733 return _ip4.count();
2736template <
typename PAYLOAD>
2739 return _ip6.count();
2742template <
typename PAYLOAD>
2745 return _ip4.count() +
_ip6.count();
2748template <
typename PAYLOAD>
2754template <
typename PAYLOAD>
2757 return _ip4.empty() &&
_ip6.empty();
2774 self_type zret{*
this};
2781 self_type zret{*
this};
2793 return &(
_iter->_rv);
2812template <>
class tuple_size<
swoc::IP4Net> :
public std::integral_constant<size_t, 2> {};
2814template <
size_t IDX>
class tuple_element<IDX, swoc::IP4Net> {
2815 static_assert(
"swoc::IP4Net tuple index out of range");
2818template <>
class tuple_element<0, swoc::IP4Net> {
2820 using type = swoc::IP4Addr;
2823template <>
class tuple_element<1, swoc::IP4Net> {
2825 using type = swoc::IPMask;
2829template <>
class tuple_size<swoc::IP6Net> :
public std::integral_constant<size_t, 2> {};
2831template <
size_t IDX>
class tuple_element<IDX, swoc::IP6Net> {
2832 static_assert(
"swoc::IP6Net tuple index out of range");
2835template <>
class tuple_element<0, swoc::IP6Net> {
2837 using type = swoc::IP6Addr;
2840template <>
class tuple_element<1, swoc::IP6Net> {
2842 using type = swoc::IPMask;
2846template <>
class tuple_size<swoc::IPNet> :
public std::integral_constant<size_t, 2> {};
2848template <
size_t IDX>
class tuple_element<IDX, swoc::IPNet> {
2849 static_assert(
"swoc::IPNet tuple index out of range");
2852template <>
class tuple_element<0, swoc::IPNet> {
2854 using type = swoc::IPAddr;
2857template <>
class tuple_element<1, swoc::IPNet> {
2859 using type = swoc::IPMask;
2864namespace swoc {
inline namespace SWOC_VERSION_NS {
2866template <
size_t IDX>
2867typename std::tuple_element<IDX, IP4Net>::type
2868get(swoc::IP4Net
const &net) {
2869 if constexpr (IDX == 0) {
2871 }
else if constexpr (IDX == 1) {
2876template <
size_t IDX>
2877typename std::tuple_element<IDX, IP6Net>::type
2878get(swoc::IP6Net
const &net) {
2879 if constexpr (IDX == 0) {
2881 }
else if constexpr (IDX == 1) {
2886template <
size_t IDX>
2887typename std::tuple_element<IDX, IPNet>::type
2888get(swoc::IPNet
const &net) {
2889 if constexpr (IDX == 0) {
2891 }
else if constexpr (IDX == 1) {
2904template <
typename P>
class tuple_size<swoc::detail::ip_space_value_type<P>> :
public integral_constant<size_t, 2> {};
2905template <
typename P>
class tuple_size<swoc::detail::ip_space_const_value_type<P>> :
public integral_constant<size_t, 2> {};
2907template <
size_t IDX,
typename P>
class tuple_element<IDX, swoc::detail::ip_space_value_type<P>> {
2908 static_assert(
"swoc::IPSpace::value_type tuple index out of range");
2910template <
size_t IDX,
typename P>
class tuple_element<IDX, swoc::detail::ip_space_const_value_type<P>> {
2911 static_assert(
"swoc::IPSpace::value_type tuple index out of range");
2914template <
typename P>
class tuple_element<0, swoc::detail::ip_space_value_type<P>> {
2916 using type = swoc::IPRangeView
const &;
2919template <
typename P>
class tuple_element<1, swoc::detail::ip_space_value_type<P>> {
2924template <
typename P>
class tuple_element<0, swoc::detail::ip_space_const_value_type<P>> {
2926 using type = swoc::IPRangeView
const &;
2929template <
typename P>
class tuple_element<1, swoc::detail::ip_space_const_value_type<P>> {
2931 using type = P
const &;
2936namespace swoc {
inline namespace SWOC_VERSION_NS {
namespace detail {
2937template <
size_t IDX,
typename P>
2939get(ip_space_const_value_type<P>
const &p) ->
typename std::tuple_element<IDX, ip_space_const_value_type<P>>::type {
2940 if constexpr (IDX == 0) {
2942 }
else if constexpr (IDX == 1) {
2943 return *(p._payload);
2947template <
size_t IDX,
typename P>
2949get(ip_space_value_type<P>
const &p) ->
typename std::tuple_element<IDX, ip_space_value_type<P>>::type {
2950 if constexpr (IDX == 0) {
2952 }
else if constexpr (IDX == 1) {
2953 return *(p._payload);
2959using swoc::detail::get;
2962using swoc::detail::get;
bool operator==(RBNode *n, RBNode::Color c)
T _max
the maximum value in the interval
constexpr DiscreteRange()
T _min
The minimum value in the interval.
static constexpr size_t WIDTH
in_addr_t _addr
Address in host order.
static constexpr sa_family_t AF_value
Address family type.
self_type & clear()
Reset network to invalid state.
self_type & assign(IP4Addr const &addr, IPMask const &mask)
bool load(swoc::TextView text)
IPMask _mask
Network mask.
IP4Range as_range() const
IP4Net(self_type const &that)=default
Copy constructor.
IP4Net()=default
Construct invalid network.
IPMask const & mask() const
IP4Addr _addr
Network address (also lower_node).
bool operator==(self_type const &that) const
Equality.
bool operator!=(self_type const &that) const
Inequality.
IP4Addr _mask
Mask for current network.
NetSource(self_type const &that)=default
Copy constructor.
self_type iterator
This class acts as a container and an iterator.
IPMask::raw_type _cidr
Current CIDR value.
bool empty() const
Return true if there are valid networks, false if not.
self_type & operator++()
Move to next network.
IP4Range range_type
Import base range type.
IP4Addr const & addr() const
iterator const_iterator
All iteration is constant so no distinction between iterators.
bool operator!=(self_type const &that) const
Inequality.
NetSource(range_type const &range)
Construct from range.
static iterator end()
Past last network.
bool operator==(self_type const &that) const
Equality.
iterator begin() const
First network.
self_type * operator->()
Access this as if it were an IP4Net.
bool load(string_view text)
< Import assign methods.
NetSource networks() const
constexpr IP4Range()=default
Default constructor, invalid range.
IP4Range(super_type const &r)
sa_family_t family() const
static constexpr size_t WIDTH
Number of bits in the address.
static constexpr sa_family_t AF_value
Address family type.
IPMask _mask
Network mask.
self_type & assign(IP6Addr const &addr, IPMask const &mask)
IPMask const & mask() const
IP6Net()=default
Construct invalid network.
self_type & clear()
Reset network to invalid state.
bool operator==(self_type const &that) const
Equality.
IP6Range as_range() const
IP6Net(self_type const &that)=default
Copy constructor.
bool operator!=(self_type const &that) const
Inequality.
IP6Addr _addr
Network address (also lower_node).
bool load(swoc::TextView text)
IP6Addr const & addr() const
bool operator!=(self_type const &that) const
Inequality.
self_type operator++(int)
Move to next network.
iterator begin() const
First network.
IPMask _mask
Current CIDR value.
IP6Range _range
Remaining range.
self_type iterator
This class acts as a container and an iterator.
NetSource(range_type const &range)
Construct from range.
iterator const_iterator
All iteration is constant so no distinction between iterators.
NetSource(self_type const &that)=default
Copy constructor.
iterator end() const
Past last network.
self_type & operator++()
Move to next network.
bool operator==(self_type const &that) const
Equality.
self_type * operator->()
Access this as if it were an IP6Net.
IP6Range range_type
Import base range type.
Inclusive range of IPv6 addresses.
sa_family_t family() const
bool load(string_view text)
< Import assign methods.
IP6Range(super_type const &r)
NetSource networks() const
IP6Addr const & ip6() const
IP4Addr const & ip4() const
sa_family_t family() const
uint8_t raw_type
Storage for mask width.
IPNet(self_type const &that)=default
Copy constructor.
IPMask::raw_type width() const
bool operator==(self_type const &that) const
Equality.
self_type & assign(IPAddr const &addr, IPMask const &mask)
IPAddr _addr
Address and family.
IPNet()=default
Construct invalid network.
bool load(swoc::TextView text)
IPMask const & mask() const
self_type & clear()
Reset network to invalid state.
IPMask _mask
Network mask.
bool operator!=(self_type const &that) const
Inequality.
sa_family_t family() const
Address family of network.
Bidirectional constant iterator for iteration over ranges.
const_iterator()=default
Default constructor.
super_type _iter
Underlying iterator.
bool operator!=(self_type const &that) const
Inequality.
self_type & operator=(self_type const &that)=default
Assignment.
reference operator*() const
pointer operator->() const
const_iterator(self_type const &that)=default
Copy constructor.
IPRange _r
Some less temporary storage for dereferences.
bool operator==(self_type const &that) const
Equality.
IPRangeSet()=default
Default construct empty set.
self_type & fill(swoc::IPRange const &r)
void clear()
Remove all addresses in the set.
self_type & mark(swoc::IPRange const &r)
self_type & erase(swoc::IPRange const &r)
const_iterator begin() const
Space _addrs
The address set.
const_iterator end() const
bool contains(swoc::IPAddr const &addr) const
bool operator==(IPRange const &r) const
Compare to a range.
IPRange::NetSource networks() const
bool contains(IPAddr const &addr) const
IP6Range const & ip6() const
storage_type _raw
Storage for the view pointer.
bool is(sa_family_t family) const
IP4Range const & ip4() const
bool operator!=(self_type const &that) const
Inequality.
self_type & assign(IP4Range const &r)
Update the view.
sa_family_t _family
Range address family.
IPRangeView()=default
Default constructor - invalid view.
self_type & clear()
Reset to invalid view.
iterator end() const
Past last network.
self_type * operator->()
Access this as if it were an IP6Net.
bool operator==(self_type const &that) const
Equality.
std::monostate _nil
Default value, no addresses.
NetSource(self_type const &that)=default
Copy constructor.
self_type iterator
This class acts as a container and an iterator.
sa_family_t _family
Mark for union content.
iterator begin() const
First network.
bool operator!=(self_type const &that) const
Inequality.
IP4Range::NetSource _ip4
IPv4 addresses.
self_type & operator++()
Move to next network.
IPRange range_type
Import base range type.
iterator const_iterator
All iteration is constant so no distinction between iterators.
self_type operator++(int)
Move to next network.
IP6Range::NetSource _ip6
IPv6 addresses.
NetSource(range_type const &range)
Construct from range.
std::monostate _nil
Make constructor easier to implement.
IPRange(IP6Addr const &addr)
bool operator!=(self_type const &that) const
Inequality.
bool load(std::string_view const &text)
IP4Range const & ip4() const
sa_family_t family() const
NetSource networks() const
IPRange(IPAddr const &addr)
bool is(sa_family_t family) const
bool contains(IPAddr const &addr) const
self_type & operator=(IPRangeView const &rv)
Assign from view.
self_type & assign(IP4Addr const &min, IP4Addr const &max)
sa_family_t _family
Family of _range.
self_type & clear()
Make the range empty / invalid.
IP6Range const & ip6() const
IPRange()=default
Default constructor - construct invalid range.
std::bidirectional_iterator_tag iterator_category
Import for API compliance.
const_iterator(self_type const &that)=default
Copy constructor.
bool operator==(self_type const &that) const
IP6Space::iterator _iter_6
const_iterator()=default
Default constructor.
reference operator*() const
pointer operator->() const
self_type & operator=(self_type const &that)
bool operator!=(self_type const &that) const
IP4Space::iterator _iter_4
IPv4 sub-space iterator.
value_type _value
Current value.
iterator()=default
Default constructor.
detail::ip_space_value_type< PAYLOAD > value_type
Value type of iteration.
iterator(self_type const &that)=default
Copy constructor.
reference operator*() const
iterator(const_iterator const &that)
self_type & operator=(self_type const &that)
pointer operator->() const
iterator find(IP6Addr const &addr)
const_iterator end(sa_family_t family) const
const_iterator end_ip4() const
const_iterator begin_ip4() const
self_type & mark(IPRange const &range, PAYLOAD const &payload)
const_iterator begin_ip6() const
const_iterator find(IP6Addr const &addr) const
iterator find(IPAddr const &addr)
self_type & fill(IPRange const &range, PAYLOAD const &payload)
const_iterator find(IP4Addr const &addr) const
std::pair< iterator, iterator > intersection(IP6Range const &r)
self_type & mark_bulk(std::vector< std::pair< DiscreteRange< IP6Addr >, PAYLOAD > > &range_payloads, bool is_sorted=false)
vector-based interface for the previous function.
void clear()
Remove all ranges.
iterator find(IP4Addr const &addr)
const_iterator begin(sa_family_t family) const
detail::ip_space_value_type< PAYLOAD > value_type
Iterator value, a range and payload.
const_iterator begin() const
self_type & blend(IPRange const &range, U const &color, F &&blender)
std::pair< iterator, iterator > intersection(IPRange const &r)
const_iterator end() const
self_type & mark_bulk(std::pair< DiscreteRange< IP6Addr >, PAYLOAD > *range_payloads, size_t size, bool is_sorted=false)
std::pair< iterator, iterator > intersection(IP4Range const &r)
IPSpace()=default
Construct an empty space.
const_iterator end_ip6() const
size_t count(sa_family_t f) const
self_type & mark_bulk(std::vector< std::pair< DiscreteRange< IP4Addr >, PAYLOAD > > &range_payloads, bool is_sorted=false)
vector-based interface for the previous function.
const_iterator find(IPAddr const &addr) const
self_type & mark_bulk(std::pair< DiscreteRange< IP4Addr >, PAYLOAD > *range_payloads, size_t size, bool is_sorted=false)
self_type & erase(IPRange const &range)
For template deduction guides.
bool operator==(IPAddr const &lhs, sockaddr const *sa)
Equality.
bool operator!=(IP4Addr const &lhs, IP4Addr const &rhs)
std::tuple< IPRangeView, PAYLOAD & > tuple() const
Support assignemnt to std::tie.
bool operator==(std::tuple< swoc::IPRange, PAYLOAD > const &t) const
Equality against an equivalent tuple.
PAYLOAD const & payload() const
IPRangeView _rv
View to the current range.
self_type & clear()
Reset to default constructed state.
self_type & assign(IP4Range const &r, PAYLOAD &payload)
IPRangeView range_view() const
PAYLOAD * _payload
Payload for _range.