1 #ifndef SQUID_ADAPTATION__CONFIG_H
2 #define SQUID_ADAPTATION__CONFIG_H
5 #include "acl/forward.h"
6 #include "base/AsyncCall.h"
7 #include "adaptation/forward.h"
8 #include "adaptation/Elements.h"
10 #include "SquidString.h"
22 static void Finalize(bool enable
);
24 static void ParseServiceSet(void);
25 static void ParseServiceChain(void);
27 static void ParseAccess(ConfigParser
&parser
);
28 static void FreeAccess(void);
29 static void DumpAccess(StoreEntry
*, const char *);
31 friend class AccessCheck
;
34 static bool Enabled
; // true if at least one adaptation mechanism is
36 // these are global squid.conf options, documented elsewhere
37 static char *masterx_shared_name
; // global TODO: do we need TheConfig?
38 static int service_iteration_limit
;
39 static int send_client_ip
;
40 static int send_username
;
41 static int use_indirect_client
;
43 // Options below are accessed via Icap::TheConfig or Ecap::TheConfig
44 // TODO: move ICAP-specific options to Icap::Config and add TheConfig
46 int service_failure_limit
;
47 time_t oldest_service_failure
;
48 int service_revival_delay
;
50 static Notes metaHeaders
; ///< The list of configured meta headers
52 typedef Vector
<ServiceConfigPointer
> ServiceConfigs
;
53 ServiceConfigs serviceConfigs
;
58 void parseService(void);
59 void freeService(void);
60 void dumpService(StoreEntry
*, const char *) const;
61 ServicePointer
findService(const String
&);
64 * Creates and starts the adaptation services. In the case the adaptation
65 * mechanism is disabled then removes any reference to the services from
66 * access rules and service groups, and returns false.
67 * \return true if the services are ready and running, false otherwise
69 virtual bool finalize();
72 /// Removes any reference to the services from configuration
75 /// creates service configuration object that will parse and keep cfg info
76 virtual ServiceConfig
*newServiceConfig() const;
78 /// Removes the given service from all service groups.
79 void removeService(const String
& service
);
81 /// Removes access rules of the given service or group
82 void removeRule(const String
& id
);
85 Config(const Config
&); // unsupported
86 Config
&operator =(const Config
&); // unsupported
88 virtual ServicePointer
createService(const ServiceConfigPointer
&cfg
) = 0;
90 static void ParseServiceGroup(ServiceGroupPointer group
);
91 static void FreeServiceGroups(void);
92 static void DumpServiceGroups(StoreEntry
*, const char *);
95 } // namespace Adaptation
97 #endif /* SQUID_ADAPTATION__CONFIG_H */