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