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