suricata
log-tcp-data.c File Reference
#include "suricata-common.h"
#include "debug.h"
#include "detect.h"
#include "pkt-var.h"
#include "conf.h"
#include "threads.h"
#include "threadvars.h"
#include "tm-threads.h"
#include "util-print.h"
#include "util-unittest.h"
#include "util-debug.h"
#include "output.h"
#include "log-tcp-data.h"
#include "app-layer-htp.h"
#include "app-layer.h"
#include "app-layer-parser.h"
#include "util-privs.h"
#include "util-buffer.h"
#include "util-logopenfile.h"
#include "util-time.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

#define DEFAULT_LOG_FILENAME   "tcp-data.log"

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

Referenced by LogTcpDataLogInitCtx().

#define MODULE_NAME   "LogTcpDataLog"

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

Referenced by LogTcpDataLogRegister().

#define OUTPUT_BUFFER_SIZE   65535

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

Referenced by LogTcpDataLogThreadInit().

Typedef Documentation

Function Documentation

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 167 of file log-tcp-data.c.

References LogTcpDataFileCtx_::dir, LogTcpDataFileCtx_::file, SCEnter, SCReturnInt, LogTcpDataLogThread_::tcpdatalog_ctx, and TM_ECODE_OK.

Referenced by LogTcpDataLogRegister().

Here is the caller graph for this function:

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 228 of file log-tcp-data.c.

References ConfigGetLogDirectory(), ConfNodeLookupChildValue(), OutputInitResult_::ctx, OutputCtx_::data, DEFAULT_LOG_FILENAME, OutputCtx_::DeInit, LogTcpDataFileCtx_::dir, LogTcpDataFileCtx_::file, LogTcpDataFileCtx_::file_ctx, LogTcpDataFileCtx_::log_dir, LogFileFreeCtx(), LogFileNewCtx(), ConfNode_::name, OutputInitResult_::ok, SC_ERR_INVALID_ARGUMENT, SC_ERR_TCPDATA_LOG_GENERIC, SCCalloc, SCConfLogOpenGeneric(), SCFree, SCLogDebug, SCLogError, SCLogInfo, SCMalloc, 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:

void LogTcpDataLogRegister ( void  )

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

References LOGGER_TCP_DATA, LogTcpDataLogger(), LogTcpDataLogInitCtx(), LogTcpDataLogThreadDeinit(), LogTcpDataLogThreadInit(), MODULE_NAME, OutputRegisterStreamingModule(), STREAMING_HTTP_BODIES, and STREAMING_TCP_DATA.

Referenced by OutputRegisterLoggers().

Here is the call graph for this function:

Here is the caller graph for this function:

TmEcode LogTcpDataLogThreadDeinit ( ThreadVars t,
void *  data 
)

Definition at line 209 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:

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

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

References LogTcpDataLogThread_::buffer, MemBufferCreateNew(), OUTPUT_BUFFER_SIZE, SCFree, SCLogDebug, SCMalloc, 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: