]> git.ipfire.org Git - thirdparty/squid.git/blob - src/format/ByteCode.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / format / ByteCode.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_FMT_BYTECODE_H
10 #define _SQUID_FMT_BYTECODE_H
11
12 /*
13 * Squid configuration allows users to define custom formats in
14 * several components.
15 * - logging
16 * - external ACL input
17 * - deny page URL
18 *
19 * These enumerations and classes define the API for parsing of
20 * format directives to define these patterns. Along with output
21 * functionality to produce formatted buffers.
22 */
23
24 namespace Format
25 {
26
27 /*
28 * Bytecodes for the configureable format stuff
29 */
30 typedef enum {
31 LFT_NONE, /* dummy */
32
33 /* arbitrary string between tokens */
34 LFT_STRING,
35
36 /* client TCP connection remote end details */
37 LFT_CLIENT_IP_ADDRESS,
38 LFT_CLIENT_FQDN,
39 LFT_CLIENT_PORT,
40 LFT_CLIENT_EUI,
41
42 /* client TCP connection local end details */
43 LFT_CLIENT_LOCAL_IP,
44 LFT_CLIENT_LOCAL_PORT,
45 /*LFT_CLIENT_LOCAL_FQDN, (rDNS) */
46 LFT_CLIENT_LOCAL_TOS,
47 LFT_CLIENT_LOCAL_NFMARK,
48
49 /* client connection local squid.conf details */
50 LFT_LOCAL_LISTENING_IP,
51 LFT_LOCAL_LISTENING_PORT,
52 /*LFT_LOCAL_LISTENING_NAME, (myportname) */
53
54 /* server TCP connection remote end details */
55 LFT_SERVER_IP_ADDRESS,
56 LFT_SERVER_FQDN_OR_PEER_NAME,
57 LFT_SERVER_PORT,
58
59 /* server TCP connection local end details */
60 LFT_SERVER_LOCAL_IP,
61 LFT_SERVER_LOCAL_IP_OLD_27,
62 LFT_SERVER_LOCAL_PORT,
63 LFT_SERVER_LOCAL_TOS,
64 LFT_SERVER_LOCAL_NFMARK,
65
66 /* original Request-Line details recieved from client */
67 LFT_CLIENT_REQ_METHOD,
68 LFT_CLIENT_REQ_URI,
69 LFT_CLIENT_REQ_URLSCHEME,
70 LFT_CLIENT_REQ_URLDOMAIN,
71 LFT_CLIENT_REQ_URLPORT,
72 LFT_CLIENT_REQ_URLPATH,
73 /* LFT_CLIENT_REQ_QUERY, */
74 LFT_CLIENT_REQ_VERSION,
75
76 /* Request-Line details recieved from client (legacy, filtered) */
77 LFT_REQUEST_METHOD,
78 LFT_REQUEST_URI,
79 LFT_REQUEST_URLPATH_OLD_31,
80 /*LFT_REQUEST_QUERY, */
81 LFT_REQUEST_VERSION_OLD_2X,
82 LFT_REQUEST_VERSION,
83 LFT_REQUEST_URLGROUP_OLD_2X,
84
85 /* request header details pre-adaptation */
86 LFT_REQUEST_HEADER,
87 LFT_REQUEST_HEADER_ELEM,
88 LFT_REQUEST_ALL_HEADERS,
89
90 /* request header details post-adaptation */
91 LFT_ADAPTED_REQUEST_HEADER,
92 LFT_ADAPTED_REQUEST_HEADER_ELEM,
93 LFT_ADAPTED_REQUEST_ALL_HEADERS,
94
95 /* Request-Line details sent to the server/peer */
96 LFT_SERVER_REQ_METHOD,
97 LFT_SERVER_REQ_URI,
98 LFT_SERVER_REQ_URLSCHEME,
99 LFT_SERVER_REQ_URLDOMAIN,
100 LFT_SERVER_REQ_URLPORT,
101 LFT_SERVER_REQ_URLPATH,
102 /*LFT_SERVER_REQ_QUERY, */
103 LFT_SERVER_REQ_VERSION,
104
105 /* request meta details */
106 LFT_CLIENT_REQUEST_SIZE_TOTAL,
107 LFT_CLIENT_REQUEST_SIZE_HEADERS,
108 /*LFT_REQUEST_SIZE_BODY, */
109 /*LFT_REQUEST_SIZE_BODY_NO_TE, */
110
111 /* original Status-Line details recieved from server */
112 // XXX: todo
113
114 /* Status-Line details sent to the client */
115 // XXX: todo
116
117 /* response Status-Line details (legacy, filtered) */
118 LFT_HTTP_SENT_STATUS_CODE_OLD_30,
119 LFT_HTTP_SENT_STATUS_CODE,
120 LFT_HTTP_RECEIVED_STATUS_CODE,
121 /*LFT_HTTP_STATUS, */
122 LFT_HTTP_BODY_BYTES_READ,
123
124 /* response header details pre-adaptation */
125 LFT_REPLY_HEADER,
126 LFT_REPLY_HEADER_ELEM,
127 LFT_REPLY_ALL_HEADERS,
128
129 /* response header details post-adaptation */
130 /* LFT_ADAPTED_REPLY_HEADER, */
131 /* LFT_ADAPTED_REPLY_HEADER_ELEM, */
132 /* LFT_ADAPTED_REPLY_ALL_HEADERS, */
133
134 /* response meta details */
135 LFT_ADAPTED_REPLY_SIZE_TOTAL,
136 LFT_REPLY_HIGHOFFSET,
137 LFT_REPLY_OBJECTSIZE,
138 LFT_ADAPTED_REPLY_SIZE_HEADERS,
139 /*LFT_REPLY_SIZE_BODY, */
140 /*LFT_REPLY_SIZE_BODY_NO_TE, */
141
142 LFT_CLIENT_IO_SIZE_TOTAL,
143
144 /* client credentials */
145 LFT_USER_NAME, /* any source will do */
146 LFT_USER_LOGIN,
147 LFT_USER_IDENT,
148 /*LFT_USER_REALM, */
149 /*LFT_USER_SCHEME, */
150 LFT_USER_EXTERNAL,
151 /* LFT_USER_SSL_CERT, */
152
153 /* global time details */
154 LFT_TIME_SECONDS_SINCE_EPOCH,
155 LFT_TIME_SUBSECOND,
156 LFT_TIME_LOCALTIME,
157 LFT_TIME_GMT,
158 LFT_TIME_START, // the time the master transaction started
159
160 /* processing time details */
161 LFT_TIME_TO_HANDLE_REQUEST,
162 LFT_PEER_RESPONSE_TIME,
163 LFT_TOTAL_SERVER_SIDE_RESPONSE_TIME,
164 LFT_DNS_WAIT_TIME,
165
166 /* Squid internal processing details */
167 LFT_SQUID_STATUS,
168 LFT_SQUID_ERROR,
169 LFT_SQUID_ERROR_DETAIL,
170 LFT_SQUID_HIERARCHY,
171
172 LFT_MIME_TYPE,
173 LFT_TAG,
174 LFT_EXT_LOG,
175
176 LFT_SEQUENCE_NUMBER,
177
178 #if USE_ADAPTATION
179 LFT_ADAPTATION_SUM_XACT_TIMES,
180 LFT_ADAPTATION_ALL_XACT_TIMES,
181 LFT_ADAPTATION_LAST_HEADER,
182 LFT_ADAPTATION_LAST_HEADER_ELEM,
183 LFT_ADAPTATION_LAST_ALL_HEADERS,
184 #endif
185
186 #if ICAP_CLIENT
187
188 LFT_ICAP_TOTAL_TIME,
189
190 LFT_ICAP_ADDR,
191 LFT_ICAP_SERV_NAME,
192 LFT_ICAP_REQUEST_URI,
193 LFT_ICAP_REQUEST_METHOD,
194 LFT_ICAP_BYTES_SENT,
195 LFT_ICAP_BYTES_READ,
196 LFT_ICAP_BODY_BYTES_READ,
197
198 LFT_ICAP_REQ_HEADER,
199 LFT_ICAP_REQ_HEADER_ELEM,
200 LFT_ICAP_REQ_ALL_HEADERS,
201
202 LFT_ICAP_REP_HEADER,
203 LFT_ICAP_REP_HEADER_ELEM,
204 LFT_ICAP_REP_ALL_HEADERS,
205
206 LFT_ICAP_TR_RESPONSE_TIME,
207 LFT_ICAP_IO_TIME,
208 LFT_ICAP_OUTCOME,
209 LFT_ICAP_STATUS_CODE,
210 #endif
211 LFT_CREDENTIALS,
212
213 #if USE_OPENSSL
214 LFT_SSL_BUMP_MODE,
215 LFT_SSL_USER_CERT_SUBJECT,
216 LFT_SSL_USER_CERT_ISSUER,
217 LFT_SSL_CLIENT_SNI,
218 LFT_SSL_SERVER_CERT_SUBJECT,
219 LFT_SSL_SERVER_CERT_ISSUER,
220 #endif
221
222 LFT_NOTE,
223 LFT_PERCENT, /* special string cases for escaped chars */
224
225 // TODO assign better bytecode names and Token strings for these
226 LFT_EXT_ACL_USER_CERT_RAW,
227 LFT_EXT_ACL_USER_CERTCHAIN_RAW,
228 LFT_EXT_ACL_USER_CERT,
229 LFT_EXT_ACL_USER_CA_CERT,
230 LFT_EXT_ACL_CLIENT_EUI48,
231 LFT_EXT_ACL_CLIENT_EUI64,
232 LFT_EXT_ACL_NAME,
233 LFT_EXT_ACL_DATA
234
235 } ByteCode_t;
236
237 /// Quoting style for a format output.
238 enum Quoting {
239 LOG_QUOTE_NONE = 0,
240 LOG_QUOTE_QUOTES,
241 LOG_QUOTE_MIMEBLOB,
242 LOG_QUOTE_URL,
243 LOG_QUOTE_RAW
244 };
245
246 } // namespace Format
247
248 #endif /* _SQUID_FMT_BYTECODE_H */
249