]> git.ipfire.org Git - thirdparty/squid.git/blame - src/enums.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / enums.h
CommitLineData
f892c2bf 1
9cef6668 2/*
262a0e14 3 * $Id$
9cef6668 4 *
5 *
2b6662ba 6 * SQUID Web Proxy Cache http://www.squid-cache.org/
9cef6668 7 * ----------------------------------------------------------
8 *
2b6662ba 9 * Squid is the result of efforts by numerous individuals from
10 * the Internet community; see the CONTRIBUTORS file for full
11 * details. Many organizations have provided support for Squid's
12 * development; see the SPONSORS file for full details. Squid is
13 * Copyrighted (C) 2001 by the Regents of the University of
14 * California; see the COPYRIGHT file for full details. Squid
15 * incorporates software developed and/or copyrighted by other
16 * sources; see the CREDITS file for full details.
9cef6668 17 *
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.
26ac0430 22 *
9cef6668 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.
26ac0430 27 *
9cef6668 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.
31 *
32 */
f892c2bf 33
b5638623 34#ifndef SQUID_ENUMS_H
35#define SQUID_ENUMS_H
36
6feb0e7c
AJ
37#include "HttpStatusCode.h"
38
9bea1d5b 39typedef enum {
79a15e0a 40 LOG_TAG_NONE,
41 LOG_TCP_HIT,
42 LOG_TCP_MISS,
1d7ab0f4 43 LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
7948b784
AR
44 LOG_TCP_REFRESH_FAIL_OLD, // refresh from origin failed, stale reply sent
45 LOG_TCP_REFRESH_FAIL_ERR, // refresh from origin failed, error forwarded
1d7ab0f4 46 LOG_TCP_REFRESH_MODIFIED, // refresh from origin replaced existing entry
ee1679df 47 LOG_TCP_CLIENT_REFRESH_MISS,
79a15e0a 48 LOG_TCP_IMS_HIT,
79a15e0a 49 LOG_TCP_SWAPFAIL_MISS,
50 LOG_TCP_NEGATIVE_HIT,
51 LOG_TCP_MEM_HIT,
52 LOG_TCP_DENIED,
f1f78347 53 LOG_TCP_DENIED_REPLY,
b540e168 54 LOG_TCP_OFFLINE_HIT,
efd900cb 55 LOG_TCP_REDIRECT,
79a15e0a 56 LOG_UDP_HIT,
79a15e0a 57 LOG_UDP_MISS,
58 LOG_UDP_DENIED,
59 LOG_UDP_INVALID,
60 LOG_UDP_MISS_NOFETCH,
071a3ae7 61 LOG_ICP_QUERY,
79a15e0a 62 LOG_TYPE_MAX
9bea1d5b 63} log_type;
f892c2bf 64
528b2c61 65enum fd_type {
f892c2bf 66 FD_NONE,
67 FD_LOG,
68 FD_FILE,
69 FD_SOCKET,
70 FD_PIPE,
1bac0258 71 FD_MSGHDR,
f892c2bf 72 FD_UNKNOWN
9bea1d5b 73};
f892c2bf 74
9bea1d5b 75enum {
f892c2bf 76 FD_READ,
77 FD_WRITE
9bea1d5b 78};
f892c2bf 79
9bea1d5b 80typedef enum {
f892c2bf 81 PEER_NONE,
82 PEER_SIBLING,
83 PEER_PARENT,
84 PEER_MULTICAST
9bea1d5b 85} peer_t;
f892c2bf 86
9bea1d5b 87typedef enum {
e6ccf245 88 CC_BADHDR = -1,
89 CC_PUBLIC = 0,
7faf2bdb 90 CC_PRIVATE,
91 CC_NO_CACHE,
92 CC_NO_STORE,
93 CC_NO_TRANSFORM,
94 CC_MUST_REVALIDATE,
95 CC_PROXY_REVALIDATE,
96 CC_MAX_AGE,
7e3ce7b9 97 CC_S_MAXAGE,
49ff0930 98 CC_MAX_STALE,
64f8c2cb 99 CC_MIN_FRESH,
d8b249ef 100 CC_ONLY_IF_CACHED,
65fd3895 101 CC_STALE_IF_ERROR,
d8b249ef 102 CC_OTHER,
7faf2bdb 103 CC_ENUM_END
9bea1d5b 104} http_hdr_cc_type;
7faf2bdb 105
43ae1d95 106typedef enum {
107 SC_NO_STORE,
108 SC_NO_STORE_REMOTE,
109 SC_MAX_AGE,
110 SC_CONTENT,
111 SC_OTHER,
112 SC_ENUM_END
113} http_hdr_sc_type;
114
e6ccf245 115typedef enum _mem_status_t {
f892c2bf 116 NOT_IN_MEMORY,
f892c2bf 117 IN_MEMORY
e6ccf245 118} mem_status_t;
f892c2bf 119
d1398b75 120typedef enum {
f892c2bf 121 PING_NONE,
122 PING_WAITING,
f892c2bf 123 PING_DONE
d1398b75 124} ping_status_t;
f892c2bf 125
d1398b75 126typedef enum {
f892c2bf 127 STORE_OK,
b7fe0ab0 128 STORE_PENDING
d1398b75 129} store_status_t;
f892c2bf 130
d1398b75 131typedef enum {
8350fe9b 132 SWAPOUT_NONE,
8350fe9b 133 SWAPOUT_WRITING,
134 SWAPOUT_DONE
d1398b75 135} swap_status_t;
f892c2bf 136
9bea1d5b 137typedef enum {
5d86029a 138 STORE_NON_CLIENT,
139 STORE_MEM_CLIENT,
140 STORE_DISK_CLIENT
9bea1d5b 141} store_client_t;
74ac2ecb 142
d46a87a8 143/*
144 * These are for StoreEntry->flag, which is defined as a SHORT
145 *
146 * NOTE: These flags are written to swap.state, so think very carefully
147 * about deleting or re-assigning!
148 */
9bea1d5b 149enum {
d46a87a8 150 ENTRY_SPECIAL,
151 ENTRY_REVALIDATE,
152 DELAY_SENDING,
153 RELEASE_REQUEST,
154 REFRESH_REQUEST,
155 ENTRY_CACHABLE,
156 ENTRY_DISPATCHED,
157 KEY_PRIVATE,
d46a87a8 158 ENTRY_FWD_HDR_WAIT,
d46a87a8 159 ENTRY_NEGCACHED,
160 ENTRY_VALIDATED,
b7fe0ab0 161 ENTRY_BAD_LENGTH,
e95eff47 162 ENTRY_ABORTED
9bea1d5b 163};
79a15e0a 164
edce4d98 165/*
166 * These are for client Streams. Each node in the stream can be queried for
167 * its status
168 */
169typedef enum {
170 STREAM_NONE, /* No particular status */
171 STREAM_COMPLETE, /* All data has been flushed, no more reads allowed */
b0dd28ba 172 /* an unpredicted end has occured, no more
26ac0430 173 * reads occured, but no need to tell
b0dd28ba 174 * downstream that an error occured
175 */
176 STREAM_UNPLANNED_COMPLETE,
177 /* An error has occured in this node or an above one,
178 * and the node is not generating an error body / it's
179 * midstream
180 */
181 STREAM_FAILED
edce4d98 182} clientStream_status_t;
183
94439e4e 184/* stateful helper callback response codes */
9bea1d5b 185typedef enum {
94439e4e 186 S_HELPER_UNKNOWN,
187 S_HELPER_RESERVE,
d20ce97d 188 S_HELPER_RELEASE
9bea1d5b 189} stateful_helper_callback_t;
94439e4e 190
3f6c0fb2 191#if SQUID_SNMP
9bea1d5b 192enum {
be335c22 193 SNMP_C_VIEW,
194 SNMP_C_USER,
195 SNMP_C_COMMUNITY
9bea1d5b 196};
067bea91 197
3f6c0fb2 198#endif
199
9bea1d5b 200typedef enum {
067bea91 201 MEM_NONE,
137ee196 202 MEM_2K_BUF,
067bea91 203 MEM_4K_BUF,
204 MEM_8K_BUF,
58cd5bbd 205 MEM_16K_BUF,
206 MEM_32K_BUF,
207 MEM_64K_BUF,
c68e9c6b 208 MEM_ACL_DENY_INFO_LIST,
c68e9c6b 209 MEM_ACL_NAME_LIST,
c68e9c6b 210#if USE_CACHE_DIGESTS
211 MEM_CACHE_DIGEST,
212#endif
c68e9c6b 213 MEM_CLIENT_INFO,
58cd5bbd 214 MEM_LINK_LIST,
c68e9c6b 215 MEM_DLINK_NODE,
c68e9c6b 216 MEM_DREAD_CTRL,
067bea91 217 MEM_DWRITE_Q,
d76fcfa7 218 MEM_HTTP_HDR_CONTENT_RANGE,
c68e9c6b 219 MEM_MD5_DIGEST,
c68e9c6b 220 MEM_NETDBENTRY,
067bea91 221 MEM_NET_DB_NAME,
c68e9c6b 222 MEM_RELIST,
92b77cf7
AJ
223 // IMPORTANT: leave this here. pools above are initialized early with memInit()
224 MEM_DONTFREE,
225 // following pools are initialized late by their component if needed (or never)
226 MEM_FQDNCACHE_ENTRY,
227 MEM_FWD_SERVER,
f64091a7 228#if !USE_DNSHELPER
7b724b86 229 MEM_IDNS_QUERY,
eb824054 230#endif
92b77cf7 231 MEM_IPCACHE_ENTRY,
067bea91 232 MEM_MAX
9bea1d5b 233} mem_type;
a21fbb54 234
9bea1d5b 235enum {
5830cdb3 236 STORE_LOG_CREATE,
237 STORE_LOG_SWAPIN,
238 STORE_LOG_SWAPOUT,
284ac611 239 STORE_LOG_RELEASE,
240 STORE_LOG_SWAPOUTFAIL
9bea1d5b 241};
5830cdb3 242
adba4a64 243/* parse state of HttpReply or HttpRequest */
9bea1d5b 244typedef enum {
2ac76861 245 psReadyToParseStartLine = 0,
246 psReadyToParseHeaders,
247 psParsed,
248 psError
9bea1d5b 249} HttpMsgParseState;
b87b92fb 250
9bea1d5b 251enum {
04a28d46 252 PCTILE_HTTP,
253 PCTILE_ICP_QUERY,
254 PCTILE_DNS,
255 PCTILE_HIT,
256 PCTILE_MISS,
257 PCTILE_NM,
258 PCTILE_NH,
259 PCTILE_ICP_REPLY
9bea1d5b 260};
071a3ae7 261
9bea1d5b 262enum {
071a3ae7 263 SENT,
264 RECV
9bea1d5b 265};
de2a0782 266
267/*
268 * These are field indicators for raw cache-cache netdb transfers
269 */
9bea1d5b 270enum {
58a6c186 271 NETDB_EX_NONE,
272 NETDB_EX_NETWORK,
273 NETDB_EX_RTT,
274 NETDB_EX_HOPS
9bea1d5b 275};
28c60158 276
f66a9ef4 277/*
278 * Return codes from checkVary(request)
279 */
9bea1d5b 280enum {
f66a9ef4 281 VARY_NONE,
282 VARY_MATCH,
283 VARY_OTHER,
284 VARY_CANCEL
9bea1d5b 285};
b5638623 286
add2192d 287/*
288 * Store digest state enum
289 */
290typedef enum {
76cdc28d 291 DIGEST_READ_NONE,
292 DIGEST_READ_REPLY,
293 DIGEST_READ_HEADERS,
294 DIGEST_READ_CBLOCK,
295 DIGEST_READ_MASK,
296 DIGEST_READ_DONE
add2192d 297} digest_read_state_t;
298
8c01ada0 299/* Distinguish between Request and Reply (for header mangling) */
300enum {
301 ROR_REQUEST,
302 ROR_REPLY
303};
304
be20dac7 305/* CygWin & Windows NT Port */
be266cb2 306#if _SQUID_WINDOWS_
be20dac7 307/*
308 * Supported Windows OS types codes
309 */
310enum {
311 _WIN_OS_UNKNOWN,
312 _WIN_OS_WIN32S,
313 _WIN_OS_WIN95,
314 _WIN_OS_WIN98,
315 _WIN_OS_WINME,
316 _WIN_OS_WINNT,
317 _WIN_OS_WIN2K,
6b1846cf 318 _WIN_OS_WINXP,
28170269 319 _WIN_OS_WINNET,
4f5320f2
GS
320 _WIN_OS_WINLON,
321 _WIN_OS_WIN7
be20dac7 322};
3ff65596 323#endif
7684c4b1 324
5529ca8a 325enum {
326 DISABLE_PMTU_OFF,
327 DISABLE_PMTU_ALWAYS,
328 DISABLE_PMTU_TRANSPARENT
329};
330
90bd689c
BR
331#if USE_HTCP
332/*
333 * This should be in htcp.h but because neighborsHtcpClear is defined in
334 * protos.h it has to be here.
335 */
336typedef enum {
337 HTCP_CLR_PURGE,
2227c2b3 338 HTCP_CLR_INVALIDATION
90bd689c
BR
339} htcp_clr_reason;
340#endif
341
b5638623 342#endif /* SQUID_ENUMS_H */