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