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