HTP
0.5
Main Page
Data Structures
Files
File List
Globals
htp
htp_config_private.h
Go to the documentation of this file.
1
/***************************************************************************
2
* Copyright (c) 2009-2010 Open Information Security Foundation
3
* Copyright (c) 2010-2013 Qualys, Inc.
4
* All rights reserved.
5
*
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions are
8
* met:
9
*
10
* - Redistributions of source code must retain the above copyright
11
* notice, this list of conditions and the following disclaimer.
12
13
* - Redistributions in binary form must reproduce the above copyright
14
* notice, this list of conditions and the following disclaimer in the
15
* documentation and/or other materials provided with the distribution.
16
17
* - Neither the name of the Qualys, Inc. nor the names of its
18
* contributors may be used to endorse or promote products derived from
19
* this software without specific prior written permission.
20
*
21
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
***************************************************************************/
33
39
#ifndef HTP_CONFIG_PRIVATE_H
40
#define HTP_CONFIG_PRIVATE_H
41
42
#ifdef __cplusplus
43
extern
"C"
{
44
#endif
45
46
#define HTP_DECODER_CONTEXTS_MAX 3
47
48
typedef
struct
htp_decoder_cfg_t
{
49
50
// Path-specific decoding options.
51
53
int
backslash_convert_slashes
;
54
56
int
convert_lowercase
;
57
59
int
path_separators_compress
;
60
62
int
path_separators_decode
;
63
65
enum
htp_unwanted_t
path_separators_encoded_unwanted
;
66
67
68
// Special characters options.
69
71
int
nul_raw_terminates
;
72
74
enum
htp_unwanted_t
nul_raw_unwanted
;
75
77
enum
htp_unwanted_t
control_chars_unwanted
;
78
79
80
// URL encoding options.
81
83
int
u_encoding_decode
;
84
86
enum
htp_unwanted_t
u_encoding_unwanted
;
87
89
enum
htp_url_encoding_handling_t
url_encoding_invalid_handling
;
90
92
enum
htp_unwanted_t
url_encoding_invalid_unwanted
;
93
95
int
nul_encoded_terminates
;
96
98
enum
htp_unwanted_t
nul_encoded_unwanted
;
99
100
101
// UTF-8 options.
102
104
enum
htp_unwanted_t
utf8_invalid_unwanted
;
105
107
int
utf8_convert_bestfit
;
108
109
110
// Best-fit mapping options.
111
113
unsigned
char
*
bestfit_map
;
114
116
unsigned
char
bestfit_replacement_byte
;
117
}
htp_decoder_cfg_t
;
118
119
struct
htp_cfg_t
{
124
size_t
field_limit_hard
;
125
130
size_t
field_limit_soft
;
131
136
enum
htp_log_level_t
log_level
;
137
142
int
tx_auto_destroy
;
143
147
enum
htp_server_personality_t
server_personality
;
148
150
int (*
parse_request_line
)(
htp_connp_t
*connp);
151
153
int (*
parse_response_line
)(
htp_connp_t
*connp);
154
156
int (*
process_request_header
)(
htp_connp_t
*connp,
unsigned
char
*data,
size_t
len);
157
159
int (*
process_response_header
)(
htp_connp_t
*connp,
unsigned
char
*data,
size_t
len);
160
162
int (*
parameter_processor
)(
htp_param_t
*param);
163
165
htp_decoder_cfg_t
decoder_cfgs
[
HTP_DECODER_CONTEXTS_MAX
];
166
168
int
generate_request_uri_normalized
;
169
171
int
response_decompression_enabled
;
172
174
char
*
request_encoding
;
175
177
char
*
internal_encoding
;
178
180
int
parse_request_cookies
;
181
183
int
parse_request_auth
;
184
186
int
extract_request_files
;
187
189
int
extract_request_files_limit
;
190
192
char
*
tmpdir
;
193
194
// Hooks
195
201
htp_hook_t
*
hook_request_start
;
202
206
htp_hook_t
*
hook_request_line
;
207
211
htp_hook_t
*
hook_request_uri_normalize
;
212
219
htp_hook_t
*
hook_request_header_data
;
220
224
htp_hook_t
*
hook_request_headers
;
225
233
htp_hook_t
*
hook_request_body_data
;
234
239
htp_hook_t
*
hook_request_file_data
;
240
246
htp_hook_t
*
hook_request_trailer_data
;
247
252
htp_hook_t
*
hook_request_trailer
;
253
257
htp_hook_t
*
hook_request_complete
;
258
263
htp_hook_t
*
hook_response_start
;
264
268
htp_hook_t
*
hook_response_line
;
269
276
htp_hook_t
*
hook_response_header_data
;
277
281
htp_hook_t
*
hook_response_headers
;
282
291
htp_hook_t
*
hook_response_body_data
;
292
298
htp_hook_t
*
hook_response_trailer_data
;
299
304
htp_hook_t
*
hook_response_trailer
;
305
311
htp_hook_t
*
hook_response_complete
;
312
318
htp_hook_t
*
hook_transaction_complete
;
319
323
htp_hook_t
*
hook_log
;
324
328
void
*
user_data
;
329
};
330
331
#ifdef __cplusplus
332
}
333
#endif
334
335
#endif
/* HTP_CONFIG_PRIVATE H */
336
Generated by
1.8.3.1