]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/ServiceConfig.h
Support adaptation sets and chains, including dynamic ICAP chains:
[thirdparty/squid.git] / src / adaptation / ServiceConfig.h
1 #ifndef SQUID_ADAPTATION__SERVICE_CONFIG_H
2 #define SQUID_ADAPTATION__SERVICE_CONFIG_H
3
4 #include "SquidString.h"
5 #include "RefCount.h"
6 #include "adaptation/Elements.h"
7
8 namespace Adaptation
9 {
10
11 // manages adaptation service configuration in squid.conf
12 class ServiceConfig
13 {
14 public:
15 ServiceConfig();
16
17 const char *methodStr() const;
18 const char *vectPointStr() const;
19
20 bool parse();
21
22 public:
23 String key; // service_configConfig name in the configuration file
24 String uri; // service_configConfig URI
25
26 // service_configConfig URI components
27 String protocol;
28 String host;
29 String resource;
30 int port;
31
32 Method method; // what is being adapted (REQMOD vs RESPMOD)
33 VectPoint point; // where the adaptation happens (pre- or post-cache)
34 bool bypass;
35 bool routing; ///< whether this service may determine the next service(s)
36
37 protected:
38 Method parseMethod(const char *buf) const;
39 VectPoint parseVectPoint(const char *buf) const;
40
41 /// interpret parsed values
42 bool grokBool(bool &var, const char *name, const char *value);
43 bool grokUri(const char *value);
44 };
45
46 } // namespace Adaptation
47
48 #endif /* SQUID_ADAPTATION__SERVICE_CONFIG_H */