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