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