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