]> git.ipfire.org Git - thirdparty/squid.git/blob - src/enums.h
Initial Large Rock and Collapsed Forwarding support.
[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 MEM_IDNS_QUERY,
198 MEM_IPCACHE_ENTRY,
199 MEM_MAX
200 } mem_type;
201
202 enum {
203 STORE_LOG_CREATE,
204 STORE_LOG_SWAPIN,
205 STORE_LOG_SWAPOUT,
206 STORE_LOG_RELEASE,
207 STORE_LOG_SWAPOUTFAIL
208 };
209
210 /* parse state of HttpReply or HttpRequest */
211 typedef enum {
212 psReadyToParseStartLine = 0,
213 psReadyToParseHeaders,
214 psParsed,
215 psError
216 } HttpMsgParseState;
217
218 enum {
219 PCTILE_HTTP,
220 PCTILE_ICP_QUERY,
221 PCTILE_DNS,
222 PCTILE_HIT,
223 PCTILE_MISS,
224 PCTILE_NM,
225 PCTILE_NH,
226 PCTILE_ICP_REPLY
227 };
228
229 enum {
230 SENT,
231 RECV
232 };
233
234 /*
235 * These are field indicators for raw cache-cache netdb transfers
236 */
237 enum {
238 NETDB_EX_NONE,
239 NETDB_EX_NETWORK,
240 NETDB_EX_RTT,
241 NETDB_EX_HOPS
242 };
243
244 /*
245 * Return codes from checkVary(request)
246 */
247 enum {
248 VARY_NONE,
249 VARY_MATCH,
250 VARY_OTHER,
251 VARY_CANCEL
252 };
253
254 /*
255 * Store digest state enum
256 */
257 typedef enum {
258 DIGEST_READ_NONE,
259 DIGEST_READ_REPLY,
260 DIGEST_READ_HEADERS,
261 DIGEST_READ_CBLOCK,
262 DIGEST_READ_MASK,
263 DIGEST_READ_DONE
264 } digest_read_state_t;
265
266 /* Distinguish between Request and Reply (for header mangling) */
267 enum {
268 ROR_REQUEST,
269 ROR_REPLY
270 };
271
272 /* CygWin & Windows NT Port */
273 #if _SQUID_WINDOWS_
274 /*
275 * Supported Windows OS types codes
276 */
277 enum {
278 _WIN_OS_UNKNOWN,
279 _WIN_OS_WIN32S,
280 _WIN_OS_WIN95,
281 _WIN_OS_WIN98,
282 _WIN_OS_WINME,
283 _WIN_OS_WINNT,
284 _WIN_OS_WIN2K,
285 _WIN_OS_WINXP,
286 _WIN_OS_WINNET,
287 _WIN_OS_WINLON,
288 _WIN_OS_WIN7
289 };
290 #endif /* _SQUID_WINDOWS_ */
291
292 enum {
293 DISABLE_PMTU_OFF,
294 DISABLE_PMTU_ALWAYS,
295 DISABLE_PMTU_TRANSPARENT
296 };
297
298 #if USE_HTCP
299 /*
300 * TODO: This should be in htcp.h
301 */
302 typedef enum {
303 HTCP_CLR_PURGE,
304 HTCP_CLR_INVALIDATION
305 } htcp_clr_reason;
306 #endif /* USE_HTCP */
307
308 #endif /* SQUID_ENUMS_H */