]> git.ipfire.org Git - thirdparty/squid.git/blame - src/SquidConfig.h
Cleanup: replace USE_SSL wrapper macro with USE_OPENSSL
[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
cb4f4424
AJ
43#if USE_OPENSSL
44#if HAVE_OPENSSL_SSL_H
a011edee 45#include <openssl/ssl.h>
cb4f4424
AJ
46#endif
47
d9c7489e
FC
48class sslproxy_cert_sign;
49class sslproxy_cert_adapt;
a011edee
FC
50#endif
51
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 */
4d5904f7
FC
117 time_msec_t idns_retransmit;
118 time_msec_t idns_query;
4d5904f7
FC
119 } Timeout;
120 size_t maxRequestHeaderSize;
121 int64_t maxRequestBodySize;
122 int64_t maxChunkedRequestBodySize;
123 size_t maxRequestBufferSize;
124 size_t maxReplyHeaderSize;
1328cfb7 125 AclSizeLimit *ReplyBodySize;
4d5904f7
FC
126
127 struct {
128 unsigned short icp;
129#if USE_HTCP
130
131 unsigned short htcp;
132#endif
133#if SQUID_SNMP
134
135 unsigned short snmp;
136#endif
137 } Port;
138
139 struct {
140 AnyP::PortCfg *http;
cb4f4424 141#if USE_OPENSSL
4d5904f7
FC
142 AnyP::PortCfg *https;
143#endif
144 } Sockaddr;
145#if SQUID_SNMP
146
147 struct {
148 char *configFile;
149 char *agentInfo;
150 } Snmp;
151#endif
152#if USE_WCCP
153
154 struct {
155 Ip::Address router;
156 Ip::Address address;
157 int version;
158 } Wccp;
159#endif
160#if USE_WCCPv2
161
162 struct {
163 Ip::Address_list *router;
164 Ip::Address address;
165 int forwarding_method;
166 int return_method;
167 int assignment_method;
168 int weight;
169 int rebuildwait;
170 void *info;
171 } Wccp2;
172#endif
173
174#if USE_ICMP
175 IcmpConfig pinger;
176#endif
177
178 char *as_whois_server;
179
180 struct {
181 char *store;
182 char *swap;
87ddff6e 183 CustomLog *accesslogs;
4d5904f7 184#if ICAP_CLIENT
87ddff6e 185 CustomLog *icaplogs;
4d5904f7
FC
186#endif
187 int rotateNumber;
188 } Log;
189 char *adminEmail;
190 char *EmailFrom;
191 char *EmailProgram;
192 char *effectiveUser;
193 char *visible_appname_string;
194 char *effectiveGroup;
195
196 struct {
4d5904f7 197 wordlist *redirect;
a8a0b1c2 198 wordlist *store_id;
4d5904f7
FC
199#if USE_UNLINKD
200
201 char *unlinkd;
202#endif
203
204 char *diskd;
cb4f4424 205#if USE_OPENSSL
4d5904f7
FC
206
207 char *ssl_password;
208#endif
209
210 } Program;
4d5904f7
FC
211
212 HelperChildConfig redirectChildren;
a8a0b1c2 213 HelperChildConfig storeIdChildren;
4d5904f7
FC
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;
a3c6762c 255 CachePeer *peers;
4d5904f7
FC
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;
613924ee 269 Mgr::ActionPasswordList *passwd_list;
4d5904f7
FC
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;
a8a0b1c2 312 int store_id_bypass;
4d5904f7
FC
313 int ignore_unknown_nameservers;
314 int client_pconns;
315 int server_pconns;
316 int error_pconns;
317#if USE_CACHE_DIGESTS
318
319 int digest_generation;
320#endif
321
322 int ie_refresh;
323 int vary_ignore_expire;
4d5904f7
FC
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;
96598f93 332 int cache_miss_revalidate;
4d5904f7
FC
333 int emailErrData;
334 int httpd_suppress_version_string;
335 int global_internal_static;
55eae904 336 int collapsed_forwarding;
4d5904f7
FC
337
338#if FOLLOW_X_FORWARDED_FOR
339 int acl_uses_indirect_client;
340 int delay_pool_uses_indirect_client;
341 int log_uses_indirect_client;
342#if LINUX_NETFILTER
343 int tproxy_uses_indirect_client;
344#endif
345#endif /* FOLLOW_X_FORWARDED_FOR */
346
347 int WIN32_IpAddrChangeMonitor;
348 int memory_cache_first;
349 int memory_cache_disk;
350 int hostStrictVerify;
351 int client_dst_passthru;
bce61b00 352 int dns_mdns;
4d5904f7
FC
353 } onoff;
354
079a8480
AJ
355 int pipeline_max_prefetch;
356
4d5904f7
FC
357 int forward_max_tries;
358 int connect_retries;
359
360 class ACL *aclList;
361
362 struct {
363 acl_access *http;
364 acl_access *adapted_http;
365 acl_access *icp;
366 acl_access *miss;
367 acl_access *NeverDirect;
368 acl_access *AlwaysDirect;
369 acl_access *ASlists;
370 acl_access *noCache;
70706149
AR
371 acl_access *sendHit;
372 acl_access *storeMiss;
8ebad780 373 acl_access *stats_collection;
4d5904f7
FC
374#if SQUID_SNMP
375
376 acl_access *snmp;
377#endif
378#if USE_HTTP_VIOLATIONS
379 acl_access *brokenPosts;
380#endif
381 acl_access *redirector;
a8a0b1c2 382 acl_access *store_id;
4d5904f7 383 acl_access *reply;
0dc8ffa5 384 AclAddress *outgoing_address;
4d5904f7
FC
385#if USE_HTCP
386
387 acl_access *htcp;
388 acl_access *htcp_clr;
389#endif
390
cb4f4424 391#if USE_OPENSSL
4d5904f7
FC
392 acl_access *ssl_bump;
393#endif
33b24cf0 394#if FOLLOW_X_FORWARDED_FOR
4d5904f7 395 acl_access *followXFF;
33b24cf0 396#endif /* FOLLOW_X_FORWARDED_FOR */
4d5904f7 397
0d901ef4
SH
398 /// spoof_client_ip squid.conf acl.
399 /// nil unless configured
400 acl_access* spoof_client_ip;
4d5904f7 401 } accessList;
7f0b3324 402 AclDenyInfoList *denyInfoList;
4d5904f7
FC
403
404 struct {
405 size_t list_width;
406 int list_wrap;
407 char *anon_user;
408 int passive;
409 int epsv_all;
410 int epsv;
411 int eprt;
412 int sanitycheck;
413 int telnet;
414 } Ftp;
8d9a8184 415 RefreshPattern *Refresh;
4d5904f7
FC
416
417 struct _cacheSwap {
418 RefCount<SwapDir> *swapDirs;
419 int n_allocated;
420 int n_configured;
421 /// number of disk processes required to support all cache_dirs
422 int n_strands;
423 } cacheSwap;
424 /*
425 * I'm sick of having to keep doing this ..
426 */
427#define INDEXSD(i) (Config.cacheSwap.swapDirs[(i)].getRaw())
428
429 struct {
430 char *directory;
431 int use_short_names;
432 } icons;
433 char *errorDirectory;
434#if USE_ERR_LOCALES
435 char *errorDefaultLanguage;
436 int errorLogMissingLanguages;
437#endif
438 char *errorStylesheet;
439
440 struct {
441 int onerror;
442 } retry;
443
444 struct {
445 int64_t limit;
446 } MemPools;
447#if USE_DELAY_POOLS
448
449 DelayConfig Delay;
450 ClientDelayConfig ClientDelay;
451#endif
452
453 struct {
454 struct {
455 int average;
456 int min_poll;
457 } dns, udp, tcp;
458 } comm_incoming;
459 int max_open_disk_fds;
460 int uri_whitespace;
1328cfb7 461 AclSizeLimit *rangeOffsetLimit;
4d5904f7
FC
462#if MULTICAST_MISS_STREAM
463
464 struct {
465
466 Ip::Address addr;
467 int ttl;
468 unsigned short port;
469 char *encode_key;
470 } mcast_miss;
471#endif
472
473 /// request_header_access and request_header_replace
474 HeaderManglers *request_header_access;
475 /// reply_header_access and reply_header_replace
476 HeaderManglers *reply_header_access;
477 ///request_header_add access list
478 HeaderWithAclList *request_header_add;
d7f4a0b7
CT
479 ///note
480 Notes notes;
4d5904f7
FC
481 char *coredump_dir;
482 char *chroot_dir;
483#if USE_CACHE_DIGESTS
484
485 struct {
486 int bits_per_entry;
487 time_t rebuild_period;
488 time_t rewrite_period;
489 size_t swapout_chunk_size;
490 int rebuild_chunk_percentage;
491 } digest;
492#endif
cb4f4424 493#if USE_OPENSSL
4d5904f7
FC
494
495 struct {
496 int unclean_shutdown;
497 char *ssl_engine;
10a69fc0
CT
498 int session_ttl;
499 size_t sessionCacheSize;
4d5904f7
FC
500 } SSL;
501#endif
502
503 wordlist *ext_methods;
504
505 struct {
506 int high_rptm;
507 int high_pf;
508 size_t high_memory;
509 } warnings;
510 char *store_dir_select_algorithm;
511 int sleep_after_fork; /* microseconds */
512 time_t minimum_expiry_time; /* seconds */
513 external_acl *externalAclHelperList;
514
cb4f4424 515#if USE_OPENSSL
4d5904f7
FC
516
517 struct {
518 char *cert;
519 char *key;
520 int version;
521 char *options;
522 char *cipher;
523 char *cafile;
524 char *capath;
525 char *crlfile;
526 char *flags;
527 acl_access *cert_error;
528 SSL_CTX *sslContext;
529 sslproxy_cert_sign *cert_sign;
530 sslproxy_cert_adapt *cert_adapt;
531 } ssl_client;
532#endif
533
534 char *accept_filter;
535 int umask;
536 int max_filedescriptors;
537 int workers;
538 CpuAffinityMap *cpuAffinityMap;
539
540#if USE_LOADABLE_MODULES
541 wordlist *loadable_module_names;
542#endif
543
544 int client_ip_max_connections;
545
b11724bb
CT
546 char *redirector_extras;
547
548 char *storeId_extras;
549
4d5904f7
FC
550 struct {
551 int v4_first; ///< Place IPv4 first in the order of DNS results.
552 ssize_t packet_max; ///< maximum size EDNS advertised for DNS replies.
553 } dns;
554
555};
556
557extern SquidConfig Config;
558
5fed1735
AJ
559class SquidConfig2
560{
561public:
7957fca1
FC
562 struct {
563 int enable_purge;
564 int mangle_request_headers;
565 } onoff;
566 uid_t effectiveUserID;
567 gid_t effectiveGroupID;
568};
569
570extern SquidConfig2 Config2;
571
4d5904f7 572#endif /* SQUID_SQUIDCONFIG_H_ */