Squid Web Cache master
Loading...
Searching...
No Matches
SquidConfig.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3 *
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.
7 */
8
9#ifndef SQUID_SRC_SQUIDCONFIG_H
10#define SQUID_SRC_SQUIDCONFIG_H
11
12#include "acl/forward.h"
13#include "base/RefCount.h"
14#include "base/YesNoNone.h"
15#if USE_DELAY_POOLS
16#include "ClientDelayConfig.h"
17#include "DelayConfig.h"
18#endif
19#include "HeaderMangling.h"
20#include "helper/ChildConfig.h"
21#include "ip/Address.h"
22#if USE_DELAY_POOLS
23#include "MessageDelayPools.h"
24#endif
25#include "Notes.h"
26#include "security/Context.h"
27#include "security/forward.h"
28#if USE_OPENSSL
29#include "ssl/support.h"
30#endif
31#include "store/Disk.h"
32#include "store/forward.h"
33#include "time/gadgets.h"
34
35#include <chrono>
36
37#if USE_OPENSSL
40#endif
41
42namespace Mgr
43{
44class ActionPasswordList;
45} // namespace Mgr
46
47class CachePeers;
48class CustomLog;
49class CpuAffinityMap;
50class DebugMessages;
51class external_acl;
52class HeaderManglers;
53class RefreshPattern;
56
57namespace AnyP
58{
59class PortCfg;
60}
61
62namespace Store {
64public:
65 DiskConfig() { assert(swapDirs == nullptr); }
66 ~DiskConfig() { delete[] swapDirs; }
67
69 size_t n_allocated = 0;
70 size_t n_configured = 0;
72 int n_strands = 0;
73};
74#define INDEXSD(i) (Config.cacheSwap.swapDirs[i].getRaw())
75}
76
79{
80public:
81 struct {
82 /* These should be for the Store::Root instance.
83 * this needs pluggable parsing to be done smoothly.
84 */
88
91 size_t memMaxSize;
92
93 struct {
94 int64_t min;
95 int pct;
96 int64_t max;
98 int64_t readAheadGap;
101#if USE_HTTP_VIOLATIONS
103#endif
104 time_t maxStale;
110
111 struct {
112 time_t read;
113 time_t write;
114 time_t lifetime;
115 time_t connect;
116 time_t forward;
118 time_t request;
124 time_t deadPeer;
126 int icp_query; /* msec */
127 int icp_query_max; /* msec */
128 int icp_query_min; /* msec */
129 int mcast_icp_query; /* msec */
139
140 struct {
141 unsigned short icp;
142#if USE_HTCP
143
144 unsigned short htcp;
145#endif
146#if SQUID_SNMP
147
148 unsigned short snmp;
149#endif
151
152#if SQUID_SNMP
153
154 struct {
158#endif
159#if USE_WCCP
160
161 struct {
166#endif
167#if USE_WCCPv2
168
169 struct {
177 void *info;
179#endif
180
182
183 struct {
184 char *store;
185 char *swap;
187#if ICAP_CLIENT
189#endif
199
200 struct {
203#if USE_UNLINKD
204
205 char *unlinkd;
206#endif
207
208 char *diskd;
209#if USE_OPENSSL
210
212#endif
213
215
218
219 struct {
232
233 struct {
234
237#if SQUID_SNMP
240#endif
241 // TODO: this should really be a CIDR value
249
250 struct {
251 int size;
252 int low;
253 int high;
255
256 struct {
257 int size;
262
263 struct {
270
271 struct {
272 int high;
273 int low;
274 time_t period;
276
277 struct {
291#if USE_HTTP_VIOLATIONS
292
294#endif
295
307#if USE_CACHE_DIGESTS
308
310#endif
311
318 int via;
324
325#if FOLLOW_X_FORWARDED_FOR
329#if LINUX_NETFILTER
331#endif
332#endif /* FOLLOW_X_FORWARDED_FOR */
333
340#if USE_OPENSSL
342#endif
344
346
348
349 // these values are actually unsigned
350 // TODO: extend the parser to support more nuanced types
353
354 std::chrono::nanoseconds paranoid_hit_validation;
355
357
358 struct {
370#if SQUID_SNMP
371
373#endif
374#if USE_HTTP_VIOLATIONS
376#endif
381#if USE_HTCP
382
385#endif
386
387#if USE_OPENSSL
389#endif
390#if FOLLOW_X_FORWARDED_FOR
392#endif /* FOLLOW_X_FORWARDED_FOR */
393
396
401
403
409
410 struct {
416 int epsv;
417 int eprt;
422
424
425 struct {
430#if USE_ERR_LOCALES
433#endif
435
436 struct {
439
440 struct {
441 int64_t limit;
443#if USE_DELAY_POOLS
444
448#endif
449
459
474#if USE_CACHE_DIGESTS
475
476 struct {
483#endif
484#if USE_OPENSSL
485
486 struct {
493#endif
494
495 struct {
501 int sleep_after_fork; /* microseconds */
502 time_t minimum_expiry_time; /* seconds */
504
505 struct {
507 // TODO: Remove when FuturePeerContext above becomes PeerContext
510#if USE_OPENSSL
515#endif
517
519 int umask;
523
524#if USE_LOADABLE_MODULES
526#endif
527
529
531
536
538
539 struct {
542 ssize_t packet_max;
544
545 struct {
550};
551
552extern SquidConfig Config;
553
555{
556public:
557 void clear() {
558 *this = SquidConfig2();
559 }
560
561 struct {
566};
567
568extern SquidConfig2 Config2;
569
570#endif /* SQUID_SRC_SQUIDCONFIG_H */
571
std::list< HeaderWithAcl > HeaderWithAclList
SquidConfig Config
SquidConfig2 Config2
#define assert(EX)
Definition assert.h:17
deny_info representation. Currently a POD.
representation of a class of Size-limit ACLs
list of address-based ACLs.
Definition Address.h:21
parsed "acl aclname ..." directives indexed by aclname
Definition Acl.cc:38
cache_peer configuration storage
Definition CachePeers.h:21
stores cpu_affinity_map configuration
a collection of DebugMessage objects (with fast access by message IDs)
Definition Messages.h:68
A collection of headerMangler objects for a given message kind.
Allows or blocks HTTP Upgrade protocols (see http_upgrade_request_protocols)
represents configuration for response delay pools
list of cachemgr password authorization definitions. Currently a POD.
Definition Notes.h:114
a representation of a refresh pattern.
A combination of PeerOptions and the corresponding Context.
a single tls_key_log directive configuration and logging handler
Definition KeyLog.h:20
gid_t effectiveGroupID
struct SquidConfig2::@102 onoff
uid_t effectiveUserID
the representation of the configuration. POD.
Definition SquidConfig.h:79
int cache_miss_revalidate
Ip::Address address
Helper::ChildConfig redirectChildren
int surrogate_is_remote
int64_t limit
char * errHtmlText
time_t negativeDnsTtl
size_t maxRequestBufferSize
Ip::Address udp_outgoing
char * errorStylesheet
time_t request_start_timeout
struct SquidConfig::@75 Swap
char * mimeTablePathname
struct SquidConfig::@99 ssl_client
size_t memMaxSize
Definition SquidConfig.h:91
int nonhierarchical_direct
size_t tcpRcvBufsz
size_t appendDomainLen
acl_access * adapted_http
Security::KeyLog * tlsKeys
one optional tls_key_log
int64_t readAheadGap
Definition SquidConfig.h:98
acl_access * spoof_client_ip
struct SquidConfig::@79 Snmp
int max_filedescriptors
HeaderWithAclList * request_header_add
request_header_add access list
time_t peer_connect
struct SquidConfig::@89 Netdb
int errorLogMissingLanguages
HeaderManglers * request_header_access
request_header_access and request_header_replace
struct SquidConfig::@82 Log
int log_uses_indirect_client
acl_access * ASlists
int objectsPerBucket
int acl_uses_indirect_client
sslproxy_cert_adapt * cert_adapt
char * effectiveGroup
time_t siteSelect
int connect_retries
time_t deadPeer
int vary_ignore_expire
int64_t shared_transient_entries_limit
char * ssl_password
struct SquidConfig::@96 digest
wordlist * store_id
struct SquidConfig::@76 quickAbort
int delay_pool_uses_indirect_client
char * agentInfo
char * foreignIntermediateCertsPath
Helper::ChildConfig storeIdChildren
CustomLog * accesslogs
char * errorDirectory
Ip::Address snmp_outgoing
time_msec_t idns_retransmit
Ip::Address_list * router
int store_id_bypass
acl_access * followXFF
time_t rebuild_period
char * EmailFrom
struct SquidConfig::@94 retry
int use_short_names
acl_access * redirector
char * storeId_extras
int64_t avgObjectSize
char * errorDefaultLanguage
HeaderManglers * reply_header_access
reply_header_access and reply_header_replace
char * anon_user
acl_access * icp
char * accept_filter
int hostStrictVerify
time_t ftpClientIdle
char * visible_appname_string
int mcast_icp_query
int memory_cache_first
int strip_query_terms
int client_dst_passthru
ClientDelayConfig ClientDelay
int tproxy_uses_indirect_client
int forward_max_tries
char * etcHostsPath
Notes notes
note
size_t maxReplyHeaderSize
acl_access * reply
acl_access * htcp_clr
time_msec_t idns_query
int reload_into_ims
acl_access * brokenPosts
acl_access * http
int connect_timeout
struct SquidConfig::@83 Program
acl_access * collapsedForwardingAccess
struct SquidConfig::@86 ipcache
struct SquidConfig::@81 Wccp2
char * unlinkd
time_t request
RemovalPolicySettings * replPolicy
Definition SquidConfig.h:99
CustomLog * icaplogs
struct SquidConfig::@87 fqdncache
int redirector_bypass
wordlist * redirect
int unclean_shutdown
int64_t maxRequestBodySize
std::chrono::nanoseconds paranoid_hit_validation
struct SquidConfig::@97 SSL
size_t sessionCacheSize
Store::DiskConfig cacheSwap
RefreshPattern * Refresh
struct SquidConfig::@77 Timeout
acl_access * store_id
Ip::Address udp_incoming
Acl::Address * outgoing_address
time_t lifetime
char * appendDomain
int WIN32_IpAddrChangeMonitor
Security::ContextPointer * sslContext_
time_t forward
sslproxy_cert_sign * cert_sign
char * coredump_dir
int memory_cache_disk
int test_reachability
time_t negativeTtl
size_t swapout_chunk_size
CpuAffinityMap * cpuAffinityMap
SBufList hostnameAliases
struct SquidConfig::@85 Addrs
size_t high_memory
acl_access * cert_error
YesNoNone shmLocking
shared_memory_locking
Definition SquidConfig.h:90
time_t pconnLifetime
pconn_lifetime in squid.conf
RemovalPolicySettings * memPolicy
time_t urlRewrite
ssize_t packet_max
maximum size EDNS advertised for DNS replies.
Mgr::ActionPasswordList * passwd_list
HeaderWithAclList * reply_header_add
reply_header_add access list
size_t maxInMemObjSize
int forwarding_method
char * surrogate_id
char * certSignHash
Security::FuturePeerContext * defaultPeerContext
time_t shutdownLifetime
AclDenyInfoList * denyInfoList
CachePeers * peers
struct SquidConfig::@90 onoff
external_acl * externalAclHelperList
bool logTlsServerHelloDetails
Acl::NamedAcls * namedAcls
acl aclname acltype ...
time_t clientIdlePconn
int rebuild_chunk_percentage
time_t maxStale
char * ssl_engine
acl_access * stats_collection
Ip::Address snmp_incoming
struct SquidConfig::CommIncoming comm_incoming
int digest_generation
size_t maxRequestHeaderSize
int collapsed_forwarding
char * chroot_dir
acl_access * serverPconnForNonretriable
unsigned short icp
wordlist * mcast_group_list
size_t udpMaxHitObjsz
struct SquidConfig::UrlHelperTimeout onUrlRewriteTimeout
int assignment_method
acl_access * ssl_bump
size_t list_width
AclSizeLimit * rangeOffsetLimit
struct SquidConfig::@100 dns
int check_hostnames
struct SquidConfig::@98 warnings
Ip::Address router
char * configFile
char * netdbFilename
int64_t min
Definition SquidConfig.h:94
char * as_whois_server
int sleep_after_fork
acl_access * storeMiss
time_t hopelessKidRevivalDelay
hopeless_kid_revival_delay
int max_open_disk_fds
char * visibleHostname
acl_access * htcp
char * adminEmail
time_t rewrite_period
struct SquidConfig::@93 icons
int relaxed_header_parser
struct SquidConfig::@92 Ftp
time_t connect
char * redirector_extras
struct SquidConfig::@101 happyEyeballs
struct SquidConfig::@95 MemPools
time_t positiveDnsTtl
char * uniqueHostname
time_t minimum_expiry_time
acl_access * sendHit
struct SquidConfig::@80 Wccp
acl_access * on_unsupported_protocol
SBufList loadable_module_names
Ip::Address client_netmask
struct SquidConfig::@91 accessList
struct SquidConfig::@78 Port
char * EmailProgram
char * pidFilename
acl_access * ftp_epsv
struct SquidConfig::@84 Accel
acl_access * snmp
acl_access * noCache
int64_t maxObjectSize
time_t serverIdlePconn
char * store_dir_select_algorithm
int allow_underscore
AclSizeLimit * ReplyBodySize
int highWaterMark
Definition SquidConfig.h:85
int client_ip_max_connections
char * directory
int pipeline_max_prefetch
int v4_first
Place IPv4 first in the order of DNS results.
int redir_rewrites_host
char * effectiveUser
HttpUpgradeProtocolAccess * http_upgrade_request_protocols
http_upgrade_request_protocols
acl_access * proxyProtocol
acceptable PROXY protocol clients
int64_t max
Definition SquidConfig.h:96
time_t backgroundPingRate
struct SquidConfig::@88 Store
int detect_broken_server_pconns
time_t period
unsigned short htcp
unsigned short snmp
acl_access * miss
int half_closed_clients
DelayConfig Delay
acl_access * NeverDirect
int global_internal_static
YesNoNone memShared
whether the memory cache is shared among workers
Definition SquidConfig.h:89
SBufList nameservers
MessageDelayConfig MessageDelay
int ignore_unknown_nameservers
acl_access * AlwaysDirect
int httpd_suppress_version_string
acl_access * forceRequestBodyContinuation
int64_t minObjectSize
int refresh_all_ims
RefCount< SwapDir > * swapDirs
Definition SquidConfig.h:68
int n_strands
number of disk processes required to support all cache_dirs
Definition SquidConfig.h:72
Definition forward.h:15
Cache Manager API.
Definition Action.h:21
std::shared_ptr< SSL_CTX > ContextPointer
Definition Context.h:29
std::list< SBuf > SBufList
Definition forward.h:23
struct SquidConfig::CommIncoming::Measure udp
struct SquidConfig::CommIncoming::Measure dns
struct SquidConfig::CommIncoming::Measure tcp
uint64_t time_msec_t
Definition gadgets.h:16