suricata
HTTP layer support

Files

file  app-layer-htp-mem.c
 
file  app-layer-htp.c
 
file  app-layer-htp.h
 
file  detect-engine-hcbd.c
 Handle HTTP request body match corresponding to http_client_body keyword.
 
file  detect-engine-hcd.c
 Handle HTTP cookie match.
 
file  detect-engine-hhhd.c
 Handle HTTP host header. HHHD - Http Host Header Data.
 
file  detect-engine-hmd.c
 Handle HTTP method match.
 
file  detect-engine-hrhd.c
 Handle HTTP raw header match.
 
file  detect-engine-hrhhd.c
 Handle HTTP host header. HRHHD - Http Raw Host Header Data.
 
file  detect-engine-hrud.c
 Handle HTTP raw uri match.
 
file  detect-engine-hsbd.c
 Handle HTTP response body match corresponding to http_server_body keyword.
 
file  detect-engine-hscd.c
 
file  detect-engine-hsmd.c
 
file  detect-engine-hua.c
 Handle HTTP user agent match.
 
file  detect-http-accept-enc.c
 
file  detect-http-accept-lang.c
 
file  detect-http-accept.c
 
file  detect-http-client-body.c
 
file  detect-http-connection.c
 
file  detect-http-content-len.c
 
file  detect-http-content-type.c
 
 
file  detect-http-header-names.c
 
file  detect-http-header.c
 
file  detect-http-hh.c
 
file  detect-http-hrh.c
 
file  detect-http-method.c
 
file  detect-http-protocol.c
 
file  detect-http-raw-header.c
 
file  detect-http-raw-uri.c
 
file  detect-http-referer.c
 
file  detect-http-request-line.c
 
file  detect-http-response-line.c
 
file  detect-http-server-body.c
 
file  detect-http-start.c
 
file  detect-http-stat-code.c
 
file  detect-http-stat-msg.c
 
file  detect-http-ua.c
 
file  detect-http-uri.c
 

Data Structures

struct  HTPCfgDir_
 
struct  HTPCfgRec_
 
struct  HtpBodyChunk_
 
struct  HtpBody_
 
struct  HtpTxUserData_
 
struct  HtpState_
 

Macros

#define HTP_CONFIG_DEFAULT_REQUEST_BODY_LIMIT   4096U
 
#define HTP_CONFIG_DEFAULT_RESPONSE_BODY_LIMIT   4096U
 
#define HTP_CONFIG_DEFAULT_REQUEST_INSPECT_MIN_SIZE   32768U
 
#define HTP_CONFIG_DEFAULT_REQUEST_INSPECT_WINDOW   4096U
 
#define HTP_CONFIG_DEFAULT_RESPONSE_INSPECT_MIN_SIZE   32768U
 
#define HTP_CONFIG_DEFAULT_RESPONSE_INSPECT_WINDOW   4096U
 
#define HTP_CONFIG_DEFAULT_FIELD_LIMIT_SOFT   9000U
 
#define HTP_CONFIG_DEFAULT_FIELD_LIMIT_HARD   18000U
 
#define HTP_CONFIG_DEFAULT_RANDOMIZE   1
 
#define HTP_CONFIG_DEFAULT_RANDOMIZE_RANGE   10
 
#define HTP_BOUNDARY_MAX   200U
 
#define HTP_FLAG_STATE_CLOSED_TS   0x0002
 
#define HTP_FLAG_STATE_CLOSED_TC   0x0004
 
#define HTP_FLAG_STORE_FILES_TS   0x0040
 
#define HTP_FLAG_STORE_FILES_TC   0x0080
 
#define HTP_FLAG_STORE_FILES_TX_TS   0x0100
 
#define HTP_FLAG_STORE_FILES_TX_TC   0x0200
 
#define HTP_CONTENTTYPE_SET   0x01
 
#define HTP_BOUNDARY_SET   0x02
 
#define HTP_BOUNDARY_OPEN   0x04
 
#define HTP_FILENAME_SET   0x08
 
#define HTP_DONTSTORE   0x10
 
#define HTP_REQUIRE_REQUEST_BODY   (1 << 0)
 
#define HTP_REQUIRE_REQUEST_MULTIPART   (1 << 1)
 
#define HTP_REQUIRE_REQUEST_FILE   (1 << 2)
 
#define HTP_REQUIRE_RESPONSE_BODY   (1 << 3)
 

Typedefs

typedef enum HtpSwfCompressType_ HtpSwfCompressType
 
typedef struct HTPCfgDir_ HTPCfgDir
 
typedef struct HTPCfgRec_ HTPCfgRec
 
typedef struct HtpBodyChunk_ HtpBodyChunk
 
typedef struct HtpBody_ HtpBody
 
typedef struct HtpTxUserData_ HtpTxUserData
 
typedef struct HtpState_ HtpState
 

Enumerations

enum  { HTP_BODY_REQUEST_NONE = 0, HTP_BODY_REQUEST_MULTIPART, HTP_BODY_REQUEST_POST, HTP_BODY_REQUEST_PUT }
 
enum  {
  HTTP_DECODER_EVENT_UNKNOWN_ERROR, HTTP_DECODER_EVENT_GZIP_DECOMPRESSION_FAILED, HTTP_DECODER_EVENT_REQUEST_FIELD_MISSING_COLON, HTTP_DECODER_EVENT_RESPONSE_FIELD_MISSING_COLON,
  HTTP_DECODER_EVENT_INVALID_REQUEST_CHUNK_LEN, HTTP_DECODER_EVENT_INVALID_RESPONSE_CHUNK_LEN, HTTP_DECODER_EVENT_INVALID_TRANSFER_ENCODING_VALUE_IN_REQUEST, HTTP_DECODER_EVENT_INVALID_TRANSFER_ENCODING_VALUE_IN_RESPONSE,
  HTTP_DECODER_EVENT_INVALID_CONTENT_LENGTH_FIELD_IN_REQUEST, HTTP_DECODER_EVENT_INVALID_CONTENT_LENGTH_FIELD_IN_RESPONSE, HTTP_DECODER_EVENT_100_CONTINUE_ALREADY_SEEN, HTTP_DECODER_EVENT_UNABLE_TO_MATCH_RESPONSE_TO_REQUEST,
  HTTP_DECODER_EVENT_INVALID_SERVER_PORT_IN_REQUEST, HTTP_DECODER_EVENT_INVALID_AUTHORITY_PORT, HTTP_DECODER_EVENT_REQUEST_HEADER_INVALID, HTTP_DECODER_EVENT_RESPONSE_HEADER_INVALID,
  HTTP_DECODER_EVENT_MISSING_HOST_HEADER, HTTP_DECODER_EVENT_HOST_HEADER_AMBIGUOUS, HTTP_DECODER_EVENT_INVALID_REQUEST_FIELD_FOLDING, HTTP_DECODER_EVENT_INVALID_RESPONSE_FIELD_FOLDING,
  HTTP_DECODER_EVENT_REQUEST_FIELD_TOO_LONG, HTTP_DECODER_EVENT_RESPONSE_FIELD_TOO_LONG, HTTP_DECODER_EVENT_REQUEST_SERVER_PORT_TCP_PORT_MISMATCH, HTTP_DECODER_EVENT_URI_HOST_INVALID,
  HTTP_DECODER_EVENT_HEADER_HOST_INVALID, HTTP_DECODER_EVENT_METHOD_DELIM_NON_COMPLIANT, HTTP_DECODER_EVENT_URI_DELIM_NON_COMPLIANT, HTTP_DECODER_EVENT_REQUEST_LINE_LEADING_WHITESPACE,
  HTTP_DECODER_EVENT_MULTIPART_GENERIC_ERROR, HTTP_DECODER_EVENT_MULTIPART_NO_FILEDATA, HTTP_DECODER_EVENT_MULTIPART_INVALID_HEADER
}
 
enum  HtpSwfCompressType_ { HTTP_SWF_COMPRESSION_NONE = 0, HTTP_SWF_COMPRESSION_ZLIB, HTTP_SWF_COMPRESSION_LZMA, HTTP_SWF_COMPRESSION_BOTH }
 

Functions

struct HtpBodyChunk_ __attribute__ ((__packed__))
 DNP3 link header. More...
 
 SC_ATOMIC_DECLARE (uint32_t, htp_config_flags)
 
void RegisterHTPParsers (void)
 Register the HTTP protocol and state handling functions to APP layer of the engine. More...
 
void HTPParserRegisterTests (void)
 Register the Unit tests for the HTTP protocol. More...
 
void HTPAtExitPrintStats (void)
 Print the stats of the HTTP requests. More...
 
void HTPFreeConfig (void)
 Clears the HTTP server configuration memory used by HTP library. More...
 
void HtpBodyPrint (HtpBody *)
 Print the information and chunks of a Body. More...
 
void HtpBodyFree (HtpBody *)
 Free the information held in the request body. More...
 
void HTPStateFree (void *)
 Function to frees the HTTP state memory and also frees the HTTP connection parser memory which was used by the HTP library. More...
 
void AppLayerHtpEnableRequestBodyCallback (void)
 Sets a flag that informs the HTP app layer that some module in the engine needs the http request body data. . More...
 
void AppLayerHtpEnableResponseBodyCallback (void)
 Sets a flag that informs the HTP app layer that some module in the engine needs the http request body data. . More...
 
void AppLayerHtpNeedFileInspection (void)
 Sets a flag that informs the HTP app layer that some module in the engine needs the http request file. More...
 
void AppLayerHtpPrintStats (void)
 
void HTPConfigure (void)
 
void HtpConfigCreateBackup (void)
 
void HtpConfigRestoreBackup (void)
 
void * HttpHeaderThreadDataInit (void *data)
 
void HttpHeaderThreadDataFree (void *data)
 
int HttpHeaderExpandBuffer (HttpHeaderThreadData *td, HttpHeaderBuffer *buf, uint32_t size)
 
HttpHeaderBufferHttpHeaderGetBufferSpaceForTXID (DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, uint64_t tx_id, const int keyword_id, HttpHeaderThreadData **ret_hdr_td)
 

Detailed Description

Macro Definition Documentation

#define HTP_BOUNDARY_MAX   200U

a boundary should be smaller in size

Definition at line 58 of file app-layer-htp.h.

#define HTP_BOUNDARY_OPEN   0x04

We have a boundary string

Definition at line 176 of file app-layer-htp.h.

#define HTP_BOUNDARY_SET   0x02

We have a boundary string

Definition at line 175 of file app-layer-htp.h.

#define HTP_CONFIG_DEFAULT_FIELD_LIMIT_HARD   18000U

Definition at line 52 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONFIG_DEFAULT_FIELD_LIMIT_SOFT   9000U

Definition at line 51 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONFIG_DEFAULT_RANDOMIZE   1

Definition at line 54 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONFIG_DEFAULT_RANDOMIZE_RANGE   10

Definition at line 55 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONFIG_DEFAULT_REQUEST_BODY_LIMIT   4096U

Definition at line 45 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONFIG_DEFAULT_REQUEST_INSPECT_MIN_SIZE   32768U

Definition at line 47 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONFIG_DEFAULT_REQUEST_INSPECT_WINDOW   4096U

Definition at line 48 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONFIG_DEFAULT_RESPONSE_BODY_LIMIT   4096U

Definition at line 46 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONFIG_DEFAULT_RESPONSE_INSPECT_MIN_SIZE   32768U

Definition at line 49 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONFIG_DEFAULT_RESPONSE_INSPECT_WINDOW   4096U

Definition at line 50 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_CONTENTTYPE_SET   0x01

We have the content type

Definition at line 174 of file app-layer-htp.h.

#define HTP_DONTSTORE   0x10

not storing this file

Definition at line 178 of file app-layer-htp.h.

#define HTP_FILENAME_SET   0x08

filename is registered in the flow

Definition at line 177 of file app-layer-htp.h.

Referenced by HTPFreeConfig().

#define HTP_FLAG_STATE_CLOSED_TC   0x0004

Flag to indicate that HTTP connection is closed

Definition at line 64 of file app-layer-htp.h.

#define HTP_FLAG_STATE_CLOSED_TS   0x0002

Flag to indicate that HTTP connection is closed

Definition at line 61 of file app-layer-htp.h.

#define HTP_FLAG_STORE_FILES_TC   0x0080

Definition at line 68 of file app-layer-htp.h.

Referenced by DetectFilestoreRegister(), and HTPFileOpen().

#define HTP_FLAG_STORE_FILES_TS   0x0040

Definition at line 67 of file app-layer-htp.h.

Referenced by DetectFilestoreRegister(), and HTPFileOpen().

#define HTP_FLAG_STORE_FILES_TX_TC   0x0200

Definition at line 70 of file app-layer-htp.h.

Referenced by DetectFilestoreRegister(), and HTPFileOpen().

#define HTP_FLAG_STORE_FILES_TX_TS   0x0100

Definition at line 69 of file app-layer-htp.h.

Referenced by DetectFilestoreRegister(), and HTPFileOpen().

#define HTP_REQUIRE_REQUEST_BODY   (1 << 0)

part of the engine needs the request body (e.g. http_client_body keyword)

Definition at line 240 of file app-layer-htp.h.

Referenced by AppLayerHtpEnableRequestBodyCallback().

#define HTP_REQUIRE_REQUEST_FILE   (1 << 2)

part of the engine needs the request file (e.g. log-file module)

Definition at line 245 of file app-layer-htp.h.

Referenced by AppLayerHtpNeedFileInspection().

#define HTP_REQUIRE_REQUEST_MULTIPART   (1 << 1)

part of the engine needs the request body multipart header (e.g. filename and / or fileext keywords)

Definition at line 243 of file app-layer-htp.h.

Referenced by AppLayerHtpEnableResponseBodyCallback().

#define HTP_REQUIRE_RESPONSE_BODY   (1 << 3)

part of the engine needs the request body (e.g. file_data keyword)

Definition at line 247 of file app-layer-htp.h.

Referenced by AppLayerHtpEnableResponseBodyCallback().

Typedef Documentation

typedef struct HtpBody_ HtpBody

Struct used to hold all the chunks of a body on a request

typedef struct HtpBodyChunk_ HtpBodyChunk

Definition at line 157 of file app-layer-htp.h.

typedef struct HTPCfgDir_ HTPCfgDir
typedef struct HTPCfgRec_ HTPCfgRec

Need a linked list in order to keep track of these

typedef struct HtpState_ HtpState
typedef struct HtpTxUserData_ HtpTxUserData

Now the Body Chunks will be stored per transaction, at the tx user data

Enumeration Type Documentation

anonymous enum
Enumerator
HTP_BODY_REQUEST_NONE 
HTP_BODY_REQUEST_MULTIPART 
HTP_BODY_REQUEST_POST 
HTP_BODY_REQUEST_PUT 

Definition at line 72 of file app-layer-htp.h.

anonymous enum
Enumerator
HTTP_DECODER_EVENT_UNKNOWN_ERROR 
HTTP_DECODER_EVENT_GZIP_DECOMPRESSION_FAILED 
HTTP_DECODER_EVENT_REQUEST_FIELD_MISSING_COLON 
HTTP_DECODER_EVENT_RESPONSE_FIELD_MISSING_COLON 
HTTP_DECODER_EVENT_INVALID_REQUEST_CHUNK_LEN 
HTTP_DECODER_EVENT_INVALID_RESPONSE_CHUNK_LEN 
HTTP_DECODER_EVENT_INVALID_TRANSFER_ENCODING_VALUE_IN_REQUEST 
HTTP_DECODER_EVENT_INVALID_TRANSFER_ENCODING_VALUE_IN_RESPONSE 
HTTP_DECODER_EVENT_INVALID_CONTENT_LENGTH_FIELD_IN_REQUEST 
HTTP_DECODER_EVENT_INVALID_CONTENT_LENGTH_FIELD_IN_RESPONSE 
HTTP_DECODER_EVENT_100_CONTINUE_ALREADY_SEEN 
HTTP_DECODER_EVENT_UNABLE_TO_MATCH_RESPONSE_TO_REQUEST 
HTTP_DECODER_EVENT_INVALID_SERVER_PORT_IN_REQUEST 
HTTP_DECODER_EVENT_INVALID_AUTHORITY_PORT 
HTTP_DECODER_EVENT_REQUEST_HEADER_INVALID 
HTTP_DECODER_EVENT_RESPONSE_HEADER_INVALID 
HTTP_DECODER_EVENT_MISSING_HOST_HEADER 
HTTP_DECODER_EVENT_HOST_HEADER_AMBIGUOUS 
HTTP_DECODER_EVENT_INVALID_REQUEST_FIELD_FOLDING 
HTTP_DECODER_EVENT_INVALID_RESPONSE_FIELD_FOLDING 
HTTP_DECODER_EVENT_REQUEST_FIELD_TOO_LONG 
HTTP_DECODER_EVENT_RESPONSE_FIELD_TOO_LONG 
HTTP_DECODER_EVENT_REQUEST_SERVER_PORT_TCP_PORT_MISMATCH 
HTTP_DECODER_EVENT_URI_HOST_INVALID 
HTTP_DECODER_EVENT_HEADER_HOST_INVALID 
HTTP_DECODER_EVENT_METHOD_DELIM_NON_COMPLIANT 
HTTP_DECODER_EVENT_URI_DELIM_NON_COMPLIANT 
HTTP_DECODER_EVENT_REQUEST_LINE_LEADING_WHITESPACE 
HTTP_DECODER_EVENT_MULTIPART_GENERIC_ERROR 
HTTP_DECODER_EVENT_MULTIPART_NO_FILEDATA 
HTTP_DECODER_EVENT_MULTIPART_INVALID_HEADER 

Definition at line 79 of file app-layer-htp.h.

Enumerator
HTTP_SWF_COMPRESSION_NONE 
HTTP_SWF_COMPRESSION_ZLIB 
HTTP_SWF_COMPRESSION_LZMA 
HTTP_SWF_COMPRESSION_BOTH 

Definition at line 116 of file app-layer-htp.h.

Function Documentation

struct HtpBodyChunk_ __attribute__ ( (__packed__)  )

DNP3 link header.

DNS packet header.

Unified2 Extra Data Header Unified2 Extra Data (currently used only for XFF)

DNS packet header.

DNP3 internal indicators.

DNP3 application header.

Part of the application header for responses only.

Unified2 Extra Data Header Unified2 Extra Data (currently used only for XFF)

Definition at line 92 of file alert-unified2-alert.c.

void AppLayerHtpEnableRequestBodyCallback ( void  )

Sets a flag that informs the HTP app layer that some module in the engine needs the http request body data. .

Definition at line 409 of file app-layer-htp.c.

References HTP_REQUIRE_REQUEST_BODY, SC_ATOMIC_OR, SCEnter, and SCReturn.

Referenced by AppLayerHtpEnableResponseBodyCallback(), AppLayerHtpNeedFileInspection(), DetectHttpClientBodyRegister(), DetectPcrePayloadMatch(), and RunUnittests().

Here is the caller graph for this function:

void AppLayerHtpEnableResponseBodyCallback ( void  )

Sets a flag that informs the HTP app layer that some module in the engine needs the http request body data. .

Definition at line 422 of file app-layer-htp.c.

References AppLayerHtpEnableRequestBodyCallback(), HTP_REQUIRE_REQUEST_MULTIPART, HTP_REQUIRE_RESPONSE_BODY, SC_ATOMIC_OR, SCEnter, and SCReturn.

Referenced by AppLayerHtpNeedFileInspection().

Here is the call graph for this function:

Here is the caller graph for this function:

void AppLayerHtpNeedFileInspection ( void  )

Sets a flag that informs the HTP app layer that some module in the engine needs the http request file.

Definition at line 451 of file app-layer-htp.c.

References AppLayerHtpEnableRequestBodyCallback(), AppLayerHtpEnableResponseBodyCallback(), HTP_REQUIRE_REQUEST_FILE, SC_ATOMIC_OR, SCEnter, and SCReturn.

Referenced by DetectFilestorePostMatch(), PostRunDeinit(), RunUnittests(), and SigMatchList2DataArray().

Here is the call graph for this function:

Here is the caller graph for this function:

void HTPAtExitPrintStats ( void  )

Print the stats of the HTTP requests.

Definition at line 1833 of file app-layer-htp.c.

References SCEnter, SCLogDebug, SCMutexLock, SCMutexUnlock, and SCReturn.

Referenced by GlobalsInitPreConfig().

Here is the caller graph for this function:

void HtpBodyFree ( HtpBody body)

Free the information held in the request body.

Parameters
bodypointer to the HtpBody holding the list
Return values
none

Definition at line 154 of file app-layer-htp-body.c.

References HtpBody_::first, HTPFree(), HtpBody_::last, HtpBodyChunk_::next, HtpBody_::sb, SCEnter, SCLogDebug, and StreamingBufferFree().

Here is the call graph for this function:

void HtpBodyPrint ( HtpBody body)

Print the information and chunks of a Body.

Parameters
bodypointer to the HtpBody holding the list
Return values
none

Definition at line 126 of file app-layer-htp-body.c.

References HtpBody_::first, HtpBodyChunk_::next, PrintRawDataFp(), HtpBody_::sb, HtpBodyChunk_::sbseg, SCEnter, SCLogDebug, SCLogDebugEnabled(), and StreamingBufferSegmentGetData().

Here is the call graph for this function:

void HtpConfigCreateBackup ( void  )

Definition at line 2885 of file app-layer-htp.c.

Referenced by HtpConfigRestoreBackup(), and HttpServerBodyGetDataCallback().

Here is the caller graph for this function:

void HtpConfigRestoreBackup ( void  )

Definition at line 2892 of file app-layer-htp.c.

References Flow_::alparser, Flow_::alproto, ALPROTO_HTTP, Flow_::alstate, AppLayerParserGetDecoderEvents(), AppLayerParserGetEventsByTx(), AppLayerParserParse(), AppLayerParserStateAlloc(), AppLayerParserThreadCtxAlloc(), AppLayerParserThreadCtxFree(), BUG_ON, HTPCfgRec_::cfg, ConfCreateContextBackup(), ConfDeInit(), ConfGetNode(), ConfInit(), ConfNodeLookupChild(), ConfRestoreContextBackup(), ConfYamlLoadString(), HtpBody_::content_len_so_far, Flow_::dst, AppLayerDecoderEvents_::events, HtpState_::f, FAIL_IF, FAIL_IF_NOT, FAIL_IF_NULL, HtpState_::files_ts, flags, FLOWLOCK_UNLOCK, FLOWLOCK_WRLOCK, HtpBodyAppendChunk(), HtpConfigCreateBackup(), HtpConfigRestoreBackup(), HTPConfigure(), HTPFreeConfig(), HTTP_DECODER_EVENT_METHOD_DELIM_NON_COMPLIANT, HTTP_DECODER_EVENT_REQUEST_FIELD_TOO_LONG, HTTP_DECODER_EVENT_URI_DELIM_NON_COMPLIANT, inet_pton(), len, ConfNode_::name, HTPCfgRec_::next, next, PASS, PrintRawDataFp(), PrintRawUriFp(), Flow_::proto, Flow_::protoctx, HtpTxUserData_::request_body, HtpTxUserData_::request_uri_normalized, SCFree, SCLogDebug, SCMalloc, SCRadixFindKeyIPV4BestMatch(), SCRadixFindKeyIPV6BestMatch(), STREAM_EOF, STREAM_START, STREAM_TOCLIENT, STREAM_TOSERVER, StreamTcpFreeConfig(), StreamTcpInitConfig(), strlcpy(), TAILQ_FIRST, TAILQ_FOREACH, TAILQ_NEXT, TRUE, unlikely, UTHBuildFlow(), UTHFreeFlow(), and ConfNode_::val.

Referenced by HtpConfigRestoreBackup(), and HttpServerBodyGetDataCallback().

Here is the call graph for this function:

Here is the caller graph for this function:

void HTPConfigure ( void  )
void HTPFreeConfig ( void  )

Clears the HTTP server configuration memory used by HTP library.

Definition at line 1846 of file app-layer-htp.c.

References ALPROTO_UNKNOWN, AppLayerParserConfParserEnabled(), AppLayerParserTriggerRawStreamReassembly(), AppLayerProtoDetectConfProtoDetectionEnabled(), AppLayerRequestProtocolChange(), HTPCfgDir_::body_limit, StreamingBufferConfig_::buf_size, StreamingBufferConfig_::buf_slide, StreamingBufferConfig_::Calloc, HTPCfgRec_::cfg, HtpState_::cfg, ConfValIsFalse(), ConfValIsTrue(), EngineModeIsIPS(), HtpState_::f, FALSE, flags, StreamingBufferConfig_::flags, StreamingBufferConfig_::Free, g_disable_randomness, HTP_CONFIG_DEFAULT_FIELD_LIMIT_HARD, HTP_CONFIG_DEFAULT_FIELD_LIMIT_SOFT, HTP_CONFIG_DEFAULT_RANDOMIZE, HTP_CONFIG_DEFAULT_RANDOMIZE_RANGE, HTP_CONFIG_DEFAULT_REQUEST_BODY_LIMIT, HTP_CONFIG_DEFAULT_REQUEST_INSPECT_MIN_SIZE, HTP_CONFIG_DEFAULT_REQUEST_INSPECT_WINDOW, HTP_CONFIG_DEFAULT_RESPONSE_BODY_LIMIT, HTP_CONFIG_DEFAULT_RESPONSE_INSPECT_MIN_SIZE, HTP_CONFIG_DEFAULT_RESPONSE_INSPECT_WINDOW, HTP_FILENAME_SET, HTPCalloc(), HTPDestroyMemcap(), HTPFileClose(), HTPFree(), HTPMalloc(), HTPRealloc(), HTPCfgRec_::http_body_inline, HTTP_SWF_COMPRESSION_BOTH, HTTP_SWF_COMPRESSION_LZMA, HTTP_SWF_COMPRESSION_NONE, HTTP_SWF_COMPRESSION_ZLIB, HTPCfgDir_::inspect_min_size, HTPCfgDir_::inspect_window, likely, StreamingBufferConfig_::Malloc, ConfNode_::name, HTPCfgRec_::next, next, ParseSizeStringU32(), RandomGet(), HTPCfgRec_::randomize, HTPCfgRec_::randomize_range, StreamingBufferConfig_::Realloc, HTPCfgRec_::request, HtpTxUserData_::request_has_trailers, HtpTxUserData_::request_headers_raw, HtpTxUserData_::request_headers_raw_len, HtpTxUserData_::request_uri_normalized, HTPCfgRec_::response, HtpTxUserData_::response_has_trailers, HtpTxUserData_::response_headers_raw, HtpTxUserData_::response_headers_raw_len, HTPCfgDir_::sbcfg, SC_ERR_INVALID_VALUE, SC_ERR_INVALID_YAML_CONF_ENTRY, SC_ERR_SIZE_PARSE, SC_ERR_UNKNOWN_VALUE, SC_WARN_OUTDATED_LIBHTP, SCEnter, SCFree, SCHTPGenerateNormalizedUri(), SCLogDebug, SCLogError, SCLogWarning, SCRadixAddKeyIPV4String(), SCRadixAddKeyIPV6String(), SCRadixReleaseRadixTree(), SCReturn, SCReturnInt, STREAM_TOCLIENT, STREAM_TOSERVER, HTPCfgRec_::swf_compress_depth, HTPCfgRec_::swf_compression_type, HTPCfgRec_::swf_decompress_depth, HTPCfgRec_::swf_decompression_enabled, TAILQ_FOREACH, HtpTxUserData_::tcflags, HtpState_::transaction_cnt, HtpTxUserData_::tsflags, unlikely, HTPCfgRec_::uri_include_all, ConfNode_::val, and WarnInvalidConfEntry.

Referenced by GlobalsInitPreConfig(), HtpConfigRestoreBackup(), and HttpServerBodyGetDataCallback().

Here is the call graph for this function:

Here is the caller graph for this function:

void HTPParserRegisterTests ( void  )

Register the Unit tests for the HTTP protocol.

Definition at line 6781 of file app-layer-htp.c.

References HTPFileParserRegisterTests(), HTPXFFParserRegisterTests(), and UtRegisterTest().

Referenced by RegisterHTPParsers().

Here is the call graph for this function:

Here is the caller graph for this function:

void HTPStateFree ( void *  )

Function to frees the HTTP state memory and also frees the HTTP connection parser memory which was used by the HTP library.

Definition at line 324 of file app-layer-htp.c.

References HtpState_::conn, HtpState_::connp, FileContainerFree(), HtpState_::files_tc, HtpState_::files_ts, HTPFree(), SCEnter, SCLogDebug, SCMutexLock, SCMutexUnlock, SCReturn, tx_id, and unlikely.

Referenced by RegisterHTPParsers().

Here is the call graph for this function:

Here is the caller graph for this function:

int HttpHeaderExpandBuffer ( HttpHeaderThreadData td,
HttpHeaderBuffer buf,
uint32_t  size 
)
SC_ATOMIC_DECLARE ( uint32_t  ,
htp_config_flags   
)