util-buffer.c File Reference
#include "suricata-common.h"
#include "suricata.h"
#include "util-debug.h"
#include "util-buffer.h"
Include dependency graph for util-buffer.c:

Go to the source code of this file.


#define MAX_LIMIT   10485760


MemBufferMemBufferCreateNew (uint32_t size)
int MemBufferExpand (MemBuffer **buffer, uint32_t expand_by)
 expand membuffer by size of 'expand_by' More...
void MemBufferFree (MemBuffer *buffer)

Detailed Description

Macro Definition Documentation


#define MAX_LIMIT   10485760

Definition at line 31 of file util-buffer.c.

Function Documentation

◆ MemBufferCreateNew()

MemBuffer* MemBufferCreateNew ( uint32_t  size)

Definition at line 32 of file util-buffer.c.

References MAX_LIMIT, SC_EINVAL, SC_ENOMEM, sc_errno, SC_OK, SCLogWarning, SCMalloc, and unlikely.

Referenced by CreateEveThreadCtx(), JsonLogThreadInit(), LogHttpLogThreadInit(), LogStatsLogThreadInit(), and LogTcpDataLogThreadInit().

Here is the caller graph for this function:

◆ MemBufferExpand()

int MemBufferExpand ( MemBuffer **  buffer,
uint32_t  expand_by 

expand membuffer by size of 'expand_by'

If expansion failed, buffer will still be valid.

Return values
result0 ok, -1 expansion failed

Definition at line 64 of file util-buffer.c.

References MAX_LIMIT, SCLogDebug, SCLogWarning, SCRealloc, MemBuffer_::size, and unlikely.

Referenced by OutputJsonBuilderBuffer(), and OutputJSONMemBufferCallback().

Here is the caller graph for this function:

◆ MemBufferFree()

void MemBufferFree ( MemBuffer buffer)

Definition at line 87 of file util-buffer.c.

References SCFree.

Referenced by CreateEveThreadCtx(), FreeEveThreadCtx(), JsonLogThreadInit(), LogHttpLogThreadDeinit(), LogStatsLogThreadDeinit(), and LogTcpDataLogThreadDeinit().

Here is the caller graph for this function: