53 SCJsonBuilder *js_resplist = NULL;
55 js_resplist = SCJbNewArray();
61 const char *command_name = NULL;
62 uint8_t command_name_length;
65 &command_name_length)) {
66 SCLogDebug(
"Unable to fetch info for FTP command code %d [index %d]",
71 SCJbOpenObject(jb,
"ftp");
73 SCJbSetString(jb,
"command", command_name);
74 uint32_t min_length = command_name_length + 1;
76 SCJbSetStringFromBytes(jb,
"command_data", (
const uint8_t *)tx->
request + min_length,
86 bool reply_truncated =
false;
91 bool is_cc_array_open =
false;
97 FTPResponseLine *response = wrapper->
response;
99 if (!reply_truncated && response->truncated) {
100 reply_truncated =
true;
102 int code_len = strlen((
const char *)response->code);
104 if (!is_cc_array_open) {
105 SCJbOpenArray(jb,
"completion_code");
106 is_cc_array_open =
true;
108 SCJbAppendStringFromBytes(jb, (
const uint8_t *)response->code, code_len);
110 if (response->length) {
111 SCJbAppendStringFromBytes(
112 js_resplist, (
const uint8_t *)response->response, response->length);
117 if (is_cc_array_open) {
121 SCJbClose(js_resplist);
122 SCJbSetObject(jb,
"reply", js_resplist);
124 SCJbFree(js_resplist);
128 SCJbSetUint(jb,
"dynamic_port", tx->
dyn_port);
146 if (reply_truncated) {