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