Go to the documentation of this file.
54 static void EveSmtpDataLogger(
void *state,
void *vtx, JsonBuilder *js)
59 jb_set_string(js,
"helo", (
const char *)((
SMTPState *)state)->helo);
62 jb_set_string(js,
"mail_from", (
const char *)tx->
mail_from);
65 jb_open_array(js,
"rcpt_to");
67 jb_append_string(js, (
char *)rcptto_str->
str);
73 static int JsonSmtpLogger(
ThreadVars *
tv,
void *thread_data,
const Packet *p,
Flow *f,
void *state,
void *tx, uint64_t tx_id)
83 jb_open_object(jb,
"smtp");
84 EveSmtpDataLogger(state, tx, jb);
102 EveSmtpDataLogger(smtp_state, tx, js);
110 static void OutputSmtpLogDeInitCtxSub(
OutputCtx *output_ctx)
112 SCLogDebug(
"cleaning up sub output_ctx %p", output_ctx);
114 if (email_ctx != NULL) {
139 output_ctx->
data = email_ctx;
140 output_ctx->
DeInit = OutputSmtpLogDeInitCtxSub;
145 result.
ctx = output_ctx;
150 static TmEcode JsonSmtpLogThreadInit(
ThreadVars *t,
const void *initdata,
void **data)
156 if(initdata == NULL) {
157 SCLogDebug(
"Error getting context for EveLogSMTP. \"initdata\" argument NULL");
165 if (aft->
ctx == NULL) {
195 OutputSmtpLogInitSub,
ALPROTO_SMTP, JsonSmtpLogger, JsonSmtpLogThreadInit,
196 JsonSmtpLogThreadDeinit);
bool EveSMTPAddMetadata(const Flow *f, uint64_t tx_id, JsonBuilder *js)
TmEcode EveEmailLogJson(JsonEmailLogThread *aft, JsonBuilder *js, const Packet *p, Flow *f, void *state, void *vtx, uint64_t tx_id)
struct HtpBodyChunk_ * next
void FreeEveThreadCtx(OutputJsonThreadCtx *ctx)
void OutputJsonBuilderBuffer(ThreadVars *tv, const Packet *p, Flow *f, JsonBuilder *js, 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)
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
Per thread variable structure.
JsonBuilder * CreateEveHeaderWithTxId(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, uint64_t tx_id, OutputJsonCtx *eve_ctx)
void OutputEmailInitConf(ConfNode *conf, OutputJsonEmailCtx *email_ctx)
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
OutputJsonThreadCtx * ctx
void(* DeInit)(struct OutputCtx_ *)
void JsonSmtpLogRegister(void)
OutputJsonEmailCtx * emaillog_ctx