]> git.ipfire.org Git - thirdparty/squid.git/blob - src/enums.h
Removed CVS $ markers
[thirdparty/squid.git] / src / enums.h
1
2 /*
3 *
4 * SQUID Web Proxy Cache http://www.squid-cache.org/
5 * ----------------------------------------------------------
6 *
7 * Squid is the result of efforts by numerous individuals from
8 * the Internet community; see the CONTRIBUTORS file for full
9 * details. Many organizations have provided support for Squid's
10 * development; see the SPONSORS file for full details. Squid is
11 * Copyrighted (C) 2001 by the Regents of the University of
12 * California; see the COPYRIGHT file for full details. Squid
13 * incorporates software developed and/or copyrighted by other
14 * sources; see the CREDITS file for full details.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
29 *
30 */
31
32 #ifndef SQUID_ENUMS_H
33 #define SQUID_ENUMS_H
34
35 #include "HttpStatusCode.h"
36
37 typedef enum {
38 LOG_TAG_NONE,
39 LOG_TCP_HIT,
40 LOG_TCP_MISS,
41 LOG_TCP_REFRESH_UNMODIFIED, // refresh from origin revalidated existing entry
42 LOG_TCP_REFRESH_FAIL_OLD, // refresh from origin failed, stale reply sent
43 LOG_TCP_REFRESH_FAIL_ERR, // refresh from origin failed, error forwarded
44 LOG_TCP_REFRESH_MODIFIED, // refresh from origin replaced existing entry
45 LOG_TCP_CLIENT_REFRESH_MISS,
46 LOG_TCP_IMS_HIT,
47 LOG_TCP_SWAPFAIL_MISS,
48 LOG_TCP_NEGATIVE_HIT,
49 LOG_TCP_MEM_HIT,
50 LOG_TCP_DENIED,
51 LOG_TCP_DENIED_REPLY,
52 LOG_TCP_OFFLINE_HIT,
53 LOG_TCP_REDIRECT,
54 LOG_UDP_HIT,
55 LOG_UDP_MISS,
56 LOG_UDP_DENIED,
57 LOG_UDP_INVALID,
58 LOG_UDP_MISS_NOFETCH,
59 LOG_ICP_QUERY,
60 LOG_TYPE_MAX
61 } log_type;
62
63 enum fd_type {
64 FD_NONE,
65 FD_LOG,
66 FD_FILE,
67 FD_SOCKET,
68 FD_PIPE,
69 FD_MSGHDR,
70 FD_UNKNOWN
71 };
72
73 enum {
74 FD_READ,
75 FD_WRITE
76 };
77
78 typedef enum {
79 PEER_NONE,
80 PEER_SIBLING,
81 PEER_PARENT,
82 PEER_MULTICAST
83 } peer_t;
84
85 typedef enum {
86 CC_BADHDR = -1,
87 CC_PUBLIC = 0,
88 CC_PRIVATE,
89 CC_NO_CACHE,
90 CC_NO_STORE,
91 CC_NO_TRANSFORM,
92 CC_MUST_REVALIDATE,
93 CC_PROXY_REVALIDATE,
94 CC_MAX_AGE,
95 CC_S_MAXAGE,
96 CC_MAX_STALE,
97 CC_MIN_FRESH,
98 CC_ONLY_IF_CACHED,
99 CC_STALE_IF_ERROR,
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 typedef enum _mem_status_t {
114 NOT_IN_MEMORY,
115 IN_MEMORY
116 } mem_status_t;
117
118 typedef enum {
119 PING_NONE,
120 PING_WAITING,
121 PING_DONE
122 } ping_status_t;
123
124 typedef enum {
125 STORE_OK,
126 STORE_PENDING
127 } store_status_t;
128
129 typedef enum {
130 SWAPOUT_NONE,
131 SWAPOUT_WRITING,
132 SWAPOUT_DONE
133 } swap_status_t;
134
135 typedef enum {
136 STORE_NON_CLIENT,
137 STORE_MEM_CLIENT,
138 STORE_DISK_CLIENT
139 } store_client_t;
140
141 /*
142 * These are for StoreEntry->flag, which is defined as a SHORT
143 *
144 * NOTE: These flags are written to swap.state, so think very carefully
145 * about deleting or re-assigning!
146 */
147 enum {
148 ENTRY_SPECIAL,
149 ENTRY_REVALIDATE,
150 DELAY_SENDING,
151 RELEASE_REQUEST,
152 REFRESH_REQUEST,
153 ENTRY_CACHABLE,
154 ENTRY_DISPATCHED,
155 KEY_PRIVATE,
156 ENTRY_FWD_HDR_WAIT,
157 ENTRY_NEGCACHED,
158 ENTRY_VALIDATED,
159 ENTRY_BAD_LENGTH,
160 ENTRY_ABORTED
161 };
162
163 /*
164 * These are for client Streams. Each node in the stream can be queried for
165 * its status
166 */
167 typedef enum {
168 STREAM_NONE, /* No particular status */
169 STREAM_COMPLETE, /* All data has been flushed, no more reads allowed */
170 /* an unpredicted end has occured, no more
171 * reads occured, but no need to tell
172 * downstream that an error occured
173 */
174 STREAM_UNPLANNED_COMPLETE,
175 /* An error has occured in this node or an above one,
176 * and the node is not generating an error body / it's
177 * midstream
178 */
179 STREAM_FAILED
180 } clientStream_status_t;
181
182 /* stateful helper callback response codes */
183 typedef enum {
184 S_HELPER_UNKNOWN,
185 S_HELPER_RESERVE,
186 S_HELPER_RELEASE
187 } stateful_helper_callback_t;
188
189 #if SQUID_SNMP
190 enum {
191 SNMP_C_VIEW,
192 SNMP_C_USER,
193 SNMP_C_COMMUNITY
194 };
195
196 #endif
197
198 typedef enum {
199 MEM_NONE,
200 MEM_2K_BUF,
201 MEM_4K_BUF,
202 MEM_8K_BUF,
203 MEM_16K_BUF,
204 MEM_32K_BUF,
205 MEM_64K_BUF,
206 MEM_ACL_DENY_INFO_LIST,
207 MEM_ACL_NAME_LIST,
208 #if USE_CACHE_DIGESTS
209 MEM_CACHE_DIGEST,
210 #endif
211 MEM_CLIENT_INFO,
212 MEM_LINK_LIST,
213 MEM_DLINK_NODE,
214 MEM_DREAD_CTRL,
215 MEM_DWRITE_Q,
216 MEM_HTTP_HDR_CONTENT_RANGE,
217 MEM_MD5_DIGEST,
218 MEM_NETDBENTRY,
219 MEM_NET_DB_NAME,
220 MEM_RELIST,
221 // IMPORTANT: leave this here. pools above are initialized early with memInit()
222 MEM_DONTFREE,
223 // following pools are initialized late by their component if needed (or never)
224 MEM_FQDNCACHE_ENTRY,
225 MEM_FWD_SERVER,
226 #if !USE_DNSHELPER
227 MEM_IDNS_QUERY,
228 #endif
229 MEM_IPCACHE_ENTRY,
230 MEM_MAX
231 } mem_type;
232
233 enum {
234 STORE_LOG_CREATE,
235 STORE_LOG_SWAPIN,
236 STORE_LOG_SWAPOUT,
237 STORE_LOG_RELEASE,
238 STORE_LOG_SWAPOUTFAIL
239 };
240
241 /* parse state of HttpReply or HttpRequest */
242 typedef enum {
243 psReadyToParseStartLine = 0,
244 psReadyToParseHeaders,
245 psParsed,
246 psError
247 } HttpMsgParseState;
248
249 enum {
250 PCTILE_HTTP,
251 PCTILE_ICP_QUERY,
252 PCTILE_DNS,
253 PCTILE_HIT,
254 PCTILE_MISS,
255 PCTILE_NM,
256 PCTILE_NH,
257 PCTILE_ICP_REPLY
258 };
259
260 enum {
261 SENT,
262 RECV
263 };
264
265 /*
266 * These are field indicators for raw cache-cache netdb transfers
267 */
268 enum {
269 NETDB_EX_NONE,
270 NETDB_EX_NETWORK,
271 NETDB_EX_RTT,
272 NETDB_EX_HOPS
273 };
274
275 /*
276 * Return codes from checkVary(request)
277 */
278 enum {
279 VARY_NONE,
280 VARY_MATCH,
281 VARY_OTHER,
282 VARY_CANCEL
283 };
284
285 /*
286 * Store digest state enum
287 */
288 typedef enum {
289 DIGEST_READ_NONE,
290 DIGEST_READ_REPLY,
291 DIGEST_READ_HEADERS,
292 DIGEST_READ_CBLOCK,
293 DIGEST_READ_MASK,
294 DIGEST_READ_DONE
295 } digest_read_state_t;
296
297 /* Distinguish between Request and Reply (for header mangling) */
298 enum {
299 ROR_REQUEST,
300 ROR_REPLY
301 };
302
303 /* CygWin & Windows NT Port */
304 #if _SQUID_WINDOWS_
305 /*
306 * Supported Windows OS types codes
307 */
308 enum {
309 _WIN_OS_UNKNOWN,
310 _WIN_OS_WIN32S,
311 _WIN_OS_WIN95,
312 _WIN_OS_WIN98,
313 _WIN_OS_WINME,
314 _WIN_OS_WINNT,
315 _WIN_OS_WIN2K,
316 _WIN_OS_WINXP,
317 _WIN_OS_WINNET,
318 _WIN_OS_WINLON,
319 _WIN_OS_WIN7
320 };
321 #endif
322
323 enum {
324 DISABLE_PMTU_OFF,
325 DISABLE_PMTU_ALWAYS,
326 DISABLE_PMTU_TRANSPARENT
327 };
328
329 #if USE_HTCP
330 /*
331 * This should be in htcp.h but because neighborsHtcpClear is defined in
332 * protos.h it has to be here.
333 */
334 typedef enum {
335 HTCP_CLR_PURGE,
336 HTCP_CLR_INVALIDATION
337 } htcp_clr_reason;
338 #endif
339
340 #endif /* SQUID_ENUMS_H */