]> git.ipfire.org Git - thirdparty/squid.git/blob - src/enums.h
Merged 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_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 LOG_TCP_REDIRECT,
56 LOG_UDP_HIT,
57 LOG_UDP_MISS,
58 LOG_UDP_DENIED,
59 LOG_UDP_INVALID,
60 LOG_UDP_MISS_NOFETCH,
61 LOG_ICP_QUERY,
62 LOG_TYPE_MAX
63 } log_type;
64
65 enum fd_type {
66 FD_NONE,
67 FD_LOG,
68 FD_FILE,
69 FD_SOCKET,
70 FD_PIPE,
71 FD_MSGHDR,
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_MIN_FRESH,
100 CC_ONLY_IF_CACHED,
101 CC_STALE_IF_ERROR,
102 CC_OTHER,
103 CC_ENUM_END
104 } http_hdr_cc_type;
105
106 typedef 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
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 /*
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 */
149 enum {
150 ENTRY_SPECIAL,
151 ENTRY_REVALIDATE,
152 DELAY_SENDING,
153 RELEASE_REQUEST,
154 REFRESH_REQUEST,
155 ENTRY_CACHABLE,
156 ENTRY_DISPATCHED,
157 KEY_PRIVATE,
158 ENTRY_FWD_HDR_WAIT,
159 ENTRY_NEGCACHED,
160 ENTRY_VALIDATED,
161 ENTRY_BAD_LENGTH,
162 ENTRY_ABORTED
163 };
164
165 /*
166 * These are for client Streams. Each node in the stream can be queried for
167 * its status
168 */
169 typedef enum {
170 STREAM_NONE, /* No particular status */
171 STREAM_COMPLETE, /* All data has been flushed, no more reads allowed */
172 /* an unpredicted end has occured, no more
173 * reads occured, but no need to tell
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
182 } clientStream_status_t;
183
184 /* stateful helper callback response codes */
185 typedef enum {
186 S_HELPER_UNKNOWN,
187 S_HELPER_RESERVE,
188 S_HELPER_RELEASE
189 } stateful_helper_callback_t;
190
191 #if SQUID_SNMP
192 enum {
193 SNMP_C_VIEW,
194 SNMP_C_USER,
195 SNMP_C_COMMUNITY
196 };
197
198 #endif
199
200 typedef enum {
201 MEM_NONE,
202 MEM_2K_BUF,
203 MEM_4K_BUF,
204 MEM_8K_BUF,
205 MEM_16K_BUF,
206 MEM_32K_BUF,
207 MEM_64K_BUF,
208 MEM_ACL_DENY_INFO_LIST,
209 MEM_ACL_NAME_LIST,
210 #if USE_CACHE_DIGESTS
211 MEM_CACHE_DIGEST,
212 #endif
213 MEM_CLIENT_INFO,
214 MEM_LINK_LIST,
215 MEM_DLINK_NODE,
216 MEM_DREAD_CTRL,
217 MEM_DWRITE_Q,
218 MEM_HTTP_HDR_CONTENT_RANGE,
219 MEM_MD5_DIGEST,
220 MEM_NETDBENTRY,
221 MEM_NET_DB_NAME,
222 MEM_RELIST,
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,
228 #if !USE_DNSHELPER
229 MEM_IDNS_QUERY,
230 #endif
231 MEM_IPCACHE_ENTRY,
232 MEM_MAX
233 } mem_type;
234
235 enum {
236 STORE_LOG_CREATE,
237 STORE_LOG_SWAPIN,
238 STORE_LOG_SWAPOUT,
239 STORE_LOG_RELEASE,
240 STORE_LOG_SWAPOUTFAIL
241 };
242
243 /* parse state of HttpReply or HttpRequest */
244 typedef enum {
245 psReadyToParseStartLine = 0,
246 psReadyToParseHeaders,
247 psParsed,
248 psError
249 } HttpMsgParseState;
250
251 enum {
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
260 };
261
262 enum {
263 SENT,
264 RECV
265 };
266
267 /*
268 * These are field indicators for raw cache-cache netdb transfers
269 */
270 enum {
271 NETDB_EX_NONE,
272 NETDB_EX_NETWORK,
273 NETDB_EX_RTT,
274 NETDB_EX_HOPS
275 };
276
277 /*
278 * Return codes from checkVary(request)
279 */
280 enum {
281 VARY_NONE,
282 VARY_MATCH,
283 VARY_OTHER,
284 VARY_CANCEL
285 };
286
287 /*
288 * Store digest state enum
289 */
290 typedef enum {
291 DIGEST_READ_NONE,
292 DIGEST_READ_REPLY,
293 DIGEST_READ_HEADERS,
294 DIGEST_READ_CBLOCK,
295 DIGEST_READ_MASK,
296 DIGEST_READ_DONE
297 } digest_read_state_t;
298
299 /* Distinguish between Request and Reply (for header mangling) */
300 enum {
301 ROR_REQUEST,
302 ROR_REPLY
303 };
304
305 /* CygWin & Windows NT Port */
306 #if _SQUID_WINDOWS_
307 /*
308 * Supported Windows OS types codes
309 */
310 enum {
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,
318 _WIN_OS_WINXP,
319 _WIN_OS_WINNET,
320 _WIN_OS_WINLON,
321 _WIN_OS_WIN7
322 };
323 #endif
324
325 enum {
326 DISABLE_PMTU_OFF,
327 DISABLE_PMTU_ALWAYS,
328 DISABLE_PMTU_TRANSPARENT
329 };
330
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 */
336 typedef enum {
337 HTCP_CLR_PURGE,
338 HTCP_CLR_INVALIDATION
339 } htcp_clr_reason;
340 #endif
341
342 #endif /* SQUID_ENUMS_H */