|
Squid Web Cache v8/master
|
#include <Tree.h>
Public Types | |
| using | Pointer = RefCount< Node > |
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. | |
| Answer | lastAction () const |
| what action to use if no nodes matched | |
| void | add (Acl::Node *rule, const Answer &action) |
| appends and takes control over the rule with a given action | |
| void | add (Acl::Node *rule) |
| same as InnerNode::add() | |
| char const * | typeString () const override |
| void | parse () override |
| parses node representation in squid.conf; dies on failures | |
| bool | resumeMatchingAt (ACLChecklist *checklist, Acl::Nodes::const_iterator pos) const |
| Resumes matching (suspended by an async call) at the given position. | |
| Nodes::size_type | childrenCount () const |
| the number of children nodes | |
| 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 SBuf &aName, const char *configuration) |
| sets user-specified ACL name and squid.conf context | |
| bool | matches (ACLChecklist *checklist) const |
| void | parseFlags () |
| configures Acl::Node options, throwing on configuration errors | |
| 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") | |
| static void | Initialize () |
| static Acl::Node * | FindByName (const SBuf &) |
| A configured ACL with a given name or nil. | |
Public Attributes | |
| SBuf | name |
| char * | cfgline = nullptr |
Protected Types | |
| typedef std::vector< Answer > | Actions |
| if not empty, contains actions corresponding to InnerNode::nodes | |
Protected Member Functions | |
| bool | bannedAction (ACLChecklist *, Nodes::const_iterator) const override |
| Acl::OrNode API. | |
| Answer | actionAt (const Nodes::size_type pos) const |
| computes action that corresponds to the position of the matched rule | |
| int | match (ACLChecklist *checklist) override |
| Matches the actual data in checklist against this Acl::Node. | |
Protected Attributes | |
| Actions | actions |
| Nodes::const_iterator | lastMatch_ |
| Nodes | nodes |
| children of this intermediate node | |
Private Member Functions | |
| MEMPROXY_CLASS (Tree) | |
| 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 | |
| virtual bool | requiresRequest () const |
| whether our (i.e. shallow) match() requires checklist to have a request | |
| virtual bool | requiresReply () const |
| whether our (i.e. shallow) match() requires checklist to have a reply | |
| virtual const Acl::Options & | options () |
| virtual const Acl::Options & | lineOptions () |
Static Private Member Functions | |
| static void | ParseNamed (ConfigParser &, NamedAcls &, const SBuf &name) |
| parses acl directive parts that follow aclname | |
An ORed set of rules at the top of the ACL expression tree with support for optional rule actions.
|
protected |
|
inherited |
|
protected |
Definition at line 30 of file Tree.cc.
References ACCESS_ALLOWED, and assert.
Referenced by winningAction().
| void Acl::Tree::add | ( | Acl::Node * | rule | ) |
Definition at line 51 of file Tree.cc.
References Acl::InnerNode::add(), and assert.
Definition at line 42 of file Tree.cc.
References Acl::InnerNode::add(), and assert.
Referenced by aclParseAclList().
|
overrideprotectedvirtual |
Reimplemented from Acl::OrNode.
Definition at line 59 of file Tree.cc.
References assert, and ACLChecklist::bannedAction().
|
inherited |
Definition at line 401 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_proxy_auth_match_cache::matchrv, and dlink_node::next.
Referenced by ACLProxyAuth::matchProxyAuth().
|
inlineinherited |
Definition at line 29 of file InnerNode.h.
References Acl::InnerNode::nodes.
Referenced by aclParseAccessLine(), and Acl::AllOf::parse().
|
inherited |
Definition at line 220 of file Acl.cc.
References safe_free, and xstrdup.
Referenced by aclParseAccessLine(), aclParseAclList(), Acl::AllOf::parse(), and ParseAclWithAction().
|
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 105 of file BoolOps.cc.
References ACLChecklist::keepMatching(), and ACLChecklist::matchChild().
|
overridevirtualinherited |
|
inherited |
|
overridevirtualinherited |
Implements Acl::Node.
Definition at line 30 of file InnerNode.cc.
Referenced by aclParseAccessLine().
Definition at line 159 of file Acl.cc.
References assert, Config, debugs, and SquidConfig::namedAcls.
Referenced by aclIsProxyAuth(), Acl::InnerNode::lineParse(), parse_ftp_epsv(), and TestACLMaxUserIP::testParseLine().
|
staticinherited |
Definition at line 471 of file Acl.cc.
References Config, debugs, and SquidConfig::namedAcls.
Referenced by serverConnectionsOpen().
|
virtualinherited |
Reimplemented in ACLProxyAuth, and ACLExternal.
| Acl::Answer Acl::Tree::lastAction | ( | ) | const |
Definition at line 21 of file Tree.cc.
References ACCESS_DUNNO.
Referenced by ACLChecklist::calcImplicitAnswer().
|
inlineprivatevirtualinherited |
Reimplemented in ACLExtUser, Acl::ParameterizedNode< P >, Acl::ParameterizedNode< ACLData< ACLChecklist * > >, Acl::ParameterizedNode< ACLData< AnyP::ProtocolType > >, Acl::ParameterizedNode< ACLData< const char * > >, Acl::ParameterizedNode< ACLData< const HttpHeader & > >, Acl::ParameterizedNode< ACLData< const Security::CertErrors * > >, Acl::ParameterizedNode< ACLData< err_type > >, Acl::ParameterizedNode< ACLData< hier_code > >, Acl::ParameterizedNode< ACLData< HttpRequestMethod > >, Acl::ParameterizedNode< ACLData< int > >, Acl::ParameterizedNode< ACLData< NotePairs::Entry * > >, Acl::ParameterizedNode< ACLData< X509 * > >, Acl::ParameterizedNode< ACLData< XactionStep > >, Acl::ParameterizedNode< ACLTimeData >, and ACLProxyAuth.
Definition at line 102 of file Node.h.
References Acl::NoOptions().
|
inherited |
parses a [ [!]acl1 [!]acl2... ] sequence, appending to nodes
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().
|
overrideprotectedvirtualinherited |
Implements Acl::Node.
Definition at line 90 of file InnerNode.cc.
|
inherited |
Orchestrates matching checklist against the Acl::Node using match(), after checking preconditions and while providing debugging.
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().
|
virtualinherited |
|
private |
|
inherited |
|
inherited |
|
inlineprivatevirtualinherited |
Reimplemented in Acl::DestinationDomainCheck, ACLDestinationIP, Acl::AnnotationCheck, Acl::ServerNameCheck, and ACLMaxUserIP.
Definition at line 98 of file Node.h.
References Acl::NoOptions().
|
overridevirtualinherited |
|
inherited |
Definition at line 360 of file Acl.cc.
References Acl::ParseFlags().
|
staticprivateinherited |
Definition at line 253 of file Acl.cc.
References Assure, SBuf::cmp(), config_input_line, DBG_CRITICAL, DBG_IMPORTANT, DBG_PARSE_NOTE, debugs, ConfigParser::destruct(), fatalf(), HttpPortList, Acl::Make(), and ConfigParser::NextToken().
|
staticinherited |
Definition at line 229 of file Acl.cc.
References CallParser(), DBG_CRITICAL, debugs, ConfigParser::destruct(), RefCount< C >::Make(), and ConfigParser::NextToken().
Referenced by parse_acl(), and TestACLMaxUserIP::testParseLine().
|
overridevirtualinherited |
Reimplemented from Acl::Node.
Definition at line 23 of file InnerNode.cc.
References Acl::InnerNode::nodes.
|
privatevirtualinherited |
Reimplemented in ACLExternal.
|
privatevirtualinherited |
Reimplemented in Acl::HttpRepHeaderCheck, ACLHTTPStatus, and Acl::ReplyHeaderCheck< header >.
|
privatevirtualinherited |
Reimplemented in Acl::DestinationDomainCheck, ACLExtUser, 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.
|
inherited |
Definition at line 96 of file InnerNode.cc.
References ACLChecklist::asyncInProgress(), and debugs.
Referenced by ACLChecklist::matchAndFinish(), and ACLChecklist::matchChild().
|
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 actions, SBuf::begin(), SBuf::end(), Acl::InnerNode::nodes, SBuf::push_back(), and text.
Referenced by Security::KeyLog::dump(), dump_http_upgrade_request_protocols(), dump_on_unsupported_protocol(), and Note::printAsNoteDirective().
|
overridevirtualinherited |
Implements Acl::Node.
Definition at line 93 of file BoolOps.cc.
|
virtualinherited |
Reimplemented in ACLMaxConnection, ACLRandom, Acl::ServerNameCheck, ACLMaxUserIP, ACLProxyAuth, and ACLExternal.
| Acl::Answer Acl::Tree::winningAction | ( | ) | const |
Definition at line 15 of file Tree.cc.
References actionAt(), Acl::OrNode::lastMatch_, and Acl::InnerNode::nodes.
Referenced by ACLChecklist::matchAndFinish().
|
protected |
Definition at line 49 of file Tree.h.
Referenced by treeDump().
|
mutableprotectedinherited |
Definition at line 72 of file BoolOps.h.
Referenced by winningAction().
|
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 Acl::NotNode::NotNode(), aclDestroyAccessList(), Acl::AnnotateClientCheck::match(), Acl::AnnotateTransactionCheck::match(), Acl::SourceDomainCheck::match(), ACLDestinationIP::match(), ACLRandom::match(), ACLExternal::parse(), and ACLMaxConnection::prepareForUse().
|
protectedinherited |
Definition at line 51 of file InnerNode.h.
Referenced by Acl::InnerNode::childrenCount(), Acl::InnerNode::prepareForUse(), treeDump(), and winningAction().