]> git.ipfire.org Git - thirdparty/squid.git/blob - src/enums.h
Removed httpHeaderIdByNameDef, small cleanups
[thirdparty/squid.git] / src / enums.h
1 /*
2 * Copyright (C) 1996-2015 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_PUBLIC = 0,
36 CC_PRIVATE,
37 CC_NO_CACHE,
38 CC_NO_STORE,
39 CC_NO_TRANSFORM,
40 CC_MUST_REVALIDATE,
41 CC_PROXY_REVALIDATE,
42 CC_MAX_AGE,
43 CC_S_MAXAGE,
44 CC_MAX_STALE,
45 CC_MIN_FRESH,
46 CC_ONLY_IF_CACHED,
47 CC_STALE_IF_ERROR,
48 CC_OTHER,
49 CC_ENUM_END /* also used to mean "invalid" */
50 } http_hdr_cc_type;
51
52 typedef enum {
53 SC_NO_STORE,
54 SC_NO_STORE_REMOTE,
55 SC_MAX_AGE,
56 SC_CONTENT,
57 SC_OTHER,
58 SC_ENUM_END /* also used to mean "invalid" */
59 } http_hdr_sc_type;
60
61 typedef enum _mem_status_t {
62 NOT_IN_MEMORY,
63 IN_MEMORY
64 } mem_status_t;
65
66 typedef enum {
67 PING_NONE,
68 PING_WAITING,
69 PING_DONE
70 } ping_status_t;
71
72 typedef enum {
73 STORE_OK,
74 STORE_PENDING
75 } store_status_t;
76
77 typedef enum {
78 SWAPOUT_NONE,
79 SWAPOUT_WRITING,
80 SWAPOUT_DONE
81 } swap_status_t;
82
83 typedef enum {
84 STORE_NON_CLIENT,
85 STORE_MEM_CLIENT,
86 STORE_DISK_CLIENT
87 } store_client_t;
88
89 /*
90 * These are for StoreEntry->flag, which is defined as a SHORT
91 *
92 * NOTE: These flags are written to swap.state, so think very carefully
93 * about deleting or re-assigning!
94 */
95 enum {
96 ENTRY_SPECIAL,
97 ENTRY_REVALIDATE,
98 DELAY_SENDING,
99 RELEASE_REQUEST,
100 REFRESH_REQUEST,
101 ENTRY_CACHABLE_RESERVED_FOR_FUTURE_USE,
102 ENTRY_DISPATCHED,
103 KEY_PRIVATE,
104 ENTRY_FWD_HDR_WAIT,
105 ENTRY_NEGCACHED,
106 ENTRY_VALIDATED,
107 ENTRY_BAD_LENGTH,
108 ENTRY_ABORTED
109 };
110
111 /*
112 * These are for client Streams. Each node in the stream can be queried for
113 * its status
114 */
115 typedef enum {
116 STREAM_NONE, /* No particular status */
117 STREAM_COMPLETE, /* All data has been flushed, no more reads allowed */
118 /* an unpredicted end has occured, no more
119 * reads occured, but no need to tell
120 * downstream that an error occured
121 */
122 STREAM_UNPLANNED_COMPLETE,
123 /* An error has occured in this node or an above one,
124 * and the node is not generating an error body / it's
125 * midstream
126 */
127 STREAM_FAILED
128 } clientStream_status_t;
129
130 /* stateful helper callback response codes */
131 typedef enum {
132 S_HELPER_UNKNOWN,
133 S_HELPER_RESERVE,
134 S_HELPER_RELEASE
135 } stateful_helper_callback_t;
136
137 #if SQUID_SNMP
138 enum {
139 SNMP_C_VIEW,
140 SNMP_C_USER,
141 SNMP_C_COMMUNITY
142 };
143 #endif /* SQUID_SNMP */
144
145 enum {
146 STORE_LOG_CREATE,
147 STORE_LOG_SWAPIN,
148 STORE_LOG_SWAPOUT,
149 STORE_LOG_RELEASE,
150 STORE_LOG_SWAPOUTFAIL
151 };
152
153 /* parse state of HttpReply or HttpRequest */
154 typedef enum {
155 psReadyToParseStartLine = 0,
156 psReadyToParseHeaders,
157 psParsed,
158 psError
159 } HttpMsgParseState;
160
161 enum {
162 PCTILE_HTTP,
163 PCTILE_ICP_QUERY,
164 PCTILE_DNS,
165 PCTILE_HIT,
166 PCTILE_MISS,
167 PCTILE_NM,
168 PCTILE_NH,
169 PCTILE_ICP_REPLY
170 };
171
172 enum {
173 SENT,
174 RECV
175 };
176
177 /*
178 * These are field indicators for raw cache-cache netdb transfers
179 */
180 enum {
181 NETDB_EX_NONE,
182 NETDB_EX_NETWORK,
183 NETDB_EX_RTT,
184 NETDB_EX_HOPS
185 };
186
187 /*
188 * Return codes from checkVary(request)
189 */
190 enum {
191 VARY_NONE,
192 VARY_MATCH,
193 VARY_OTHER,
194 VARY_CANCEL
195 };
196
197 /*
198 * Store digest state enum
199 */
200 typedef enum {
201 DIGEST_READ_NONE,
202 DIGEST_READ_REPLY,
203 DIGEST_READ_HEADERS,
204 DIGEST_READ_CBLOCK,
205 DIGEST_READ_MASK,
206 DIGEST_READ_DONE
207 } digest_read_state_t;
208
209 /* Distinguish between Request and Reply (for header mangling) */
210 enum {
211 ROR_REQUEST,
212 ROR_REPLY
213 };
214
215 /* CygWin & Windows NT Port */
216 #if _SQUID_WINDOWS_
217 /*
218 * Supported Windows OS types codes
219 */
220 enum {
221 _WIN_OS_UNKNOWN,
222 _WIN_OS_WIN32S,
223 _WIN_OS_WIN95,
224 _WIN_OS_WIN98,
225 _WIN_OS_WINME,
226 _WIN_OS_WINNT,
227 _WIN_OS_WIN2K,
228 _WIN_OS_WINXP,
229 _WIN_OS_WINNET,
230 _WIN_OS_WINLON,
231 _WIN_OS_WIN7
232 };
233 #endif /* _SQUID_WINDOWS_ */
234
235 enum {
236 DISABLE_PMTU_OFF,
237 DISABLE_PMTU_ALWAYS,
238 DISABLE_PMTU_TRANSPARENT
239 };
240
241 #if USE_HTCP
242 /*
243 * TODO: This should be in htcp.h
244 */
245 typedef enum {
246 HTCP_CLR_PURGE,
247 HTCP_CLR_INVALIDATION
248 } htcp_clr_reason;
249 #endif /* USE_HTCP */
250
251 #endif /* SQUID_ENUMS_H */
252