HTP
0.5
Main Page
Data Structures
Files
File List
Globals
htp
htp_config.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_H
40
#define HTP_CONFIG_H
41
42
#ifdef __cplusplus
43
extern
"C"
{
44
#endif
45
46
#include "
htp.h
"
47
51
enum
htp_decoder_ctx_t
{
53
HTP_DECODER_DEFAULTS
= 0,
54
56
HTP_DECODER_URLENCODED
= 1,
57
59
HTP_DECODER_URL_PATH
= 2
60
};
61
65
enum
htp_server_personality_t
{
70
HTP_SERVER_MINIMAL
= 0,
71
73
HTP_SERVER_GENERIC
= 1,
74
76
HTP_SERVER_IDS
= 2,
77
79
HTP_SERVER_IIS_4_0
= 3,
80
82
HTP_SERVER_IIS_5_0
= 4,
83
85
HTP_SERVER_IIS_5_1
= 5,
86
88
HTP_SERVER_IIS_6_0
= 6,
89
91
HTP_SERVER_IIS_7_0
= 7,
92
93
/* Mimics the behavior of IIS 7.5, as shipped with Windows 7. */
94
HTP_SERVER_IIS_7_5
= 8,
95
96
/* Mimics the behavior of Apache 2.x. */
97
HTP_SERVER_APACHE_2
= 9
98
};
99
103
enum
htp_unwanted_t
{
104
106
HTP_UNWANTED_IGNORE
= 0,
107
109
HTP_UNWANTED_400
= 400,
110
112
HTP_UNWANTED_404
= 404
113
};
114
118
enum
htp_url_encoding_handling_t
{
120
HTP_URL_DECODE_PRESERVE_PERCENT
= 0,
121
123
HTP_URL_DECODE_REMOVE_PERCENT
= 1,
124
126
HTP_URL_DECODE_PROCESS_INVALID
= 2
127
};
128
136
htp_cfg_t
*
htp_config_create
(
void
);
137
149
htp_cfg_t
*
htp_config_copy
(
htp_cfg_t
*cfg);
150
156
void
htp_config_destroy
(
htp_cfg_t
*cfg);
157
164
void
*
htp_config_get_user_data
(
htp_cfg_t
*cfg);
165
173
void
htp_config_register_log
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_log_t
*));
174
181
void
htp_config_register_multipart_parser
(
htp_cfg_t
*cfg);
182
190
void
htp_config_register_request_start
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
191
198
void
htp_config_register_request_body_data
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_data_t
*));
199
206
void
htp_config_register_request_complete
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
207
214
void
htp_config_register_request_file_data
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_file_data_t
*));
215
222
void
htp_config_register_request_header_data
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_data_t
*));
223
230
void
htp_config_register_request_headers
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
231
238
void
htp_config_register_request_line
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
239
246
void
htp_config_register_request_uri_normalize
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
247
254
void
htp_config_register_request_trailer
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
255
262
void
htp_config_register_request_trailer_data
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_data_t
*d));
263
270
void
htp_config_register_response_body_data
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_data_t
*));
271
278
void
htp_config_register_response_complete
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
279
286
void
htp_config_register_response_header_data
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_data_t
*));
287
294
void
htp_config_register_response_headers
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
295
302
void
htp_config_register_response_line
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
303
310
void
htp_config_register_response_start
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
311
318
void
htp_config_register_response_trailer
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
319
326
void
htp_config_register_response_trailer_data
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_data_t
*d));
327
334
void
htp_config_register_transaction_complete
(
htp_cfg_t
*cfg,
int
(*callback_fn)(
htp_tx_t
*));
335
342
void
htp_config_register_urlencoded_parser
(
htp_cfg_t
*cfg);
343
353
void
htp_config_set_backslash_convert_slashes
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
int
enabled);
354
367
void
htp_config_set_bestfit_map
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
void
*map);
368
378
void
htp_config_set_bestfit_replacement_byte
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
int
replacement_byte);
379
387
void
htp_config_set_control_chars_unwanted
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
enum
htp_unwanted_t
unwanted);
388
398
void
htp_config_set_convert_lowercase
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
int
enabled);
399
416
htp_status_t
htp_config_set_extract_request_files
(
htp_cfg_t
*cfg,
int
extract_files,
int
limit);
417
429
void
htp_config_set_field_limits
(
htp_cfg_t
*cfg,
size_t
soft_limit,
size_t
hard_limit);
430
437
void
htp_config_set_log_level
(
htp_cfg_t
*cfg,
enum
htp_log_level_t
log_level);
438
445
void
htp_config_set_generate_request_uri_normalized
(
htp_cfg_t
*cfg,
int
generate);
446
456
void
htp_config_set_nul_encoded_terminates
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
int
enabled);
457
465
void
htp_config_set_nul_encoded_unwanted
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
enum
htp_unwanted_t
unwanted);
466
474
void
htp_config_set_nul_raw_terminates
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
int
enabled);
475
485
void
htp_config_set_nul_raw_unwanted
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
enum
htp_unwanted_t
unwanted);
486
493
void
htp_config_set_parse_request_auth
(
htp_cfg_t
*cfg,
int
parse_request_auth);
494
501
void
htp_config_set_parse_request_cookies
(
htp_cfg_t
*cfg,
int
parse_request_cookies);
502
514
void
htp_config_set_path_separators_compress
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
int
enabled);
515
527
void
htp_config_set_path_separators_decode
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
int
enabled);
528
536
void
htp_config_set_path_separators_encoded_unwanted
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
enum
htp_unwanted_t
unwanted);
537
544
void
htp_config_set_response_decompression
(
htp_cfg_t
*cfg,
int
enabled);
545
553
htp_status_t
htp_config_set_server_personality
(
htp_cfg_t
*cfg,
enum
htp_server_personality_t
personality);
554
562
void
htp_config_set_tmpdir
(
htp_cfg_t
*cfg,
char
*tmpdir);
563
572
void
htp_config_set_tx_auto_destroy
(
htp_cfg_t
*cfg,
int
tx_auto_destroy);
573
580
void
htp_config_set_user_data
(
htp_cfg_t
*cfg,
void
*user_data);
581
590
void
htp_config_set_u_encoding_decode
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
int
enabled);
591
599
void
htp_config_set_u_encoding_unwanted
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
enum
htp_unwanted_t
unwanted);
600
608
void
htp_config_set_url_encoding_invalid_handling
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
enum
htp_url_encoding_handling_t
handling);
609
617
void
htp_config_set_url_encoding_invalid_unwanted
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
enum
htp_unwanted_t
unwanted);
618
627
void
htp_config_set_utf8_convert_bestfit
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
int
enabled);
628
638
void
htp_config_set_utf8_invalid_unwanted
(
htp_cfg_t
*cfg,
enum
htp_decoder_ctx_t
ctx,
enum
htp_unwanted_t
unwanted);
639
640
641
#ifdef __cplusplus
642
}
643
#endif
644
645
#endif
/* HTP_CONFIG_H */
646
Generated by
1.8.3.1