HTP 0.5
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
43extern "C" {
44#endif
45
46#include "htp.h"
47
61
71
74
77
80
83
86
89
92
93 /* Mimics the behavior of IIS 7.5, as shipped with Windows 7. */
95
96 /* Mimics the behavior of Apache 2.x. */
98};
99
114
128
137
150
157
165
173void htp_config_register_log(htp_cfg_t *cfg, int (*callback_fn)(htp_log_t *));
174
182
190void htp_config_register_request_start(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
191
198void htp_config_register_request_body_data(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_data_t *));
199
206void htp_config_register_request_complete(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
207
214void htp_config_register_request_file_data(htp_cfg_t *cfg, int (*callback_fn)(htp_file_data_t *));
215
222void htp_config_register_request_header_data(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_data_t *));
223
230void htp_config_register_request_headers(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
231
238void htp_config_register_request_line(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
239
246void htp_config_register_request_uri_normalize(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
247
254void htp_config_register_request_trailer(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
255
262void htp_config_register_request_trailer_data(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_data_t *d));
263
270void htp_config_register_response_body_data(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_data_t *));
271
278void htp_config_register_response_complete(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
279
287
294void htp_config_register_response_headers(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
295
302void htp_config_register_response_line(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
303
310void htp_config_register_response_start(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
311
318void htp_config_register_response_trailer(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
319
326void htp_config_register_response_trailer_data(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_data_t *d));
327
334void htp_config_register_transaction_complete(htp_cfg_t *cfg, int (*callback_fn)(htp_tx_t *));
335
343
354
367void htp_config_set_bestfit_map(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, void *map);
368
378void htp_config_set_bestfit_replacement_byte(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int replacement_byte);
379
388
398void htp_config_set_convert_lowercase(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled);
399
416htp_status_t htp_config_set_extract_request_files(htp_cfg_t *cfg, int extract_files, int limit);
417
427void htp_config_set_field_limits(htp_cfg_t *cfg, size_t soft_limit, size_t hard_limit);
428
435void htp_config_set_lzma_memlimit(htp_cfg_t *cfg, size_t memlimit);
436
443void htp_config_set_lzma_layers(htp_cfg_t *cfg, int limit);
444
451void htp_config_set_compression_bomb_limit(htp_cfg_t *cfg, size_t bomblimit);
452
459void htp_config_set_compression_time_limit(htp_cfg_t *cfg, size_t useclimit);
460
467void htp_config_set_log_level(htp_cfg_t *cfg, enum htp_log_level_t log_level);
468
479
488
496void htp_config_set_nul_raw_terminates(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled);
497
508
515void htp_config_set_parse_request_auth(htp_cfg_t *cfg, int parse_request_auth);
516
523void htp_config_set_parse_request_cookies(htp_cfg_t *cfg, int parse_request_cookies);
524
531void htp_config_set_allow_space_uri(htp_cfg_t *cfg, int allow_space_uri);
532
545
558
567
577void htp_config_set_plusspace_decode(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled);
578
586
593void htp_config_set_request_decompression(htp_cfg_t *cfg, int enabled);
594
603
611void htp_config_set_tmpdir(htp_cfg_t *cfg, char *tmpdir);
612
621void htp_config_set_tx_auto_destroy(htp_cfg_t *cfg, int tx_auto_destroy);
622
629void htp_config_set_user_data(htp_cfg_t *cfg, void *user_data);
630
639void htp_config_set_u_encoding_decode(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled);
640
649
658
667
676void htp_config_set_utf8_convert_bestfit(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled);
677
688
697
705
706#ifdef __cplusplus
707}
708#endif
709
710#endif /* HTP_CONFIG_H */
711
void htp_config_set_parse_request_cookies(htp_cfg_t *cfg, int parse_request_cookies)
Definition htp_config.c:555
void htp_config_set_request_decompression(htp_cfg_t *cfg, int enabled)
Definition htp_config.c:565
void htp_config_set_backslash_convert_slashes(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
Definition htp_config.c:784
void htp_config_register_response_trailer_data(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *d))
Definition htp_config.c:486
void htp_config_set_lzma_memlimit(htp_cfg_t *cfg, size_t memlimit)
Definition htp_config.c:516
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)
Definition htp_config.c:736
htp_cfg_t * htp_config_create(void)
Definition htp_config.c:148
void * htp_config_get_user_data(htp_cfg_t *cfg)
Definition htp_config.c:386
void htp_config_set_utf8_invalid_unwanted(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
Definition htp_config.c:928
void htp_config_set_parse_request_auth(htp_cfg_t *cfg, int parse_request_auth)
Definition htp_config.c:550
void htp_config_set_utf8_convert_bestfit(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
Definition htp_config.c:844
void htp_config_set_log_level(htp_cfg_t *cfg, enum htp_log_level_t log_level)
Definition htp_config.c:545
void htp_config_set_response_decompression(htp_cfg_t *cfg, int enabled)
Definition htp_config.c:560
void htp_config_register_request_trailer_data(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *d))
Definition htp_config.c:446
void htp_config_set_nul_encoded_unwanted(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
Definition htp_config.c:892
htp_server_personality_t
Definition htp_config.h:65
@ HTP_SERVER_IIS_7_5
Definition htp_config.h:94
@ HTP_SERVER_GENERIC
Definition htp_config.h:73
@ HTP_SERVER_IIS_5_1
Definition htp_config.h:85
@ HTP_SERVER_MINIMAL
Definition htp_config.h:70
@ HTP_SERVER_IDS
Definition htp_config.h:76
@ HTP_SERVER_IIS_5_0
Definition htp_config.h:82
@ HTP_SERVER_IIS_7_0
Definition htp_config.h:91
@ HTP_SERVER_APACHE_2
Definition htp_config.h:97
@ HTP_SERVER_IIS_6_0
Definition htp_config.h:88
@ HTP_SERVER_IIS_4_0
Definition htp_config.h:79
void htp_config_register_request_file_data(htp_cfg_t *cfg, int(*callback_fn)(htp_file_data_t *))
Definition htp_config.c:411
void htp_config_set_u_encoding_decode(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
Definition htp_config.c:772
void htp_config_register_multipart_parser(htp_cfg_t *cfg)
Definition htp_config.c:396
void htp_config_register_response_complete(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:456
void htp_config_set_bestfit_replacement_byte(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int replacement_byte)
Definition htp_config.c:724
void htp_config_set_convert_lowercase(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
Definition htp_config.c:832
void htp_config_set_nul_raw_unwanted(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
Definition htp_config.c:904
void htp_config_set_allow_space_uri(htp_cfg_t *cfg, int allow_space_uri)
Definition htp_config.c:570
void htp_config_set_nul_raw_terminates(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
Definition htp_config.c:748
void htp_config_set_bestfit_map(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, void *map)
Definition htp_config.c:712
void htp_config_register_request_start(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:436
void htp_config_set_compression_time_limit(htp_cfg_t *cfg, size_t useclimit)
Definition htp_config.c:535
void htp_config_set_url_encoding_invalid_unwanted(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
Definition htp_config.c:880
void htp_config_set_tmpdir(htp_cfg_t *cfg, char *tmpdir)
Definition htp_config.c:691
void htp_config_register_response_trailer(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:481
void htp_config_register_response_header_data(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *))
Definition htp_config.c:461
void htp_config_set_nul_encoded_terminates(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
Definition htp_config.c:760
void htp_config_register_request_trailer(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:441
void htp_config_set_response_decompression_layer_limit(htp_cfg_t *cfg, int limit)
Definition htp_config.c:946
void htp_config_set_field_limits(htp_cfg_t *cfg, size_t soft_limit, size_t hard_limit)
Definition htp_config.c:510
void htp_config_register_request_complete(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:401
void htp_config_register_transaction_complete(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:491
void htp_config_set_plusspace_decode(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
Definition htp_config.c:820
void htp_config_set_compression_bomb_limit(htp_cfg_t *cfg, size_t bomblimit)
Definition htp_config.c:526
void htp_config_set_requestline_leading_whitespace_unwanted(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
Definition htp_config.c:940
htp_unwanted_t
Definition htp_config.h:103
@ HTP_UNWANTED_IGNORE
Definition htp_config.h:106
@ HTP_UNWANTED_404
Definition htp_config.h:112
@ HTP_UNWANTED_400
Definition htp_config.h:109
void htp_config_set_lzma_layers(htp_cfg_t *cfg, int limit)
Definition htp_config.c:521
void htp_config_register_request_body_data(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *))
Definition htp_config.c:406
void htp_config_register_response_start(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:476
void htp_config_set_path_separators_decode(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
Definition htp_config.c:796
htp_status_t htp_config_set_server_personality(htp_cfg_t *cfg, enum htp_server_personality_t personality)
Definition htp_config.c:575
void htp_config_register_response_line(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:471
void htp_config_register_request_header_data(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *))
Definition htp_config.c:421
void htp_config_register_request_uri_normalize(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:416
void htp_config_set_control_chars_unwanted(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
Definition htp_config.c:868
void htp_config_set_tx_auto_destroy(htp_cfg_t *cfg, int tx_auto_destroy)
Definition htp_config.c:696
htp_status_t htp_config_set_extract_request_files(htp_cfg_t *cfg, int extract_files, int limit)
Definition htp_config.c:502
void htp_config_register_request_line(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:431
void htp_config_set_u_encoding_unwanted(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
Definition htp_config.c:856
void htp_config_register_response_headers(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:466
void htp_config_register_request_headers(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
Definition htp_config.c:426
void htp_config_destroy(htp_cfg_t *cfg)
Definition htp_config.c:359
void htp_config_set_path_separators_compress(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
Definition htp_config.c:808
void htp_config_register_response_body_data(htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *))
Definition htp_config.c:451
htp_url_encoding_handling_t
Definition htp_config.h:118
@ HTP_URL_DECODE_REMOVE_PERCENT
Definition htp_config.h:123
@ HTP_URL_DECODE_PRESERVE_PERCENT
Definition htp_config.h:120
@ HTP_URL_DECODE_PROCESS_INVALID
Definition htp_config.h:126
void htp_config_register_log(htp_cfg_t *cfg, int(*callback_fn)(htp_log_t *))
Definition htp_config.c:391
void htp_config_register_urlencoded_parser(htp_cfg_t *cfg)
Definition htp_config.c:496
void htp_config_set_path_separators_encoded_unwanted(htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
Definition htp_config.c:916
void htp_config_set_user_data(htp_cfg_t *cfg, void *user_data)
Definition htp_config.c:701
htp_cfg_t * htp_config_copy(htp_cfg_t *cfg)
Definition htp_config.c:185
htp_decoder_ctx_t
Definition htp_config.h:51
@ HTP_DECODER_URL_PATH
Definition htp_config.h:59
@ HTP_DECODER_URLENCODED
Definition htp_config.h:56
@ HTP_DECODER_DEFAULTS
Definition htp_config.h:53
int htp_status_t
Definition htp_core.h:46
htp_log_level_t
Definition htp_core.h:249
Definition htp_config_private.h:123
Definition htp.h:131
Definition htp.h:145
Definition htp.h:551
Definition htp.h:208