2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_ACL_LOGIC_H
10 #define SQUID_ACL_LOGIC_H
12 #include "acl/InnerNode.h"
14 /* ACLs defined here are used internally to construct an ACL expression tree.
15 * They cannot be specified directly in squid.conf because squid.conf ACLs are
16 * more complex than (and are implemented using) these operator-like classes.*/
21 /// Implements the "not" or "!" operator.
22 class NotNode
: public InnerNode
24 MEMPROXY_CLASS(NotNode
);
27 explicit NotNode(ACL
*acl
);
31 virtual char const *typeString() const;
32 virtual ACL
*clone() const;
34 virtual SBufList
dump() const;
36 /* Acl::InnerNode API */
37 virtual int doMatch(ACLChecklist
*checklist
, Nodes::const_iterator start
) const;
40 /// An inner ACL expression tree node representing a boolean conjuction (AND)
41 /// operator applied to a list of child tree nodes.
42 /// For example, conditions expressed on a single http_access line are ANDed.
43 class AndNode
: public InnerNode
45 MEMPROXY_CLASS(AndNode
);
49 virtual char const *typeString() const;
50 virtual ACL
*clone() const;
54 virtual int doMatch(ACLChecklist
*checklist
, Nodes::const_iterator start
) const;
57 /// An inner ACL expression tree node representing a boolean disjuction (OR)
58 /// operator applied to a list of child tree nodes.
59 /// For example, conditions expressed by multiple http_access lines are ORed.
60 class OrNode
: public InnerNode
62 MEMPROXY_CLASS(OrNode
);
65 /// whether the given rule should be excluded from matching tests based
67 virtual bool bannedAction(ACLChecklist
*, Nodes::const_iterator
) const;
70 virtual char const *typeString() const;
71 virtual ACL
*clone() const;
75 mutable Nodes::const_iterator lastMatch_
;
78 virtual int doMatch(ACLChecklist
*checklist
, Nodes::const_iterator start
) const;
83 #endif /* SQUID_ACL_LOGIC_H */