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