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