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