#include <Tree.h>

Inheritance diagram for Acl::Tree:
Collaboration diagram for Acl::Tree:

Public Member Functions

template<class ActionToStringConverter >
SBufList treeDump (const char *name, ActionToStringConverter converter) const
Answer winningAction () const
 Returns the corresponding action after a successful tree match. More...
Answer lastAction () const
 what action to use if no nodes matched More...
void add (ACL *rule, const Answer &action)
 appends and takes control over the rule with a given action More...
void add (ACL *rule)
 same as InnerNode::add() More...
virtual char const * typeString () const
virtual ACLclone () const
virtual void parse ()
 parses node represenation in squid.conf; dies on failures More...
bool resumeMatchingAt (ACLChecklist *checklist, Acl::Nodes::const_iterator pos) const
 Resumes matching (suspended by an async call) at the given position. More...
Nodes::size_type childrenCount () const
 the number of children nodes More...
virtual void prepareForUse ()
virtual bool empty () const
virtual SBufList dump () const
void lineParse ()
 parses one "acl name type acl1 acl2..." line, appending to nodes More...
void * operator new (size_t)
void operator delete (void *)
void context (const char *name, const char *configuration)
 sets user-specified ACL name and squid.conf context More...
bool matches (ACLChecklist *checklist) const
virtual const Acl::Optionsoptions ()
virtual void parseFlags ()
 configures ACL options, throwing on configuration errors More...
virtual bool isProxyAuth () const
virtual bool valid () const
int cacheMatchAcl (dlink_list *cache, ACLChecklist *)
virtual int matchForCache (ACLChecklist *checklist)
SBufList dumpOptions ()

Static Public Member Functions

static void ParseAclLine (ConfigParser &parser, ACL **head)
static void Initialize ()
static ACLFindByName (const char *name)

Public Attributes

char name [ACL_NAME_SZ]
char * cfgline
bool registered
 added to the global list of ACLs via aclRegister() More...

Protected Types

typedef std::vector< AnswerActions
 if not empty, contains actions corresponding to InnerNode::nodes More...

Protected Member Functions

virtual bool bannedAction (ACLChecklist *, Nodes::const_iterator) const override
 Acl::OrNode API. More...
Answer actionAt (const Nodes::size_type pos) const
 computes action that corresponds to the position of the matched rule More...
virtual int match (ACLChecklist *checklist)
 Matches the actual data in checklist against this ACL. More...

Protected Attributes

Actions actions
Nodes::const_iterator lastMatch_
std::vector< ACL * > nodes
 children nodes of this intermediate node More...

Private Member Functions


Detailed Description

An ORed set of rules at the top of the ACL expression tree, providing two unique properties: cbdata protection and optional rule actions.

Definition at line 20 of file Tree.h.

Member Typedef Documentation

◆ Actions

Definition at line 48 of file Tree.h.

Member Function Documentation

◆ actionAt()

Acl::Answer Acl::Tree::actionAt ( const Nodes::size_type  pos) const

Definition at line 32 of file Tree.cc.

References ACCESS_ALLOWED, actions, assert, and Acl::InnerNode::nodes.

Referenced by winningAction().

◆ add() [1/2]

void Acl::Tree::add ( ACL rule,
const Answer action 

Definition at line 44 of file Tree.cc.

References actions, Acl::InnerNode::add(), assert, and Acl::InnerNode::nodes.

Referenced by aclParseAclList().

◆ add() [2/2]

void Acl::Tree::add ( ACL rule)

Definition at line 53 of file Tree.cc.

References actions, Acl::InnerNode::add(), and assert.

◆ bannedAction()

bool Acl::Tree::bannedAction ( ACLChecklist checklist,
Nodes::const_iterator  node 
) const

Reimplemented from Acl::OrNode.

Definition at line 61 of file Tree.cc.

References actions, assert, ACLChecklist::bannedAction(), and Acl::InnerNode::nodes.

◆ cacheMatchAcl()


Acl::Tree::CBDATA_CLASS ( Tree  )

◆ childrenCount()

Nodes::size_type Acl::InnerNode::childrenCount ( ) const

◆ clone()

ACL * Acl::OrNode::clone ( ) const

Reimplemented in Acl::AnyOf.

Definition at line 116 of file BoolOps.cc.

◆ context()

void ACL::context ( const char *  name,
const char *  configuration 

◆ dump()

SBufList Acl::InnerNode::dump ( ) const

Implements ACL.

Reimplemented in Acl::NotNode, and Acl::AllOf.

Definition at line 78 of file InnerNode.cc.

References i, and Acl::InnerNode::nodes.

Referenced by Acl::InnerNode::childrenCount().

◆ dumpOptions()

SBufList ACL::dumpOptions ( )
approximate options configuration

Definition at line 299 of file Acl.cc.

References SBufStream::buf(), SBuf::isEmpty(), and ACL::options().

Referenced by dump_acl().

◆ empty()

bool Acl::InnerNode::empty ( ) const

◆ FindByName()

ACL * ACL::FindByName ( const char *  name)

◆ Initialize()

void ACL::Initialize ( )

Definition at line 407 of file Acl.cc.

References a, SquidConfig::aclList, Config, debugs, ACL::next, and ACL::prepareForUse().

Referenced by serverConnectionsOpen().

◆ isProxyAuth()

bool ACL::isProxyAuth ( ) const

Reimplemented in ACLExternal, ACLIdent, and ACLProxyAuth.

Definition at line 286 of file Acl.cc.

Referenced by aclIsProxyAuth().

◆ lastAction()

Acl::Answer Acl::Tree::lastAction ( ) const

Definition at line 23 of file Tree.cc.

References ACCESS_DUNNO, and actions.

Referenced by ACLChecklist::calcImplicitAnswer().

◆ lineParse()

◆ match()

int Acl::InnerNode::match ( ACLChecklist checklist)

Implements ACL.

Definition at line 87 of file InnerNode.cc.

References Acl::InnerNode::doMatch(), and Acl::InnerNode::nodes.

Referenced by Acl::InnerNode::childrenCount().

◆ matches()

bool ACL::matches ( ACLChecklist checklist) const

Orchestrates matching checklist against the ACL using match(), after checking preconditions and while providing debugging.

true if and only if there was a successful match. Updates the checklist state on match, async, and failure.

Definition at line 121 of file Acl.cc.

References AclMatchedName, ACLChecklist::asyncInProgress(), DBG_IMPORTANT, debugs, ACLChecklist::hasAle(), ACLChecklist::hasReply(), ACLChecklist::hasRequest(), ACL::match(), ACL::name, PROF_start, PROF_stop, ACL::requiresAle(), ACL::requiresReply(), ACL::requiresRequest(), and ACLChecklist::verifyAle().

Referenced by ACLChecklist::matchAndFinish(), and ACLChecklist::matchChild().

◆ matchForCache()

int ACL::matchForCache ( ACLChecklist checklist)

Reimplemented in ACLProxyAuth.

Definition at line 318 of file Acl.cc.

References fatal().

Referenced by ACL::cacheMatchAcl().

◆ operator delete()

void ACL::operator delete ( void *  )

Definition at line 87 of file Acl.cc.

References fatal().

◆ operator new()

void * ACL::operator new ( size_t  )

Definition at line 80 of file Acl.cc.

References fatal().

◆ options()

virtual const Acl::Options& ACL::options ( )
(linked) Options supported by this ACL

Reimplemented in ACLStrategised< M >, ACLDestinationIP, and ACLMaxUserIP.

Definition at line 63 of file Acl.h.

References Acl::NoOptions(), and parse().

Referenced by ACL::dumpOptions(), and ACL::parseFlags().

◆ parse()

void Acl::OrNode::parse ( )

Implements ACL.

Reimplemented in Acl::AnyOf.

Definition at line 150 of file BoolOps.cc.

References assert.

◆ ParseAclLine()

◆ parseFlags()

void ACL::parseFlags ( )

Reimplemented in ACLIdent, ACLProxyAuth, ACLStrategised< M >, and ACLExtUser.

Definition at line 292 of file Acl.cc.

References Acl::NoFlags(), ACL::options(), and Acl::ParseFlags().

Referenced by ACL::ParseAclLine().

◆ prepareForUse()

void Acl::InnerNode::prepareForUse ( )

Reimplemented from ACL.

Definition at line 22 of file InnerNode.cc.

References Acl::InnerNode::nodes.

Referenced by Acl::InnerNode::childrenCount().

◆ resumeMatchingAt()

bool Acl::InnerNode::resumeMatchingAt ( ACLChecklist checklist,
Acl::Nodes::const_iterator  pos 
) const

◆ treeDump()

template<class ActionToStringConverter >
SBufList Acl::Tree::treeDump ( const char *  name,
ActionToStringConverter  converter 
) const

dumps <name, action, rule, new line> tuples the supplied converter maps action.kind to a string

Definition at line 60 of file Tree.h.

References action(), actions, Acl::InnerNode::nodes, and text.

◆ typeString()

char const * Acl::OrNode::typeString ( ) const

Implements ACL.

Reimplemented in Acl::AnyOf.

Definition at line 110 of file BoolOps.cc.

◆ valid()

bool ACL::valid ( ) const

Reimplemented in ACLExternal, ACLStrategised< M >, ACLProxyAuth, ACLMaxConnection, ACLMaxUserIP, and ACLRandom.

Definition at line 115 of file Acl.cc.

Referenced by ACL::ParseAclLine().

◆ winningAction()

Acl::Answer Acl::Tree::winningAction ( ) const

Definition at line 17 of file Tree.cc.

References actionAt(), Acl::OrNode::lastMatch_, and Acl::InnerNode::nodes.

Referenced by ACLChecklist::matchAndFinish().

Member Data Documentation

◆ actions

Actions Acl::Tree::actions

Definition at line 49 of file Tree.h.

Referenced by actionAt(), add(), bannedAction(), lastAction(), and treeDump().

◆ cfgline

char* ACL::cfgline

◆ lastMatch_

Nodes::const_iterator Acl::OrNode::lastMatch_

Definition at line 75 of file BoolOps.h.

Referenced by winningAction().

◆ name

◆ next

ACL* ACL::next

Definition at line 85 of file Acl.h.

Referenced by dump_acl(), ACL::FindByName(), ACL::Initialize(), and ACL::ParseAclLine().

◆ nodes

◆ registered

bool ACL::registered

Definition at line 86 of file Acl.h.

Referenced by aclDeregister(), aclDestroyAcls(), and aclRegister().

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






Web Site Translations