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