Go to the documentation of this file.
63 static int JsonSNMPLogger(
ThreadVars *
tv,
void *thread_data,
64 const Packet *p,
Flow *f,
void *state,
void *tx, uint64_t tx_id)
76 jb_open_object(jb,
"snmp");
77 if (!rs_snmp_log_json_response(jb, state, snmptx)) {
93 static void OutputSNMPLogDeInitCtxSub(
OutputCtx *output_ctx)
107 if (
unlikely(snmplog_ctx == NULL)) {
111 snmplog_ctx->
cfg = ajt->
cfg;
118 output_ctx->
data = snmplog_ctx;
119 output_ctx->
DeInit = OutputSNMPLogDeInitCtxSub;
121 SCLogDebug(
"SNMP log sub-module initialized.");
125 result.
ctx = output_ctx;
130 static TmEcode JsonSNMPLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
137 if (initdata == NULL) {
138 SCLogDebug(
"Error getting context for EveLogSNMP. \"initdata\" is NULL.");
154 *data = (
void *)thread;
158 if (thread->
buffer != NULL) {
168 if (thread == NULL) {
171 if (thread->
buffer != NULL) {
183 JsonSNMPLogger, JsonSNMPLogThreadInit,
184 JsonSNMPLogThreadDeinit, NULL);
OutputJsonCommonSettings cfg
OutputJsonCommonSettings cfg
#define JSON_OUTPUT_BUFFER_SIZE
void JsonSNMPLogRegister(void)
int OutputJsonBuilderBuffer(JsonBuilder *js, LogFileCtx *file_ctx, MemBuffer **buffer)
void EveAddCommonOptions(const OutputJsonCommonSettings *cfg, const Packet *p, const Flow *f, JsonBuilder *js)
JsonBuilder * CreateEveHeader(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr)
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
Per thread variable structure.
LogFileCtx * LogFileEnsureExists(LogFileCtx *parent_ctx, int thread_id)
LogFileEnsureExists() Ensure a log file context for the thread exists.
LogSNMPFileCtx * snmplog_ctx
#define MemBufferReset(mem_buffer)
Reset the mem buffer.
void(* DeInit)(struct OutputCtx_ *)
struct LogSNMPLogThread_ LogSNMPLogThread
void MemBufferFree(MemBuffer *buffer)
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, ThreadExitPrintStatsFunc ThreadExitPrintStats)
struct LogSNMPFileCtx_ LogSNMPFileCtx
struct SNMPTransaction_ SNMPTransaction
MemBuffer * MemBufferCreateNew(uint32_t size)