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