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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors