app-layer-htp-range.h File Reference
#include "suricata-common.h"
#include "app-layer-parser.h"
#include "util-thash.h"
#include "rust-bindings.h"
Include dependency graph for app-layer-htp-range.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  HttpRangeContainerBuffer
struct  HttpRangeContainerFile
struct  HttpRangeContainerBlock


typedef struct HttpRangeContainerBuffer HttpRangeContainerBuffer
typedef struct HttpRangeContainerFile HttpRangeContainerFile
typedef struct HttpRangeContainerBlock HttpRangeContainerBlock


void HttpRangeContainersInit (void)
void HttpRangeContainersDestroy (void)
uint32_t HttpRangeContainersTimeoutHash (struct timeval *ts)
int HttpRangeContainerBufferCompare (HttpRangeContainerBuffer *a, HttpRangeContainerBuffer *b)
 RB_HEAD (HTTP_RANGES, HttpRangeContainerBuffer)
 RB_PROTOTYPE (HTTP_RANGES, HttpRangeContainerBuffer, rb, HttpRangeContainerBufferCompare)
int HttpRangeAppendData (HttpRangeContainerBlock *c, const uint8_t *data, uint32_t len)
FileHttpRangeClose (HttpRangeContainerBlock *c, uint16_t flags)
HttpRangeContainerBlockHttpRangeContainerOpenFile (const unsigned char *key, uint32_t keylen, const Flow *f, const HTTPContentRange *cr, const StreamingBufferConfig *sbcfg, const unsigned char *name, uint16_t name_len, uint16_t flags, const unsigned char *data, uint32_t data_len)
void HttpRangeFreeBlock (HttpRangeContainerBlock *b)

Typedef Documentation

◆ HttpRangeContainerBlock

A structure representing a single range request : either skipping, buffering, or appending As this belongs to a flow, appending data to it is ensured to be thread-safe Only one block per file has the pointer to the container

◆ HttpRangeContainerBuffer

◆ HttpRangeContainerFile

Item in hash table for a file in multiple ranges Thread-safety is ensured with the thread-safe hash table cf THashData The number of use is increased for each flow opening a new HttpRangeContainerBlock until it closes this HttpRangeContainerBlock The design goal is to have concurrency only on opening and closing a range request and have a lock-free data structure belonging to one Flow (see HttpRangeContainerBlock below) for every append in between (we suppose we have many appends per range request)

Function Documentation

◆ HttpRangeAppendData()

int HttpRangeAppendData ( HttpRangeContainerBlock c,
const uint8_t *  data,
uint32_t  len 

◆ HttpRangeClose()

◆ HttpRangeContainerBufferCompare()

◆ HttpRangeContainerOpenFile()

HttpRangeContainerBlock* HttpRangeContainerOpenFile ( const unsigned char *  key,
uint32_t  keylen,
const Flow f,
const HTTPContentRange *  cr,
const StreamingBufferConfig sbcfg,
const unsigned char *  name,
uint16_t  name_len,
uint16_t  flags,
const unsigned char *  data,
uint32_t  data_len 

◆ HttpRangeContainersDestroy()

void HttpRangeContainersDestroy ( void  )

Definition at line 184 of file app-layer-htp-range.c.

References ContainerUrlRangeList, ContainerTHashTable::ht, and THashShutdown().

Here is the call graph for this function:

◆ HttpRangeContainersInit()

void HttpRangeContainersInit ( void  )

Definition at line 150 of file app-layer-htp-range.c.

References ConfGetValue(), ContainerUrlRangeList, ContainerTHashTable::ht, HTTP_RANGE_DEFAULT_MEMCAP, HTTP_RANGE_DEFAULT_TIMEOUT, ParseSizeStringU64(), SC_ERR_INVALID_VALUE, SCLogDebug, SCLogWarning, str, StringParseUint32(), and THashInit().

Referenced by PreRunInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HttpRangeContainersTimeoutHash()

uint32_t HttpRangeContainersTimeoutHash ( struct timeval *  ts)

Definition at line 189 of file app-layer-htp-range.c.

References SCLogDebug.

◆ HttpRangeFreeBlock()

void HttpRangeFreeBlock ( HttpRangeContainerBlock b)

Definition at line 604 of file app-layer-htp-range.c.

Referenced by HTPFileClose(), and InitGlobal().

Here is the caller graph for this function:




HttpRangeContainerBuffer  ,
rb  ,