]> git.ipfire.org Git - thirdparty/squid.git/blob - src/enums.h
HTTP Compliance: support requests with Cache-Control: min-fresh.
[thirdparty/squid.git] / src / enums.h
1
2 /*
3 * $Id$
4 *
5 *
6 * SQUID Web Proxy Cache http://www.squid-cache.org/
7 * ----------------------------------------------------------
8 *
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.
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.
22 *
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.
27 *
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 */
33
34 #ifndef SQUID_ENUMS_H
35 #define SQUID_ENUMS_H
36
37 #include "HttpStatusCode.h"
38
39 typedef enum {
40 LOG_TAG_NONE,
41 LOG_TCP_HIT,
42 LOG_TCP_MISS,
43 LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
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
46 LOG_TCP_REFRESH_MODIFIED, // refresh from origin replaced existing entry
47 LOG_TCP_CLIENT_REFRESH_MISS,
48 LOG_TCP_IMS_HIT,
49 LOG_TCP_SWAPFAIL_MISS,
50 LOG_TCP_NEGATIVE_HIT,
51 LOG_TCP_MEM_HIT,
52 LOG_TCP_DENIED,
53 LOG_TCP_DENIED_REPLY,
54 LOG_TCP_OFFLINE_HIT,
55 #if LOG_TCP_REDIRECTS
56 LOG_TCP_REDIRECT,
57 #endif
58 LOG_UDP_HIT,
59 LOG_UDP_MISS,
60 LOG_UDP_DENIED,
61 LOG_UDP_INVALID,
62 LOG_UDP_MISS_NOFETCH,
63 LOG_ICP_QUERY,
64 LOG_TYPE_MAX
65 } log_type;
66
67 enum fd_type {
68 FD_NONE,
69 FD_LOG,
70 FD_FILE,
71 FD_SOCKET,
72 FD_PIPE,
73 FD_MSGHDR,
74 FD_UNKNOWN
75 };
76
77 enum {
78 FD_READ,
79 FD_WRITE
80 };
81
82 typedef enum {
83 PEER_NONE,
84 PEER_SIBLING,
85 PEER_PARENT,
86 PEER_MULTICAST
87 } peer_t;
88
89 typedef enum {
90 CC_BADHDR = -1,
91 CC_PUBLIC = 0,
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,
99 CC_S_MAXAGE,
100 CC_MAX_STALE,
101 CC_MIN_FRESH,
102 CC_ONLY_IF_CACHED,
103 CC_OTHER,
104 CC_ENUM_END
105 } http_hdr_cc_type;
106
107 typedef enum {
108 SC_NO_STORE,
109 SC_NO_STORE_REMOTE,
110 SC_MAX_AGE,
111 SC_CONTENT,
112 SC_OTHER,
113 SC_ENUM_END
114 } http_hdr_sc_type;
115
116
117 typedef enum _mem_status_t {
118 NOT_IN_MEMORY,
119 IN_MEMORY
120 } mem_status_t;
121
122 typedef enum {
123 PING_NONE,
124 PING_WAITING,
125 PING_DONE
126 } ping_status_t;
127
128 typedef enum {
129 STORE_OK,
130 STORE_PENDING
131 } store_status_t;
132
133 typedef enum {
134 SWAPOUT_NONE,
135 SWAPOUT_WRITING,
136 SWAPOUT_DONE
137 } swap_status_t;
138
139 typedef enum {
140 STORE_NON_CLIENT,
141 STORE_MEM_CLIENT,
142 STORE_DISK_CLIENT
143 } store_client_t;
144
145 typedef enum {
146 PROTO_NONE,
147 PROTO_HTTP,
148 PROTO_FTP,
149 PROTO_GOPHER,
150 PROTO_WAIS,
151 PROTO_CACHEOBJ,
152 PROTO_ICP,
153 #if USE_HTCP
154 PROTO_HTCP,
155 #endif
156 PROTO_URN,
157 PROTO_WHOIS,
158 PROTO_INTERNAL,
159 PROTO_HTTPS,
160 PROTO_ICY,
161 PROTO_MAX
162 } protocol_t;
163
164 /*
165 * These are for StoreEntry->flag, which is defined as a SHORT
166 *
167 * NOTE: These flags are written to swap.state, so think very carefully
168 * about deleting or re-assigning!
169 */
170 enum {
171 ENTRY_SPECIAL,
172 ENTRY_REVALIDATE,
173 DELAY_SENDING,
174 RELEASE_REQUEST,
175 REFRESH_REQUEST,
176 ENTRY_CACHABLE,
177 ENTRY_DISPATCHED,
178 KEY_PRIVATE,
179 ENTRY_FWD_HDR_WAIT,
180 ENTRY_NEGCACHED,
181 ENTRY_VALIDATED,
182 ENTRY_BAD_LENGTH,
183 ENTRY_ABORTED
184 };
185
186 /*
187 * These are for client Streams. Each node in the stream can be queried for
188 * its status
189 */
190 typedef enum {
191 STREAM_NONE, /* No particular status */
192 STREAM_COMPLETE, /* All data has been flushed, no more reads allowed */
193 /* an unpredicted end has occured, no more
194 * reads occured, but no need to tell
195 * downstream that an error occured
196 */
197 STREAM_UNPLANNED_COMPLETE,
198 /* An error has occured in this node or an above one,
199 * and the node is not generating an error body / it's
200 * midstream
201 */
202 STREAM_FAILED
203 } clientStream_status_t;
204
205 /* stateful helper callback response codes */
206 typedef enum {
207 S_HELPER_UNKNOWN,
208 S_HELPER_RESERVE,
209 S_HELPER_RELEASE
210 } stateful_helper_callback_t;
211
212 #if SQUID_SNMP
213 enum {
214 SNMP_C_VIEW,
215 SNMP_C_USER,
216 SNMP_C_COMMUNITY
217 };
218
219 #endif
220
221 typedef enum {
222 MEM_NONE,
223 MEM_2K_BUF,
224 MEM_4K_BUF,
225 MEM_8K_BUF,
226 MEM_16K_BUF,
227 MEM_32K_BUF,
228 MEM_64K_BUF,
229 MEM_ACL_DENY_INFO_LIST,
230 MEM_ACL_NAME_LIST,
231 #if USE_CACHE_DIGESTS
232 MEM_CACHE_DIGEST,
233 #endif
234 MEM_CLIENT_INFO,
235 MEM_LINK_LIST,
236 MEM_DLINK_NODE,
237 MEM_DONTFREE,
238 MEM_DREAD_CTRL,
239 MEM_DWRITE_Q,
240 MEM_FQDNCACHE_ENTRY,
241 MEM_FWD_SERVER,
242 MEM_HTTP_HDR_CC,
243 MEM_HTTP_HDR_CONTENT_RANGE,
244 MEM_IPCACHE_ENTRY,
245 MEM_MD5_DIGEST,
246 MEM_NETDBENTRY,
247 MEM_NET_DB_NAME,
248 MEM_RELIST,
249 #if !USE_DNSSERVERS
250 MEM_IDNS_QUERY,
251 #endif
252 MEM_MAX
253 } mem_type;
254
255 enum {
256 STORE_LOG_CREATE,
257 STORE_LOG_SWAPIN,
258 STORE_LOG_SWAPOUT,
259 STORE_LOG_RELEASE,
260 STORE_LOG_SWAPOUTFAIL
261 };
262
263 /* parse state of HttpReply or HttpRequest */
264 typedef enum {
265 psReadyToParseStartLine = 0,
266 psReadyToParseHeaders,
267 psParsed,
268 psError
269 } HttpMsgParseState;
270
271
272 enum {
273 PCTILE_HTTP,
274 PCTILE_ICP_QUERY,
275 PCTILE_DNS,
276 PCTILE_HIT,
277 PCTILE_MISS,
278 PCTILE_NM,
279 PCTILE_NH,
280 PCTILE_ICP_REPLY
281 };
282
283 enum {
284 SENT,
285 RECV
286 };
287
288 /*
289 * These are field indicators for raw cache-cache netdb transfers
290 */
291 enum {
292 NETDB_EX_NONE,
293 NETDB_EX_NETWORK,
294 NETDB_EX_RTT,
295 NETDB_EX_HOPS
296 };
297
298 /*
299 * Return codes from checkVary(request)
300 */
301 enum {
302 VARY_NONE,
303 VARY_MATCH,
304 VARY_OTHER,
305 VARY_CANCEL
306 };
307
308 /*
309 * Store digest state enum
310 */
311 typedef enum {
312 DIGEST_READ_NONE,
313 DIGEST_READ_REPLY,
314 DIGEST_READ_HEADERS,
315 DIGEST_READ_CBLOCK,
316 DIGEST_READ_MASK,
317 DIGEST_READ_DONE
318 } digest_read_state_t;
319
320 /* Distinguish between Request and Reply (for header mangling) */
321 enum {
322 ROR_REQUEST,
323 ROR_REPLY
324 };
325
326
327 /* CygWin & Windows NT Port */
328 #ifdef _SQUID_WIN32_
329 /*
330 * Supported Windows OS types codes
331 */
332 enum {
333 _WIN_OS_UNKNOWN,
334 _WIN_OS_WIN32S,
335 _WIN_OS_WIN95,
336 _WIN_OS_WIN98,
337 _WIN_OS_WINME,
338 _WIN_OS_WINNT,
339 _WIN_OS_WIN2K,
340 _WIN_OS_WINXP,
341 _WIN_OS_WINNET,
342 _WIN_OS_WINLON,
343 _WIN_OS_WIN7
344 };
345
346 #endif
347
348 typedef enum {
349 CLF_UNKNOWN,
350 CLF_AUTO,
351 CLF_CUSTOM,
352 CLF_SQUID,
353 CLF_COMMON,
354 #if ICAP_CLIENT
355 CLF_ICAP_SQUID,
356 #endif
357 CLF_NONE
358 } customlog_type;
359
360 enum {
361 DISABLE_PMTU_OFF,
362 DISABLE_PMTU_ALWAYS,
363 DISABLE_PMTU_TRANSPARENT
364 };
365
366 #if USE_HTCP
367 /*
368 * This should be in htcp.h but because neighborsHtcpClear is defined in
369 * protos.h it has to be here.
370 */
371 typedef enum {
372 HTCP_CLR_PURGE,
373 HTCP_CLR_INVALIDATION
374 } htcp_clr_reason;
375 #endif
376
377 #endif /* SQUID_ENUMS_H */