]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/ServiceConfig.h
Merge from trunk rev.14108
[thirdparty/squid.git] / src / adaptation / ServiceConfig.h
1 /*
2 * Copyright (C) 1996-2015 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_ADAPTATION__SERVICE_CONFIG_H
10 #define SQUID_ADAPTATION__SERVICE_CONFIG_H
11
12 #include "adaptation/Elements.h"
13 #include "base/RefCount.h"
14 #include "security/PeerOptions.h"
15 #include "SquidString.h"
16
17 namespace Adaptation
18 {
19
20 // manages adaptation service configuration in squid.conf
21 class ServiceConfig: public RefCountable
22 {
23 public:
24 ServiceConfig();
25
26 const char *methodStr() const;
27 const char *vectPointStr() const;
28
29 bool parse();
30
31 public:
32 String key; // service_configConfig name in the configuration file
33 String uri; // service_configConfig URI
34
35 // service_configConfig URI components
36 String protocol;
37 String host;
38 String resource;
39 int port;
40
41 Method method; // what is being adapted (REQMOD vs RESPMOD)
42 VectPoint point; // where the adaptation happens (pre- or post-cache)
43 bool bypass;
44
45 // options
46 long maxConn; ///< maximum number of concurrent service transactions
47 SrvBehaviour onOverload; ///< how to handle Max-Connections feature
48 bool routing; ///< whether this service may determine the next service(s)
49 bool ipv6; ///< whether this service uses IPv6 transport (default IPv4)
50
51 // security settings for adaptation service
52 Security::PeerOptions secure;
53
54 protected:
55 Method parseMethod(const char *buf) const;
56 VectPoint parseVectPoint(const char *buf) const;
57
58 /// interpret parsed values
59 bool grokBool(bool &var, const char *name, const char *value);
60 bool grokUri(const char *value);
61 bool grokLong(long &var, const char *name, const char *value);
62 /// handle on-overload configuration option
63 bool grokOnOverload(SrvBehaviour &var, const char *value);
64 /// handle name=value configuration option with name unknown to Squid
65 virtual bool grokExtension(const char *name, const char *value);
66 };
67
68 } // namespace Adaptation
69
70 #endif /* SQUID_ADAPTATION__SERVICE_CONFIG_H */
71