HTP  0.5
Enumerations | Functions
htp_config.h File Reference
#include "htp.h"

Go to the source code of this file.

Enumerations

enum  htp_decoder_ctx_t { HTP_DECODER_DEFAULTS = 0, HTP_DECODER_URLENCODED = 1, HTP_DECODER_URL_PATH = 2 }
 
enum  htp_server_personality_t {
  HTP_SERVER_MINIMAL = 0, HTP_SERVER_GENERIC = 1, HTP_SERVER_IDS = 2, HTP_SERVER_IIS_4_0 = 3,
  HTP_SERVER_IIS_5_0 = 4, HTP_SERVER_IIS_5_1 = 5, HTP_SERVER_IIS_6_0 = 6, HTP_SERVER_IIS_7_0 = 7,
  HTP_SERVER_IIS_7_5 = 8, HTP_SERVER_APACHE_2 = 9
}
 
enum  htp_unwanted_t { HTP_UNWANTED_IGNORE = 0, HTP_UNWANTED_400 = 400, HTP_UNWANTED_404 = 404 }
 
enum  htp_url_encoding_handling_t { HTP_URL_DECODE_PRESERVE_PERCENT = 0, HTP_URL_DECODE_REMOVE_PERCENT = 1, HTP_URL_DECODE_PROCESS_INVALID = 2 }
 

Functions

htp_cfg_thtp_config_create (void)
 
htp_cfg_thtp_config_copy (htp_cfg_t *cfg)
 
void htp_config_destroy (htp_cfg_t *cfg)
 
void * htp_config_get_user_data (htp_cfg_t *cfg)
 
void htp_config_register_log (htp_cfg_t *cfg, int(*callback_fn)(htp_log_t *))
 
void htp_config_register_multipart_parser (htp_cfg_t *cfg)
 
void htp_config_register_request_start (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_request_body_data (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *))
 
void htp_config_register_request_complete (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_request_file_data (htp_cfg_t *cfg, int(*callback_fn)(htp_file_data_t *))
 
void htp_config_register_request_header_data (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *))
 
void htp_config_register_request_headers (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_request_line (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_request_uri_normalize (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_request_trailer (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_request_trailer_data (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *d))
 
void htp_config_register_response_body_data (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *))
 
void htp_config_register_response_complete (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_response_header_data (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *))
 
void htp_config_register_response_headers (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_response_line (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_response_start (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_response_trailer (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_response_trailer_data (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_data_t *d))
 
void htp_config_register_transaction_complete (htp_cfg_t *cfg, int(*callback_fn)(htp_tx_t *))
 
void htp_config_register_urlencoded_parser (htp_cfg_t *cfg)
 
void htp_config_set_backslash_convert_slashes (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
 
void htp_config_set_bestfit_map (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, void *map)
 
void htp_config_set_bestfit_replacement_byte (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int replacement_byte)
 
void htp_config_set_control_chars_unwanted (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
 
void htp_config_set_convert_lowercase (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
 
htp_status_t htp_config_set_extract_request_files (htp_cfg_t *cfg, int extract_files, int limit)
 
void htp_config_set_field_limits (htp_cfg_t *cfg, size_t soft_limit, size_t hard_limit)
 
void htp_config_set_log_level (htp_cfg_t *cfg, enum htp_log_level_t log_level)
 
void htp_config_set_nul_encoded_terminates (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
 
void htp_config_set_nul_encoded_unwanted (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
 
void htp_config_set_nul_raw_terminates (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
 
void htp_config_set_nul_raw_unwanted (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
 
void htp_config_set_parse_request_auth (htp_cfg_t *cfg, int parse_request_auth)
 
void htp_config_set_parse_request_cookies (htp_cfg_t *cfg, int parse_request_cookies)
 
void htp_config_set_path_separators_compress (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
 
void htp_config_set_path_separators_decode (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
 
void htp_config_set_path_separators_encoded_unwanted (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
 
void htp_config_set_plusspace_decode (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
 
void htp_config_set_response_decompression (htp_cfg_t *cfg, int enabled)
 
htp_status_t htp_config_set_server_personality (htp_cfg_t *cfg, enum htp_server_personality_t personality)
 
void htp_config_set_tmpdir (htp_cfg_t *cfg, char *tmpdir)
 
void htp_config_set_tx_auto_destroy (htp_cfg_t *cfg, int tx_auto_destroy)
 
void htp_config_set_user_data (htp_cfg_t *cfg, void *user_data)
 
void htp_config_set_u_encoding_decode (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
 
void htp_config_set_u_encoding_unwanted (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
 
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)
 
void htp_config_set_url_encoding_invalid_unwanted (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
 
void htp_config_set_utf8_convert_bestfit (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, int enabled)
 
void htp_config_set_utf8_invalid_unwanted (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
 
void htp_config_set_requestline_leading_whitespace_unwanted (htp_cfg_t *cfg, enum htp_decoder_ctx_t ctx, enum htp_unwanted_t unwanted)
 
void htp_config_set_response_decompression_layer_limit (htp_cfg_t *cfg, int limit)
 

Detailed Description

Author
Ivan Ristic ivanr.nosp@m.@web.nosp@m.kreat.nosp@m.or.c.nosp@m.om

Enumeration Type Documentation

Decoder contexts.

Enumerator
HTP_DECODER_DEFAULTS 

Default settings. Settings applied to this context are propagated to all other contexts.

HTP_DECODER_URLENCODED 

Urlencoded decoder settings.

HTP_DECODER_URL_PATH 

URL path decoder settings.

Enumerates the possible server personalities.

Enumerator
HTP_SERVER_MINIMAL 

Minimal personality that performs at little work as possible. All optional features are disabled. This personality is a good starting point for customization.

HTP_SERVER_GENERIC 

A generic personality that aims to work reasonably well for all server types.

HTP_SERVER_IDS 

The IDS personality tries to perform as much decoding as possible.

HTP_SERVER_IIS_4_0 

Mimics the behavior of IIS 4.0, as shipped with Windows NT 4.0.

HTP_SERVER_IIS_5_0 

Mimics the behavior of IIS 5.0, as shipped with Windows 2000.

HTP_SERVER_IIS_5_1 

Mimics the behavior of IIS 5.1, as shipped with Windows XP Professional.

HTP_SERVER_IIS_6_0 

Mimics the behavior of IIS 6.0, as shipped with Windows 2003.

HTP_SERVER_IIS_7_0 

Mimics the behavior of IIS 7.0, as shipped with Windows 2008.

HTP_SERVER_IIS_7_5 
HTP_SERVER_APACHE_2 

Enumerates the ways in which servers respond to malformed data.

Enumerator
HTP_UNWANTED_IGNORE 

Ignores problem.

HTP_UNWANTED_400 

Responds with HTTP 400 status code.

HTP_UNWANTED_404 

Responds with HTTP 404 status code.

Enumerates the possible approaches to handling invalid URL-encodings.

Enumerator
HTP_URL_DECODE_PRESERVE_PERCENT 

Ignore invalid URL encodings and leave the % in the data.

HTP_URL_DECODE_REMOVE_PERCENT 

Ignore invalid URL encodings, but remove the % from the data.

HTP_URL_DECODE_PROCESS_INVALID 

Decode invalid URL encodings.

Function Documentation

htp_cfg_t* htp_config_copy ( htp_cfg_t cfg)

Creates a copy of the supplied configuration structure. The idea is to create one or more configuration objects at configuration-time, but to use this function to create per-connection copies. That way it will be possible to adjust per-connection configuration as necessary, without affecting the global configuration. Make sure no other thread changes the configuration object while this function is operating.

Parameters
[in]cfg
Returns
A copy of the configuration structure.
htp_cfg_t* htp_config_create ( void  )

Creates a new configuration structure. Configuration structures created at configuration time must not be changed afterwards in order to support lock-less copying.

Returns
New configuration structure.
void htp_config_destroy ( htp_cfg_t cfg)

Destroy a configuration structure.

Parameters
[in]cfg
void* htp_config_get_user_data ( htp_cfg_t cfg)

Retrieves user data associated with this configuration.

Parameters
[in]cfg
Returns
User data pointer, or NULL if not set.
void htp_config_register_log ( htp_cfg_t cfg,
int(*)(htp_log_t *)  callback_fn 
)

Registers a callback that is invoked every time there is a log message with severity equal and higher than the configured log level.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_multipart_parser ( htp_cfg_t cfg)

Adds the built-in Multipart parser to the configuration. This parser will extract information stored in request bodies, when they are in multipart/form-data format.

Parameters
[in]cfg
void htp_config_register_request_body_data ( htp_cfg_t cfg,
int(*)(htp_tx_data_t *)  callback_fn 
)

Registers a REQUEST_BODY_DATA callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_request_complete ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a REQUEST_COMPLETE callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_request_file_data ( htp_cfg_t cfg,
int(*)(htp_file_data_t *)  callback_fn 
)

Registers a REQUEST_FILE_DATA callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_request_header_data ( htp_cfg_t cfg,
int(*)(htp_tx_data_t *)  callback_fn 
)

Registers a REQUEST_HEADER_DATA callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_request_headers ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a REQUEST_HEADERS callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_request_line ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a REQUEST_LINE callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_request_start ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a REQUEST_START callback, which is invoked every time a new request begins and before any parsing is done.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_request_trailer ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a HTP_REQUEST_TRAILER callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_request_trailer_data ( htp_cfg_t cfg,
int(*)(htp_tx_data_t *d)  callback_fn 
)

Registers a REQUEST_TRAILER_DATA callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_request_uri_normalize ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a REQUEST_URI_NORMALIZE callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_response_body_data ( htp_cfg_t cfg,
int(*)(htp_tx_data_t *)  callback_fn 
)

Registers a RESPONSE_BODY_DATA callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_response_complete ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a RESPONSE_COMPLETE callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_response_header_data ( htp_cfg_t cfg,
int(*)(htp_tx_data_t *)  callback_fn 
)

Registers a RESPONSE_HEADER_DATA callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_response_headers ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a RESPONSE_HEADERS callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_response_line ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a RESPONSE_LINE callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_response_start ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a RESPONSE_START callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_response_trailer ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a RESPONSE_TRAILER callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_response_trailer_data ( htp_cfg_t cfg,
int(*)(htp_tx_data_t *d)  callback_fn 
)

Registers a RESPONSE_TRAILER_DATA callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_transaction_complete ( htp_cfg_t cfg,
int(*)(htp_tx_t *)  callback_fn 
)

Registers a TRANSACTION_COMPLETE callback.

Parameters
[in]cfg
[in]callback_fn
void htp_config_register_urlencoded_parser ( htp_cfg_t cfg)

Adds the built-in Urlencoded parser to the configuration. The parser will parse query strings and request bodies with the appropriate MIME type.

Parameters
[in]cfg
void htp_config_set_backslash_convert_slashes ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  enabled 
)

Configures whether backslash characters are treated as path segment separators. They are not on Unix systems, but are on Windows systems. If this setting is enabled, a path such as "/one\two/three" will be converted to "/one/two/three". Implemented only for HTP_DECODER_URL_PATH.

Parameters
[in]cfg
[in]ctx
[in]enabled
void htp_config_set_bestfit_map ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
void *  map 
)

Configures a best-fit map, which is used whenever characters longer than one byte need to be converted to a single-byte. By default a Windows 1252 best-fit map is used. The map is an list of triplets, the first 2 bytes being an UCS-2 character to map from, and the third byte being the single byte to map to. Make sure that your map contains the mappings to cover the full-width and half-width form characters (U+FF00-FFEF). The last triplet in the map must be all zeros (3 NUL bytes).

Parameters
[in]cfg
[in]ctx
[in]map
void htp_config_set_bestfit_replacement_byte ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  replacement_byte 
)

Sets the replacement character that will be used to in the lossy best-fit mapping from multi-byte to single-byte streams. The question mark character is used as the default replacement byte.

Parameters
[in]cfg
[in]ctx
[in]replacement_byte
void htp_config_set_control_chars_unwanted ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
enum htp_unwanted_t  unwanted 
)

Controls reaction to raw control characters in the data.

Parameters
[in]cfg
[in]ctx
[in]unwanted
void htp_config_set_convert_lowercase ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  enabled 
)

Configures whether input data will be converted to lowercase. Useful when set on the HTP_DECODER_URL_PATH context, in order to handle servers with case-insensitive filesystems. Implemented only for HTP_DECODER_URL_PATH.

Parameters
[in]cfg
[in]ctx
[in]enabled
htp_status_t htp_config_set_extract_request_files ( htp_cfg_t cfg,
int  extract_files,
int  limit 
)

Enables or disables Multipart file extraction. This function can be invoked only after a previous htp_config_set_tmpdir() invocation. Otherwise, the configuration change will fail, and extraction will not be enabled. Disabled by default. Please note that the built-in file extraction implementation uses synchronous I/O, which means that it is not suitable for use in an event-driven container. There's an upper limit to how many files can be created on the filesystem during a single request. The limit exists in order to mitigate against a DoS attack with a Multipart payload that contains hundreds and thousands of files (it's cheap for the attacker to do this, but costly for the server to support it). The default limit may be pretty conservative.

Parameters
[in]cfg
[in]extract_files1 if you wish extraction to be enabled, 0 otherwise
[in]limitthe maximum number of files allowed; use -1 to use the parser default.
void htp_config_set_field_limits ( htp_cfg_t cfg,
size_t  soft_limit,
size_t  hard_limit 
)

Configures the maximum size of the buffer LibHTP will use when all data is not available in the current buffer (e.g., a very long header line that might span several packets). This limit is controlled by the hard_limit parameter. The soft_limit parameter is not implemented.

Parameters
[in]cfg
[in]soft_limitNOT IMPLEMENTED.
[in]hard_limit
void htp_config_set_log_level ( htp_cfg_t cfg,
enum htp_log_level_t  log_level 
)

Configures the desired log level.

Parameters
[in]cfg
[in]log_level
void htp_config_set_nul_encoded_terminates ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  enabled 
)

Configures how the server reacts to encoded NUL bytes. Some servers will stop at at NUL, while some will respond with 400 or 404. When the termination option is not used, the NUL byte will remain in the path.

Parameters
[in]cfg
[in]ctx
[in]enabled
void htp_config_set_nul_encoded_unwanted ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
enum htp_unwanted_t  unwanted 
)

Configures reaction to encoded NUL bytes in input data.

Parameters
[in]cfg
[in]ctx
[in]unwanted
void htp_config_set_nul_raw_terminates ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  enabled 
)

Configures the handling of raw NUL bytes. If enabled, raw NUL terminates strings.

Parameters
[in]cfg
[in]ctx
[in]enabled
void htp_config_set_nul_raw_unwanted ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
enum htp_unwanted_t  unwanted 
)

Configures how the server reacts to raw NUL bytes. Some servers will terminate path at NUL, while some will respond with 400 or 404. When the termination option is not used, the NUL byte will remain in the data.

Parameters
[in]cfg
[in]ctx
[in]unwanted
void htp_config_set_parse_request_auth ( htp_cfg_t cfg,
int  parse_request_auth 
)

Enable or disable request HTTP Authentication parsing. Enabled by default.

Parameters
[in]cfg
[in]parse_request_auth
void htp_config_set_parse_request_cookies ( htp_cfg_t cfg,
int  parse_request_cookies 
)

Enable or disable request cookie parsing. Enabled by default.

Parameters
[in]cfg
[in]parse_request_cookies
void htp_config_set_path_separators_compress ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  enabled 
)

Configures whether consecutive path segment separators will be compressed. When enabled, a path such as "/one//two" will be normalized to "/one/two". Backslash conversion and path segment separator decoding are carried out before compression. For example, the path "/one\\/two\/%5cthree/%2f//four" will be converted to "/one/two/three/four" (assuming all 3 options are enabled). Implemented only for HTP_DECODER_URL_PATH.

Parameters
[in]cfg
[in]ctx
[in]enabled
void htp_config_set_path_separators_decode ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  enabled 
)

Configures whether encoded path segment separators will be decoded. Apache does not do this by default, but IIS does. If enabled, a path such as "/one%2ftwo" will be normalized to "/one/two". If the backslash_separators option is also enabled, encoded backslash characters will be converted too (and subsequently normalized to forward slashes). Implemented only for HTP_DECODER_URL_PATH.

Parameters
[in]cfg
[in]ctx
[in]enabled
void htp_config_set_path_separators_encoded_unwanted ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
enum htp_unwanted_t  unwanted 
)

Configures reaction to encoded path separator characters (e.g., %2f). Implemented only for HTP_DECODER_URL_PATH.

Parameters
[in]cfg
[in]ctx
[in]unwanted
void htp_config_set_plusspace_decode ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  enabled 
)

Configures whether plus characters are converted to spaces when decoding URL-encoded strings. This is appropriate to do for parameters, but not for URLs. Only applies to contexts where decoding is taking place.

Parameters
[in]cfg
[in]ctx
[in]enabled
void htp_config_set_requestline_leading_whitespace_unwanted ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
enum htp_unwanted_t  unwanted 
)

Configures how the server reacts to leading whitespace on the request line.

Parameters
[in]cfg
[in]ctx
[in]unwanted
void htp_config_set_response_decompression ( htp_cfg_t cfg,
int  enabled 
)

Controls whether compressed response bodies will be automatically decompressed.

Parameters
[in]cfg
[in]enabledset to 1 to enable decompression, 0 otherwise
void htp_config_set_response_decompression_layer_limit ( htp_cfg_t cfg,
int  limit 
)

Configures many layers of compression we try to decompress.

Parameters
[in]cfg
[in]limit0 disables limit
htp_status_t htp_config_set_server_personality ( htp_cfg_t cfg,
enum htp_server_personality_t  personality 
)

Configure desired server personality.

Parameters
[in]cfg
[in]personality
Returns
HTP_OK if the personality is supported, HTP_ERROR if it isn't.
void htp_config_set_tmpdir ( htp_cfg_t cfg,
char *  tmpdir 
)

Configures the path where temporary files should be stored. Must be set in order to use the Multipart file extraction functionality.

Parameters
[in]cfg
[in]tmpdir
void htp_config_set_tx_auto_destroy ( htp_cfg_t cfg,
int  tx_auto_destroy 
)

Configures whether transactions will be automatically destroyed once they are processed and all callbacks invoked. This option is appropriate for programs that process transactions as they are processed.

Parameters
[in]cfg
[in]tx_auto_destroy
void htp_config_set_u_encoding_decode ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  enabled 
)

Configures whether u-encoded sequences are decoded. Such sequences will be treated as invalid URL encoding if decoding is not desirable.

Parameters
[in]cfg
[in]ctx
[in]enabled
void htp_config_set_u_encoding_unwanted ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
enum htp_unwanted_t  unwanted 
)

Configures reaction to u-encoded sequences in input data.

Parameters
[in]cfg
[in]ctx
[in]unwanted
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 
)

Configures how the server handles to invalid URL encoding.

Parameters
[in]cfg
[in]ctx
[in]handling
void htp_config_set_url_encoding_invalid_unwanted ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
enum htp_unwanted_t  unwanted 
)

Configures how the server reacts to invalid URL encoding.

Parameters
[in]cfg
[in]ctx
[in]unwanted
void htp_config_set_user_data ( htp_cfg_t cfg,
void *  user_data 
)

Associates provided opaque user data with the configuration.

Parameters
[in]cfg
[in]user_data
void htp_config_set_utf8_convert_bestfit ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
int  enabled 
)

Controls whether the data should be treated as UTF-8 and converted to a single-byte stream using best-fit mapping. Implemented only for HTP_DECODER_URL_PATH.

Parameters
[in]cfg
[in]ctx
[in]enabled
void htp_config_set_utf8_invalid_unwanted ( htp_cfg_t cfg,
enum htp_decoder_ctx_t  ctx,
enum htp_unwanted_t  unwanted 
)

Configures how the server reacts to invalid UTF-8 characters. This setting does not affect path normalization; it only controls what response status will be expect for a request that contains invalid UTF-8 characters. Implemented only for HTP_DECODER_URL_PATH.

Parameters
[in]cfg
[in]ctx
[in]unwanted