Squid Web Cache master
Loading...
Searching...
No Matches
BoolOps.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 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_SRC_ACL_BOOLOPS_H
10#define SQUID_SRC_ACL_BOOLOPS_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::Node *acl);
28
29private:
30 /* Acl::Node 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::Node 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_SRC_ACL_BOOLOPS_H */
81
void parse() override
parses node representation in squid.conf; dies on failures
Definition BoolOps.cc:84
char const * typeString() const override
Definition BoolOps.cc:65
MEMPROXY_CLASS(AndNode)
int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const override
Definition BoolOps.cc:71
An intermediate Acl::Node tree node. Manages a collection of child tree nodes.
Definition InnerNode.h:23
Implements the "not" or "!" operator.
Definition BoolOps.h:23
MEMPROXY_CLASS(NotNode)
SBufList dump() const override
Definition BoolOps.cc:55
char const * typeString() const override
Definition BoolOps.cc:49
void parse() override
parses node representation in squid.conf; dies on failures
Definition BoolOps.cc:27
int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const override
Definition BoolOps.cc:35
MEMPROXY_CLASS(OrNode)
void parse() override
parses node representation in squid.conf; dies on failures
Definition BoolOps.cc:127
Nodes::const_iterator lastMatch_
Definition BoolOps.h:72
char const * typeString() const override
Definition BoolOps.cc:93
virtual bool bannedAction(ACLChecklist *, Nodes::const_iterator) const
Definition BoolOps.cc:99
int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const override
Definition BoolOps.cc:105
Definition Acl.cc:33
std::list< SBuf > SBufList
Definition forward.h:23