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