2 * Copyright (C) 1996-2017 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/forward.h"
34 class sslproxy_cert_sign
;
35 class sslproxy_cert_adapt
;
40 class ActionPasswordList
;
48 class RemovalPolicySettings
;
58 RefCount
<SwapDir
> *swapDirs
;
61 /// number of disk processes required to support all cache_dirs
64 #define INDEXSD(i) (Config.cacheSwap.swapDirs[i].getRaw())
67 /// the representation of the configuration. POD.
72 /* These should be for the Store::Root instance.
73 * this needs pluggable parsing to be done smoothly.
79 YesNoNone memShared
; ///< whether the memory cache is shared among workers
80 YesNoNone shmLocking
; ///< shared_memory_locking
89 RemovalPolicySettings
*replPolicy
;
90 RemovalPolicySettings
*memPolicy
;
91 #if USE_HTTP_VIOLATIONS
95 time_t negativeDnsTtl
;
96 time_t positiveDnsTtl
;
97 time_t shutdownLifetime
;
98 time_t backgroundPingRate
;
99 time_t hopelessKidRevivalDelay
; ///< hopeless_kid_revival_delay
109 time_t clientIdlePconn
;
110 time_t serverIdlePconn
;
111 time_t ftpClientIdle
;
112 time_t pconnLifetime
; ///< pconn_lifetime in squid.conf
115 time_t request_start_timeout
;
116 int icp_query
; /* msec */
117 int icp_query_max
; /* msec */
118 int icp_query_min
; /* msec */
119 int mcast_icp_query
; /* msec */
120 time_msec_t idns_retransmit
;
121 time_msec_t idns_query
;
124 size_t maxRequestHeaderSize
;
125 int64_t maxRequestBodySize
;
126 size_t maxRequestBufferSize
;
127 size_t maxReplyHeaderSize
;
128 AclSizeLimit
*ReplyBodySize
;
160 Ip::Address_list
*router
;
162 int forwarding_method
;
164 int assignment_method
;
171 char *as_whois_server
;
176 CustomLog
*accesslogs
;
186 char *visible_appname_string
;
187 char *effectiveGroup
;
205 Helper::ChildConfig redirectChildren
;
206 Helper::ChildConfig storeIdChildren
;
212 size_t appendDomainLen
;
215 char *mimeTablePathname
;
217 char *visibleHostname
;
218 char *uniqueHostname
;
219 wordlist
*hostnameAliases
;
231 Ip::Address udp_incoming
;
232 Ip::Address udp_outgoing
;
234 Ip::Address snmp_incoming
;
235 Ip::Address snmp_outgoing
;
237 /* FIXME INET6 : this should really be a CIDR value */
238 Ip::Address client_netmask
;
241 size_t udpMaxHitObjsz
;
242 wordlist
*mcast_group_list
;
257 Mgr::ActionPasswordList
*passwd_list
;
260 int objectsPerBucket
;
261 int64_t avgObjectSize
;
262 int64_t maxObjectSize
;
263 int64_t minObjectSize
;
264 size_t maxInMemObjSize
;
286 int test_reachability
;
287 int half_closed_clients
;
289 #if USE_HTTP_VIOLATIONS
295 int redir_rewrites_host
;
297 int nonhierarchical_direct
;
298 int strip_query_terms
;
299 int redirector_bypass
;
301 int ignore_unknown_nameservers
;
305 #if USE_CACHE_DIGESTS
307 int digest_generation
;
310 int vary_ignore_expire
;
311 int surrogate_is_remote
;
312 int request_entities
;
313 int detect_broken_server_pconns
;
314 int balance_on_multiple_ip
;
315 int relaxed_header_parser
;
317 int allow_underscore
;
319 int cache_miss_revalidate
;
321 int httpd_suppress_version_string
;
322 int global_internal_static
;
323 int collapsed_forwarding
;
325 #if FOLLOW_X_FORWARDED_FOR
326 int acl_uses_indirect_client
;
327 int delay_pool_uses_indirect_client
;
328 int log_uses_indirect_client
;
330 int tproxy_uses_indirect_client
;
332 #endif /* FOLLOW_X_FORWARDED_FOR */
334 int WIN32_IpAddrChangeMonitor
;
335 int memory_cache_first
;
336 int memory_cache_disk
;
337 int hostStrictVerify
;
338 int client_dst_passthru
;
341 bool logTlsServerHelloDetails
;
345 int64_t collapsed_forwarding_shared_entries_limit
;
347 int pipeline_max_prefetch
;
349 int forward_max_tries
;
356 acl_access
*adapted_http
;
359 acl_access
*NeverDirect
;
360 acl_access
*AlwaysDirect
;
364 acl_access
*storeMiss
;
365 acl_access
*stats_collection
;
370 #if USE_HTTP_VIOLATIONS
371 acl_access
*brokenPosts
;
373 acl_access
*redirector
;
374 acl_access
*store_id
;
376 Acl::Address
*outgoing_address
;
380 acl_access
*htcp_clr
;
384 acl_access
*ssl_bump
;
386 #if FOLLOW_X_FORWARDED_FOR
387 acl_access
*followXFF
;
388 #endif /* FOLLOW_X_FORWARDED_FOR */
390 /// acceptible PROXY protocol clients
391 acl_access
*proxyProtocol
;
393 /// spoof_client_ip squid.conf acl.
394 /// nil unless configured
395 acl_access
* spoof_client_ip
;
396 acl_access
*on_unsupported_protocol
;
398 acl_access
*ftp_epsv
;
400 acl_access
*forceRequestBodyContinuation
;
401 acl_access
*serverPconnForNonretriable
;
403 AclDenyInfoList
*denyInfoList
;
416 RefreshPattern
*Refresh
;
418 Store::DiskConfig cacheSwap
;
424 char *errorDirectory
;
426 char *errorDefaultLanguage
;
427 int errorLogMissingLanguages
;
429 char *errorStylesheet
;
441 ClientDelayConfig ClientDelay
;
442 MessageDelayConfig MessageDelay
;
451 int max_open_disk_fds
;
453 AclSizeLimit
*rangeOffsetLimit
;
454 #if MULTICAST_MISS_STREAM
465 /// request_header_access and request_header_replace
466 HeaderManglers
*request_header_access
;
467 /// reply_header_access and reply_header_replace
468 HeaderManglers
*reply_header_access
;
469 ///request_header_add access list
470 HeaderWithAclList
*request_header_add
;
471 ///reply_header_add access list
472 HeaderWithAclList
*reply_header_add
;
477 #if USE_CACHE_DIGESTS
481 time_t rebuild_period
;
482 time_t rewrite_period
;
483 size_t swapout_chunk_size
;
484 int rebuild_chunk_percentage
;
490 int unclean_shutdown
;
493 size_t sessionCacheSize
;
503 char *store_dir_select_algorithm
;
504 int sleep_after_fork
; /* microseconds */
505 time_t minimum_expiry_time
; /* seconds */
506 external_acl
*externalAclHelperList
;
509 Security::ContextPointer sslContext
;
511 char *foreignIntermediateCertsPath
;
512 acl_access
*cert_error
;
513 sslproxy_cert_sign
*cert_sign
;
514 sslproxy_cert_adapt
*cert_adapt
;
520 int max_filedescriptors
;
522 CpuAffinityMap
*cpuAffinityMap
;
524 #if USE_LOADABLE_MODULES
525 wordlist
*loadable_module_names
;
528 int client_ip_max_connections
;
530 char *redirector_extras
;
532 struct UrlHelperTimeout
{
535 } onUrlRewriteTimeout
;
537 char *storeId_extras
;
540 SBufList nameservers
;
541 int v4_first
; ///< Place IPv4 first in the order of DNS results.
542 ssize_t packet_max
; ///< maximum size EDNS advertised for DNS replies.
546 extern SquidConfig Config
;
552 *this = SquidConfig2();
556 int enable_purge
= 0;
558 uid_t effectiveUserID
= 0;
559 gid_t effectiveGroupID
= 0;
562 extern SquidConfig2 Config2
;
564 #endif /* SQUID_SQUIDCONFIG_H_ */