]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/AccessRule.h
Merged from trunk r12948.
[thirdparty/squid.git] / src / adaptation / AccessRule.h
1 #ifndef SQUID_ADAPTATION__ACCESS_RULE_H
2 #define SQUID_ADAPTATION__ACCESS_RULE_H
3
4 #include "acl/forward.h"
5 #include "adaptation/forward.h"
6 #include "SquidString.h"
7
8 class ConfigParser;
9
10 namespace Adaptation
11 {
12
13 // manages adaptation_access configuration by associating an acl with
14 // an adaptation service group
15 class AccessRule
16 {
17 public:
18 AccessRule(const String &groupId);
19 ~AccessRule();
20
21 void parse(ConfigParser &parser);
22 void finalize();
23
24 // service group consisting of one or more services
25 ServiceGroupPointer group();
26
27 public:
28 typedef int Id;
29 const Id id;
30 String groupId;
31 acl_access *acl;
32
33 private:
34 static Id LastId;
35 };
36
37 typedef Vector<Adaptation::AccessRule*> AccessRules;
38 AccessRules &AllRules();
39 AccessRule *FindRule(const AccessRule::Id &id);
40 AccessRule *FindRuleByGroupId(const String &groupId);
41
42 } // namespace Adaptation
43
44 #endif /* SQUID_ADAPTATION__ACCESS_RULE_H */