]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/AccessRule.h
Prep for merge from trunk: undo branch r13313, r13312, and r13311 that were
[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 #include <vector>
9
10 class ConfigParser;
11
12 namespace Adaptation
13 {
14
15 // manages adaptation_access configuration by associating an acl with
16 // an adaptation service group
17 class AccessRule
18 {
19 public:
20 AccessRule(const String &groupId);
21 ~AccessRule();
22
23 void parse(ConfigParser &parser);
24 void finalize();
25
26 // service group consisting of one or more services
27 ServiceGroupPointer group();
28
29 public:
30 typedef int Id;
31 const Id id;
32 String groupId;
33 acl_access *acl;
34
35 private:
36 static Id LastId;
37 };
38
39 typedef std::vector<Adaptation::AccessRule*> AccessRules;
40 AccessRules &AllRules();
41 AccessRule *FindRule(const AccessRule::Id &id);
42 AccessRule *FindRuleByGroupId(const String &groupId);
43
44 } // namespace Adaptation
45
46 #endif /* SQUID_ADAPTATION__ACCESS_RULE_H */