#include <Tree.h>
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... | |
char const * | typeString () const override |
void | parse () override |
parses node representation 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... | |
void | prepareForUse () override |
bool | empty () const override |
SBufList | dump () const override |
size_t | lineParse () |
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 |
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 ACL * | FindByName (const char *name) |
Public Attributes | |
char | name [ACL_NAME_SZ] |
char * | cfgline |
ACL * | next |
bool | registered |
added to the global list of ACLs via aclRegister() More... | |
Protected Types | |
typedef std::vector< Answer > | Actions |
if not empty, contains actions corresponding to InnerNode::nodes More... | |
Protected Member Functions | |
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... | |
int | match (ACLChecklist *checklist) override |
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 | |
CBDATA_CLASS (Tree) | |
MEMPROXY_CLASS (OrNode) | |
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::Options & | options () |
virtual const Acl::Options & | lineOptions () |
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.
Member Typedef Documentation
◆ Actions
|
protected |
Member Function Documentation
◆ actionAt()
|
protected |
Definition at line 32 of file Tree.cc.
References ACCESS_ALLOWED, and assert.
Referenced by winningAction().
◆ add() [1/2]
void Acl::Tree::add | ( | ACL * | rule | ) |
Definition at line 53 of file Tree.cc.
References Acl::InnerNode::add(), and assert.
◆ add() [2/2]
Definition at line 44 of file Tree.cc.
References action(), Acl::InnerNode::add(), and assert.
Referenced by aclParseAclList().
◆ bannedAction()
|
overrideprotectedvirtual |
Reimplemented from Acl::OrNode.
Definition at line 61 of file Tree.cc.
References assert, and ACLChecklist::bannedAction().
◆ cacheMatchAcl()
|
inherited |
Definition at line 367 of file Acl.cc.
References acl_proxy_auth_match_cache::acl_data, dlink_node::data, debugs, dlinkAddTail(), dlink_list::head, acl_proxy_auth_match_cache::link, ACL::matchForCache(), acl_proxy_auth_match_cache::matchrv, ACL::name, and dlink_node::next.
Referenced by ACLProxyAuth::matchProxyAuth().
◆ CBDATA_CLASS()
|
private |
◆ childrenCount()
|
inlineinherited |
Definition at line 30 of file InnerNode.h.
References Acl::InnerNode::nodes.
Referenced by Acl::AllOf::parse().
◆ context()
|
inherited |
Definition at line 180 of file Acl.cc.
References ACL_NAME_SZ, ACL::cfgline, ACL::name, safe_free, xstrdup, and xstrncpy().
Referenced by aclParseAccessLine(), aclParseAclList(), Acl::AllOf::parse(), and ParseAclWithAction().
◆ doMatch()
|
overrideprivatevirtualinherited |
checks whether the nodes match, starting with the given one kids determine what a match means for their type of intermediate nodes
Implements Acl::InnerNode.
Definition at line 106 of file BoolOps.cc.
References ACLChecklist::keepMatching(), and ACLChecklist::matchChild().
◆ dump()
|
overridevirtualinherited |
Implements ACL.
Definition at line 80 of file InnerNode.cc.
◆ dumpOptions()
|
inherited |
- Returns
- approximate options configuration
Definition at line 326 of file Acl.cc.
References SBufStream::buf(), SBuf::isEmpty(), and ACL::options().
Referenced by dump_acl().
◆ empty()
|
overridevirtualinherited |
◆ FindByName()
|
staticinherited |
Definition at line 118 of file Acl.cc.
References SquidConfig::aclList, Config, debugs, ACL::name, and ACL::next.
Referenced by aclIsProxyAuth(), ExternalACLLookup::checkForAsync(), Acl::InnerNode::lineParse(), parse_ftp_epsv(), and ACL::ParseAclLine().
◆ Initialize()
|
staticinherited |
Definition at line 438 of file Acl.cc.
References SquidConfig::aclList, Config, debugs, ACL::next, and ACL::prepareForUse().
Referenced by serverConnectionsOpen().
◆ isProxyAuth()
|
virtualinherited |
Reimplemented in ACLProxyAuth, ACLExternal, and ACLIdent.
Definition at line 309 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.
Referenced by ACLChecklist::calcImplicitAnswer().
◆ lineOptions()
|
inlineprivatevirtualinherited |
- Returns
- (linked) "line" Options supported by this ACL
- See also
- ACL::options()
Reimplemented in ACLExtUser, Acl::ParameterizedNode< P >, Acl::ParameterizedNode< ACLData< const char * > >, Acl::ParameterizedNode< ACLData< NotePairs::Entry * > >, Acl::ParameterizedNode< ACLData< XactionStep > >, Acl::ParameterizedNode< ACLData< const Security::CertErrors * > >, Acl::ParameterizedNode< ACLData< X509 * > >, Acl::ParameterizedNode< ACLTimeData >, Acl::ParameterizedNode< ACLData< Ip::Address > >, Acl::ParameterizedNode< ACLData< ACLChecklist * > >, Acl::ParameterizedNode< ACLData< hier_code > >, Acl::ParameterizedNode< ACLData< HttpHeader * > >, Acl::ParameterizedNode< ACLData< int > >, Acl::ParameterizedNode< ACLData< HttpRequestMethod > >, Acl::ParameterizedNode< ACLData< AnyP::ProtocolType > >, Acl::ParameterizedNode< ACLData< err_type > >, ACLProxyAuth, and ACLIdent.
Definition at line 109 of file Acl.h.
References Acl::NoOptions().
Referenced by ACL::parseFlags().
◆ 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::FindByName(), self_destruct(), ConfigParser::strtokFile(), and xstrdup.
Referenced by aclParseAccessLine(), aclParseAclList(), Acl::AllOf::parse(), and ParseAclWithAction().
◆ match()
|
overrideprotectedvirtualinherited |
Implements ACL.
Definition at line 89 of file InnerNode.cc.
◆ matches()
|
inherited |
Orchestrates matching checklist against the ACL 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 146 of file Acl.cc.
References AclMatchedName, ACLChecklist::asyncInProgress(), DBG_IMPORTANT, debugs, ACLChecklist::hasAle(), ACLChecklist::hasReply(), ACLChecklist::hasRequest(), ACL::match(), ACL::name, ACL::requiresAle(), ACL::requiresReply(), ACL::requiresRequest(), and ACLChecklist::verifyAle().
Referenced by ACLChecklist::matchAndFinish(), and ACLChecklist::matchChild().
◆ matchForCache()
|
virtualinherited |
Reimplemented in ACLProxyAuth.
Definition at line 349 of file Acl.cc.
References fatal().
Referenced by ACL::cacheMatchAcl().
◆ MEMPROXY_CLASS()
|
privateinherited |
◆ operator delete()
|
inherited |
◆ operator new()
|
inherited |
◆ options()
|
inlineprivatevirtualinherited |
- Returns
- (linked) 'global' Options supported by this ACL
Reimplemented in Acl::DestinationDomainCheck, ACLDestinationIP, Acl::AnnotationCheck, Acl::ServerNameCheck, and ACLMaxUserIP.
Definition at line 105 of file Acl.h.
References Acl::NoOptions().
Referenced by ACL::dumpOptions(), and ACL::parseFlags().
◆ parse()
|
overridevirtualinherited |
◆ ParseAclLine()
|
staticinherited |
Definition at line 191 of file Acl.cc.
References A, ACL_NAME_SZ, SquidConfig::aclList, AclMatchedName, aclRegister(), assert, Config, config_input_line, DBG_CRITICAL, DBG_IMPORTANT, DBG_PARSE_NOTE, debugs, ConfigParser::destruct(), fatalf(), ACL::FindByName(), head, HttpPortList, LOCAL_ARRAY, Acl::Make(), ConfigParser::NextToken(), and xstrncpy().
Referenced by parse_acl(), and TestACLMaxUserIP::testParseLine().
◆ parseFlags()
|
inherited |
Definition at line 315 of file Acl.cc.
References ACL::lineOptions(), ACL::options(), and Acl::ParseFlags().
◆ prepareForUse()
|
overridevirtualinherited |
Reimplemented from ACL.
Definition at line 22 of file InnerNode.cc.
References Acl::InnerNode::nodes.
◆ requiresAle()
|
privatevirtualinherited |
◆ requiresReply()
|
privatevirtualinherited |
Reimplemented in Acl::HttpRepHeaderCheck, ACLHTTPStatus, and Acl::ReplyHeaderCheck< header >.
Definition at line 415 of file Acl.cc.
Referenced by ACL::matches().
◆ requiresRequest()
|
privatevirtualinherited |
Reimplemented in Acl::AnnotateClientCheck, Acl::AnnotateTransactionCheck, Acl::DestinationAsnCheck, Acl::DestinationDomainCheck, Acl::HierCodeCheck, Acl::HttpReqHeaderCheck, Acl::MethodCheck, Acl::NoteCheck, Acl::ProtocolCheck, Acl::RequestHeaderCheck< header >, Acl::ServerNameCheck, Acl::TransactionInitiator, Acl::UrlCheck, Acl::UrlLoginCheck, Acl::UrlPathCheck, Acl::UrlPortCheck, ACLMaxUserIP, ACLProxyAuth, and ACLExternal.
Definition at line 421 of file Acl.cc.
Referenced by ACL::matches().
◆ resumeMatchingAt()
|
inherited |
Definition at line 95 of file InnerNode.cc.
References ACLChecklist::asyncInProgress(), and debugs.
Referenced by ACLChecklist::matchAndFinish(), and ACLChecklist::matchChild().
◆ treeDump()
|
inline |
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, SBuf::end(), Acl::InnerNode::nodes, and text.
◆ typeString()
|
overridevirtualinherited |
Implements ACL.
Definition at line 94 of file BoolOps.cc.
◆ valid()
|
virtualinherited |
Reimplemented in ACLMaxConnection, ACLRandom, Acl::ServerNameCheck, ACLMaxUserIP, ACLProxyAuth, and ACLExternal.
◆ 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
|
protected |
Definition at line 49 of file Tree.h.
Referenced by treeDump().
◆ cfgline
|
inherited |
Definition at line 88 of file Acl.h.
Referenced by ACL::~ACL(), ACL::context(), and Acl::AllOf::parse().
◆ lastMatch_
|
mutableprotectedinherited |
Definition at line 72 of file BoolOps.h.
Referenced by winningAction().
◆ name
|
inherited |
Definition at line 87 of file Acl.h.
Referenced by ACL::ACL(), Acl::NotNode::NotNode(), ACL::~ACL(), ACL::cacheMatchAcl(), ACL::context(), dump_acl(), ACL::FindByName(), ACLDestinationIP::match(), ACLRandom::match(), ACL::matches(), and ACLMaxConnection::prepareForUse().
◆ next
|
inherited |
Definition at line 89 of file Acl.h.
Referenced by dump_acl(), ACL::FindByName(), and ACL::Initialize().
◆ nodes
|
protectedinherited |
Definition at line 53 of file InnerNode.h.
Referenced by Acl::InnerNode::childrenCount(), Acl::InnerNode::prepareForUse(), treeDump(), and winningAction().
◆ registered
|
inherited |
Definition at line 90 of file Acl.h.
Referenced by aclDeregister(), aclDestroyAcls(), and aclRegister().
The documentation for this class was generated from the following files: