2 * Copyright (C) 1996-2020 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"
37 class sslproxy_cert_sign
;
38 class sslproxy_cert_adapt
;
43 class ActionPasswordList
;
51 class RemovalPolicySettings
;
52 class HttpUpgradeProtocolAccess
;
62 DiskConfig() { assert(swapDirs
== nullptr); }
63 ~DiskConfig() { delete[] swapDirs
; }
65 RefCount
<SwapDir
> *swapDirs
= nullptr;
68 /// number of disk processes required to support all cache_dirs
71 #define INDEXSD(i) (Config.cacheSwap.swapDirs[i].getRaw())
74 /// the representation of the configuration. POD.
79 /* These should be for the Store::Root instance.
80 * this needs pluggable parsing to be done smoothly.
86 YesNoNone memShared
; ///< whether the memory cache is shared among workers
87 YesNoNone shmLocking
; ///< shared_memory_locking
96 RemovalPolicySettings
*replPolicy
;
97 RemovalPolicySettings
*memPolicy
;
98 #if USE_HTTP_VIOLATIONS
102 time_t negativeDnsTtl
;
103 time_t positiveDnsTtl
;
104 time_t shutdownLifetime
;
105 time_t backgroundPingRate
;
106 time_t hopelessKidRevivalDelay
; ///< hopeless_kid_revival_delay
116 time_t clientIdlePconn
;
117 time_t serverIdlePconn
;
118 time_t ftpClientIdle
;
119 time_t pconnLifetime
; ///< pconn_lifetime in squid.conf
122 time_t request_start_timeout
;
123 int icp_query
; /* msec */
124 int icp_query_max
; /* msec */
125 int icp_query_min
; /* msec */
126 int mcast_icp_query
; /* msec */
127 time_msec_t idns_retransmit
;
128 time_msec_t idns_query
;
131 size_t maxRequestHeaderSize
;
132 int64_t maxRequestBodySize
;
133 size_t maxRequestBufferSize
;
134 size_t maxReplyHeaderSize
;
135 AclSizeLimit
*ReplyBodySize
;
167 Ip::Address_list
*router
;
169 int forwarding_method
;
171 int assignment_method
;
178 char *as_whois_server
;
183 CustomLog
*accesslogs
;
193 char *visible_appname_string
;
194 char *effectiveGroup
;
212 Helper::ChildConfig redirectChildren
;
213 Helper::ChildConfig storeIdChildren
;
219 size_t appendDomainLen
;
222 char *mimeTablePathname
;
224 char *visibleHostname
;
225 char *uniqueHostname
;
226 wordlist
*hostnameAliases
;
238 Ip::Address udp_incoming
;
239 Ip::Address udp_outgoing
;
241 Ip::Address snmp_incoming
;
242 Ip::Address snmp_outgoing
;
244 /* FIXME INET6 : this should really be a CIDR value */
245 Ip::Address client_netmask
;
248 size_t udpMaxHitObjsz
;
249 wordlist
*mcast_group_list
;
264 Mgr::ActionPasswordList
*passwd_list
;
267 int objectsPerBucket
;
268 int64_t avgObjectSize
;
269 int64_t maxObjectSize
;
270 int64_t minObjectSize
;
271 size_t maxInMemObjSize
;
293 int test_reachability
;
294 int half_closed_clients
;
296 #if USE_HTTP_VIOLATIONS
302 int redir_rewrites_host
;
304 int nonhierarchical_direct
;
305 int strip_query_terms
;
306 int redirector_bypass
;
308 int ignore_unknown_nameservers
;
312 #if USE_CACHE_DIGESTS
314 int digest_generation
;
317 int vary_ignore_expire
;
318 int surrogate_is_remote
;
319 int request_entities
;
320 int detect_broken_server_pconns
;
321 int relaxed_header_parser
;
323 int allow_underscore
;
325 int cache_miss_revalidate
;
327 int httpd_suppress_version_string
;
328 int global_internal_static
;
329 int collapsed_forwarding
;
331 #if FOLLOW_X_FORWARDED_FOR
332 int acl_uses_indirect_client
;
333 int delay_pool_uses_indirect_client
;
334 int log_uses_indirect_client
;
336 int tproxy_uses_indirect_client
;
338 #endif /* FOLLOW_X_FORWARDED_FOR */
340 int WIN32_IpAddrChangeMonitor
;
341 int memory_cache_first
;
342 int memory_cache_disk
;
343 int hostStrictVerify
;
344 int client_dst_passthru
;
347 bool logTlsServerHelloDetails
;
351 int64_t shared_transient_entries_limit
;
353 int pipeline_max_prefetch
;
355 int forward_max_tries
;
358 std::chrono::nanoseconds paranoid_hit_validation
;
364 acl_access
*adapted_http
;
367 acl_access
*NeverDirect
;
368 acl_access
*AlwaysDirect
;
372 acl_access
*storeMiss
;
373 acl_access
*stats_collection
;
378 #if USE_HTTP_VIOLATIONS
379 acl_access
*brokenPosts
;
381 acl_access
*redirector
;
382 acl_access
*store_id
;
384 Acl::Address
*outgoing_address
;
388 acl_access
*htcp_clr
;
392 acl_access
*ssl_bump
;
394 #if FOLLOW_X_FORWARDED_FOR
395 acl_access
*followXFF
;
396 #endif /* FOLLOW_X_FORWARDED_FOR */
398 /// acceptable PROXY protocol clients
399 acl_access
*proxyProtocol
;
401 /// spoof_client_ip squid.conf acl.
402 /// nil unless configured
403 acl_access
* spoof_client_ip
;
404 acl_access
*on_unsupported_protocol
;
406 acl_access
*ftp_epsv
;
408 acl_access
*forceRequestBodyContinuation
;
409 acl_access
*serverPconnForNonretriable
;
410 acl_access
*collapsedForwardingAccess
;
412 AclDenyInfoList
*denyInfoList
;
425 RefreshPattern
*Refresh
;
427 Store::DiskConfig cacheSwap
;
433 char *errorDirectory
;
435 char *errorDefaultLanguage
;
436 int errorLogMissingLanguages
;
438 char *errorStylesheet
;
450 ClientDelayConfig ClientDelay
;
451 MessageDelayConfig MessageDelay
;
460 int max_open_disk_fds
;
462 AclSizeLimit
*rangeOffsetLimit
;
463 #if MULTICAST_MISS_STREAM
474 /// request_header_access and request_header_replace
475 HeaderManglers
*request_header_access
;
476 /// reply_header_access and reply_header_replace
477 HeaderManglers
*reply_header_access
;
478 ///request_header_add access list
479 HeaderWithAclList
*request_header_add
;
480 ///reply_header_add access list
481 HeaderWithAclList
*reply_header_add
;
482 /// http_upgrade_request_protocols
483 HttpUpgradeProtocolAccess
*http_upgrade_request_protocols
;
488 #if USE_CACHE_DIGESTS
492 time_t rebuild_period
;
493 time_t rewrite_period
;
494 size_t swapout_chunk_size
;
495 int rebuild_chunk_percentage
;
501 int unclean_shutdown
;
504 size_t sessionCacheSize
;
514 char *store_dir_select_algorithm
;
515 int sleep_after_fork
; /* microseconds */
516 time_t minimum_expiry_time
; /* seconds */
517 external_acl
*externalAclHelperList
;
520 Security::ContextPointer sslContext
;
522 char *foreignIntermediateCertsPath
;
523 acl_access
*cert_error
;
524 sslproxy_cert_sign
*cert_sign
;
525 sslproxy_cert_adapt
*cert_adapt
;
531 int max_filedescriptors
;
533 CpuAffinityMap
*cpuAffinityMap
;
535 #if USE_LOADABLE_MODULES
536 wordlist
*loadable_module_names
;
539 int client_ip_max_connections
;
541 char *redirector_extras
;
543 struct UrlHelperTimeout
{
546 } onUrlRewriteTimeout
;
548 char *storeId_extras
;
551 SBufList nameservers
;
552 int v4_first
; ///< Place IPv4 first in the order of DNS results.
553 ssize_t packet_max
; ///< maximum size EDNS advertised for DNS replies.
563 extern SquidConfig Config
;
569 *this = SquidConfig2();
573 int enable_purge
= 0;
575 uid_t effectiveUserID
= 0;
576 gid_t effectiveGroupID
= 0;
579 extern SquidConfig2 Config2
;
581 #endif /* SQUID_SQUIDCONFIG_H_ */