BoolOps.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 ACL *clone() const;
33  virtual void parse();
34  virtual SBufList dump() const;
35 
36  /* Acl::InnerNode API */
37  virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const;
38 };
39 
43 class AndNode: public InnerNode
44 {
46 
47 public:
48  /* ACL API */
49  virtual char const *typeString() const;
50  virtual ACL *clone() const;
51  virtual void parse();
52 
53 private:
54  virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const;
55 };
56 
60 class OrNode: public InnerNode
61 {
63 
64 public:
67  virtual bool bannedAction(ACLChecklist *, Nodes::const_iterator) const;
68 
69  /* ACL API */
70  virtual char const *typeString() const;
71  virtual ACL *clone() const;
72  virtual void parse();
73 
74 protected:
75  mutable Nodes::const_iterator lastMatch_;
76 
77 private:
78  virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const;
79 };
80 
81 } // namespace Acl
82 
83 #endif /* SQUID_ACL_LOGIC_H */
84 
virtual ACL * clone() const
Definition: BoolOps.cc:115
Definition: Acl.h:39
virtual void parse()
parses node represenation in squid.conf; dies on failures
Definition: BoolOps.cc:100
virtual SBufList dump() const
Definition: BoolOps.cc:65
virtual ACL * clone() const
Definition: BoolOps.cc:81
An intermediate ACL tree node. Manages a collection of child tree nodes.
Definition: InnerNode.h:21
Implements the "not" or "!" operator.
Definition: BoolOps.h:22
virtual ACL * clone() const
Definition: BoolOps.cc:55
MEMPROXY_CLASS(NotNode)
std::list< SBuf > SBufList
Definition: forward.h:26
MEMPROXY_CLASS(OrNode)
Nodes::const_iterator lastMatch_
Definition: BoolOps.h:75
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const
Definition: BoolOps.cc:35
virtual char const * typeString() const
Definition: BoolOps.cc:109
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const
Definition: BoolOps.cc:87
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const
Definition: BoolOps.cc:127
virtual char const * typeString() const
Definition: BoolOps.cc:75
virtual char const * typeString() const
Definition: BoolOps.cc:49
virtual void parse()
parses node represenation in squid.conf; dies on failures
Definition: BoolOps.cc:27
MEMPROXY_CLASS(AndNode)
NotNode(ACL *acl)
Definition: BoolOps.cc:17
virtual void parse()
parses node represenation in squid.conf; dies on failures
Definition: BoolOps.cc:149
virtual bool bannedAction(ACLChecklist *, Nodes::const_iterator) const
Definition: BoolOps.cc:121

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors