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