#include <Node.h>

Inheritance diagram for Acl::Node:
Collaboration diagram for Acl::Node:

Public Types

using Pointer = RefCount< Node >
 

Public Member Functions

void * operator new (size_t)
 
void operator delete (void *)
 
 Node ()
 
 Node (Node &&)=delete
 
virtual ~Node ()
 
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 void parse ()=0
 parses node representation in squid.conf; dies on failures More...
 
virtual const char * typeString () const =0
 
virtual bool isProxyAuth () const
 
virtual SBufList dump () const =0
 
virtual bool empty () const =0
 
virtual bool valid () const
 
int cacheMatchAcl (dlink_list *cache, ACLChecklist *)
 
virtual int matchForCache (ACLChecklist *checklist)
 
virtual void prepareForUse ()
 
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
 

Private Member Functions

virtual int match (ACLChecklist *checklist)=0
 Matches the actual data in checklist against this Acl::Node. More...
 
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

A configurable condition. A node in the ACL expression tree. Can evaluate itself in FilledChecklist context. Does not change during evaluation.

Definition at line 25 of file Node.h.

Member Typedef Documentation

◆ Pointer

Definition at line 29 of file Node.h.

Constructor & Destructor Documentation

◆ Node() [1/2]

Acl::Node::Node ( )

Definition at line 177 of file Acl.cc.

References debugs.

◆ Node() [2/2]

Acl::Node::Node ( Node &&  )
delete

◆ ~Node()

Acl::Node::~Node ( )
virtual

Definition at line 464 of file Acl.cc.

References debugs, and safe_free.

Member Function Documentation

◆ cacheMatchAcl()

◆ context()

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

Definition at line 220 of file Acl.cc.

References safe_free, and xstrdup.

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

◆ dump()

◆ dumpWhole()

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

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()

◆ FindByName()

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

◆ Initialize()

void Acl::Node::Initialize ( )
static

Definition at line 471 of file Acl.cc.

References Config, debugs, and SquidConfig::namedAcls.

Referenced by serverConnectionsOpen().

◆ isProxyAuth()

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

Reimplemented in ACLExternal, and ACLProxyAuth.

Definition at line 354 of file Acl.cc.

◆ lineOptions()

◆ match()

◆ matches()

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

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)
virtual

Reimplemented in ACLProxyAuth.

Definition at line 383 of file Acl.cc.

References fatal().

◆ operator delete()

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

Definition at line 153 of file Acl.cc.

References fatal().

◆ operator new()

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

Definition at line 147 of file Acl.cc.

References fatal().

◆ options()

virtual const Acl::Options& Acl::Node::options ( )
inlineprivatevirtual
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()

◆ parseFlags()

void Acl::Node::parseFlags ( )

Definition at line 360 of file Acl.cc.

References Acl::ParseFlags().

◆ ParseNamed()

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

◆ ParseNamedAcl()

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

◆ prepareForUse()

◆ requiresAle()

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

Reimplemented in ACLExternal.

Definition at line 443 of file Acl.cc.

◆ requiresReply()

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

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

Definition at line 449 of file Acl.cc.

◆ requiresRequest()

◆ typeString()

◆ valid()

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

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

Definition at line 83 of file Node.h.

◆ name

SBuf Acl::Node::name

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().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors