]> git.ipfire.org Git - thirdparty/squid.git/blob - src/enums.h
Bug 4223: fixed retries of failed re-forwardable transactions (#211)
[thirdparty/squid.git] / src / enums.h
1 /*
2 * Copyright (C) 1996-2018 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 /// StoreEntry relationship with a disk cache
51 typedef enum {
52 /// StoreEntry is currently not associated with any disk store entry.
53 /// Does not guarantee (or preclude!) a matching disk store entry existence.
54 SWAPOUT_NONE,
55 /// StoreEntry is being swapped out to the associated disk store entry.
56 /// Guarantees the disk store entry existence.
57 SWAPOUT_WRITING,
58 /// StoreEntry is associated with a complete (i.e., fully swapped out) disk store entry.
59 /// Guarantees the disk store entry existence.
60 SWAPOUT_DONE
61 } swap_status_t;
62
63 typedef enum {
64 STORE_NON_CLIENT,
65 STORE_MEM_CLIENT,
66 STORE_DISK_CLIENT
67 } store_client_t;
68
69 /*
70 * These are for StoreEntry->flag, which is defined as a SHORT
71 *
72 * NOTE: These flags are written to swap.state, so think very carefully
73 * about deleting or re-assigning!
74 */
75 enum {
76 ENTRY_SPECIAL,
77 ENTRY_REVALIDATE_ALWAYS,
78
79 /// Tiny Store writes are likely. The writes should be aggregated together
80 /// before Squid announces the new content availability to the store
81 /// clients. For example, forming a cached HTTP response header may result
82 /// in dozens of StoreEntry::write() calls, many of which adding as little
83 /// as two bytes. Sharing those small writes with the store clients
84 /// increases overhead, especially because the client code can do nothing
85 /// useful with the written content until the whole response header is
86 /// stored. Might be combined with ENTRY_FWD_HDR_WAIT. TODO: Rename to
87 /// ENTRY_DELAY_WHILE_COALESCING to emphasize the difference from and
88 /// similarity with ENTRY_FWD_HDR_WAIT.
89 DELAY_SENDING,
90 RELEASE_REQUEST, ///< prohibits making the key public
91 REFRESH_REQUEST,
92 ENTRY_REVALIDATE_STALE,
93 ENTRY_DISPATCHED,
94 KEY_PRIVATE,
95
96 /// The current entry response may change. The contents of an entry in this
97 /// state must not be shared with its store clients. For example, Squid
98 /// receives (and buffers) an HTTP/504 response but may decide to retry that
99 /// transaction to receive a successful response from another server
100 /// instead. Might be combined with DELAY_SENDING. TODO: Rename to
101 /// ENTRY_DELAY_WHILE_WOBBLING to emphasize the difference from and
102 /// similarity with DELAY_SENDING.
103 ENTRY_FWD_HDR_WAIT,
104 ENTRY_NEGCACHED,
105 ENTRY_VALIDATED,
106 ENTRY_BAD_LENGTH,
107 ENTRY_ABORTED
108 };
109
110 /*
111 * These are for client Streams. Each node in the stream can be queried for
112 * its status
113 */
114 typedef enum {
115 STREAM_NONE, /* No particular status */
116 STREAM_COMPLETE, /* All data has been flushed, no more reads allowed */
117 /* an unpredicted end has occurred, no more
118 * reads occurred, but no need to tell
119 * downstream that an error occurred
120 */
121 STREAM_UNPLANNED_COMPLETE,
122 /* An error has occurred in this node or an above one,
123 * and the node is not generating an error body / it's
124 * midstream
125 */
126 STREAM_FAILED
127 } clientStream_status_t;
128
129 /* stateful helper callback response codes */
130 typedef enum {
131 S_HELPER_UNKNOWN,
132 S_HELPER_RESERVE,
133 S_HELPER_RELEASE
134 } stateful_helper_callback_t;
135
136 #if SQUID_SNMP
137 enum {
138 SNMP_C_VIEW,
139 SNMP_C_USER,
140 SNMP_C_COMMUNITY
141 };
142 #endif /* SQUID_SNMP */
143
144 enum {
145 STORE_LOG_CREATE,
146 STORE_LOG_SWAPIN,
147 STORE_LOG_SWAPOUT,
148 STORE_LOG_RELEASE,
149 STORE_LOG_SWAPOUTFAIL
150 };
151
152 enum {
153 PCTILE_HTTP,
154 PCTILE_ICP_QUERY,
155 PCTILE_DNS,
156 PCTILE_HIT,
157 PCTILE_MISS,
158 PCTILE_NM,
159 PCTILE_NH,
160 PCTILE_ICP_REPLY
161 };
162
163 enum {
164 SENT,
165 RECV
166 };
167
168 /*
169 * These are field indicators for raw cache-cache netdb transfers
170 */
171 enum {
172 NETDB_EX_NONE,
173 NETDB_EX_NETWORK,
174 NETDB_EX_RTT,
175 NETDB_EX_HOPS
176 };
177
178 /*
179 * Return codes from checkVary(request)
180 */
181 enum {
182 VARY_NONE,
183 VARY_MATCH,
184 VARY_OTHER,
185 VARY_CANCEL
186 };
187
188 /*
189 * Store digest state enum
190 */
191 typedef enum {
192 DIGEST_READ_NONE,
193 DIGEST_READ_REPLY,
194 DIGEST_READ_HEADERS,
195 DIGEST_READ_CBLOCK,
196 DIGEST_READ_MASK,
197 DIGEST_READ_DONE
198 } digest_read_state_t;
199
200 /* CygWin & Windows NT Port */
201 #if _SQUID_WINDOWS_
202 /*
203 * Supported Windows OS types codes
204 */
205 enum {
206 _WIN_OS_UNKNOWN,
207 _WIN_OS_WIN32S,
208 _WIN_OS_WIN95,
209 _WIN_OS_WIN98,
210 _WIN_OS_WINME,
211 _WIN_OS_WINNT,
212 _WIN_OS_WIN2K,
213 _WIN_OS_WINXP,
214 _WIN_OS_WINNET,
215 _WIN_OS_WINLON,
216 _WIN_OS_WIN7
217 };
218 #endif /* _SQUID_WINDOWS_ */
219
220 enum {
221 DISABLE_PMTU_OFF,
222 DISABLE_PMTU_ALWAYS,
223 DISABLE_PMTU_TRANSPARENT
224 };
225
226 #if USE_HTCP
227 /*
228 * TODO: This should be in htcp.h
229 */
230 typedef enum {
231 HTCP_CLR_PURGE,
232 HTCP_CLR_INVALIDATION
233 } htcp_clr_reason;
234 #endif /* USE_HTCP */
235
236 #endif /* SQUID_ENUMS_H */
237