Configurable any-of ACL. Each ACL line is a disjuction of ACLs. More...

#include <AnyOf.h>

Inheritance diagram for Acl::AnyOf:
Collaboration diagram for Acl::AnyOf:

Public Types

using Pointer = RefCount< Node >
 

Public Member Functions

const char * typeString () const override
 
void parse () override
 parses node representation in squid.conf; dies on failures More...
 
virtual bool bannedAction (ACLChecklist *, Nodes::const_iterator) const
 
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...
 
void prepareForUse () override
 
bool empty () const override
 
SBufList dump () const override
 
size_t lineParse ()
 
void add (Acl::Node *node)
 appends the node to the collection and takes control over it More...
 
void * operator new (size_t)
 
void operator delete (void *)
 
void context (const SBuf &aName, const char *configuration)
 sets user-specified ACL name and squid.conf context More...
 
bool matches (ACLChecklist *checklist) const
 
void parseFlags ()
 configures Acl::Node 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)
 
void dumpWhole (const char *directiveName, std::ostream &)
 

Static Public Member Functions

static void ParseNamedAcl (ConfigParser &, NamedAcls *&)
 parses acl directive parts that follow directive name (i.e. "acl") More...
 
static void Initialize ()
 
static Acl::NodeFindByName (const SBuf &)
 A configured ACL with a given name or nil. More...
 

Public Attributes

SBuf name
 
char * cfgline = nullptr
 

Protected Member Functions

virtual int doMatch (ACLChecklist *checklist, Nodes::const_iterator start) const =0
 
int match (ACLChecklist *checklist) override
 Matches the actual data in checklist against this Acl::Node. More...
 

Protected Attributes

Nodes::const_iterator lastMatch_
 
Nodes nodes
 children of this intermediate node More...
 

Private Member Functions

 MEMPROXY_CLASS (AnyOf)
 
int doMatch (ACLChecklist *checklist, Nodes::const_iterator start) const override
 
virtual bool requiresAle () const
 whether our (i.e. shallow) match() requires checklist to have a AccessLogEntry More...
 
virtual bool requiresRequest () const
 whether our (i.e. shallow) match() requires checklist to have a request More...
 
virtual bool requiresReply () const
 whether our (i.e. shallow) match() requires checklist to have a reply More...
 
virtual const Acl::Optionsoptions ()
 
virtual const Acl::OptionslineOptions ()
 

Static Private Member Functions

static void ParseNamed (ConfigParser &, NamedAcls &, const SBuf &name)
 parses acl directive parts that follow aclname More...
 

Detailed Description

Definition at line 18 of file AnyOf.h.

Member Typedef Documentation

◆ Pointer

using Acl::Node::Pointer = RefCount<Node>
inherited

Definition at line 29 of file Node.h.

Member Function Documentation

◆ add()

void Acl::InnerNode::add ( Acl::Node node)
inherited

Definition at line 36 of file InnerNode.cc.

References assert.

Referenced by Acl::Tree::add(), Acl::NotNode::NotNode(), Acl::AllOf::parse(), and ParseAclWithAction().

◆ bannedAction()

bool Acl::OrNode::bannedAction ( ACLChecklist ,
Nodes::const_iterator   
) const
virtualinherited

whether the given rule should be excluded from matching tests based on its action

Definition at line 99 of file BoolOps.cc.

◆ cacheMatchAcl()

◆ childrenCount()

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

Definition at line 29 of file InnerNode.h.

References Acl::InnerNode::nodes.

Referenced by aclParseAccessLine(), and Acl::AllOf::parse().

◆ context()

void Acl::Node::context ( const SBuf aName,
const char *  configuration 
)
inherited

Definition at line 220 of file Acl.cc.

References safe_free, and xstrdup.

Referenced by aclParseAccessLine(), aclParseAclList(), Acl::AllOf::parse(), and ParseAclWithAction().

◆ doMatch() [1/2]

virtual int Acl::InnerNode::doMatch ( ACLChecklist checklist,
Nodes::const_iterator  start 
) const
protectedpure virtualinherited

checks whether the nodes match, starting with the given one kids determine what a match means for their type of intermediate nodes

Implemented in Acl::AndNode, Acl::NotNode, and Acl::AllOf.

◆ doMatch() [2/2]

int Acl::OrNode::doMatch ( ACLChecklist checklist,
Nodes::const_iterator  start 
) const
overrideprivateinherited

Definition at line 105 of file BoolOps.cc.

References ACLChecklist::keepMatching(), and ACLChecklist::matchChild().

◆ dump()

SBufList Acl::InnerNode::dump ( ) const
overridevirtualinherited

Implements Acl::Node.

Definition at line 81 of file InnerNode.cc.

◆ dumpWhole()

void Acl::Node::dumpWhole ( const char *  directiveName,
std::ostream &  os 
)
inherited

Prints aggregated "acl" (or similar) directive configuration, including the given directive name, ACL name, ACL type, and ACL parameters. The printed parameters are collected from all same-name "acl" directives.

Definition at line 371 of file Acl.cc.

References asList().

◆ empty()

bool Acl::InnerNode::empty ( ) const
overridevirtualinherited

Implements Acl::Node.

Definition at line 30 of file InnerNode.cc.

Referenced by aclParseAccessLine().

◆ FindByName()

Acl::Node * Acl::Node::FindByName ( const SBuf name)
staticinherited

◆ Initialize()

void Acl::Node::Initialize ( )
staticinherited

Definition at line 471 of file Acl.cc.

References Config, debugs, and SquidConfig::namedAcls.

Referenced by serverConnectionsOpen().

◆ isProxyAuth()

bool Acl::Node::isProxyAuth ( ) const
virtualinherited

Reimplemented in ACLExternal, and ACLProxyAuth.

Definition at line 354 of file Acl.cc.

◆ lineOptions()

◆ lineParse()

size_t Acl::InnerNode::lineParse ( )
inherited

parses a [ [!]acl1 [!]acl2... ] sequence, appending to nodes

Returns
the number of parsed ACL names

Definition at line 44 of file InnerNode.cc.

References config_input_line, DBG_CRITICAL, debugs, Acl::Node::FindByName(), self_destruct(), ConfigParser::strtokFile(), and xstrdup.

Referenced by aclParseAccessLine(), aclParseAclList(), Acl::AllOf::parse(), and ParseAclWithAction().

◆ match()

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

Implements Acl::Node.

Definition at line 90 of file InnerNode.cc.

◆ matches()

bool Acl::Node::matches ( ACLChecklist checklist) const
inherited

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

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

Definition at line 189 of file Acl.cc.

References ACLChecklist::asyncInProgress(), DBG_IMPORTANT, debugs, ACLChecklist::hasAle(), ACLChecklist::hasReply(), ACLChecklist::hasRequest(), ACLChecklist::setLastCheckedName(), and ACLChecklist::verifyAle().

Referenced by ACLChecklist::matchAndFinish().

◆ matchForCache()

int Acl::Node::matchForCache ( ACLChecklist checklist)
virtualinherited

Reimplemented in ACLProxyAuth.

Definition at line 383 of file Acl.cc.

References fatal().

◆ MEMPROXY_CLASS()

Acl::AnyOf::MEMPROXY_CLASS ( AnyOf  )
private

◆ operator delete()

void Acl::Node::operator delete ( void *  )
inherited

Definition at line 153 of file Acl.cc.

References fatal().

◆ operator new()

void * Acl::Node::operator new ( size_t  )
inherited

Definition at line 147 of file Acl.cc.

References fatal().

◆ options()

virtual const Acl::Options& Acl::Node::options ( )
inlineprivatevirtualinherited
Returns
(linked) 'global' Options supported by this Acl::Node

Reimplemented in Acl::ServerNameCheck, Acl::DestinationDomainCheck, Acl::AnnotationCheck, ACLMaxUserIP, and ACLDestinationIP.

Definition at line 98 of file Node.h.

References Acl::NoOptions().

◆ parse()

void Acl::AnyOf::parse ( )
overridevirtual

Implements Acl::Node.

Definition at line 22 of file AnyOf.cc.

◆ parseFlags()

void Acl::Node::parseFlags ( )
inherited

Definition at line 360 of file Acl.cc.

References Acl::ParseFlags().

◆ ParseNamed()

void Acl::Node::ParseNamed ( ConfigParser parser,
NamedAcls namedAcls,
const SBuf name 
)
staticprivateinherited

◆ ParseNamedAcl()

void Acl::Node::ParseNamedAcl ( ConfigParser parser,
NamedAcls *&  namedAcls 
)
staticinherited

◆ prepareForUse()

void Acl::InnerNode::prepareForUse ( )
overridevirtualinherited

Reimplemented from Acl::Node.

Definition at line 23 of file InnerNode.cc.

References Acl::InnerNode::nodes.

◆ requiresAle()

bool Acl::Node::requiresAle ( ) const
privatevirtualinherited

Reimplemented in ACLExternal.

Definition at line 443 of file Acl.cc.

◆ requiresReply()

bool Acl::Node::requiresReply ( ) const
privatevirtualinherited

Reimplemented in ACLHTTPStatus, Acl::ReplyHeaderCheck< header >, and Acl::HttpRepHeaderCheck.

Definition at line 449 of file Acl.cc.

◆ requiresRequest()

◆ resumeMatchingAt()

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

Definition at line 96 of file InnerNode.cc.

References ACLChecklist::asyncInProgress(), and debugs.

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

◆ typeString()

const char * Acl::AnyOf::typeString ( ) const
overridevirtual

Implements Acl::Node.

Definition at line 13 of file AnyOf.cc.

◆ valid()

bool Acl::Node::valid ( ) const
virtualinherited

Reimplemented in ACLExternal, ACLProxyAuth, Acl::ServerNameCheck, ACLMaxUserIP, ACLMaxConnection, and ACLRandom.

Definition at line 183 of file Acl.cc.

Member Data Documentation

◆ cfgline

char* Acl::Node::cfgline = nullptr
inherited

Definition at line 83 of file Node.h.

◆ lastMatch_

Nodes::const_iterator Acl::OrNode::lastMatch_
mutableprotectedinherited

Definition at line 72 of file BoolOps.h.

Referenced by Acl::Tree::winningAction().

◆ name

SBuf Acl::Node::name
inherited

Either aclname parameter from the explicitly configured acl directive or a label generated for an internal ACL tree node. All Node objects corresponding to one Squid configuration have unique names. See also: context() and FindByName().

Definition at line 81 of file Node.h.

Referenced by aclDestroyAccessList(), Acl::AnnotateClientCheck::match(), Acl::AnnotateTransactionCheck::match(), ACLRandom::match(), Acl::SourceDomainCheck::match(), ACLDestinationIP::match(), Acl::NotNode::NotNode(), ACLExternal::parse(), and ACLMaxConnection::prepareForUse().

◆ nodes

Nodes Acl::InnerNode::nodes
protectedinherited

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

 

Introduction

Documentation

Support

Miscellaneous