]> git.ipfire.org Git - thirdparty/squid.git/blame - src/adaptation/AccessRule.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / adaptation / AccessRule.h
CommitLineData
bbc27441 1/*
bde978a6 2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
bbc27441
AJ
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
62c7f90e
AR
9#ifndef SQUID_ADAPTATION__ACCESS_RULE_H
10#define SQUID_ADAPTATION__ACCESS_RULE_H
11
6f58d7d7 12#include "acl/forward.h"
62c7f90e 13#include "adaptation/forward.h"
6f58d7d7 14#include "SquidString.h"
62c7f90e 15
b7347197
FC
16#include <vector>
17
8e57fe25 18class ConfigParser;
62c7f90e 19
26ac0430
AJ
20namespace Adaptation
21{
62c7f90e
AR
22
23// manages adaptation_access configuration by associating an acl with
24// an adaptation service group
26ac0430
AJ
25class AccessRule
26{
62c7f90e 27public:
287bbe9a 28 AccessRule(const String &groupId);
62c7f90e
AR
29 ~AccessRule();
30
31 void parse(ConfigParser &parser);
b6b637eb 32 void finalize();
62c7f90e
AR
33
34 // service group consisting of one or more services
a22e6cd3 35 ServiceGroupPointer group();
62c7f90e
AR
36
37public:
38 typedef int Id;
39 const Id id;
40 String groupId;
41 acl_access *acl;
42
43private:
44 static Id LastId;
45};
46
c8ea3cc0 47typedef std::vector<Adaptation::AccessRule*> AccessRules;
8a648e8d
FC
48AccessRules &AllRules();
49AccessRule *FindRule(const AccessRule::Id &id);
50AccessRule *FindRuleByGroupId(const String &groupId);
62c7f90e
AR
51
52} // namespace Adaptation
53
54#endif /* SQUID_ADAPTATION__ACCESS_RULE_H */
f53969cc 55