Go to the documentation of this file.
54 static void EveSmtpDataLogger(
void *state,
void *vtx, SCJsonBuilder *js)
56 if (state == NULL || vtx == NULL) {
63 SCJbSetString(js,
"helo", (
const char *)((
SMTPState *)state)->helo);
66 SCJbSetString(js,
"mail_from", (
const char *)tx->
mail_from);
69 SCJbOpenArray(js,
"rcpt_to");
71 SCJbAppendString(js, (
char *)rcptto_str->
str);
77 static int JsonSmtpLogger(
ThreadVars *
tv,
void *thread_data,
const Packet *
p,
Flow *f,
void *state,
void *tx, uint64_t tx_id)
87 SCJbOpenObject(jb,
"smtp");
88 EveSmtpDataLogger(state, tx, jb);
106 EveSmtpDataLogger(smtp_state, tx, js);
114 static void OutputSmtpLogDeInitCtxSub(
OutputCtx *output_ctx)
116 SCLogDebug(
"cleaning up sub output_ctx %p", output_ctx);
118 if (email_ctx != NULL) {
143 output_ctx->
data = email_ctx;
144 output_ctx->
DeInit = OutputSmtpLogDeInitCtxSub;
149 result.
ctx = output_ctx;
154 static TmEcode JsonSmtpLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
160 if(initdata == NULL) {
161 SCLogDebug(
"Error getting context for EveLogSMTP. \"initdata\" argument NULL");
169 if (aft->
ctx == NULL) {
199 OutputSmtpLogInitSub,
ALPROTO_SMTP, JsonSmtpLogger, JsonSmtpLogThreadInit,
200 JsonSmtpLogThreadDeinit);
struct HtpBodyChunk_ * next
void FreeEveThreadCtx(OutputJsonThreadCtx *ctx)
#define TAILQ_EMPTY(head)
#define TAILQ_FOREACH(var, head, field)
OutputJsonThreadCtx * CreateEveThreadCtx(ThreadVars *t, OutputJsonCtx *ctx)
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)
TmEcode EveEmailLogJson(JsonEmailLogThread *aft, SCJsonBuilder *js, const Packet *p, Flow *f, void *state, void *vtx, uint64_t tx_id)
void OutputJsonBuilderBuffer(ThreadVars *tv, const Packet *p, Flow *f, SCJsonBuilder *js, OutputJsonThreadCtx *ctx)
bool EveSMTPAddMetadata(const Flow *f, uint64_t tx_id, SCJsonBuilder *js)
void SCAppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
Per thread variable structure.
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
OutputJsonThreadCtx * ctx
void(* DeInit)(struct OutputCtx_ *)
SCJsonBuilder * CreateEveHeaderWithTxId(const Packet *p, enum SCOutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, uint64_t tx_id, OutputJsonCtx *eve_ctx)
void JsonSmtpLogRegister(void)
void OutputEmailInitConf(SCConfNode *conf, OutputJsonEmailCtx *email_ctx)
OutputJsonEmailCtx * emaillog_ctx