suricata
|
#include "decode.h"
#include "tm-modules.h"
#include "output-packet.h"
#include "output-tx.h"
#include "output-file.h"
#include "output-filedata.h"
#include "output-flow.h"
#include "output-streaming.h"
#include "output-stats.h"
Go to the source code of this file.
Data Structures | |
struct | OutputLoggerThreadStore_ |
struct | OutputInitResult_ |
struct | OutputModule_ |
struct | EveJsonSimpleAppLayerLogger |
Macros | |
#define | DEFAULT_LOG_MODE_APPEND "yes" |
#define | DEFAULT_LOG_FILETYPE "regular" |
Typedefs | |
typedef struct OutputLoggerThreadStore_ | OutputLoggerThreadStore |
typedef struct OutputInitResult_ | OutputInitResult |
typedef OutputInitResult(* | OutputInitFunc) (ConfNode *) |
typedef OutputInitResult(* | OutputInitSubFunc) (ConfNode *, OutputCtx *) |
typedef TmEcode(* | OutputLogFunc) (ThreadVars *, Packet *, void *) |
typedef uint32_t(* | OutputGetActiveCountFunc) (void) |
typedef struct OutputModule_ | OutputModule |
typedef bool(* | EveJsonSimpleTxLogFunc) (void *, struct JsonBuilder *) |
typedef struct EveJsonSimpleAppLayerLogger | EveJsonSimpleAppLayerLogger |
Functions | |
typedef | TAILQ_HEAD (OutputModuleList_, OutputModule_) OutputModuleList |
void | OutputRegisterModule (const char *, const char *, OutputInitFunc) |
void | OutputRegisterPacketModule (LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, PacketLogger LogFunc, PacketLogCondition ConditionFunc, ThreadInitFunc, ThreadDeinitFunc) |
Register a packet output module. More... | |
void | OutputRegisterPacketSubModule (LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, PacketLogger LogFunc, PacketLogCondition ConditionFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a packet output sub-module. More... | |
void | OutputRegisterTxModule (LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a tx output module. More... | |
void | OutputRegisterTxSubModule (LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
void | OutputRegisterTxModuleWithCondition (LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a tx output module with condition. More... | |
void | OutputRegisterTxSubModuleWithCondition (LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
void | OutputRegisterTxModuleWithProgress (LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a tx output module with progress. More... | |
void | OutputRegisterTxSubModuleWithProgress (LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
void | OutputRegisterFileSubModule (LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, SCFileLogger FileLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a file output sub-module. More... | |
void | OutputRegisterFiledataModule (LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, SCFiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a file data output module. More... | |
void | OutputRegisterFlowSubModule (LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, FlowLogger FlowLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a flow output sub-module. More... | |
void | OutputRegisterStreamingModule (LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, SCStreamingLogger StreamingLogFunc, enum SCOutputStreamingType stream_type, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a streaming data output module. More... | |
void | OutputRegisterStatsModule (LoggerId id, const char *name, const char *conf_name, OutputInitFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a stats data output module. More... | |
void | OutputRegisterStatsSubModule (LoggerId id, const char *parent_name, const char *name, const char *conf_name, OutputInitSubFunc InitFunc, StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit) |
Register a stats data output sub-module. More... | |
OutputModule * | OutputGetModuleByConfName (const char *name) |
Get an output module by name. More... | |
void | OutputDeregisterAll (void) |
Deregister all modules. Useful for a memory clean exit. More... | |
int | OutputDropLoggerEnable (void) |
void | OutputDropLoggerDisable (void) |
void | OutputRegisterFileRotationFlag (int *flag) |
Register a flag for file rotation notification. More... | |
void | OutputUnregisterFileRotationFlag (int *flag) |
Unregister a file rotation flag. More... | |
void | OutputNotifyFileRotation (void) |
Notifies all registered file rotation notification flags. More... | |
void | OutputRegisterRootLogger (ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit, OutputLogFunc LogFunc, OutputGetActiveCountFunc ActiveCntFunc) |
void | TmModuleLoggerRegister (void) |
TmEcode | OutputLoggerLog (ThreadVars *, Packet *, void *) |
TmEcode | OutputLoggerThreadInit (ThreadVars *, const void *, void **) |
TmEcode | OutputLoggerThreadDeinit (ThreadVars *, void *) |
void | OutputLoggerExitPrintStats (ThreadVars *, void *) |
void | OutputSetupActiveLoggers (void) |
void | OutputClearActiveLoggers (void) |
EveJsonSimpleAppLayerLogger * | SCEveJsonSimpleGetLogger (AppProto alproto) |
Variables | |
OutputModuleList | output_modules |
Definition in file output.h.
typedef struct EveJsonSimpleAppLayerLogger EveJsonSimpleAppLayerLogger |
typedef bool(* EveJsonSimpleTxLogFunc) (void *, struct JsonBuilder *) |
typedef OutputInitResult(* OutputInitFunc) (ConfNode *) |
typedef struct OutputInitResult_ OutputInitResult |
typedef OutputInitResult(* OutputInitSubFunc) (ConfNode *, OutputCtx *) |
typedef TmEcode(* OutputLogFunc) (ThreadVars *, Packet *, void *) |
typedef struct OutputLoggerThreadStore_ OutputLoggerThreadStore |
typedef struct OutputModule_ OutputModule |
void OutputClearActiveLoggers | ( | void | ) |
Definition at line 821 of file output.c.
References SCFree, TAILQ_FIRST, and TAILQ_REMOVE.
void OutputDeregisterAll | ( | void | ) |
Deregister all modules. Useful for a memory clean exit.
Definition at line 629 of file output.c.
References output_modules, SCFree, TAILQ_FIRST, and TAILQ_REMOVE.
Referenced by GlobalsDestroy().
OutputModule* OutputGetModuleByConfName | ( | const char * | conf_name | ) |
Get an output module by name.
The | OutputModule with the given name or NULL if no output module with the given name is registered. |
Definition at line 612 of file output.c.
References OutputModule_::conf_name, output_modules, and TAILQ_FOREACH.
void OutputLoggerExitPrintStats | ( | ThreadVars * | , |
void * | |||
) |
TmEcode OutputLoggerLog | ( | ThreadVars * | , |
Packet * | , | ||
void * | |||
) |
TmEcode OutputLoggerThreadDeinit | ( | ThreadVars * | , |
void * | |||
) |
Definition at line 753 of file output.c.
References TM_ECODE_FAILED.
TmEcode OutputLoggerThreadInit | ( | ThreadVars * | , |
const void * | , | ||
void ** | |||
) |
void OutputNotifyFileRotation | ( | void | ) |
Notifies all registered file rotation notification flags.
Definition at line 701 of file output.c.
References OutputFileRolloverFlag, and TAILQ_FOREACH.
Referenced by SuricataMainLoop().
void OutputRegisterFiledataModule | ( | LoggerId | id, |
const char * | name, | ||
const char * | conf_name, | ||
OutputInitFunc | InitFunc, | ||
SCFiledataLogger | FiledataLogFunc, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a file data output module.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 430 of file output.c.
Referenced by OutputFilestoreRegister().
void OutputRegisterFileRotationFlag | ( | int * | flag | ) |
Register a flag for file rotation notification.
flag | A pointer that will be set to 1 when file rotation is requested. |
Definition at line 663 of file output.c.
References OutputFileRolloverFlag, SCCalloc, SCLogError, TAILQ_INSERT_TAIL, and unlikely.
void OutputRegisterFileSubModule | ( | LoggerId | id, |
const char * | parent_name, | ||
const char * | name, | ||
const char * | conf_name, | ||
OutputInitSubFunc | InitFunc, | ||
SCFileLogger | FileLogFunc, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a file output sub-module.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 393 of file output.c.
Referenced by JsonFileLogRegister().
void OutputRegisterFlowSubModule | ( | LoggerId | id, |
const char * | parent_name, | ||
const char * | name, | ||
const char * | conf_name, | ||
OutputInitSubFunc | InitFunc, | ||
FlowLogger | FlowLogFunc, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a flow output sub-module.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 466 of file output.c.
Referenced by JsonFlowLogRegister(), and JsonNetFlowLogRegister().
void OutputRegisterModule | ( | const char * | , |
const char * | , | ||
OutputInitFunc | |||
) |
Referenced by LuaLogRegister(), and OutputJsonRegister().
void OutputRegisterPacketModule | ( | LoggerId | id, |
const char * | name, | ||
const char * | conf_name, | ||
OutputInitFunc | InitFunc, | ||
PacketLogger | PacketLogFunc, | ||
PacketLogCondition | PacketConditionFunc, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a packet output module.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 169 of file output.c.
Referenced by AlertDebugLogRegister(), AlertFastLogRegister(), AlertSyslogRegister(), and PcapLogRegister().
void OutputRegisterPacketSubModule | ( | LoggerId | id, |
const char * | parent_name, | ||
const char * | name, | ||
const char * | conf_name, | ||
OutputInitSubFunc | InitFunc, | ||
PacketLogger | PacketLogFunc, | ||
PacketLogCondition | PacketConditionFunc, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a packet output sub-module.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 206 of file output.c.
Referenced by EveStreamLogRegister(), JsonAlertLogRegister(), JsonAnomalyLogRegister(), JsonArpLogRegister(), JsonDropLogRegister(), JsonFrameLogRegister(), and JsonMetadataLogRegister().
void OutputRegisterRootLogger | ( | ThreadInitFunc | ThreadInit, |
ThreadDeinitFunc | ThreadDeinit, | ||
OutputLogFunc | LogFunc, | ||
OutputGetActiveCountFunc | ActiveCntFunc | ||
) |
Definition at line 779 of file output.c.
Referenced by OutputPacketLoggerRegister(), and OutputStreamingLoggerRegister().
void OutputRegisterStatsModule | ( | LoggerId | id, |
const char * | name, | ||
const char * | conf_name, | ||
OutputInitFunc | InitFunc, | ||
StatsLogger | StatsLogFunc, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a stats data output module.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 541 of file output.c.
Referenced by LogStatsLogRegister().
void OutputRegisterStatsSubModule | ( | LoggerId | id, |
const char * | parent_name, | ||
const char * | name, | ||
const char * | conf_name, | ||
OutputInitSubFunc | InitFunc, | ||
StatsLogger | StatsLogFunc, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a stats data output sub-module.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 577 of file output.c.
Referenced by JsonStatsLogRegister().
void OutputRegisterStreamingModule | ( | LoggerId | id, |
const char * | name, | ||
const char * | conf_name, | ||
OutputInitFunc | InitFunc, | ||
SCStreamingLogger | StreamingLogFunc, | ||
enum SCOutputStreamingType | stream_type, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a streaming data output module.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 503 of file output.c.
Referenced by LogTcpDataLogRegister().
void OutputRegisterTxModule | ( | LoggerId | id, |
const char * | name, | ||
const char * | conf_name, | ||
OutputInitFunc | InitFunc, | ||
AppProto | alproto, | ||
TxLogger | TxLogFunc, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a tx output module.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 369 of file output.c.
Referenced by LogHttpLogRegister().
void OutputRegisterTxModuleWithCondition | ( | LoggerId | id, |
const char * | name, | ||
const char * | conf_name, | ||
OutputInitFunc | InitFunc, | ||
AppProto | alproto, | ||
TxLogger | TxLogFunc, | ||
TxLoggerCondition | TxLogCondition, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a tx output module with condition.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 320 of file output.c.
Referenced by LogTlsStoreRegister().
void OutputRegisterTxModuleWithProgress | ( | LoggerId | id, |
const char * | name, | ||
const char * | conf_name, | ||
OutputInitFunc | InitFunc, | ||
AppProto | alproto, | ||
TxLogger | TxLogFunc, | ||
int | tc_log_progress, | ||
int | ts_log_progress, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Register a tx output module with progress.
This function will register an output module so it can be configured with the configuration file.
Returns | 0 on success, -1 on failure. |
Definition at line 344 of file output.c.
Referenced by LogTlsLogRegister().
void OutputRegisterTxSubModule | ( | LoggerId | id, |
const char * | parent_name, | ||
const char * | name, | ||
const char * | conf_name, | ||
OutputInitSubFunc | InitFunc, | ||
AppProto | alproto, | ||
TxLogger | TxLogFunc, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Definition at line 377 of file output.c.
Referenced by JsonDCERPCLogRegister(), JsonDHCPLogRegister(), JsonDNP3LogRegister(), JsonDoh2LogRegister(), JsonHttpLogRegister(), JsonIKELogRegister(), JsonMQTTLogRegister(), JsonNFSLogRegister(), JsonPgsqlLogRegister(), JsonSMBLogRegister(), and JsonSmtpLogRegister().
void OutputRegisterTxSubModuleWithCondition | ( | LoggerId | id, |
const char * | parent_name, | ||
const char * | name, | ||
const char * | conf_name, | ||
OutputInitSubFunc | InitFunc, | ||
AppProto | alproto, | ||
TxLogger | TxLogFunc, | ||
TxLoggerCondition | TxLogCondition, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
void OutputRegisterTxSubModuleWithProgress | ( | LoggerId | id, |
const char * | parent_name, | ||
const char * | name, | ||
const char * | conf_name, | ||
OutputInitSubFunc | InitFunc, | ||
AppProto | alproto, | ||
TxLogger | TxLogFunc, | ||
int | tc_log_progress, | ||
int | ts_log_progress, | ||
ThreadInitFunc | ThreadInit, | ||
ThreadDeinitFunc | ThreadDeinit | ||
) |
Definition at line 352 of file output.c.
Referenced by JsonTlsLogRegister(), and OutputRegisterLoggers().
void OutputSetupActiveLoggers | ( | void | ) |
Definition at line 808 of file output.c.
References RootLogger_::ActiveCntFunc, cnt, and TAILQ_FIRST.
void OutputUnregisterFileRotationFlag | ( | int * | flag | ) |
Unregister a file rotation flag.
Note that it is safe to call this function with a flag that may not have been registered, in which case this function won't do anything.
flag | A pointer that has been previously registered for file rotation notifications. |
Definition at line 684 of file output.c.
References next, OutputFileRolloverFlag, SCFree, TAILQ_FIRST, TAILQ_NEXT, and TAILQ_REMOVE.
Referenced by LogFileFreeCtx().
EveJsonSimpleAppLayerLogger* SCEveJsonSimpleGetLogger | ( | AppProto | alproto | ) |
Definition at line 836 of file output.c.
References ALPROTO_MAX.
typedef TAILQ_HEAD | ( | OutputModuleList_ | , |
OutputModule_ | |||
) |
void TmModuleLoggerRegister | ( | void | ) |
Definition at line 830 of file output.c.
References OutputRegisterLoggers(), and OutputRegisterRootLoggers().
Referenced by RegisterAllModules().
OutputModuleList output_modules |
Referenced by OutputDeregisterAll(), OutputGetModuleByConfName(), and RunModeInitializeOutputs().