#include <SplayInserter.h>

Public Types

using Value = DataValue
 

Static Public Member Functions

static void Merge (Splay< Value > &, Value &&)
 

Private Member Functions

int Compare (const Value &a, const Value &b)
 
bool IsSubset (const Value &a, const Value &b)
 
Acl::SplayInserter< char * >::Value MakeCombinedValue (const Value &, const Value &)
 
void DestroyValue (Value v)
 
int Compare (const Value &a, const Value &b)
 
bool IsSubset (const Value &a, const Value &b)
 
Acl::SplayInserter< acl_httpstatus_data * >::Value MakeCombinedValue (const Value &a, const Value &b)
 
int Compare (const Value &a, const Value &b)
 
bool IsSubset (const Value &a, const Value &b)
 
Acl::SplayInserter< acl_ip_data * >::Value MakeCombinedValue (const Value &a, const Value &b)
 

Static Private Member Functions

static int Compare (const Value &a, const Value &b)
 
static bool IsSubset (const Value &a, const Value &b)
 
static Value MakeCombinedValue (const Value &a, const Value &b)
 
static void DestroyValue (Value v)
 A Splay::SPLAYFREE-like function that destroys parsed ACL parameter values. More...
 

Detailed Description

template<class DataValue>
class Acl::SplayInserter< DataValue >

Helps populate a Splay tree with configured ACL parameter values and their duplicate-handling derivatives (each represented by a DataValue object).

Definition at line 22 of file SplayInserter.h.

Member Typedef Documentation

◆ Value

template<class DataValue >
using Acl::SplayInserter< DataValue >::Value = DataValue

Definition at line 25 of file SplayInserter.h.

Member Function Documentation

◆ Compare() [1/4]

int Acl::SplayInserter< acl_httpstatus_data * >::Compare ( const Value a,
const Value b 
)
private

Definition at line 44 of file HttpStatus.cc.

References aclHTTPStatusCompare().

◆ Compare() [2/4]

template<class DataValue >
static int Acl::SplayInserter< DataValue >::Compare ( const Value a,
const Value b 
)
staticprivate

SplayInserter users are expected to specialize all or most of the static methods below. Most of these methods have no generic implementation. A Splay::SPLAYCMP function for comparing parsed ACL parameter values. This function must work correctly with all valid ACL parameter values, including those representing sets or ranges. The order specified by this function must be the same as the order specified by the SPLAYCMP function used later by ACL::match().

Return values
-1when a < b (this function defines what "less" means in Merge() context)
+1when b < a
0all other cases (i.e. when a and b overlap) Here, two values overlap if they are identical, if one contains all values from another, or if one contains at least one value from another.

◆ Compare() [3/4]

int Acl::SplayInserter< char * >::Compare ( const Value a,
const Value b 
)
private

Definition at line 96 of file DomainData.cc.

References matchDomainName().

◆ Compare() [4/4]

int Acl::SplayInserter< acl_ip_data * >::Compare ( const Value a,
const Value b 
)
private

Definition at line 103 of file Ip.cc.

◆ DestroyValue() [1/2]

template<class DataValue >
static void Acl::SplayInserter< DataValue >::DestroyValue ( Value  v)
inlinestaticprivate

Definition at line 61 of file SplayInserter.h.

◆ DestroyValue() [2/2]

void Acl::SplayInserter< char * >::DestroyValue ( Value  v)
private

Definition at line 153 of file DomainData.cc.

References xfree.

◆ IsSubset() [1/4]

bool Acl::SplayInserter< acl_httpstatus_data * >::IsSubset ( const Value a,
const Value b 
)
private

Definition at line 51 of file HttpStatus.cc.

◆ IsSubset() [2/4]

template<class DataValue >
static bool Acl::SplayInserter< DataValue >::IsSubset ( const Value a,
const Value b 
)
staticprivate

whether the set of values matched by a contains the entire set of values matched by b, including cases where a is identical to b \prec The two values overlap: Compare(a, b) == 0

◆ IsSubset() [3/4]

bool Acl::SplayInserter< acl_ip_data * >::IsSubset ( const Value a,
const Value b 
)
private

Definition at line 116 of file Ip.cc.

◆ IsSubset() [4/4]

bool Acl::SplayInserter< char * >::IsSubset ( const Value a,
const Value b 
)
private

Definition at line 120 of file DomainData.cc.

◆ MakeCombinedValue() [1/4]

Acl::SplayInserter< char * >::Value Acl::SplayInserter< char * >::MakeCombinedValue ( const Value ,
const Value  
)
private

Definition at line 145 of file DomainData.cc.

References Assure.

◆ MakeCombinedValue() [2/4]

template<class DataValue >
static Value Acl::SplayInserter< DataValue >::MakeCombinedValue ( const Value a,
const Value b 
)
staticprivate

Creates a new Value that matches all individual values matched by a and all individual values matched by b but no other values. \prec The two values overlap: Compare(a, b) == 0

◆ MakeCombinedValue() [3/4]

Acl::SplayInserter< acl_httpstatus_data * >::Value Acl::SplayInserter< acl_httpstatus_data * >::MakeCombinedValue ( const Value a,
const Value b 
)
private

Definition at line 58 of file HttpStatus.cc.

References max(), and min().

◆ MakeCombinedValue() [4/4]

Acl::SplayInserter< acl_ip_data * >::Value Acl::SplayInserter< acl_ip_data * >::MakeCombinedValue ( const Value a,
const Value b 
)
private

Definition at line 123 of file Ip.cc.

References max(), min(), and Ip::Address::NoAddr().

◆ Merge()

template<class DataValue >
void Acl::SplayInserter< DataValue >::Merge ( Splay< Value > &  storage,
Value &&  newItem 
)
static

If necessary, updates the splay tree to match all individual values that match the given parsed ACL parameter value. If the given value itself is not added to the tree (e.g., because it is a duplicate), it is destroyed using DestroyValue(). Otherwise, the given value will be destroyed later, during subsequent calls to this method or free_acl().

Definition at line 68 of file SplayInserter.h.

References DBG_IMPORTANT, DBG_PARSE_NOTE, debugs, Debug::Extra(), Splay< V >::insert(), and Splay< V >::remove().

Referenced by aclParseHTTPStatusList(), ACLDomainData::parse(), and ACLIP::parse().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors