]>
Commit | Line | Data |
---|---|---|
9cef6668 | 1 | /* |
77b1029d | 2 | * Copyright (C) 1996-2020 The Squid Software Foundation and contributors |
9cef6668 | 3 | * |
bbc27441 AJ |
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. | |
9cef6668 | 7 | */ |
f892c2bf | 8 | |
b5638623 | 9 | #ifndef SQUID_ENUMS_H |
10 | #define SQUID_ENUMS_H | |
11 | ||
528b2c61 | 12 | enum fd_type { |
bf0a242d | 13 | FD_NONE_TYPE, |
f892c2bf | 14 | FD_LOG, |
15 | FD_FILE, | |
16 | FD_SOCKET, | |
17 | FD_PIPE, | |
1bac0258 | 18 | FD_MSGHDR, |
f892c2bf | 19 | FD_UNKNOWN |
9bea1d5b | 20 | }; |
f892c2bf | 21 | |
9bea1d5b | 22 | enum { |
f892c2bf | 23 | FD_READ, |
24 | FD_WRITE | |
9bea1d5b | 25 | }; |
f892c2bf | 26 | |
9bea1d5b | 27 | typedef enum { |
f892c2bf | 28 | PEER_NONE, |
29 | PEER_SIBLING, | |
30 | PEER_PARENT, | |
31 | PEER_MULTICAST | |
9bea1d5b | 32 | } peer_t; |
f892c2bf | 33 | |
e6ccf245 | 34 | typedef enum _mem_status_t { |
f892c2bf | 35 | NOT_IN_MEMORY, |
f892c2bf | 36 | IN_MEMORY |
e6ccf245 | 37 | } mem_status_t; |
f892c2bf | 38 | |
d1398b75 | 39 | typedef enum { |
f892c2bf | 40 | PING_NONE, |
41 | PING_WAITING, | |
f892c2bf | 42 | PING_DONE |
d1398b75 | 43 | } ping_status_t; |
f892c2bf | 44 | |
d1398b75 | 45 | typedef enum { |
f892c2bf | 46 | STORE_OK, |
b7fe0ab0 | 47 | STORE_PENDING |
d1398b75 | 48 | } store_status_t; |
f892c2bf | 49 | |
4310f8b0 | 50 | /// StoreEntry relationship with a disk cache |
d1398b75 | 51 | typedef enum { |
4310f8b0 EB |
52 | /// StoreEntry is currently not associated with any disk store entry. |
53 | /// Does not guarantee (or preclude!) a matching disk store entry existence. | |
8350fe9b | 54 | SWAPOUT_NONE, |
4310f8b0 EB |
55 | /// StoreEntry is being swapped out to the associated disk store entry. |
56 | /// Guarantees the disk store entry existence. | |
8350fe9b | 57 | SWAPOUT_WRITING, |
4310f8b0 EB |
58 | /// StoreEntry is associated with a complete (i.e., fully swapped out) disk store entry. |
59 | /// Guarantees the disk store entry existence. | |
02ba667b EB |
60 | SWAPOUT_DONE, |
61 | /// StoreEntry is associated with an unusable disk store entry. | |
62 | /// Swapout attempt has failed. The entry should be marked for eventual deletion. | |
63 | /// Guarantees the disk store entry existence. | |
64 | SWAPOUT_FAILED | |
d1398b75 | 65 | } swap_status_t; |
f892c2bf | 66 | |
9bea1d5b | 67 | typedef enum { |
5d86029a | 68 | STORE_NON_CLIENT, |
69 | STORE_MEM_CLIENT, | |
70 | STORE_DISK_CLIENT | |
9bea1d5b | 71 | } store_client_t; |
74ac2ecb | 72 | |
d46a87a8 | 73 | /* |
74 | * These are for StoreEntry->flag, which is defined as a SHORT | |
75 | * | |
76 | * NOTE: These flags are written to swap.state, so think very carefully | |
77 | * about deleting or re-assigning! | |
78 | */ | |
9bea1d5b | 79 | enum { |
d46a87a8 | 80 | ENTRY_SPECIAL, |
fa83b766 | 81 | ENTRY_REVALIDATE_ALWAYS, |
70eb3fde EB |
82 | |
83 | /// Tiny Store writes are likely. The writes should be aggregated together | |
84 | /// before Squid announces the new content availability to the store | |
85 | /// clients. For example, forming a cached HTTP response header may result | |
86 | /// in dozens of StoreEntry::write() calls, many of which adding as little | |
87 | /// as two bytes. Sharing those small writes with the store clients | |
88 | /// increases overhead, especially because the client code can do nothing | |
89 | /// useful with the written content until the whole response header is | |
90 | /// stored. Might be combined with ENTRY_FWD_HDR_WAIT. TODO: Rename to | |
91 | /// ENTRY_DELAY_WHILE_COALESCING to emphasize the difference from and | |
92 | /// similarity with ENTRY_FWD_HDR_WAIT. | |
d46a87a8 | 93 | DELAY_SENDING, |
4310f8b0 | 94 | RELEASE_REQUEST, ///< prohibits making the key public |
d46a87a8 | 95 | REFRESH_REQUEST, |
fa83b766 | 96 | ENTRY_REVALIDATE_STALE, |
d46a87a8 | 97 | ENTRY_DISPATCHED, |
98 | KEY_PRIVATE, | |
70eb3fde EB |
99 | |
100 | /// The current entry response may change. The contents of an entry in this | |
101 | /// state must not be shared with its store clients. For example, Squid | |
102 | /// receives (and buffers) an HTTP/504 response but may decide to retry that | |
103 | /// transaction to receive a successful response from another server | |
104 | /// instead. Might be combined with DELAY_SENDING. TODO: Rename to | |
105 | /// ENTRY_DELAY_WHILE_WOBBLING to emphasize the difference from and | |
106 | /// similarity with DELAY_SENDING. | |
d46a87a8 | 107 | ENTRY_FWD_HDR_WAIT, |
d46a87a8 | 108 | ENTRY_NEGCACHED, |
109 | ENTRY_VALIDATED, | |
b7fe0ab0 | 110 | ENTRY_BAD_LENGTH, |
d2a6dcba EB |
111 | ENTRY_ABORTED, |
112 | /// Whether the entry serves collapsed hits now. | |
113 | /// Meaningful only for public entries. | |
114 | ENTRY_REQUIRES_COLLAPSING | |
9bea1d5b | 115 | }; |
79a15e0a | 116 | |
edce4d98 | 117 | /* |
118 | * These are for client Streams. Each node in the stream can be queried for | |
119 | * its status | |
120 | */ | |
121 | typedef enum { | |
f53969cc SM |
122 | STREAM_NONE, /* No particular status */ |
123 | STREAM_COMPLETE, /* All data has been flushed, no more reads allowed */ | |
61beade2 AJ |
124 | /* an unpredicted end has occurred, no more |
125 | * reads occurred, but no need to tell | |
126 | * downstream that an error occurred | |
b0dd28ba | 127 | */ |
128 | STREAM_UNPLANNED_COMPLETE, | |
61beade2 | 129 | /* An error has occurred in this node or an above one, |
b0dd28ba | 130 | * and the node is not generating an error body / it's |
131 | * midstream | |
132 | */ | |
133 | STREAM_FAILED | |
edce4d98 | 134 | } clientStream_status_t; |
135 | ||
94439e4e | 136 | /* stateful helper callback response codes */ |
9bea1d5b | 137 | typedef enum { |
94439e4e | 138 | S_HELPER_UNKNOWN, |
139 | S_HELPER_RESERVE, | |
d20ce97d | 140 | S_HELPER_RELEASE |
9bea1d5b | 141 | } stateful_helper_callback_t; |
94439e4e | 142 | |
3f6c0fb2 | 143 | #if SQUID_SNMP |
9bea1d5b | 144 | enum { |
be335c22 | 145 | SNMP_C_VIEW, |
146 | SNMP_C_USER, | |
147 | SNMP_C_COMMUNITY | |
9bea1d5b | 148 | }; |
fafe8849 | 149 | #endif /* SQUID_SNMP */ |
3f6c0fb2 | 150 | |
9bea1d5b | 151 | enum { |
5830cdb3 | 152 | STORE_LOG_CREATE, |
153 | STORE_LOG_SWAPIN, | |
154 | STORE_LOG_SWAPOUT, | |
284ac611 | 155 | STORE_LOG_RELEASE, |
156 | STORE_LOG_SWAPOUTFAIL | |
9bea1d5b | 157 | }; |
5830cdb3 | 158 | |
9bea1d5b | 159 | enum { |
04a28d46 | 160 | PCTILE_HTTP, |
161 | PCTILE_ICP_QUERY, | |
162 | PCTILE_DNS, | |
163 | PCTILE_HIT, | |
164 | PCTILE_MISS, | |
165 | PCTILE_NM, | |
166 | PCTILE_NH, | |
167 | PCTILE_ICP_REPLY | |
9bea1d5b | 168 | }; |
071a3ae7 | 169 | |
9bea1d5b | 170 | enum { |
071a3ae7 | 171 | SENT, |
172 | RECV | |
9bea1d5b | 173 | }; |
de2a0782 | 174 | |
175 | /* | |
176 | * These are field indicators for raw cache-cache netdb transfers | |
177 | */ | |
9bea1d5b | 178 | enum { |
58a6c186 | 179 | NETDB_EX_NONE, |
180 | NETDB_EX_NETWORK, | |
181 | NETDB_EX_RTT, | |
182 | NETDB_EX_HOPS | |
9bea1d5b | 183 | }; |
28c60158 | 184 | |
f66a9ef4 | 185 | /* |
186 | * Return codes from checkVary(request) | |
187 | */ | |
9bea1d5b | 188 | enum { |
f66a9ef4 | 189 | VARY_NONE, |
190 | VARY_MATCH, | |
191 | VARY_OTHER, | |
192 | VARY_CANCEL | |
9bea1d5b | 193 | }; |
b5638623 | 194 | |
add2192d | 195 | /* |
196 | * Store digest state enum | |
197 | */ | |
198 | typedef enum { | |
76cdc28d | 199 | DIGEST_READ_NONE, |
200 | DIGEST_READ_REPLY, | |
201 | DIGEST_READ_HEADERS, | |
202 | DIGEST_READ_CBLOCK, | |
203 | DIGEST_READ_MASK, | |
204 | DIGEST_READ_DONE | |
add2192d | 205 | } digest_read_state_t; |
206 | ||
be20dac7 | 207 | /* CygWin & Windows NT Port */ |
be266cb2 | 208 | #if _SQUID_WINDOWS_ |
be20dac7 | 209 | /* |
210 | * Supported Windows OS types codes | |
211 | */ | |
212 | enum { | |
213 | _WIN_OS_UNKNOWN, | |
214 | _WIN_OS_WIN32S, | |
215 | _WIN_OS_WIN95, | |
216 | _WIN_OS_WIN98, | |
217 | _WIN_OS_WINME, | |
218 | _WIN_OS_WINNT, | |
219 | _WIN_OS_WIN2K, | |
6b1846cf | 220 | _WIN_OS_WINXP, |
28170269 | 221 | _WIN_OS_WINNET, |
4f5320f2 GS |
222 | _WIN_OS_WINLON, |
223 | _WIN_OS_WIN7 | |
be20dac7 | 224 | }; |
fafe8849 | 225 | #endif /* _SQUID_WINDOWS_ */ |
7684c4b1 | 226 | |
5529ca8a | 227 | enum { |
228 | DISABLE_PMTU_OFF, | |
229 | DISABLE_PMTU_ALWAYS, | |
230 | DISABLE_PMTU_TRANSPARENT | |
231 | }; | |
232 | ||
90bd689c BR |
233 | #if USE_HTCP |
234 | /* | |
592b8687 | 235 | * TODO: This should be in htcp.h |
90bd689c BR |
236 | */ |
237 | typedef enum { | |
238 | HTCP_CLR_PURGE, | |
2227c2b3 | 239 | HTCP_CLR_INVALIDATION |
90bd689c | 240 | } htcp_clr_reason; |
fafe8849 | 241 | #endif /* USE_HTCP */ |
90bd689c | 242 | |
b5638623 | 243 | #endif /* SQUID_ENUMS_H */ |
f53969cc | 244 |