]> git.ipfire.org Git - thirdparty/squid.git/blame - src/SquidConfig.h
Fixed mistakenly reverted test
[thirdparty/squid.git] / src / SquidConfig.h
CommitLineData
4d5904f7
FC
1#ifndef SQUID_SQUIDCONFIG_H_
2#define SQUID_SQUIDCONFIG_H_
3/*
4d5904f7
FC
4 * SQUID Web Proxy Cache http://www.squid-cache.org/
5 * ----------------------------------------------------------
6 *
7 * Squid is the result of efforts by numerous individuals from
8 * the Internet community; see the CONTRIBUTORS file for full
9 * details. Many organizations have provided support for Squid's
10 * development; see the SPONSORS file for full details. Squid is
11 * Copyrighted (C) 2001 by the Regents of the University of
12 * California; see the COPYRIGHT file for full details. Squid
13 * incorporates software developed and/or copyrighted by other
14 * sources; see the CREDITS file for full details.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
29 *
30 */
31
0dc8ffa5 32#include "acl/AclAddress.h"
4d5904f7
FC
33#include "ClientDelayConfig.h"
34#include "DelayConfig.h"
c6983ec7 35#include "HelperChildConfig.h"
4d5904f7
FC
36#include "HttpHeaderTools.h"
37#include "icmp/IcmpConfig.h"
38#include "ip/Address.h"
39#include "RefCount.h"
bf35a4a7 40#include "YesNoNone.h"
4d5904f7 41
a011edee
FC
42#if USE_SSL
43#include <openssl/ssl.h>
d9c7489e
FC
44class sslproxy_cert_sign;
45class sslproxy_cert_adapt;
a011edee
FC
46#endif
47
4d5904f7 48class acl_access;
1328cfb7 49class AclSizeLimit;
ee82937c 50class AclDenyInfoList;
e4a14600
A
51namespace Mgr
52{
613924ee
FC
53class ActionPasswordList;
54} // namespace Mgr
55class CustomLog;
c6983ec7 56class CpuAffinityMap;
613924ee 57class external_acl;
4d5904f7 58class HeaderManglers;
8d9a8184 59class RefreshPattern;
4d5904f7 60class RemovalPolicySettings;
ee82937c 61class SwapDir;
4d5904f7 62
e4a14600
A
63namespace AnyP
64{
4d5904f7
FC
65class PortCfg;
66}
67
001d55dc 68/// the representation of the configuration. POD.
1b2f0924
FC
69class SquidConfig
70{
4d5904f7
FC
71public:
72 struct {
73 /* These should be for the Store::Root instance.
74 * this needs pluggable parsing to be done smoothly.
75 */
76 int highWaterMark;
77 int lowWaterMark;
78 } Swap;
79
80 YesNoNone memShared; ///< whether the memory cache is shared among workers
81 size_t memMaxSize;
82
83 struct {
84 int64_t min;
85 int pct;
86 int64_t max;
87 } quickAbort;
88 int64_t readAheadGap;
89 RemovalPolicySettings *replPolicy;
90 RemovalPolicySettings *memPolicy;
91#if USE_HTTP_VIOLATIONS
92 time_t negativeTtl;
93#endif
94 time_t maxStale;
95 time_t negativeDnsTtl;
96 time_t positiveDnsTtl;
97 time_t shutdownLifetime;
98 time_t backgroundPingRate;
99
100 struct {
101 time_t read;
102 time_t write;
103 time_t lifetime;
104 time_t connect;
105 time_t forward;
106 time_t peer_connect;
107 time_t request;
108 time_t clientIdlePconn;
109 time_t serverIdlePconn;
110 time_t siteSelect;
111 time_t deadPeer;
112 int icp_query; /* msec */
113 int icp_query_max; /* msec */
114 int icp_query_min; /* msec */
115 int mcast_icp_query; /* msec */
116
117#if !USE_DNSHELPER
118 time_msec_t idns_retransmit;
119 time_msec_t idns_query;
120#endif
121
122 } Timeout;
123 size_t maxRequestHeaderSize;
124 int64_t maxRequestBodySize;
125 int64_t maxChunkedRequestBodySize;
126 size_t maxRequestBufferSize;
127 size_t maxReplyHeaderSize;
1328cfb7 128 AclSizeLimit *ReplyBodySize;
4d5904f7
FC
129
130 struct {
131 unsigned short icp;
132#if USE_HTCP
133
134 unsigned short htcp;
135#endif
136#if SQUID_SNMP
137
138 unsigned short snmp;
139#endif
140 } Port;
141
142 struct {
143 AnyP::PortCfg *http;
144#if USE_SSL
145 AnyP::PortCfg *https;
146#endif
147 } Sockaddr;
148#if SQUID_SNMP
149
150 struct {
151 char *configFile;
152 char *agentInfo;
153 } Snmp;
154#endif
155#if USE_WCCP
156
157 struct {
158 Ip::Address router;
159 Ip::Address address;
160 int version;
161 } Wccp;
162#endif
163#if USE_WCCPv2
164
165 struct {
166 Ip::Address_list *router;
167 Ip::Address address;
168 int forwarding_method;
169 int return_method;
170 int assignment_method;
171 int weight;
172 int rebuildwait;
173 void *info;
174 } Wccp2;
175#endif
176
177#if USE_ICMP
178 IcmpConfig pinger;
179#endif
180
181 char *as_whois_server;
182
183 struct {
184 char *store;
185 char *swap;
87ddff6e 186 CustomLog *accesslogs;
4d5904f7 187#if ICAP_CLIENT
87ddff6e 188 CustomLog *icaplogs;
4d5904f7
FC
189#endif
190 int rotateNumber;
191 } Log;
192 char *adminEmail;
193 char *EmailFrom;
194 char *EmailProgram;
195 char *effectiveUser;
196 char *visible_appname_string;
197 char *effectiveGroup;
198
199 struct {
200#if USE_DNSHELPER
201 char *dnsserver;
202#endif
203
204 wordlist *redirect;
205#if USE_UNLINKD
206
207 char *unlinkd;
208#endif
209
210 char *diskd;
211#if USE_SSL
212
213 char *ssl_password;
214#endif
215
216 } Program;
217#if USE_DNSHELPER
218 HelperChildConfig dnsChildren;
219#endif
220
221 HelperChildConfig redirectChildren;
222 time_t authenticateGCInterval;
223 time_t authenticateTTL;
224 time_t authenticateIpTTL;
225
226 struct {
227 char *surrogate_id;
228 } Accel;
229 char *appendDomain;
230 size_t appendDomainLen;
231 char *pidFilename;
232 char *netdbFilename;
233 char *mimeTablePathname;
234 char *etcHostsPath;
235 char *visibleHostname;
236 char *uniqueHostname;
237 wordlist *hostnameAliases;
238 char *errHtmlText;
239
240 struct {
241 char *host;
242 char *file;
243 time_t period;
244 unsigned short port;
245 } Announce;
246
247 struct {
248
249 Ip::Address udp_incoming;
250 Ip::Address udp_outgoing;
251#if SQUID_SNMP
252 Ip::Address snmp_incoming;
253 Ip::Address snmp_outgoing;
254#endif
255 /* FIXME INET6 : this should really be a CIDR value */
256 Ip::Address client_netmask;
257 } Addrs;
258 size_t tcpRcvBufsz;
259 size_t udpMaxHitObjsz;
260 wordlist *hierarchy_stoplist;
261 wordlist *mcast_group_list;
262 wordlist *dns_nameservers;
a3c6762c 263 CachePeer *peers;
4d5904f7
FC
264 int npeers;
265
266 struct {
267 int size;
268 int low;
269 int high;
270 } ipcache;
271
272 struct {
273 int size;
274 } fqdncache;
275 int minDirectHops;
276 int minDirectRtt;
613924ee 277 Mgr::ActionPasswordList *passwd_list;
4d5904f7
FC
278
279 struct {
280 int objectsPerBucket;
281 int64_t avgObjectSize;
282 int64_t maxObjectSize;
283 int64_t minObjectSize;
284 size_t maxInMemObjSize;
285 } Store;
286
287 struct {
288 int high;
289 int low;
290 time_t period;
291 } Netdb;
292
293 struct {
294 int log_udp;
295 int res_defnames;
296 int anonymizer;
297 int client_db;
298 int query_icmp;
299 int icp_hit_stale;
300 int buffered_logs;
301 int common_log;
302 int log_mime_hdrs;
303 int log_fqdn;
304 int announce;
305 int mem_pools;
306 int test_reachability;
307 int half_closed_clients;
308 int refresh_all_ims;
309#if USE_HTTP_VIOLATIONS
310
311 int reload_into_ims;
312#endif
313
314 int offline;
315 int redir_rewrites_host;
316 int prefer_direct;
317 int nonhierarchical_direct;
318 int strip_query_terms;
319 int redirector_bypass;
320 int ignore_unknown_nameservers;
321 int client_pconns;
322 int server_pconns;
323 int error_pconns;
324#if USE_CACHE_DIGESTS
325
326 int digest_generation;
327#endif
328
329 int ie_refresh;
330 int vary_ignore_expire;
331 int pipeline_prefetch;
332 int surrogate_is_remote;
333 int request_entities;
334 int detect_broken_server_pconns;
335 int balance_on_multiple_ip;
336 int relaxed_header_parser;
337 int check_hostnames;
338 int allow_underscore;
339 int via;
340 int emailErrData;
341 int httpd_suppress_version_string;
342 int global_internal_static;
343
344#if FOLLOW_X_FORWARDED_FOR
345 int acl_uses_indirect_client;
346 int delay_pool_uses_indirect_client;
347 int log_uses_indirect_client;
348#if LINUX_NETFILTER
349 int tproxy_uses_indirect_client;
350#endif
351#endif /* FOLLOW_X_FORWARDED_FOR */
352
353 int WIN32_IpAddrChangeMonitor;
354 int memory_cache_first;
355 int memory_cache_disk;
356 int hostStrictVerify;
357 int client_dst_passthru;
358 } onoff;
359
360 int forward_max_tries;
361 int connect_retries;
362
363 class ACL *aclList;
364
365 struct {
366 acl_access *http;
367 acl_access *adapted_http;
368 acl_access *icp;
369 acl_access *miss;
370 acl_access *NeverDirect;
371 acl_access *AlwaysDirect;
372 acl_access *ASlists;
373 acl_access *noCache;
374 acl_access *log;
375#if SQUID_SNMP
376
377 acl_access *snmp;
378#endif
379#if USE_HTTP_VIOLATIONS
380 acl_access *brokenPosts;
381#endif
382 acl_access *redirector;
383 acl_access *reply;
0dc8ffa5 384 AclAddress *outgoing_address;
4d5904f7
FC
385#if USE_HTCP
386
387 acl_access *htcp;
388 acl_access *htcp_clr;
389#endif
390
391#if USE_SSL
392 acl_access *ssl_bump;
393#endif
33b24cf0 394#if FOLLOW_X_FORWARDED_FOR
4d5904f7 395 acl_access *followXFF;
33b24cf0 396#endif /* FOLLOW_X_FORWARDED_FOR */
4d5904f7
FC
397
398#if ICAP_CLIENT
399 acl_access* icap;
400#endif
401 } accessList;
7f0b3324 402 AclDenyInfoList *denyInfoList;
4d5904f7
FC
403
404 struct {
405 size_t list_width;
406 int list_wrap;
407 char *anon_user;
408 int passive;
409 int epsv_all;
410 int epsv;
411 int eprt;
412 int sanitycheck;
413 int telnet;
414 } Ftp;
8d9a8184 415 RefreshPattern *Refresh;
4d5904f7
FC
416
417 struct _cacheSwap {
418 RefCount<SwapDir> *swapDirs;
419 int n_allocated;
420 int n_configured;
421 /// number of disk processes required to support all cache_dirs
422 int n_strands;
423 } cacheSwap;
424 /*
425 * I'm sick of having to keep doing this ..
426 */
427#define INDEXSD(i) (Config.cacheSwap.swapDirs[(i)].getRaw())
428
429 struct {
430 char *directory;
431 int use_short_names;
432 } icons;
433 char *errorDirectory;
434#if USE_ERR_LOCALES
435 char *errorDefaultLanguage;
436 int errorLogMissingLanguages;
437#endif
438 char *errorStylesheet;
439
440 struct {
441 int onerror;
442 } retry;
443
444 struct {
445 int64_t limit;
446 } MemPools;
447#if USE_DELAY_POOLS
448
449 DelayConfig Delay;
450 ClientDelayConfig ClientDelay;
451#endif
452
453 struct {
454 struct {
455 int average;
456 int min_poll;
457 } dns, udp, tcp;
458 } comm_incoming;
459 int max_open_disk_fds;
460 int uri_whitespace;
1328cfb7 461 AclSizeLimit *rangeOffsetLimit;
4d5904f7
FC
462#if MULTICAST_MISS_STREAM
463
464 struct {
465
466 Ip::Address addr;
467 int ttl;
468 unsigned short port;
469 char *encode_key;
470 } mcast_miss;
471#endif
472
473 /// request_header_access and request_header_replace
474 HeaderManglers *request_header_access;
475 /// reply_header_access and reply_header_replace
476 HeaderManglers *reply_header_access;
477 ///request_header_add access list
478 HeaderWithAclList *request_header_add;
479 char *coredump_dir;
480 char *chroot_dir;
481#if USE_CACHE_DIGESTS
482
483 struct {
484 int bits_per_entry;
485 time_t rebuild_period;
486 time_t rewrite_period;
487 size_t swapout_chunk_size;
488 int rebuild_chunk_percentage;
489 } digest;
490#endif
491#if USE_SSL
492
493 struct {
494 int unclean_shutdown;
495 char *ssl_engine;
496 } SSL;
497#endif
498
499 wordlist *ext_methods;
500
501 struct {
502 int high_rptm;
503 int high_pf;
504 size_t high_memory;
505 } warnings;
506 char *store_dir_select_algorithm;
507 int sleep_after_fork; /* microseconds */
508 time_t minimum_expiry_time; /* seconds */
509 external_acl *externalAclHelperList;
510
511#if USE_SSL
512
513 struct {
514 char *cert;
515 char *key;
516 int version;
517 char *options;
518 char *cipher;
519 char *cafile;
520 char *capath;
521 char *crlfile;
522 char *flags;
523 acl_access *cert_error;
524 SSL_CTX *sslContext;
525 sslproxy_cert_sign *cert_sign;
526 sslproxy_cert_adapt *cert_adapt;
527 } ssl_client;
528#endif
529
530 char *accept_filter;
531 int umask;
532 int max_filedescriptors;
533 int workers;
534 CpuAffinityMap *cpuAffinityMap;
535
536#if USE_LOADABLE_MODULES
537 wordlist *loadable_module_names;
538#endif
539
540 int client_ip_max_connections;
541
542 struct {
543 int v4_first; ///< Place IPv4 first in the order of DNS results.
544 ssize_t packet_max; ///< maximum size EDNS advertised for DNS replies.
545 } dns;
546
547};
548
549extern SquidConfig Config;
550
5fed1735
AJ
551class SquidConfig2
552{
553public:
7957fca1
FC
554 struct {
555 int enable_purge;
556 int mangle_request_headers;
557 } onoff;
558 uid_t effectiveUserID;
559 gid_t effectiveGroupID;
560};
561
562extern SquidConfig2 Config2;
563
4d5904f7 564#endif /* SQUID_SQUIDCONFIG_H_ */