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 30 of file util-buffer.c.

Referenced by MemBufferCreateNew(), and MemBufferExpand().

Function Documentation

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 60 of file util-buffer.c.

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

Referenced by OutputJSONMemBufferCallback().

Here is the caller graph for this function: