2 * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_SQUIDCONFIG_H_
10 #define SQUID_SQUIDCONFIG_H_
12 #include "acl/forward.h"
13 #include "base/RefCount.h"
14 #include "base/YesNoNone.h"
16 #include "ClientDelayConfig.h"
17 #include "DelayConfig.h"
19 #include "helper/ChildConfig.h"
20 #include "HttpHeaderTools.h"
21 #include "ip/Address.h"
23 #include "MessageDelayPools.h"
26 #include "security/forward.h"
27 #include "SquidTime.h"
29 #include "ssl/support.h"
31 #include "store/Disk.h"
32 #include "store/forward.h"
35 class sslproxy_cert_sign
;
36 class sslproxy_cert_adapt
;
41 class ActionPasswordList
;
49 class RemovalPolicySettings
;
59 DiskConfig() { assert(swapDirs
== nullptr); }
60 ~DiskConfig() { delete[] swapDirs
; }
62 RefCount
<SwapDir
> *swapDirs
= nullptr;
65 /// number of disk processes required to support all cache_dirs
68 #define INDEXSD(i) (Config.cacheSwap.swapDirs[i].getRaw())
71 /// the representation of the configuration. POD.
76 /* These should be for the Store::Root instance.
77 * this needs pluggable parsing to be done smoothly.
83 YesNoNone memShared
; ///< whether the memory cache is shared among workers
84 YesNoNone shmLocking
; ///< shared_memory_locking
93 RemovalPolicySettings
*replPolicy
;
94 RemovalPolicySettings
*memPolicy
;
95 #if USE_HTTP_VIOLATIONS
99 time_t negativeDnsTtl
;
100 time_t positiveDnsTtl
;
101 time_t shutdownLifetime
;
102 time_t backgroundPingRate
;
103 time_t hopelessKidRevivalDelay
; ///< hopeless_kid_revival_delay
113 time_t clientIdlePconn
;
114 time_t serverIdlePconn
;
115 time_t ftpClientIdle
;
116 time_t pconnLifetime
; ///< pconn_lifetime in squid.conf
119 time_t request_start_timeout
;
120 int icp_query
; /* msec */
121 int icp_query_max
; /* msec */
122 int icp_query_min
; /* msec */
123 int mcast_icp_query
; /* msec */
124 time_msec_t idns_retransmit
;
125 time_msec_t idns_query
;
128 size_t maxRequestHeaderSize
;
129 int64_t maxRequestBodySize
;
130 size_t maxRequestBufferSize
;
131 size_t maxReplyHeaderSize
;
132 AclSizeLimit
*ReplyBodySize
;
164 Ip::Address_list
*router
;
166 int forwarding_method
;
168 int assignment_method
;
175 char *as_whois_server
;
180 CustomLog
*accesslogs
;
190 char *visible_appname_string
;
191 char *effectiveGroup
;
209 Helper::ChildConfig redirectChildren
;
210 Helper::ChildConfig storeIdChildren
;
216 size_t appendDomainLen
;
219 char *mimeTablePathname
;
221 char *visibleHostname
;
222 char *uniqueHostname
;
223 wordlist
*hostnameAliases
;
235 Ip::Address udp_incoming
;
236 Ip::Address udp_outgoing
;
238 Ip::Address snmp_incoming
;
239 Ip::Address snmp_outgoing
;
241 /* FIXME INET6 : this should really be a CIDR value */
242 Ip::Address client_netmask
;
245 size_t udpMaxHitObjsz
;
246 wordlist
*mcast_group_list
;
261 Mgr::ActionPasswordList
*passwd_list
;
264 int objectsPerBucket
;
265 int64_t avgObjectSize
;
266 int64_t maxObjectSize
;
267 int64_t minObjectSize
;
268 size_t maxInMemObjSize
;
290 int test_reachability
;
291 int half_closed_clients
;
293 #if USE_HTTP_VIOLATIONS
299 int redir_rewrites_host
;
301 int nonhierarchical_direct
;
302 int strip_query_terms
;
303 int redirector_bypass
;
305 int ignore_unknown_nameservers
;
309 #if USE_CACHE_DIGESTS
311 int digest_generation
;
314 int vary_ignore_expire
;
315 int surrogate_is_remote
;
316 int request_entities
;
317 int detect_broken_server_pconns
;
318 int balance_on_multiple_ip
;
319 int relaxed_header_parser
;
321 int allow_underscore
;
323 int cache_miss_revalidate
;
325 int httpd_suppress_version_string
;
326 int global_internal_static
;
327 int collapsed_forwarding
;
329 #if FOLLOW_X_FORWARDED_FOR
330 int acl_uses_indirect_client
;
331 int delay_pool_uses_indirect_client
;
332 int log_uses_indirect_client
;
334 int tproxy_uses_indirect_client
;
336 #endif /* FOLLOW_X_FORWARDED_FOR */
338 int WIN32_IpAddrChangeMonitor
;
339 int memory_cache_first
;
340 int memory_cache_disk
;
341 int hostStrictVerify
;
342 int client_dst_passthru
;
345 bool logTlsServerHelloDetails
;
349 int64_t shared_transient_entries_limit
;
351 int pipeline_max_prefetch
;
353 int forward_max_tries
;
360 acl_access
*adapted_http
;
363 acl_access
*NeverDirect
;
364 acl_access
*AlwaysDirect
;
368 acl_access
*storeMiss
;
369 acl_access
*stats_collection
;
374 #if USE_HTTP_VIOLATIONS
375 acl_access
*brokenPosts
;
377 acl_access
*redirector
;
378 acl_access
*store_id
;
380 Acl::Address
*outgoing_address
;
384 acl_access
*htcp_clr
;
388 acl_access
*ssl_bump
;
390 #if FOLLOW_X_FORWARDED_FOR
391 acl_access
*followXFF
;
392 #endif /* FOLLOW_X_FORWARDED_FOR */
394 /// acceptible PROXY protocol clients
395 acl_access
*proxyProtocol
;
397 /// spoof_client_ip squid.conf acl.
398 /// nil unless configured
399 acl_access
* spoof_client_ip
;
400 acl_access
*on_unsupported_protocol
;
402 acl_access
*ftp_epsv
;
404 acl_access
*forceRequestBodyContinuation
;
405 acl_access
*serverPconnForNonretriable
;
406 acl_access
*collapsedForwardingAccess
;
408 AclDenyInfoList
*denyInfoList
;
421 RefreshPattern
*Refresh
;
423 Store::DiskConfig cacheSwap
;
429 char *errorDirectory
;
431 char *errorDefaultLanguage
;
432 int errorLogMissingLanguages
;
434 char *errorStylesheet
;
446 ClientDelayConfig ClientDelay
;
447 MessageDelayConfig MessageDelay
;
456 int max_open_disk_fds
;
458 AclSizeLimit
*rangeOffsetLimit
;
459 #if MULTICAST_MISS_STREAM
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 ///reply_header_add access list
477 HeaderWithAclList
*reply_header_add
;
482 #if USE_CACHE_DIGESTS
486 time_t rebuild_period
;
487 time_t rewrite_period
;
488 size_t swapout_chunk_size
;
489 int rebuild_chunk_percentage
;
495 int unclean_shutdown
;
498 size_t sessionCacheSize
;
508 char *store_dir_select_algorithm
;
509 int sleep_after_fork
; /* microseconds */
510 time_t minimum_expiry_time
; /* seconds */
511 external_acl
*externalAclHelperList
;
514 Security::ContextPointer sslContext
;
516 char *foreignIntermediateCertsPath
;
517 acl_access
*cert_error
;
518 sslproxy_cert_sign
*cert_sign
;
519 sslproxy_cert_adapt
*cert_adapt
;
525 int max_filedescriptors
;
527 CpuAffinityMap
*cpuAffinityMap
;
529 #if USE_LOADABLE_MODULES
530 wordlist
*loadable_module_names
;
533 int client_ip_max_connections
;
535 char *redirector_extras
;
537 struct UrlHelperTimeout
{
540 } onUrlRewriteTimeout
;
542 char *storeId_extras
;
545 SBufList nameservers
;
546 int v4_first
; ///< Place IPv4 first in the order of DNS results.
547 ssize_t packet_max
; ///< maximum size EDNS advertised for DNS replies.
551 extern SquidConfig Config
;
557 *this = SquidConfig2();
561 int enable_purge
= 0;
563 uid_t effectiveUserID
= 0;
564 gid_t effectiveGroupID
= 0;
567 extern SquidConfig2 Config2
;
569 #endif /* SQUID_SQUIDCONFIG_H_ */