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