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