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