]> git.ipfire.org Git - thirdparty/squid.git/blame - src/acl/BoolOps.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / acl / BoolOps.h
CommitLineData
bbc27441 1/*
bde978a6 2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
bbc27441
AJ
3 *
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.
7 */
8
b6095d3e
AR
9#ifndef SQUID_ACL_LOGIC_H
10#define SQUID_ACL_LOGIC_H
11
12#include "acl/InnerNode.h"
13
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.*/
17
e936c41c
AR
18namespace Acl
19{
b6095d3e
AR
20
21/// Implements the "not" or "!" operator.
22class NotNode: public InnerNode
23{
b6095d3e
AR
24 MEMPROXY_CLASS(NotNode);
25
741c2986 26public:
b6095d3e
AR
27 explicit NotNode(ACL *acl);
28
29private:
30 /* ACL API */
31 virtual char const *typeString() const;
32 virtual ACL *clone() const;
33 virtual void parse();
8966008b 34 virtual SBufList dump() const;
b6095d3e
AR
35
36 /* Acl::InnerNode API */
37 virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const;
38};
b6095d3e 39
b6095d3e
AR
40/// An inner ACL expression tree node representing a boolean conjuction (AND)
41/// operator applied to a list of child tree nodes.
115b045f 42/// For example, conditions expressed on a single http_access line are ANDed.
b6095d3e
AR
43class AndNode: public InnerNode
44{
b6095d3e
AR
45 MEMPROXY_CLASS(AndNode);
46
741c2986 47public:
b6095d3e
AR
48 /* ACL API */
49 virtual char const *typeString() const;
50 virtual ACL *clone() const;
51 virtual void parse();
52
53private:
54 virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const;
55};
b6095d3e
AR
56
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.
60class OrNode: public InnerNode
61{
b6095d3e
AR
62 MEMPROXY_CLASS(OrNode);
63
741c2986 64public:
b6095d3e
AR
65 /* ACL API */
66 virtual char const *typeString() const;
67 virtual ACL *clone() const;
68 virtual void parse();
69
70protected:
71 mutable Nodes::const_iterator lastMatch_;
72
73private:
74 virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const;
75};
b6095d3e 76
b6095d3e
AR
77} // namespace Acl
78
79#endif /* SQUID_ACL_LOGIC_H */
f53969cc 80