]> git.ipfire.org Git - thirdparty/squid.git/blob - src/enums.h
Log TCP_REDIRECT when Squid generates a 300-399 status response
[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
116 typedef enum _mem_status_t {
117 NOT_IN_MEMORY,
118 IN_MEMORY
119 } mem_status_t;
120
121 typedef enum {
122 PING_NONE,
123 PING_WAITING,
124 PING_DONE
125 } ping_status_t;
126
127 typedef enum {
128 STORE_OK,
129 STORE_PENDING
130 } store_status_t;
131
132 typedef enum {
133 SWAPOUT_NONE,
134 SWAPOUT_WRITING,
135 SWAPOUT_DONE
136 } swap_status_t;
137
138 typedef enum {
139 STORE_NON_CLIENT,
140 STORE_MEM_CLIENT,
141 STORE_DISK_CLIENT
142 } store_client_t;
143
144 /*
145 * These are for StoreEntry->flag, which is defined as a SHORT
146 *
147 * NOTE: These flags are written to swap.state, so think very carefully
148 * about deleting or re-assigning!
149 */
150 enum {
151 ENTRY_SPECIAL,
152 ENTRY_REVALIDATE,
153 DELAY_SENDING,
154 RELEASE_REQUEST,
155 REFRESH_REQUEST,
156 ENTRY_CACHABLE,
157 ENTRY_DISPATCHED,
158 KEY_PRIVATE,
159 ENTRY_FWD_HDR_WAIT,
160 ENTRY_NEGCACHED,
161 ENTRY_VALIDATED,
162 ENTRY_BAD_LENGTH,
163 ENTRY_ABORTED
164 };
165
166 /*
167 * These are for client Streams. Each node in the stream can be queried for
168 * its status
169 */
170 typedef enum {
171 STREAM_NONE, /* No particular status */
172 STREAM_COMPLETE, /* All data has been flushed, no more reads allowed */
173 /* an unpredicted end has occured, no more
174 * reads occured, but no need to tell
175 * downstream that an error occured
176 */
177 STREAM_UNPLANNED_COMPLETE,
178 /* An error has occured in this node or an above one,
179 * and the node is not generating an error body / it's
180 * midstream
181 */
182 STREAM_FAILED
183 } clientStream_status_t;
184
185 /* stateful helper callback response codes */
186 typedef enum {
187 S_HELPER_UNKNOWN,
188 S_HELPER_RESERVE,
189 S_HELPER_RELEASE
190 } stateful_helper_callback_t;
191
192 #if SQUID_SNMP
193 enum {
194 SNMP_C_VIEW,
195 SNMP_C_USER,
196 SNMP_C_COMMUNITY
197 };
198
199 #endif
200
201 typedef enum {
202 MEM_NONE,
203 MEM_2K_BUF,
204 MEM_4K_BUF,
205 MEM_8K_BUF,
206 MEM_16K_BUF,
207 MEM_32K_BUF,
208 MEM_64K_BUF,
209 MEM_ACL_DENY_INFO_LIST,
210 MEM_ACL_NAME_LIST,
211 #if USE_CACHE_DIGESTS
212 MEM_CACHE_DIGEST,
213 #endif
214 MEM_CLIENT_INFO,
215 MEM_LINK_LIST,
216 MEM_DLINK_NODE,
217 MEM_DREAD_CTRL,
218 MEM_DWRITE_Q,
219 MEM_HTTP_HDR_CONTENT_RANGE,
220 MEM_MD5_DIGEST,
221 MEM_NETDBENTRY,
222 MEM_NET_DB_NAME,
223 MEM_RELIST,
224 // IMPORTANT: leave this here. pools above are initialized early with memInit()
225 MEM_DONTFREE,
226 // following pools are initialized late by their component if needed (or never)
227 MEM_FQDNCACHE_ENTRY,
228 MEM_FWD_SERVER,
229 #if !USE_DNSHELPER
230 MEM_IDNS_QUERY,
231 #endif
232 MEM_IPCACHE_ENTRY,
233 MEM_MAX
234 } mem_type;
235
236 enum {
237 STORE_LOG_CREATE,
238 STORE_LOG_SWAPIN,
239 STORE_LOG_SWAPOUT,
240 STORE_LOG_RELEASE,
241 STORE_LOG_SWAPOUTFAIL
242 };
243
244 /* parse state of HttpReply or HttpRequest */
245 typedef enum {
246 psReadyToParseStartLine = 0,
247 psReadyToParseHeaders,
248 psParsed,
249 psError
250 } HttpMsgParseState;
251
252
253 enum {
254 PCTILE_HTTP,
255 PCTILE_ICP_QUERY,
256 PCTILE_DNS,
257 PCTILE_HIT,
258 PCTILE_MISS,
259 PCTILE_NM,
260 PCTILE_NH,
261 PCTILE_ICP_REPLY
262 };
263
264 enum {
265 SENT,
266 RECV
267 };
268
269 /*
270 * These are field indicators for raw cache-cache netdb transfers
271 */
272 enum {
273 NETDB_EX_NONE,
274 NETDB_EX_NETWORK,
275 NETDB_EX_RTT,
276 NETDB_EX_HOPS
277 };
278
279 /*
280 * Return codes from checkVary(request)
281 */
282 enum {
283 VARY_NONE,
284 VARY_MATCH,
285 VARY_OTHER,
286 VARY_CANCEL
287 };
288
289 /*
290 * Store digest state enum
291 */
292 typedef enum {
293 DIGEST_READ_NONE,
294 DIGEST_READ_REPLY,
295 DIGEST_READ_HEADERS,
296 DIGEST_READ_CBLOCK,
297 DIGEST_READ_MASK,
298 DIGEST_READ_DONE
299 } digest_read_state_t;
300
301 /* Distinguish between Request and Reply (for header mangling) */
302 enum {
303 ROR_REQUEST,
304 ROR_REPLY
305 };
306
307
308 /* CygWin & Windows NT Port */
309 #if _SQUID_WINDOWS_
310 /*
311 * Supported Windows OS types codes
312 */
313 enum {
314 _WIN_OS_UNKNOWN,
315 _WIN_OS_WIN32S,
316 _WIN_OS_WIN95,
317 _WIN_OS_WIN98,
318 _WIN_OS_WINME,
319 _WIN_OS_WINNT,
320 _WIN_OS_WIN2K,
321 _WIN_OS_WINXP,
322 _WIN_OS_WINNET,
323 _WIN_OS_WINLON,
324 _WIN_OS_WIN7
325 };
326 #endif
327
328 enum {
329 DISABLE_PMTU_OFF,
330 DISABLE_PMTU_ALWAYS,
331 DISABLE_PMTU_TRANSPARENT
332 };
333
334 #if USE_HTCP
335 /*
336 * This should be in htcp.h but because neighborsHtcpClear is defined in
337 * protos.h it has to be here.
338 */
339 typedef enum {
340 HTCP_CLR_PURGE,
341 HTCP_CLR_INVALIDATION
342 } htcp_clr_reason;
343 #endif
344
345 #endif /* SQUID_ENUMS_H */