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