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