|
suricata
|
#include "suricata-common.h"#include "app-layer-htp-range.h"#include "util-misc.h"#include "util-thash.h"#include "util-memcmp.h"#include "util-hash-lookup3.h"#include "util-validate.h"#include "util-byte.h"
Go to the source code of this file.
Data Structures | |
| struct | ContainerTHashTable |
Macros | |
| #define | CONTAINER_URLRANGE_HASH_SIZE 256 |
| #define | HTTP_RANGE_DEFAULT_TIMEOUT 60 |
| #define | HTTP_RANGE_DEFAULT_MEMCAP 100 * 1024 * 1024 |
Typedefs | |
| typedef struct ContainerTHashTable | ContainerTHashTable |
Variables | |
| ContainerTHashTable | ContainerUrlRangeList |
Definition in file app-layer-htp-range.c.
| #define CONTAINER_URLRANGE_HASH_SIZE 256 |
Definition at line 43 of file app-layer-htp-range.c.
| #define HTTP_RANGE_DEFAULT_MEMCAP 100 * 1024 * 1024 |
Definition at line 169 of file app-layer-htp-range.c.
| #define HTTP_RANGE_DEFAULT_TIMEOUT 60 |
Definition at line 168 of file app-layer-htp-range.c.
| typedef struct ContainerTHashTable ContainerTHashTable |
| uint64_t HTPByteRangeMemcapGlobalCounter | ( | void | ) |
Definition at line 55 of file app-layer-htp-range.c.
References THashTableContext_::config, ContainerUrlRangeList, ContainerTHashTable::ht, and SC_ATOMIC_GET.
Referenced by AppLayerRegisterGlobalCounters().

| uint64_t HTPByteRangeMemuseGlobalCounter | ( | void | ) |
Definition at line 61 of file app-layer-htp-range.c.
References ContainerUrlRangeList, ContainerTHashTable::ht, and SC_ATOMIC_GET.
Referenced by AppLayerRegisterGlobalCounters().

| int HTPByteRangeSetMemcap | ( | uint64_t | size | ) |
Definition at line 45 of file app-layer-htp-range.c.
References THashTableContext_::config, ContainerUrlRangeList, ContainerTHashTable::ht, SC_ATOMIC_GET, and SC_ATOMIC_SET.
| int HttpRangeAppendData | ( | const StreamingBufferConfig * | sbcfg, |
| HttpRangeContainerBlock * | c, | ||
| const uint8_t * | data, | ||
| uint32_t | len | ||
| ) |
Definition at line 377 of file app-layer-htp-range.c.
References HttpRangeContainerBuffer::buffer, HttpRangeContainerBuffer::buflen, HttpRangeContainerBlock::current, THashDataGetResult::data, FileAppendData(), HttpRangeContainerBlock::files, HttpRangeContainerBuffer::gap, len, HttpRangeContainerBuffer::offset, SCLogDebug, and HttpRangeContainerBlock::toskip.
Referenced by HTPFileCloseHandleRange(), and HTPFileStoreChunk().


| File * HttpRangeClose | ( | const StreamingBufferConfig * | sbcfg, |
| HttpRangeContainerBlock * | c, | ||
| uint16_t | flags | ||
| ) |
f is non-NULL, the ownership of the file is transferred to the caller. Definition at line 450 of file app-layer-htp-range.c.
References HttpRangeContainerBuffer::buffer, HttpRangeContainerBuffer::buflen, HttpRangeContainerBlock::container, ContainerUrlRangeList, HttpRangeContainerBlock::current, DEBUG_VALIDATE_BUG_ON, HttpRangeContainerFile::error, FILE_TRUNCATED, FileAppendData(), HttpRangeContainerFile::files, HttpRangeContainerBlock::files, flags, HttpRangeContainerFile::fragment_tree, HttpRangeContainerBuffer::gap, HttpRangeContainerFile::hdata, ContainerTHashTable::ht, HttpRangeContainerFile::lastsize, HttpRangeContainerBuffer::offset, offset, RB_FOREACH_SAFE, SC_ATOMIC_GET, SC_ATOMIC_SUB, SCFree, SCLogDebug, File_::size, HttpRangeContainerBuffer::start, FileContainer_::tail, HttpRangeContainerBlock::toskip, and HttpRangeContainerFile::totalsize.
Referenced by HTPFileCloseHandleRange().


| int HttpRangeContainerBufferCompare | ( | HttpRangeContainerBuffer * | a, |
| HttpRangeContainerBuffer * | b | ||
| ) |
Definition at line 67 of file app-layer-htp-range.c.
References HttpRangeContainerBuffer::buflen, HttpRangeContainerBuffer::offset, and HttpRangeContainerBuffer::start.
| HttpRangeContainerBlock * HttpRangeContainerOpenFile | ( | const uint8_t * | key, |
| uint32_t | keylen, | ||
| const Flow * | f, | ||
| const HTTPContentRange * | crparsed, | ||
| const StreamingBufferConfig * | sbcfg, | ||
| const uint8_t * | name, | ||
| uint16_t | name_len, | ||
| uint16_t | flags, | ||
| const uint8_t * | data, | ||
| uint32_t | data_len | ||
| ) |
Definition at line 341 of file app-layer-htp-range.c.
References HttpRangeContainerBlock::container, THashDataGetResult::data, DEBUG_VALIDATE_BUG_ON, flags, HttpRangeContainerFile::hdata, name, HttpRangeContainerFile::sbcfg, SC_ATOMIC_GET, SCLogDebug, and THashDecrUsecnt.
Referenced by HTPFileOpenWithRange().

| void HttpRangeContainersDestroy | ( | void | ) |
Definition at line 204 of file app-layer-htp-range.c.
References ContainerUrlRangeList, ContainerTHashTable::ht, and THashShutdown().
Referenced by PostRunDeinit().


| void HttpRangeContainersInit | ( | void | ) |
Definition at line 171 of file app-layer-htp-range.c.
References CONTAINER_URLRANGE_HASH_SIZE, ContainerUrlRangeList, ContainerTHashTable::ht, HTTP_RANGE_DEFAULT_MEMCAP, HTTP_RANGE_DEFAULT_TIMEOUT, ParseSizeStringU64(), SCConfGet(), SCLogDebug, SCLogWarning, str, StringParseUint32(), THashInit(), and ContainerTHashTable::timeout.
Referenced by PreRunInit().


| uint32_t HttpRangeContainersTimeoutHash | ( | const SCTime_t | ts | ) |
Definition at line 209 of file app-layer-htp-range.c.
References ContainerUrlRangeList, ContainerTHashTable::ht, THashExpire(), and ts.

| void HttpRangeFreeBlock | ( | HttpRangeContainerBlock * | b | ) |
Definition at line 607 of file app-layer-htp-range.c.
References HttpRangeContainerBuffer::buffer, HttpRangeContainerBuffer::buflen, HttpRangeContainerBlock::container, ContainerUrlRangeList, HttpRangeContainerBlock::current, DEBUG_VALIDATE_BUG_ON, FileContainerFree(), HttpRangeContainerBlock::files, ContainerTHashTable::ht, HttpRangeContainerFile::sbcfg, SC_ATOMIC_SUB, and SCFree.
Referenced by HTPFileClose().


| RB_GENERATE | ( | HTTP_RANGES | , |
| HttpRangeContainerBuffer | , | ||
| rb | , | ||
| HttpRangeContainerBufferCompare | |||
| ) |
| ContainerTHashTable ContainerUrlRangeList |
Definition at line 39 of file app-layer-htp-range.c.
Referenced by HTPByteRangeMemcapGlobalCounter(), HTPByteRangeMemuseGlobalCounter(), HTPByteRangeSetMemcap(), HttpRangeClose(), HttpRangeContainersDestroy(), HttpRangeContainersInit(), HttpRangeContainersTimeoutHash(), and HttpRangeFreeBlock().