suricata
app-layer-htp-mem.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "conf.h"
#include "util-mem.h"
#include "util-misc.h"
#include "app-layer-htp-mem.h"
Include dependency graph for app-layer-htp-mem.c:

Go to the source code of this file.

Functions

 SC_ATOMIC_DECLARE (uint64_t, htp_config_memcap)
 
 SC_ATOMIC_DECLARE (uint64_t, htp_memuse)
 
 SC_ATOMIC_DECLARE (uint64_t, htp_memcap)
 
void HTPParseMemcap ()
 
uint64_t HTPMemuseGlobalCounter (void)
 
uint64_t HTPMemcapGlobalCounter (void)
 
int HTPSetMemcap (uint64_t size)
 Update memcap value. More...
 
uint64_t HTPGetMemcap (void)
 Update memcap value. More...
 
void * HTPMalloc (size_t size)
 
void * HTPCalloc (size_t n, size_t size)
 
void * HTPRealloc (void *ptr, size_t orig_size, size_t size)
 
void HTPFree (void *ptr, size_t size)
 
void HTPDestroyMemcap (void)
 

Detailed Description

Author
Eric Leblond eric@.nosp@m.regi.nosp@m.t.org

This file provides a memory handling for the HTTP protocol support.

Definition in file app-layer-htp-mem.c.

Function Documentation

void* HTPCalloc ( size_t  n,
size_t  size 
)

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

References SCCalloc, and unlikely.

Referenced by HtpBodyAppendChunk(), and HTPFreeConfig().

Here is the caller graph for this function:

void HTPDestroyMemcap ( void  )

Definition at line 198 of file app-layer-htp-mem.c.

References SC_ATOMIC_DESTROY.

Referenced by HTPFreeConfig().

Here is the caller graph for this function:

void HTPFree ( void *  ptr,
size_t  size 
)

Definition at line 191 of file app-layer-htp-mem.c.

References SCFree.

Referenced by HtpBodyAppendChunk(), HtpBodyFree(), HtpBodyPrune(), HTPFreeConfig(), and HTPStateFree().

Here is the caller graph for this function:

uint64_t HTPGetMemcap ( void  )

Update memcap value.

Return values
memcapvalue

Definition at line 131 of file app-layer-htp-mem.c.

References SC_ATOMIC_GET.

Referenced by RunModeUnixSocketGetDefaultMode().

Here is the caller graph for this function:

void* HTPMalloc ( size_t  size)

Definition at line 137 of file app-layer-htp-mem.c.

References SCMalloc, and unlikely.

Referenced by AppLayerHtpPrintStats(), and HTPFreeConfig().

Here is the caller graph for this function:

uint64_t HTPMemcapGlobalCounter ( void  )

Definition at line 91 of file app-layer-htp-mem.c.

References SC_ATOMIC_ADD, and SC_ATOMIC_GET.

Referenced by AppLayerRegisterGlobalCounters().

Here is the caller graph for this function:

uint64_t HTPMemuseGlobalCounter ( void  )

Definition at line 85 of file app-layer-htp-mem.c.

References SC_ATOMIC_GET.

Referenced by AppLayerRegisterGlobalCounters(), and RunModeUnixSocketGetDefaultMode().

Here is the caller graph for this function:

void HTPParseMemcap ( void  )

set config values for memcap, prealloc and hash_size

Definition at line 45 of file app-layer-htp-mem.c.

References ConfGet(), ParseSizeStringU64(), SC_ATOMIC_ADD, SC_ATOMIC_GET, SC_ATOMIC_INIT, SC_ATOMIC_SET, SC_ATOMIC_SUB, SC_ERR_SIZE_PARSE, SCLogError, and SCLogInfo.

Referenced by HTPConfigure().

Here is the call graph for this function:

Here is the caller graph for this function:

void* HTPRealloc ( void *  ptr,
size_t  orig_size,
size_t  size 
)

Definition at line 171 of file app-layer-htp-mem.c.

References SCRealloc.

Referenced by HTPFreeConfig().

Here is the caller graph for this function:

int HTPSetMemcap ( uint64_t  size)

Update memcap value.

Parameters
sizenew memcap value

Definition at line 117 of file app-layer-htp-mem.c.

References SC_ATOMIC_GET, and SC_ATOMIC_SET.

Referenced by RunModeUnixSocketGetDefaultMode().

Here is the caller graph for this function:

SC_ATOMIC_DECLARE ( uint64_t  ,
htp_config_memcap   
)
SC_ATOMIC_DECLARE ( uint64_t  ,
htp_memuse   
)
SC_ATOMIC_DECLARE ( uint64_t  ,
htp_memcap   
)