51 #include "rust-sip-log-gen.h" 69 return rs_sip_log_json(state, tx);
76 static int JsonSIPLogger(
ThreadVars *tv,
void *thread_data,
90 sipjs = rs_sip_log_json(state, siptx);
94 json_object_set_new(js,
"sip", sipjs);
107 static void OutputSIPLogDeInitCtxSub(
OutputCtx *output_ctx)
125 siplog_ctx->
cfg = ajt->
cfg;
132 output_ctx->
data = siplog_ctx;
133 output_ctx->
DeInit = OutputSIPLogDeInitCtxSub;
135 SCLogDebug(
"SIP log sub-module initialized.");
139 result.
ctx = output_ctx;
144 #define OUTPUT_BUFFER_SIZE 65535 146 static TmEcode JsonSIPLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
153 if (initdata == NULL) {
154 SCLogDebug(
"Error getting context for EveLogSIP. \"initdata\" is NULL.");
166 *data = (
void *)thread;
174 if (thread == NULL) {
177 if (thread->
buffer != NULL) {
189 JsonSIPLogger, JsonSIPLogThreadInit,
190 JsonSIPLogThreadDeinit, NULL);
struct LogSIPLogThread_ LogSIPLogThread
MemBuffer * MemBufferCreateNew(uint32_t size)
json_t * CreateJSONHeader(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type)
int OutputJSONBuffer(json_t *js, LogFileCtx *file_ctx, MemBuffer **buffer)
#define MemBufferReset(mem_buffer)
Reset the mem buffer.
void(* DeInit)(struct OutputCtx_ *)
void JsonAddCommonOptions(const OutputJsonCommonSettings *cfg, const Packet *p, const Flow *f, json_t *js)
LogSIPFileCtx * siplog_ctx
struct LogSIPFileCtx_ LogSIPFileCtx
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
struct SIPTransaction_ SIPTransaction
json_t * JsonSIPAddMetadata(const Flow *f, uint64_t tx_id)
OutputJsonCommonSettings cfg
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
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 JsonSIPLogRegister(void)
void * FlowGetAppState(const Flow *f)
OutputJsonCommonSettings cfg
Per thread variable structure.
struct SIPState_ SIPState
#define OUTPUT_BUFFER_SIZE
void MemBufferFree(MemBuffer *buffer)