suricata
log-tcp-data.c File Reference
#include "suricata-common.h"
#include "log-tcp-data.h"
#include "threadvars.h"
#include "util-conf.h"
#include "util-logopenfile.h"
#include "util-path.h"
#include "util-print.h"
Include dependency graph for log-tcp-data.c:

Go to the source code of this file.

Data Structures

struct  LogTcpDataFileCtx_
 
struct  LogTcpDataLogThread_
 

Macros

#define DEFAULT_LOG_FILENAME   "tcp-data.log"
 
#define MODULE_NAME   "LogTcpDataLog"
 
#define OUTPUT_BUFFER_SIZE   65535
 

Typedefs

typedef struct LogTcpDataFileCtx_ LogTcpDataFileCtx
 
typedef struct LogTcpDataLogThread_ LogTcpDataLogThread
 

Functions

TmEcode LogTcpDataLogThreadInit (ThreadVars *, const void *, void **)
 
TmEcode LogTcpDataLogThreadDeinit (ThreadVars *, void *)
 
int LogTcpDataLogger (ThreadVars *tv, void *thread_data, const Flow *f, const uint8_t *data, uint32_t data_len, uint64_t tx_id, uint8_t flags)
 
void LogTcpDataLogRegister (void)
 
OutputInitResult LogTcpDataLogInitCtx (ConfNode *conf)
 Create a new http log LogFileCtx. More...
 

Detailed Description

Macro Definition Documentation

◆ DEFAULT_LOG_FILENAME

#define DEFAULT_LOG_FILENAME   "tcp-data.log"

Definition at line 35 of file log-tcp-data.c.

◆ MODULE_NAME

#define MODULE_NAME   "LogTcpDataLog"

Definition at line 37 of file log-tcp-data.c.

◆ OUTPUT_BUFFER_SIZE

#define OUTPUT_BUFFER_SIZE   65535

Definition at line 39 of file log-tcp-data.c.

Typedef Documentation

◆ LogTcpDataFileCtx

◆ LogTcpDataLogThread

Function Documentation

◆ LogTcpDataLogger()

int LogTcpDataLogger ( ThreadVars tv,
void *  thread_data,
const Flow f,
const uint8_t *  data,
uint32_t  data_len,
uint64_t  tx_id,
uint8_t  flags 
)

Definition at line 151 of file log-tcp-data.c.

References LogTcpDataFileCtx_::dir, SCEnter, and LogTcpDataLogThread_::tcpdatalog_ctx.

Referenced by LogTcpDataLogRegister().

Here is the caller graph for this function:

◆ LogTcpDataLogInitCtx()

OutputInitResult LogTcpDataLogInitCtx ( ConfNode conf)

Create a new http log LogFileCtx.

Parameters
confPointer to ConfNode containing this loggers configuration.
Returns
NULL if failure, LogFileCtx* to the file_ctx if succesful

Definition at line 211 of file log-tcp-data.c.

References ConfigGetLogDirectory(), ConfNodeLookupChildValue(), OutputCtx_::data, DEFAULT_LOG_FILENAME, OutputCtx_::DeInit, LogTcpDataFileCtx_::dir, LogTcpDataFileCtx_::file, LogTcpDataFileCtx_::file_ctx, LogTcpDataFileCtx_::log_dir, LogFileFreeCtx(), LogFileNewCtx(), ConfNode_::name, SCCalloc, SCConfLogOpenGeneric(), SCFree, SCLogError, SCLogInfo, SCMkDir, STREAMING_HTTP_BODIES, STREAMING_TCP_DATA, strlcpy(), LogTcpDataFileCtx_::type, and unlikely.

Referenced by LogTcpDataLogRegister().

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

◆ LogTcpDataLogRegister()

void LogTcpDataLogRegister ( void  )

◆ LogTcpDataLogThreadDeinit()

TmEcode LogTcpDataLogThreadDeinit ( ThreadVars t,
void *  data 
)

Definition at line 192 of file log-tcp-data.c.

References LogTcpDataLogThread_::buffer, MemBufferFree(), SCFree, and TM_ECODE_OK.

Referenced by LogTcpDataLogRegister().

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

◆ LogTcpDataLogThreadInit()

TmEcode LogTcpDataLogThreadInit ( ThreadVars t,
const void *  initdata,
void **  data 
)

Definition at line 166 of file log-tcp-data.c.

References LogTcpDataLogThread_::buffer, MemBufferCreateNew(), OUTPUT_BUFFER_SIZE, SCCalloc, SCFree, SCLogDebug, LogTcpDataLogThread_::tcpdatalog_ctx, TM_ECODE_FAILED, TM_ECODE_OK, and unlikely.

Referenced by LogTcpDataLogRegister().

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