Go to the documentation of this file.
47 void *state,
void *tx, uint64_t tx_id)
56 if (!rs_modbus_to_json(tx, js)) {
66 static void OutputModbusLogDeInitCtxSub(
OutputCtx *output_ctx)
79 if (
unlikely(modbuslog_ctx == NULL)) {
90 output_ctx->
data = modbuslog_ctx;
91 output_ctx->
DeInit = OutputModbusLogDeInitCtxSub;
95 SCLogDebug(
"modbus log sub-module initialized.");
97 result.
ctx = output_ctx;
102 static TmEcode JsonModbusLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
104 if (initdata == NULL) {
105 SCLogDebug(
"Error getting context for EveLogModbus. \"initdata\" is NULL.");
116 if (thread->
ctx == NULL) {
120 *data = (
void *)thread;
131 if (thread == NULL) {
141 void *state = FlowGetAppState(f);
145 return rs_modbus_to_json(tx, js);
156 OutputModbusLogInitSub,
ALPROTO_MODBUS, JsonModbusLogger, JsonModbusLogThreadInit,
157 JsonModbusLogThreadDeinit, NULL);
struct JsonModbusLogThread_ JsonModbusLogThread
void FreeEveThreadCtx(OutputJsonThreadCtx *ctx)
bool JsonModbusAddMetadata(const Flow *f, uint64_t tx_id, JsonBuilder *js)
int OutputJsonBuilderBuffer(JsonBuilder *js, OutputJsonThreadCtx *ctx)
OutputJsonThreadCtx * CreateEveThreadCtx(ThreadVars *t, OutputJsonCtx *ctx)
OutputJsonThreadCtx * ctx
LogModbusFileCtx * modbuslog_ctx
struct LogModbusFileCtx_ LogModbusFileCtx
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
JsonBuilder * CreateEveHeader(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, OutputJsonCtx *eve_ctx)
Per thread variable structure.
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
void(* DeInit)(struct OutputCtx_ *)
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)
void JsonModbusLogRegister(void)