Go to the documentation of this file.
33 #ifndef SURICATA_APP_LAYER_HTP_H
34 #define SURICATA_APP_LAYER_HTP_H
42 #define HTP_CONFIG_DEFAULT_REQUEST_BODY_LIMIT 4096U
43 #define HTP_CONFIG_DEFAULT_RESPONSE_BODY_LIMIT 4096U
44 #define HTP_CONFIG_DEFAULT_REQUEST_INSPECT_MIN_SIZE 32768U
45 #define HTP_CONFIG_DEFAULT_REQUEST_INSPECT_WINDOW 4096U
46 #define HTP_CONFIG_DEFAULT_RESPONSE_INSPECT_MIN_SIZE 32768U
47 #define HTP_CONFIG_DEFAULT_RESPONSE_INSPECT_WINDOW 4096U
48 #define HTP_CONFIG_DEFAULT_FIELD_LIMIT_SOFT 9000U
49 #define HTP_CONFIG_DEFAULT_FIELD_LIMIT_HARD 18000U
51 #define HTP_CONFIG_DEFAULT_LZMA_LAYERS 0U
53 #define HTP_CONFIG_DEFAULT_LZMA_MEMLIMIT 1048576U
54 #define HTP_CONFIG_DEFAULT_COMPRESSION_BOMB_LIMIT 1048576U
56 #define HTP_CONFIG_DEFAULT_COMPRESSION_TIME_LIMIT 100000
58 #define HTP_CONFIG_DEFAULT_RANDOMIZE 1
59 #define HTP_CONFIG_DEFAULT_RANDOMIZE_RANGE 10
62 #define HTP_FLAG_STATE_CLOSED_TS 0x0002
64 #define HTP_FLAG_STATE_CLOSED_TC \
199 #define HTP_BOUNDARY_SET BIT_U8(1)
200 #define HTP_FILENAME_SET BIT_U8(3)
201 #define HTP_DONTSTORE BIT_U8(4)
202 #define HTP_STREAM_DEPTH_SET BIT_U8(5)
266 #define HTP_REQUIRE_REQUEST_BODY (1 << 0)
268 #define HTP_REQUIRE_REQUEST_FILE (1 << 2)
270 #define HTP_REQUIRE_RESPONSE_BODY (1 << 3)
struct HtpState_ HtpState
const struct HTPCfgRec_ * cfg
@ HTTP_DECODER_EVENT_REQUEST_LINE_LEADING_WHITESPACE
@ HTTP_DECODER_EVENT_REQUEST_LINE_INVALID
@ HTTP_DECODER_EVENT_RESPONSE_FIELD_MISSING_COLON
@ HTTP_DECODER_EVENT_RESPONSE_ABNORMAL_TRANSFER_ENCODING
void AppLayerHtpNeedFileInspection(void)
Sets a flag that informs the HTP app layer that some module in the engine needs the http request file...
@ HTTP_DECODER_EVENT_TOO_MANY_WARNINGS
@ HTTP_DECODER_EVENT_REQUEST_FIELD_MISSING_COLON
@ HTTP_DECODER_EVENT_INVALID_TRANSFER_ENCODING_VALUE_IN_REQUEST
@ HTTP_DECODER_EVENT_URI_HOST_INVALID
uint32_t request_headers_raw_len
struct HtpTxUserData_ HtpTxUserData
void AppLayerHtpPrintStats(void)
@ HTTP_DECODER_EVENT_METHOD_DELIM_NON_COMPLIANT
@ HTTP_DECODER_EVENT_MISSING_HOST_HEADER
@ HTTP_DECODER_EVENT_INVALID_REQUEST_CHUNK_LEN
MimeStateHTTP * mime_state
void * HtpGetTxForH2(void *)
@ HTTP_DECODER_EVENT_REQUEST_BODY_UNEXPECTED
@ HTTP_DECODER_EVENT_DUPLICATE_CONTENT_LENGTH_FIELD_IN_RESPONSE
@ HTTP_DECODER_EVENT_ABNORMAL_CE_HEADER
enum HtpSwfCompressType_ HtpSwfCompressType
@ HTTP_SWF_COMPRESSION_ZLIB
bstr * request_uri_normalized
@ HTP_BODY_REQUEST_MULTIPART
uint32_t swf_compress_depth
void HTPStateFree(void *)
Function to frees the HTTP state memory and also frees the HTTP connection parser memory which was us...
@ HTTP_DECODER_EVENT_INVALID_REQUEST_FIELD_FOLDING
@ HTTP_DECODER_EVENT_100_CONTINUE_ALREADY_SEEN
@ HTTP_DECODER_EVENT_REQUEST_SERVER_PORT_TCP_PORT_MISMATCH
@ HTTP_DECODER_EVENT_RESPONSE_HEADER_INVALID
@ HTTP_DECODER_EVENT_INVALID_AUTHORITY_PORT
@ HTTP_DECODER_EVENT_REQUEST_CHUNK_EXTENSION
uint64_t content_len_so_far
struct HtpBodyChunk_ __attribute__((__packed__))
DNP3 link header.
FrameId response_frame_id
@ HTTP_DECODER_EVENT_INVALID_SERVER_PORT_IN_REQUEST
HttpRangeContainerBlock * file_range
@ HTTP_DECODER_EVENT_INVALID_RESPONSE_FIELD_FOLDING
@ HTTP_DECODER_EVENT_LZMA_MEMLIMIT_REACHED
uint64_t last_request_data_stamp
@ HTTP_SWF_COMPRESSION_NONE
void HtpConfigCreateBackup(void)
uint32_t inspect_min_size
@ HTTP_DECODER_EVENT_INVALID_TRANSFER_ENCODING_VALUE_IN_RESPONSE
@ HTTP_DECODER_EVENT_COMPRESSION_BOMB
void AppLayerHtpEnableRequestBodyCallback(void)
Sets a flag that informs the HTP app layer that some module in the engine needs the http request body...
@ HTTP_DECODER_EVENT_INVALID_CONTENT_LENGTH_FIELD_IN_RESPONSE
@ HTTP_DECODER_EVENT_FAILED_PROTOCOL_CHANGE
uint8_t response_has_trailers
uint8_t * request_headers_raw
uint32_t swf_decompress_depth
int swf_decompression_enabled
AppLayerStateData state_data
void HTPAtExitPrintStats(void)
Print the stats of the HTTP requests.
uint8_t request_has_trailers
struct HTPCfgRec_ HTPCfgRec
@ HTTP_DECODER_EVENT_RESPONSE_MULTIPART_BYTERANGES
@ HTTP_DECODER_EVENT_RANGE_INVALID
@ HTTP_DECODER_EVENT_REQUEST_HEADER_INVALID
@ HTTP_DECODER_EVENT_MULTIPART_GENERIC_ERROR
void AppLayerHtpEnableResponseBodyCallback(void)
Sets a flag that informs the HTP app layer that some module in the engine needs the http request body...
@ HTTP_DECODER_EVENT_UNABLE_TO_MATCH_RESPONSE_TO_REQUEST
HtpSwfCompressType swf_compression_type
@ HTTP_DECODER_EVENT_MULTIPART_NO_FILEDATA
@ HTTP_DECODER_EVENT_UNKNOWN_ERROR
@ HTTP_DECODER_EVENT_RESPONSE_HEADER_REPETITION
@ HTTP_DECODER_EVENT_DUPLICATE_CONTENT_LENGTH_FIELD_IN_REQUEST
@ HTTP_DECODER_EVENT_RESPONSE_INVALID_STATUS
struct AppLayerTxData AppLayerTxData
uint8_t request_body_type
uint8_t * response_headers_raw
SC_ATOMIC_EXTERN(uint32_t, htp_config_flags)
uint64_t last_response_data_stamp
@ HTTP_DECODER_EVENT_INVALID_CONTENT_LENGTH_FIELD_IN_REQUEST
@ HTTP_DECODER_EVENT_REQUEST_LINE_MISSING_PROTOCOL
@ HTTP_DECODER_EVENT_HEADER_HOST_INVALID
void HtpConfigRestoreBackup(void)
@ HTTP_DECODER_EVENT_GZIP_DECOMPRESSION_FAILED
@ HTTP_DECODER_EVENT_RESPONSE_TOO_MANY_HEADERS
@ HTTP_DECODER_EVENT_REQUEST_TOO_MANY_HEADERS
struct HtpBodyChunk_ * next
uint8_t response_body_init
@ HTTP_DECODER_EVENT_AUTH_UNRECOGNIZED
@ HTTP_DECODER_EVENT_REQUEST_FIELD_TOO_LONG
@ HTTP_DECODER_EVENT_INVALID_RESPONSE_CHUNK_LEN
@ HTTP_DECODER_EVENT_RESPONSE_FIELD_TOO_LONG
@ HTTP_SWF_COMPRESSION_BOTH
void RegisterHTPParsers(void)
Register the HTTP protocol and state handling functions to APP layer of the engine.
@ HTTP_SWF_COMPRESSION_LZMA
@ HTTP_DECODER_EVENT_REQUEST_LINE_INCOMPLETE
@ HTTP_DECODER_EVENT_FILE_NAME_TOO_LONG
@ HTTP_DECODER_EVENT_HOST_HEADER_AMBIGUOUS
struct HTPCfgDir_ HTPCfgDir
@ HTTP_DECODER_EVENT_MULTIPART_INVALID_HEADER
@ HTTP_DECODER_EVENT_RESPONSE_INVALID_PROTOCOL
@ HTTP_DECODER_EVENT_TOO_MANY_ENCODING_LAYERS
@ HTTP_DECODER_EVENT_DOUBLE_ENCODED_URI
@ HTTP_DECODER_EVENT_REQUEST_HEADER_REPETITION
void HTPFreeConfig(void)
Clears the HTTP server configuration memory used by HTP library.
uint32_t response_headers_raw_len
@ HTTP_DECODER_EVENT_URI_DELIM_NON_COMPLIANT
uint8_t request_body_init
StreamingBufferSegment sbseg
@ HTTP_DECODER_EVENT_RESPONSE_CHUNKED_OLD_PROTO
uint16_t htp_messages_offset