Config.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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__CONFIG_H
10#define SQUID_ADAPTATION__CONFIG_H
11
12#include "acl/forward.h"
13#include "adaptation/Elements.h"
14#include "adaptation/forward.h"
15#include "base/AsyncCall.h"
16#include "event.h"
17#include "Notes.h"
18#include "SquidString.h"
19
20class ConfigParser;
21class HttpRequest;
22class HttpReply;
23
24namespace Adaptation
25{
26
27class Config
28{
29public:
30 static void Finalize(bool enable);
31
32 static void ParseServiceSet(void);
33 static void ParseServiceChain(void);
34
35 static void ParseAccess(ConfigParser &parser);
36 static void FreeAccess(void);
37 static void DumpAccess(StoreEntry *, const char *);
38
39 friend class AccessCheck;
40
41public:
42 static bool Enabled; // true if at least one adaptation mechanism is
43
44 // these are global squid.conf options, documented elsewhere
45 static char *masterx_shared_name; // global TODO: do we need TheConfig?
47 static int send_client_ip;
48 static int send_username;
50
51 // Options below are accessed via Icap::TheConfig or Ecap::TheConfig
52 // TODO: move ICAP-specific options to Icap::Config and add TheConfig
53 int onoff;
57
59
60 static bool needHistory;
61
62 typedef std::vector<ServiceConfigPointer> ServiceConfigs;
64
65 Config();
66 virtual ~Config();
67
68 void parseService(void);
69 void freeService(void);
70 void dumpService(StoreEntry *, const char *) const;
72
79 virtual bool finalize();
80
81protected:
83 virtual void clear();
84
86 virtual ServiceConfig *newServiceConfig() const;
87
89 void removeService(const String& service);
90
92 void removeRule(const String& id);
93
94private:
95 Config(const Config &); // unsupported
96 Config &operator =(const Config &); // unsupported
97
99
100 static void ParseServiceGroup(ServiceGroupPointer group);
101 static void FreeServiceGroups(void);
102 static void DumpServiceGroups(StoreEntry *, const char *);
103};
104
105} // namespace Adaptation
106
107#endif /* SQUID_ADAPTATION__CONFIG_H */
108
ServiceConfigs serviceConfigs
Definition: Config.h:63
time_t oldest_service_failure
Definition: Config.h:55
static void DumpServiceGroups(StoreEntry *, const char *)
Definition: Config.cc:270
void parseService(void)
Definition: Config.cc:135
static int send_client_ip
Definition: Config.h:47
void removeService(const String &service)
Removes the given service from all service groups.
Definition: Config.cc:60
virtual bool finalize()
Definition: Config.cc:184
virtual void clear()
Removes any reference to the services from configuration.
Definition: Config.cc:121
Config & operator=(const Config &)
ServiceConfigPointer findServiceConfig(const String &)
Definition: Config.cc:91
static void ParseServiceSet(void)
Definition: Config.cc:241
static void Finalize(bool enable)
Definition: Config.cc:230
static void FreeServiceGroups(void)
Definition: Config.cc:261
static int use_indirect_client
Definition: Config.h:49
static void ParseAccess(ConfigParser &parser)
Definition: Config.cc:278
Config(const Config &)
static void ParseServiceGroup(ServiceGroupPointer group)
Definition: Config.cc:253
void removeRule(const String &id)
Removes access rules of the given service or group.
Definition: Config.cc:103
static bool needHistory
HttpRequest adaptation history should recorded.
Definition: Config.h:60
virtual ServicePointer createService(const ServiceConfigPointer &cfg)=0
static void FreeAccess(void)
Definition: Config.cc:290
static int send_username
Definition: Config.h:48
void dumpService(StoreEntry *, const char *) const
Definition: Config.cc:157
int service_failure_limit
Definition: Config.h:54
std::vector< ServiceConfigPointer > ServiceConfigs
Definition: Config.h:62
int service_revival_delay
Definition: Config.h:56
static char * masterx_shared_name
Definition: Config.h:45
static bool Enabled
Definition: Config.h:42
static int service_iteration_limit
Definition: Config.h:46
virtual ~Config()
Definition: Config.cc:317
void freeService(void)
Definition: Config.cc:146
virtual ServiceConfig * newServiceConfig() const
creates service configuration object that will parse and keep cfg info
Definition: Config.cc:54
static Notes metaHeaders
The list of configured meta headers.
Definition: Config.h:58
static void ParseServiceChain(void)
Definition: Config.cc:247
static void DumpAccess(StoreEntry *, const char *)
Definition: Config.cc:299
Definition: Notes.h:109

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors