Go to the documentation of this file.
53 JsonBuilder *js_resplist = NULL;
55 js_resplist = jb_new_array();
61 jb_open_object(jb,
"ftp");
65 jb_set_string_from_bytes(jb,
67 (
const uint8_t *)tx->
request + min_length,
76 bool reply_truncated =
false;
81 bool is_cc_array_open =
false;
84 uint8_t *where = response->
str;
87 if (response->
len > 0 && response->
len <= UINT16_MAX) {
88 length = (uint16_t)response->
len - 1;
89 }
else if (response->
len > UINT16_MAX) {
92 if (!reply_truncated && response->
truncated) {
93 reply_truncated =
true;
100 if (isdigit(where[0]) && isdigit(where[1]) && isdigit(where[2])) {
101 if (!is_cc_array_open) {
102 jb_open_array(jb,
"completion_code");
103 is_cc_array_open =
true;
105 jb_append_string_from_bytes(jb, (
const uint8_t *)where, 3);
111 jb_append_string_from_bytes(js_resplist, (
const uint8_t *)where +
offset, pos -
offset);
120 if (is_cc_array_open) {
124 jb_close(js_resplist);
125 jb_set_object(jb,
"reply", js_resplist);
127 jb_free(js_resplist);
131 jb_set_uint(jb,
"dynamic_port", tx->
dyn_port);
149 if (reply_truncated) {
159 static int JsonFTPLogger(
ThreadVars *
tv,
void *thread_data,
160 const Packet *p,
Flow *f,
void *state,
void *vtx, uint64_t tx_id)
165 const char *event_type;
167 event_type =
"ftp_data";
const uint8_t command_length
const FtpCommand * command_descriptor
OutputInitResult OutputJsonLogInitSub(ConfNode *conf, OutputCtx *parent_ctx)
struct HtpBodyChunk_ * next
TmEcode JsonLogThreadInit(ThreadVars *t, const void *initdata, void **data)
int OutputJsonBuilderBuffer(JsonBuilder *js, OutputJsonThreadCtx *ctx)
#define TAILQ_EMPTY(head)
#define TAILQ_FOREACH(var, head, field)
FtpRequestCommand command
const char * command_name
bool EveFTPDataAddMetadata(void *vtx, JsonBuilder *jb)
#define JB_SET_STRING(jb, key, val)
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
Per thread variable structure.
#define JB_SET_TRUE(jb, key)
bool EveFTPLogCommand(void *vtx, JsonBuilder *jb)
JsonBuilder * CreateEveHeaderWithTxId(const Packet *p, enum OutputJsonLogDirection dir, const char *event_type, JsonAddrInfo *addr, uint64_t tx_id, OutputJsonCtx *eve_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, ThreadExitPrintStatsFunc ThreadExitPrintStats)
#define JB_SET_FALSE(jb, key)
void JsonFTPLogRegister(void)
TmEcode JsonLogThreadDeinit(ThreadVars *t, void *data)
uint16_t JsonGetNextLineFromBuffer(const char *buffer, const uint16_t len)
AppProto alproto
application level protocol