3 * $Id: structs.h,v 1.308 1999/12/30 17:37:00 wessels Exp $
6 * SQUID Internet Object Cache http://squid.nlanr.net/Squid/
7 * ----------------------------------------------------------
9 * Squid is the result of efforts by numerous individuals from the
10 * Internet community. Development is led by Duane Wessels of the
11 * National Laboratory for Applied Network Research and funded by the
12 * National Science Foundation. Squid is Copyrighted (C) 1998 by
13 * Duane Wessels and the University of California San Diego. Please
14 * see the COPYRIGHT file for full details. Squid incorporates
15 * software developed and/or copyrighted by other sources. Please see
16 * the CREDITS file for full details.
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
46 struct in_addr addr1
; /* if addr2 non-zero then its a range */
49 acl_ip_data
*next
; /* used for parsing, not for storing */
52 struct _acl_snmp_comm
{
58 struct _acl_time_data
{
65 struct _acl_name_list
{
66 char name
[ACL_NAME_SZ
];
70 struct _acl_proxy_auth_user
{
71 /* first two items must be same as hash_link */
73 acl_proxy_auth_user
*next
;
74 /* extra fields for proxy_auth */
76 int passwd_ok
; /* 1 = passwd checked OK */
78 struct in_addr ipaddr
; /* IP addr this user authenticated from */
82 struct _acl_deny_info_list
{
85 acl_name_list
*acl_list
;
86 acl_deny_info_list
*next
;
91 struct _acl_arp_data
{
98 /* never reference these directly! */
99 unsigned short int size
; /* buffer size; 64K limit */
100 unsigned short int len
; /* current length */
106 struct _snmp_request_t
{
113 struct sockaddr_in from
;
114 struct snmp_pdu
*PDU
;
115 aclCheck_t
*acl_checklist
;
122 char name
[ACL_NAME_SZ
];
143 const acl_access
*access_list
;
144 struct in_addr src_addr
;
145 struct in_addr dst_addr
;
146 struct in_addr my_addr
;
147 unsigned short my_port
;
150 ConnStateData
*conn
; /* hack for ident */
151 char ident
[USER_IDENT_SZ
];
153 char browser
[BROWSERNAMELEN
];
154 acl_proxy_auth_user
*auth_user
;
155 acl_lookup_state state
[ACL_ENUM_MAX
];
157 char *snmp_community
;
163 struct _aio_result_t
{
195 struct _sockaddr_in_list
{
196 struct sockaddr_in s
;
197 sockaddr_in_list
*next
;
206 /* malloc()'d only as far as used (class * sizeof(delaySpec)!
207 * order of elements very important!
209 struct _delaySpecSet
{
211 delaySpec individual
;
215 struct _delayConfig
{
216 unsigned short pools
;
217 unsigned short initial
;
218 unsigned char *class;
219 delaySpecSet
**rates
;
225 struct _SquidConfig
{
246 * Note: the non-LRU policies do not use referenceAge, but we cannot
247 * remove it until we find out how to implement #else for cf_parser.c
252 time_t negativeDnsTtl
;
253 time_t positiveDnsTtl
;
254 time_t shutdownLifetime
;
264 int icp_query
; /* msec */
265 int icp_query_max
; /* msec */
266 int mcast_icp_query
; /* msec */
271 size_t maxRequestHeaderSize
;
272 size_t maxRequestBodySize
;
273 size_t maxReplyBodySize
;
284 sockaddr_in_list
*http
;
294 struct in_addr router
;
295 struct in_addr incoming
;
296 struct in_addr outgoing
;
299 char *as_whois_server
;
310 char *effectiveGroup
;
314 wordlist
*authenticate
;
319 int redirectChildren
;
320 int authenticateChildren
;
322 int authenticateIpTTL
;
328 size_t appendDomainLen
;
331 char *mimeTablePathname
;
332 char *visibleHostname
;
333 char *uniqueHostname
;
334 wordlist
*hostnameAliases
;
343 struct in_addr tcp_outgoing
;
344 struct in_addr udp_incoming
;
345 struct in_addr udp_outgoing
;
347 struct in_addr snmp_incoming
;
348 struct in_addr snmp_outgoing
;
350 struct in_addr client_netmask
;
353 size_t udpMaxHitObjsz
;
354 wordlist
*hierarchy_stoplist
;
355 wordlist
*mcast_group_list
;
356 wordlist
*dns_testname_list
;
357 wordlist
*dns_nameservers
;
369 cachemgr_passwd
*passwd_list
;
371 int objectsPerBucket
;
372 size_t avgObjectSize
;
373 size_t maxObjectSize
;
389 #if ALLOW_SOURCE_PING
396 int accel_with_proxy
;
398 int test_reachability
;
399 int half_closed_clients
;
404 int redir_rewrites_host
;
406 int strip_query_terms
;
407 int redirector_bypass
;
408 int ignore_unknown_nameservers
;
409 #if USE_CACHE_DIGESTS
410 int digest_generation
;
418 acl_access
*NeverDirect
;
419 acl_access
*AlwaysDirect
;
425 acl_access
*brokenPosts
;
427 acl_access
*identLookup
;
429 acl_access
*redirector
;
431 acl_deny_info_list
*denyInfoList
;
432 char *proxyAuthRealm
;
448 char *errorDirectory
;
467 int max_open_disk_fds
;
469 size_t rangeOffsetLimit
;
470 #if MULTICAST_MISS_STREAM
478 HttpHeaderMask anonymize_headers
;
480 #if USE_CACHE_DIGESTS
485 int swapout_chunk_size
;
486 int rebuild_chunk_percentage
;
491 struct _SquidConfig2
{
498 struct _close_handler
{
514 struct _dnsserver_t
{
521 char ip_inbuf
[DNS_INBUF_SZ
];
522 struct timeval dispatch_time
;
526 struct _dnsStatData
{
529 int hist
[DefaultDnsChildrenMax
];
542 /* ETag support is rudimantal;
543 * this struct is likely to change
544 * Note: "str" points to memory in HttpHeaderEntry (for now)
545 * so ETags should be used as tmp variables only (for now) */
547 const char *str
; /* quoted-string */
548 int weak
; /* true if it is a weak validator */
555 char ipaddr
[16]; /* dotted decimal address of peer */
556 char desc
[FD_DESC_SZ
];
559 unsigned int close_request
:1;
560 unsigned int write_daemon
:1;
561 unsigned int closing
:1;
562 unsigned int socket_eof
:1;
563 unsigned int nolinger
:1;
564 unsigned int nonblocking
:1;
566 unsigned int called_connect
:1;
570 int uses
; /* ie # req's over persistent conn */
573 void *wrt_handle_data
;
575 dwrite_q
*write_q_tail
;
586 close_handler
*close_handler
; /* linked list */
587 DEFER
*defer_check
; /* check if we should defer read */
589 CommWriteStateData
*rwstate
; /* State data for comm_write */
597 unsigned long *file_map
;
600 /* auto-growing memory-resident buffer with printf interface */
601 /* note: when updating this struct, update MemBufNULL #define */
603 /* public, read-only */
605 mb_size_t size
; /* used space, does not count 0-terminator */
607 /* private, stay away; use interface function instead */
608 mb_size_t max_capacity
; /* when grows: assert(new_capacity <= max_capacity) */
609 mb_size_t capacity
; /* allocated space */
610 FREE
*freefunc
; /* what to use to free the buffer, NULL after memBufFreeFunc() is called */
613 /* see Packer.c for description */
615 /* protected, use interface functions instead */
618 void *real_handler
; /* first parameter to real append and vprintf */
621 /* http status line */
622 struct _HttpStatusLine
{
623 /* public, read only */
625 const char *reason
; /* points to a _constant_ string (default or supplied), never free()d */
630 * Note: HttpBody is used only for messages with a small content that is
631 * known a priory (e.g., error messages).
638 /* http header extention field */
639 struct _HttpHdrExtField
{
640 String name
; /* field-name from HTTP/1.1 (no column after name) */
641 String value
; /* field-value from HTTP/1.1 */
644 /* http cache control header field */
651 /* http byte-range-spec */
652 struct _HttpHdrRangeSpec
{
657 /* There may be more than one byte range specified in the request.
658 * This object holds all range specs in order of their appearence
659 * in the request because we SHOULD preserve that order.
661 struct _HttpHdrRange
{
665 /* http content-range header field */
666 struct _HttpHdrContRange
{
667 HttpHdrRangeSpec spec
;
668 ssize_t elength
; /* entity length, not content length */
671 /* some fields can hold either time or etag specs (e.g. If-Range) */
673 ETag tag
; /* entity tag */
675 int valid
; /* true if struct is usable */
678 /* data for iterating thru range specs */
679 struct _HttpHdrRangeIter
{
681 const HttpHdrRangeSpec
*spec
; /* current spec at pos */
682 ssize_t debt_size
; /* bytes left to send from the current spec */
683 ssize_t prefix_size
; /* the size of the incoming HTTP msg prefix */
684 String boundary
; /* boundary for multipart responses */
687 /* constant attributes of http header fields */
688 struct _HttpHeaderFieldAttrs
{
694 /* per field statistics */
695 struct _HttpHeaderFieldStat
{
696 int aliveCount
; /* created but not destroyed (count) */
697 int seenCount
; /* #fields we've seen */
698 int parsCount
; /* #parsing attempts */
699 int errCount
; /* #pasring errors */
700 int repCount
; /* #repetitons */
703 /* compiled version of HttpHeaderFieldAttrs plus stats */
704 struct _HttpHeaderFieldInfo
{
708 HttpHeaderFieldStat stat
;
711 struct _HttpHeaderEntry
{
718 /* protected, do not use these, use interface functions instead */
719 Array entries
; /* parsed fields in raw format */
720 HttpHeaderMask mask
; /* bit set <=> entry present */
721 http_hdr_owner_type owner
; /* request or reply */
722 int len
; /* length when packed, not counting terminating '\0' */
726 /* unsupported, writable, may disappear/change in the future */
727 int hdr_sz
; /* sums _stored_ status-line, headers, and <CRLF> */
729 /* public, readable; never update these or their .hdr equivalents directly */
732 time_t last_modified
;
735 HttpHdrCc
*cache_control
;
736 HttpHdrContRange
*content_range
;
737 short int keep_alive
;
739 /* public, readable */
740 HttpMsgParseState pstate
; /* the current parsing state */
742 /* public, writable, but use httpReply* interfaces when possible */
743 HttpStatusLine sline
;
745 HttpBody body
; /* for small constant memory-resident text bodies only */
748 struct _http_state_flags
{
749 unsigned int proxying
:1;
750 unsigned int keepalive
:1;
751 unsigned int only_if_cached
:1;
754 struct _HttpStateData
{
759 peer
*peer
; /* peer request made to */
760 int eof
; /* reached end-of-object? */
761 request_t
*orig_request
;
763 http_state_flags flags
;
768 struct sockaddr_in address
;
773 struct timeval start
;
776 struct timeval queue_time
;
780 struct timeval start
;
784 int n_replies_expected
;
785 int timeout
; /* msec */
791 struct _HierarchyLogEntry
{
793 char host
[SQUIDHOSTNAMELEN
];
795 char cd_host
[SQUIDHOSTNAMELEN
]; /* the host of selected by cd peer */
796 peer_select_alg_t alg
; /* peer selection algorithm */
797 lookup_t cd_lookup
; /* cd prediction: none, miss, hit */
798 int n_choices
; /* #peers we selected from (cd only) */
799 int n_ichoices
; /* #peers with known rtt we selected from (cd only) */
800 struct timeval peer_select_start
;
801 struct timeval store_complete_stop
;
804 struct _AccessLogEntry
{
809 const char *content_type
;
816 struct in_addr caddr
;
827 const char *method_str
;
829 HierarchyLogEntry hier
;
832 struct _clientHttpRequest
{
834 request_t
*request
; /* Parsed URL ... */
841 HttpHdrRangeIter range_iter
; /* data for iterating thru range specs */
842 size_t req_sz
; /* raw request size on input, not current request size */
844 StoreEntry
*old_entry
;
846 #if USE_CACHE_DIGESTS
847 const char *lookup_type
; /* temporary hack: storeGet() result: HIT/MISS/NONE */
849 http_status http_code
;
850 struct timeval start
;
853 aclCheck_t
*acl_checklist
; /* need ptr back so we can unreg if needed */
854 clientHttpRequest
*next
;
857 unsigned int accel
:1;
858 unsigned int internal
:1;
859 unsigned int done_copying
:1;
868 struct _ConnStateData
{
875 clientHttpRequest
*chr
;
876 struct sockaddr_in peer
;
877 struct sockaddr_in me
;
878 struct in_addr log_addr
;
879 char ident
[USER_IDENT_SZ
];
888 struct _ipcache_addrs
{
889 struct in_addr
*in_addrs
;
890 unsigned char *bad_mask
;
893 unsigned char badcount
;
902 struct _ipcache_entry
{
903 /* first two items must be equivalent to hash_link */
909 ip_pending
*pending_head
;
911 struct timeval request_time
;
914 ipcache_status_t status
:3;
917 struct _fqdn_pending
{
923 struct _fqdncache_entry
{
924 /* first two items must be equivalent to hash_link */
926 fqdncache_entry
*next
;
929 unsigned char name_count
;
930 char *names
[FQDN_MAX_NAMES
+ 1];
931 fqdn_pending
*pending_head
;
933 struct timeval request_time
;
936 fqdncache_status_t status
:3;
939 struct _domain_ping
{
941 int do_ping
; /* boolean */
945 struct _domain_type
{
951 #if USE_CACHE_DIGESTS
953 short int current
; /* current version */
954 short int required
; /* minimal version that can safely handle current version */
957 /* digest control block; used for transmission and storage */
958 struct _StoreDigestCBlock
{
964 unsigned char bits_per_entry
;
965 unsigned char hash_func_count
;
966 short int reserved_short
;
967 int reserved
[32 - 6];
970 struct _DigestFetchState
{
973 StoreEntry
*old_entry
;
986 /* statistics for cache digests and other hit "predictors" */
987 struct _cd_guess_stats
{
988 /* public, read-only */
993 int close_hits
; /* tmp, remove it later */
997 peer
*peer
; /* pointer back to peer structure, argh */
998 CacheDigest
*cd
; /* actual digest structure */
999 String host
; /* copy of peer->host */
1000 const char *req_result
; /* text status of the last request */
1002 unsigned int needed
:1; /* there were requests for this digest */
1003 unsigned int usable
:1; /* can be used for lookups */
1004 unsigned int requested
:1; /* in process of receiving [fresh] digest */
1007 /* all times are absolute unless augmented with _delay */
1008 time_t initialized
; /* creation */
1009 time_t needed
; /* first lookup/use by a peer */
1010 time_t next_check
; /* next scheduled check/refresh event */
1011 time_t retry_delay
; /* delay before re-checking _invalid_ digest */
1012 time_t requested
; /* requested a fresh copy of a digest */
1013 time_t req_delay
; /* last request response time */
1014 time_t received
; /* received the current copy of a digest */
1015 time_t disabled
; /* disabled for good */
1018 cd_guess_stats guess
;
1032 struct sockaddr_in in_addr
;
1038 int ignored_replies
;
1039 int n_keepalives_sent
;
1040 int n_keepalives_recv
;
1043 int logged_state
; /* so we can print dead/revived msgs */
1047 int counts
[ICP_END
];
1058 domain_ping
*peer_domain
;
1059 domain_type
*typelist
;
1062 unsigned int proxy_only
:1;
1063 unsigned int no_query
:1;
1064 unsigned int no_digest
:1;
1065 unsigned int default_parent
:1;
1066 unsigned int roundrobin
:1;
1067 unsigned int mcast_responder
:1;
1068 unsigned int closest_only
:1;
1070 unsigned int htcp
:1;
1072 unsigned int no_netdb_exchange
:1;
1074 unsigned int no_delay
:1;
1079 double avg_n_members
;
1080 int n_times_counted
;
1081 int n_replies_expected
;
1085 unsigned int count_event_pending
:1;
1086 unsigned int counting
:1;
1089 #if USE_CACHE_DIGESTS
1093 int tcp_up
; /* 0 if a connect() fails */
1094 time_t last_fail_time
;
1095 struct in_addr addresses
[10];
1103 unsigned long load_multiplier
;
1107 char *login
; /* Proxy authorization */
1108 time_t connect_timeout
;
1111 struct _net_db_name
{
1113 net_db_name
*htbl_next
;
1115 netdbEntry
*net_db_entry
;
1118 struct _net_db_peer
{
1125 struct _netdbEntry
{
1126 /* first two items must be equivalent to hash_link */
1134 time_t next_ping_time
;
1135 time_t last_use_time
;
1150 void *callback_data
;
1153 * Why are these struct sockaddr_in instead of peer *? Because a
1154 * peer structure can become invalid during the peer selection
1155 * phase, specifically after a reconfigure. Thus we need to lookup
1156 * the peer * based on the address when we are finally ready to
1157 * reference the peer structure.
1159 struct sockaddr_in first_parent_miss
;
1160 struct sockaddr_in closest_parent_miss
;
1162 * ->hit and ->secho can be peer* because they should only be
1163 * accessed during the thread when they are set
1167 #if ALLOW_SOURCE_PING
1171 aclCheck_t
*acl_checklist
;
1174 struct _pingerEchoData
{
1176 unsigned char opcode
;
1178 char payload
[PINGER_PAYLOAD_SZ
];
1181 struct _pingerReplyData
{
1182 struct in_addr from
;
1183 unsigned char opcode
;
1187 char payload
[PINGER_PAYLOAD_SZ
];
1190 struct _icp_common_t
{
1191 unsigned char opcode
; /* opcode */
1192 unsigned char version
; /* version number */
1193 unsigned short length
; /* total length (bytes) */
1194 u_num32 reqnum
; /* req number (req'd for UDP) */
1197 u_num32 shostid
; /* sender host id */
1207 } Http
, Ftp
, Gopher
, Wais
;
1222 /* keep track each client receiving data from that particular StoreEntry */
1223 struct _store_client
{
1230 void *callback_data
;
1231 StoreEntry
*entry
; /* ptr to the parent StoreEntry, argh! */
1232 storeIOState
*swapin_sio
;
1234 unsigned int disk_io_pending
:1;
1235 unsigned int store_copying
:1;
1236 unsigned int copy_event_pending
:1;
1245 /* This structure can be freed while object is purged out from memory */
1252 store_client
*clients
;
1255 off_t queue_offset
; /* relative to in-mem data */
1260 struct timeval start_ping
;
1261 IRCB
*ping_reply_callback
;
1263 int fd
; /* FD of client creating this entry */
1269 #if HEAP_REPLACEMENT
1271 * A MemObject knows where it is in the in-memory heap.
1280 #if URL_CHECKSUM_DEBUG
1281 unsigned int chksum
;
1285 struct _StoreEntry
{
1286 /* first two items must be same as hash_link */
1287 const cache_key
*key
;
1294 size_t swap_file_sz
;
1297 sfileno swap_file_number
;
1298 #if HEAP_REPLACEMENT
1303 u_short lock_count
; /* Assume < 65536! */
1304 mem_status_t mem_status
:3;
1305 ping_status_t ping_status
:3;
1306 store_status_t store_status
:3;
1307 swap_status_t swap_status
:3;
1316 int index
; /* This entry's index into the swapDirs array */
1319 unsigned int selected
:1;
1320 unsigned int read_only
:1;
1329 STOBJUNLINK
*unlink
;
1336 STLOGCLEANOPEN
*open
;
1337 STLOGCLEANWRITE
*write
;
1366 struct _request_flags
{
1367 unsigned int range
:1;
1368 unsigned int nocache
:1;
1370 unsigned int auth
:1;
1371 unsigned int cachable
:1;
1372 unsigned int hierarchical
:1;
1373 unsigned int loopdetect
:1;
1374 unsigned int proxy_keepalive
:1;
1375 unsigned int proxying
:1;
1376 unsigned int refresh
:1;
1377 unsigned int used_proxy_auth
:1;
1378 unsigned int redirected
:1;
1379 unsigned int need_validation
:1;
1381 unsigned int nocache_hack
:1; /* for changing/ignoring no-cache requests */
1383 unsigned int accelerated
:1;
1384 unsigned int internal
:1;
1389 struct _link_list
*next
;
1392 struct _storeIOState
{
1393 sfileno swap_file_number
;
1395 size_t st_size
; /* do stat(2) after read open */
1396 off_t offset
; /* current offset pointer */
1398 void *callback_data
;
1401 void *callback_data
;
1404 unsigned int closing
:1; /* debugging aid */
1410 unsigned int close_request
:1;
1411 unsigned int reading
:1;
1412 unsigned int writing
:1;
1418 unsigned int close_request
:1;
1419 unsigned int reading
:1;
1420 unsigned int writing
:1;
1421 unsigned int opening
:1;
1423 const char *read_buf
;
1424 link_list
*pending_writes
;
1425 link_list
*pending_reads
;
1431 unsigned int reading
:1;
1432 unsigned int writing
:1;
1442 protocol_t protocol
;
1443 char login
[MAX_LOGIN_SZ
];
1444 char host
[SQUIDHOSTNAMELEN
+ 1];
1445 char user_ident
[USER_IDENT_SZ
]; /* from proxy auth or ident server */
1449 int link_count
; /* free when zero */
1450 request_flags flags
;
1451 HttpHdrCc
*cache_control
;
1452 HttpHdrRange
*range
;
1457 /* these in_addr's could probably be sockaddr_in's */
1458 struct in_addr client_addr
;
1459 struct in_addr my_addr
;
1460 unsigned short my_port
;
1465 HierarchyLogEntry hier
;
1467 char *peer_login
; /* Configured peer login:password */
1468 time_t lastmod
; /* Used on refreshes */
1471 struct _cachemgr_passwd
{
1474 cachemgr_passwd
*next
;
1479 regex_t compiled_pattern
;
1485 unsigned int icase
:1;
1487 unsigned int override_expire
:1;
1488 unsigned int override_lastmod
:1;
1489 unsigned int reload_into_ims
:1;
1490 unsigned int ignore_reload
:1;
1495 struct _CommWriteStateData
{
1504 struct _ErrorState
{
1507 http_status http_status
;
1513 char *dnsserver_msg
;
1515 struct in_addr src_addr
;
1518 void *callback_data
;
1520 unsigned int flag_cbdata
:1;
1523 wordlist
*server_msg
;
1531 * "very generic" histogram;
1532 * see important comments on hbase_f restrictions in StatHist.c
1540 hbase_f
*val_in
; /* e.g., log() for log-based histogram */
1541 hbase_f
*val_out
; /* e.g., exp() for log based histogram */
1545 * if you add a field to StatCounters,
1546 * you MUST sync statCountersInitSpecial, statCountersClean, and statCountersCopy
1548 struct _StatCounters
{
1556 kb_t hit_kbytes_out
;
1557 StatHist miss_svc_time
;
1558 StatHist nm_svc_time
;
1559 StatHist nh_svc_time
;
1560 StatHist hit_svc_time
;
1561 StatHist all_svc_time
;
1569 } all
, http
, ftp
, other
;
1581 int replies_dropped
;
1588 StatHist query_svc_time
;
1589 StatHist reply_svc_time
;
1606 #if USE_CACHE_DIGESTS
1607 cd_guess_stats guess
;
1609 StatHist on_xition_count
;
1619 struct timeval timestamp
;
1620 StatHist comm_icp_incoming
;
1621 StatHist comm_dns_incoming
;
1622 StatHist comm_http_incoming
;
1623 StatHist select_fds_hist
;
1650 int swap_files_cleaned
;
1651 int aborted_requests
;
1654 /* per header statistics */
1655 struct _HttpHeaderStat
{
1657 HttpHeaderMask
*owner_mask
;
1659 StatHist hdrUCountDistr
;
1660 StatHist fieldTypeDistr
;
1661 StatHist ccTypeDistr
;
1666 int busyDestroyedCount
;
1677 struct _storeSwapLogData
{
1679 sfileno swap_file_number
;
1684 size_t swap_file_sz
;
1687 unsigned char key
[MD5_DIGEST_CHARS
];
1690 /* object to track per-action memory usage (e.g. #idle objects) */
1692 ssize_t level
; /* current level (count or volume) */
1693 ssize_t hwater_level
; /* high water mark */
1694 time_t hwater_stamp
; /* timestamp of last high water mark change */
1697 /* object to track per-pool memory usage (alloc = inuse+idle) */
1698 struct _MemPoolMeter
{
1706 /* a pool is a [growing] space for objects of the same size */
1710 Stack pstack
; /* stack for free pointers */
1714 struct _ClientInfo
{
1715 /* first two items must be equivalent to hash_link */
1718 struct in_addr addr
;
1720 int result_hist
[LOG_TYPE_MAX
];
1724 kb_t hit_kbytes_out
;
1731 int n_established
; /* number of current established connections */
1734 struct _CacheDigest
{
1735 /* public, read-only */
1736 char *mask
; /* bit mask */
1737 size_t mask_size
; /* mask size in bytes */
1738 int capacity
; /* expected maximum for .count, not a hard limit */
1739 int bits_per_entry
; /* number of bits allocated for each entry from capacity */
1740 int count
; /* number of digested entries */
1741 int del_count
; /* number of deletions performed so far */
1745 peer
*peer
; /* NULL --> origin server */
1760 unsigned int dont_retry
:1;
1761 unsigned int ftp_pasv_failed
:1;
1766 struct _htcpReplyData
{
1772 /* cache-to-origin */
1782 struct _helper_request
{
1792 const char *id_name
;
1796 time_t last_queue_warn
;
1805 struct _helper_server
{
1812 struct timeval dispatch_time
;
1813 struct timeval answer_time
;
1816 helper_request
*request
;
1817 struct _helper_flags
{
1818 unsigned int alive
:1;
1819 unsigned int busy
:1;
1820 unsigned int closing
:1;
1821 unsigned int shutdown
:1;
1829 * use this when you need to pass callback data to a blocking
1830 * operation, but you don't want to add that pointer to cbdata
1832 struct _generic_cbdata
{
1836 struct _store_rebuild_data
{
1837 int objcount
; /* # objects successfully reloaded */
1838 int expcount
; /* # objects expired */
1839 int scancount
; /* # entries scanned or read from state file */
1840 int clashcount
; /* # swapfile clashes avoided */
1841 int dupcount
; /* # duplicates purged */
1842 int cancelcount
; /* # SWAP_LOG_DEL objects purged */
1843 int invalid
; /* # bad lines */
1844 int badflags
; /* # bad e->flags */