]> git.ipfire.org Git - thirdparty/squid.git/blob - src/enums.h
SourceLayout: shuffle mem_type enum to libmem
[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 enum {
147 STORE_LOG_CREATE,
148 STORE_LOG_SWAPIN,
149 STORE_LOG_SWAPOUT,
150 STORE_LOG_RELEASE,
151 STORE_LOG_SWAPOUTFAIL
152 };
153
154 /* parse state of HttpReply or HttpRequest */
155 typedef enum {
156 psReadyToParseStartLine = 0,
157 psReadyToParseHeaders,
158 psParsed,
159 psError
160 } HttpMsgParseState;
161
162 enum {
163 PCTILE_HTTP,
164 PCTILE_ICP_QUERY,
165 PCTILE_DNS,
166 PCTILE_HIT,
167 PCTILE_MISS,
168 PCTILE_NM,
169 PCTILE_NH,
170 PCTILE_ICP_REPLY
171 };
172
173 enum {
174 SENT,
175 RECV
176 };
177
178 /*
179 * These are field indicators for raw cache-cache netdb transfers
180 */
181 enum {
182 NETDB_EX_NONE,
183 NETDB_EX_NETWORK,
184 NETDB_EX_RTT,
185 NETDB_EX_HOPS
186 };
187
188 /*
189 * Return codes from checkVary(request)
190 */
191 enum {
192 VARY_NONE,
193 VARY_MATCH,
194 VARY_OTHER,
195 VARY_CANCEL
196 };
197
198 /*
199 * Store digest state enum
200 */
201 typedef enum {
202 DIGEST_READ_NONE,
203 DIGEST_READ_REPLY,
204 DIGEST_READ_HEADERS,
205 DIGEST_READ_CBLOCK,
206 DIGEST_READ_MASK,
207 DIGEST_READ_DONE
208 } digest_read_state_t;
209
210 /* Distinguish between Request and Reply (for header mangling) */
211 enum {
212 ROR_REQUEST,
213 ROR_REPLY
214 };
215
216 /* CygWin & Windows NT Port */
217 #if _SQUID_WINDOWS_
218 /*
219 * Supported Windows OS types codes
220 */
221 enum {
222 _WIN_OS_UNKNOWN,
223 _WIN_OS_WIN32S,
224 _WIN_OS_WIN95,
225 _WIN_OS_WIN98,
226 _WIN_OS_WINME,
227 _WIN_OS_WINNT,
228 _WIN_OS_WIN2K,
229 _WIN_OS_WINXP,
230 _WIN_OS_WINNET,
231 _WIN_OS_WINLON,
232 _WIN_OS_WIN7
233 };
234 #endif /* _SQUID_WINDOWS_ */
235
236 enum {
237 DISABLE_PMTU_OFF,
238 DISABLE_PMTU_ALWAYS,
239 DISABLE_PMTU_TRANSPARENT
240 };
241
242 #if USE_HTCP
243 /*
244 * TODO: This should be in htcp.h
245 */
246 typedef enum {
247 HTCP_CLR_PURGE,
248 HTCP_CLR_INVALIDATION
249 } htcp_clr_reason;
250 #endif /* USE_HTCP */
251
252 #endif /* SQUID_ENUMS_H */