BoolOps.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
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 
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 
18 namespace Acl
19 {
20 
22 class NotNode: public InnerNode
23 {
25 
26 public:
27  explicit NotNode(ACL *acl);
28 
29 private:
30  /* ACL API */
31  virtual char const *typeString() const;
32  virtual void parse();
33  virtual SBufList dump() const;
34 
35  /* Acl::InnerNode API */
36  virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const;
37 };
38 
42 class AndNode: public InnerNode
43 {
45 
46 public:
47  /* ACL API */
48  virtual char const *typeString() const;
49  virtual void parse();
50 
51 private:
52  virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const;
53 };
54 
58 class OrNode: public InnerNode
59 {
61 
62 public:
65  virtual bool bannedAction(ACLChecklist *, Nodes::const_iterator) const;
66 
67  /* ACL API */
68  virtual char const *typeString() const;
69  virtual void parse();
70 
71 protected:
72  mutable Nodes::const_iterator lastMatch_;
73 
74 private:
75  virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const;
76 };
77 
78 } // namespace Acl
79 
80 #endif /* SQUID_ACL_LOGIC_H */
81 
virtual bool bannedAction(ACLChecklist *, Nodes::const_iterator) const
Definition: BoolOps.cc:100
Nodes::const_iterator lastMatch_
Definition: BoolOps.h:72
std::list< SBuf > SBufList
Definition: forward.h:22
virtual void parse()
parses node representation in squid.conf; dies on failures
Definition: BoolOps.cc:28
Definition: Acl.cc:31
An intermediate ACL tree node. Manages a collection of child tree nodes.
Definition: InnerNode.h:22
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const
Definition: BoolOps.cc:72
MEMPROXY_CLASS(OrNode)
Implements the "not" or "!" operator.
Definition: BoolOps.h:23
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const
Definition: BoolOps.cc:36
virtual SBufList dump() const
Definition: BoolOps.cc:56
MEMPROXY_CLASS(AndNode)
virtual void parse()
parses node representation in squid.conf; dies on failures
Definition: BoolOps.cc:85
Definition: Acl.h:40
virtual char const * typeString() const
Definition: BoolOps.cc:94
NotNode(ACL *acl)
Definition: BoolOps.cc:17
virtual char const * typeString() const
Definition: BoolOps.cc:66
MEMPROXY_CLASS(NotNode)
virtual void parse()
parses node representation in squid.conf; dies on failures
Definition: BoolOps.cc:128
virtual char const * typeString() const
Definition: BoolOps.cc:50
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const
Definition: BoolOps.cc:106

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors