|
suricata
|
#include "app-layer-htp.h"

Go to the source code of this file.
Functions | |
| int | HTPFileOpen (HtpState *, HtpTxUserData *, const uint8_t *, uint16_t, const uint8_t *, uint32_t, uint8_t) |
| Open the file with "filename" and pass the first chunk of data if any. More... | |
| int | HTPFileOpenWithRange (HtpState *, HtpTxUserData *, const uint8_t *, uint16_t, const uint8_t *, uint32_t, const htp_tx_t *, const bstr *rawvalue, HtpTxUserData *htud) |
| Sets range for a file. More... | |
| bool | SCHTPFileCloseHandleRange (const StreamingBufferConfig *sbcfg, FileContainer *, const uint16_t, HttpRangeContainerBlock *, const uint8_t *, uint32_t) |
| close range, add reassembled file if possible More... | |
| int | HTPFileStoreChunk (HtpTxUserData *, const uint8_t *, uint32_t, uint8_t) |
| Store a chunk of data in the flow. More... | |
| int | HTPParseContentRange (const bstr *rawvalue, HTTPContentRange *range) |
| int | HTPFileClose (HtpTxUserData *tx, const uint8_t *data, uint32_t data_len, uint8_t flags, uint8_t direction) |
| Close the file in the flow. More... | |
| void | HTPFileParserRegisterTests (void) |
Definition in file app-layer-htp-file.h.
| int HTPFileClose | ( | HtpTxUserData * | tx, |
| const uint8_t * | data, | ||
| uint32_t | data_len, | ||
| uint8_t | flags, | ||
| uint8_t | direction | ||
| ) |
Close the file in the flow.
| tx | HtpTxUserData |
| data | data chunk if any |
| data_len | length of the data portion |
| flags | flags to indicate events |
| direction | flow direction |
Currently on the FLOW_FILE_TRUNCATED flag is implemented, indicating that the file isn't complete but we're stopping storing it.
| 0 | ok |
| -1 | error |
| -2 | not storing files on this flow/tx |
Definition at line 309 of file app-layer-htp-file.c.
References HtpTxUserData_::file_range, FILE_TRUNCATED, FileCloseFile(), HtpTxUserData_::files_tc, HtpTxUserData_::files_ts, flags, htp_sbcfg, SCEnter, SCHTPFileCloseHandleRange(), SCHttpRangeFreeBlock(), SCLogDebug, SCReturnInt, and HtpTxUserData_::tx_data.

| int HTPFileOpen | ( | HtpState * | s, |
| HtpTxUserData * | tx, | ||
| const uint8_t * | filename, | ||
| uint16_t | filename_len, | ||
| const uint8_t * | data, | ||
| uint32_t | data_len, | ||
| uint8_t | direction | ||
| ) |
Open the file with "filename" and pass the first chunk of data if any.
| s | http state |
| filename | name of the file |
| filename_len | length of the name |
| data | data chunk (if any) |
| data_len | length of the data portion |
| direction | flow direction |
| 0 | ok |
| -1 | error |
| -2 | not handling files on this flow |
Definition at line 50 of file app-layer-htp-file.c.
References HtpState_::cfg, DEBUG_VALIDATE_BUG_ON, HtpTxUserData_::file_range, HtpState_::file_track_id, FileOpenFileWithId(), HtpTxUserData_::files_tc, HtpTxUserData_::files_ts, FileSetInspectSizes(), flags, htp_sbcfg, HTPCfgDir_::inspect_min_size, HTPCfgDir_::inspect_window, HTPCfgRec_::request, HTPCfgRec_::response, SCFileFlowFlagsToFlags(), SCLogDebug, SCReturnInt, FileContainer_::tail, and HtpTxUserData_::tx_data.

| int HTPFileOpenWithRange | ( | HtpState * | s, |
| HtpTxUserData * | txud, | ||
| const uint8_t * | filename, | ||
| uint16_t | filename_len, | ||
| const uint8_t * | data, | ||
| uint32_t | data_len, | ||
| const htp_tx_t * | tx, | ||
| const bstr * | rawvalue, | ||
| HtpTxUserData * | htud | ||
| ) |
Sets range for a file.
| s | http state |
| rawvalue | raw header value |
| 0 | ok |
| -1 | error |
Definition at line 149 of file app-layer-htp-file.c.
References DEBUG_VALIDATE_BUG_ON, flags, and SCEnter.
| void HTPFileParserRegisterTests | ( | void | ) |
Definition at line 1234 of file app-layer-htp-file.c.
References UtRegisterTest().

| int HTPFileStoreChunk | ( | HtpTxUserData * | tx, |
| const uint8_t * | data, | ||
| uint32_t | data_len, | ||
| uint8_t | direction | ||
| ) |
Store a chunk of data in the flow.
| s | HtpState |
| tx | HtpTxUserData |
| data | data chunk (if any) |
| data_len | length of the data portion |
| direction | flow direction |
| 0 | ok |
| -1 | error |
| -2 | file doesn't need storing |
Definition at line 223 of file app-layer-htp-file.c.
References HtpTxUserData_::file_range, FileAppendData(), HtpTxUserData_::files_tc, HtpTxUserData_::files_ts, htp_sbcfg, SCEnter, SCHttpRangeAppendData(), SCLogDebug, and SCReturnInt.

| int HTPParseContentRange | ( | const bstr * | rawvalue, |
| HTTPContentRange * | range | ||
| ) |
Performs parsing of the content-range value
| [in] | rawvalue | |
| [out] | range |
Definition at line 96 of file app-layer-htp-file.c.
References len.
| bool SCHTPFileCloseHandleRange | ( | const StreamingBufferConfig * | sbcfg, |
| FileContainer * | files, | ||
| const uint16_t | flags, | ||
| HttpRangeContainerBlock * | c, | ||
| const uint8_t * | data, | ||
| uint32_t | data_len | ||
| ) |
close range, add reassembled file if possible
| true | if reassembled file was added |
| false | if no reassembled file was added |
Definition at line 267 of file app-layer-htp-file.c.
Referenced by HTPFileClose().
