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