2 * Copyright (C) 1996-2016 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"
15 #include "ClientDelayConfig.h"
16 #include "DelayConfig.h"
17 #include "helper/ChildConfig.h"
18 #include "HttpHeaderTools.h"
19 #include "ip/Address.h"
21 #include "security/forward.h"
22 #include "SquidTime.h"
24 #include "ssl/support.h"
26 #include "store/forward.h"
29 class sslproxy_cert_sign
;
30 class sslproxy_cert_adapt
;
35 class ActionPasswordList
;
43 class RemovalPolicySettings
;
53 RefCount
<SwapDir
> *swapDirs
;
56 /// number of disk processes required to support all cache_dirs
59 #define INDEXSD(i) (Config.cacheSwap.swapDirs[i].getRaw())
62 /// the representation of the configuration. POD.
67 /* These should be for the Store::Root instance.
68 * this needs pluggable parsing to be done smoothly.
74 YesNoNone memShared
; ///< whether the memory cache is shared among workers
75 YesNoNone shmLocking
; ///< shared_memory_locking
84 RemovalPolicySettings
*replPolicy
;
85 RemovalPolicySettings
*memPolicy
;
86 #if USE_HTTP_VIOLATIONS
90 time_t negativeDnsTtl
;
91 time_t positiveDnsTtl
;
92 time_t shutdownLifetime
;
93 time_t backgroundPingRate
;
103 time_t clientIdlePconn
;
104 time_t serverIdlePconn
;
105 time_t ftpClientIdle
;
106 time_t pconnLifetime
; ///< pconn_lifetime in squid.conf
109 time_t request_start_timeout
;
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
;
118 size_t maxRequestHeaderSize
;
119 int64_t maxRequestBodySize
;
120 size_t maxRequestBufferSize
;
121 size_t maxReplyHeaderSize
;
122 AclSizeLimit
*ReplyBodySize
;
154 Ip::Address_list
*router
;
156 int forwarding_method
;
158 int assignment_method
;
165 char *as_whois_server
;
170 CustomLog
*accesslogs
;
180 char *visible_appname_string
;
181 char *effectiveGroup
;
199 Helper::ChildConfig redirectChildren
;
200 Helper::ChildConfig storeIdChildren
;
201 time_t authenticateGCInterval
;
202 time_t authenticateTTL
;
203 time_t authenticateIpTTL
;
209 size_t appendDomainLen
;
212 char *mimeTablePathname
;
214 char *visibleHostname
;
215 char *uniqueHostname
;
216 wordlist
*hostnameAliases
;
228 Ip::Address udp_incoming
;
229 Ip::Address udp_outgoing
;
231 Ip::Address snmp_incoming
;
232 Ip::Address snmp_outgoing
;
234 /* FIXME INET6 : this should really be a CIDR value */
235 Ip::Address client_netmask
;
238 size_t udpMaxHitObjsz
;
239 wordlist
*mcast_group_list
;
240 wordlist
*dns_nameservers
;
255 Mgr::ActionPasswordList
*passwd_list
;
258 int objectsPerBucket
;
259 int64_t avgObjectSize
;
260 int64_t maxObjectSize
;
261 int64_t minObjectSize
;
262 size_t maxInMemObjSize
;
284 int test_reachability
;
285 int half_closed_clients
;
287 #if USE_HTTP_VIOLATIONS
293 int redir_rewrites_host
;
295 int nonhierarchical_direct
;
296 int strip_query_terms
;
297 int redirector_bypass
;
299 int ignore_unknown_nameservers
;
303 #if USE_CACHE_DIGESTS
305 int digest_generation
;
308 int vary_ignore_expire
;
309 int surrogate_is_remote
;
310 int request_entities
;
311 int detect_broken_server_pconns
;
312 int balance_on_multiple_ip
;
313 int relaxed_header_parser
;
315 int allow_underscore
;
317 int cache_miss_revalidate
;
319 int httpd_suppress_version_string
;
320 int global_internal_static
;
321 int collapsed_forwarding
;
323 #if FOLLOW_X_FORWARDED_FOR
324 int acl_uses_indirect_client
;
325 int delay_pool_uses_indirect_client
;
326 int log_uses_indirect_client
;
328 int tproxy_uses_indirect_client
;
330 #endif /* FOLLOW_X_FORWARDED_FOR */
332 int WIN32_IpAddrChangeMonitor
;
333 int memory_cache_first
;
334 int memory_cache_disk
;
335 int hostStrictVerify
;
336 int client_dst_passthru
;
339 bool logTlsServerHelloDetails
;
343 int64_t collapsed_forwarding_shared_entries_limit
;
345 int pipeline_max_prefetch
;
347 int forward_max_tries
;
354 acl_access
*adapted_http
;
357 acl_access
*NeverDirect
;
358 acl_access
*AlwaysDirect
;
362 acl_access
*storeMiss
;
363 acl_access
*stats_collection
;
368 #if USE_HTTP_VIOLATIONS
369 acl_access
*brokenPosts
;
371 acl_access
*redirector
;
372 acl_access
*store_id
;
374 Acl::Address
*outgoing_address
;
378 acl_access
*htcp_clr
;
382 acl_access
*ssl_bump
;
384 #if FOLLOW_X_FORWARDED_FOR
385 acl_access
*followXFF
;
386 #endif /* FOLLOW_X_FORWARDED_FOR */
388 /// acceptible PROXY protocol clients
389 acl_access
*proxyProtocol
;
391 /// spoof_client_ip squid.conf acl.
392 /// nil unless configured
393 acl_access
* spoof_client_ip
;
394 acl_access
*on_unsupported_protocol
;
396 acl_access
*ftp_epsv
;
398 acl_access
*forceRequestBodyContinuation
;
399 acl_access
*serverPconnForNonretriable
;
401 AclDenyInfoList
*denyInfoList
;
414 RefreshPattern
*Refresh
;
416 Store::DiskConfig cacheSwap
;
422 char *errorDirectory
;
424 char *errorDefaultLanguage
;
425 int errorLogMissingLanguages
;
427 char *errorStylesheet
;
439 ClientDelayConfig ClientDelay
;
448 int max_open_disk_fds
;
450 AclSizeLimit
*rangeOffsetLimit
;
451 #if MULTICAST_MISS_STREAM
462 /// request_header_access and request_header_replace
463 HeaderManglers
*request_header_access
;
464 /// reply_header_access and reply_header_replace
465 HeaderManglers
*reply_header_access
;
466 ///request_header_add access list
467 HeaderWithAclList
*request_header_add
;
468 ///reply_header_add access list
469 HeaderWithAclList
*reply_header_add
;
474 #if USE_CACHE_DIGESTS
478 time_t rebuild_period
;
479 time_t rewrite_period
;
480 size_t swapout_chunk_size
;
481 int rebuild_chunk_percentage
;
487 int unclean_shutdown
;
490 size_t sessionCacheSize
;
495 wordlist
*ext_methods
;
502 char *store_dir_select_algorithm
;
503 int sleep_after_fork
; /* microseconds */
504 time_t minimum_expiry_time
; /* seconds */
505 external_acl
*externalAclHelperList
;
508 Security::ContextPointer sslContext
;
510 char *foreignIntermediateCertsPath
;
511 acl_access
*cert_error
;
512 sslproxy_cert_sign
*cert_sign
;
513 sslproxy_cert_adapt
*cert_adapt
;
519 int max_filedescriptors
;
521 CpuAffinityMap
*cpuAffinityMap
;
523 #if USE_LOADABLE_MODULES
524 wordlist
*loadable_module_names
;
527 int client_ip_max_connections
;
529 char *redirector_extras
;
531 struct UrlHelperTimeout
{
534 } onUrlRewriteTimeout
;
536 char *storeId_extras
;
539 int v4_first
; ///< Place IPv4 first in the order of DNS results.
540 ssize_t packet_max
; ///< maximum size EDNS advertised for DNS replies.
545 extern SquidConfig Config
;
551 *this = SquidConfig2();
555 int enable_purge
= 0;
557 uid_t effectiveUserID
= 0;
558 gid_t effectiveGroupID
= 0;
561 extern SquidConfig2 Config2
;
563 #endif /* SQUID_SQUIDCONFIG_H_ */