]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/Tree.h
1 #ifndef SQUID_ACL_TREE_H
2 #define SQUID_ACL_TREE_H
4 #include "acl/BoolOps.h"
10 /// An ORed set of rules at the top of the ACL expression tree, providing two
11 /// unique properties: cbdata protection and optional rule actions.
12 class Tree
: public OrNode
15 /// dumps <name, action, rule, new line> tuples
16 /// action.kind is mapped to a string using the supplied conversion table
17 typedef const char **ActionToString
;
18 SBufList
treeDump(const char *name
, const ActionToString
&convert
) const;
20 /// Returns the corresponding action after a successful tree match.
21 allow_t
winningAction() const;
23 /// what action to use if no nodes matched
24 allow_t
lastAction() const;
26 /// appends and takes control over the rule with a given action
27 void add(ACL
*rule
, const allow_t
&action
);
28 void add(ACL
*rule
); ///< same as InnerNode::add()
31 allow_t
actionAt(const Nodes::size_type pos
) const;
33 /// if not empty, contains actions corresponding to InnerNode::nodes
34 typedef std::vector
<allow_t
> Actions
;
38 // XXX: We should use refcounting instead, but it requires making ACLs
39 // refcounted as well. Otherwise, async lookups will reach deleted ACLs.
45 #endif /* SQUID_ACL_TREE_H */