53 js_resplist = SCJbNewArray();
59 const char *command_name = NULL;
60 uint8_t command_name_length;
63 &command_name_length)) {
64 SCLogDebug(
"Unable to fetch info for FTP command code %d [index %d]",
69 SCJbOpenObject(jb,
"ftp");
71 SCJbSetString(jb,
"command", command_name);
72 uint32_t min_length = command_name_length + 1;
74 SCJbSetStringFromBytes(jb,
"command_data", (
const uint8_t *)tx->
request + min_length,
84 bool reply_truncated =
false;
89 bool is_cc_array_open =
false;
95 FTPResponseLine *response = wrapper->
response;
97 if (!reply_truncated && response->truncated) {
98 reply_truncated =
true;
100 if (response->code_length > 0) {
101 if (!is_cc_array_open) {
102 SCJbOpenArray(jb,
"completion_code");
103 is_cc_array_open =
true;
105 SCJbAppendStringFromBytes(
106 jb, (
const uint8_t *)response->code, (uint32_t)response->code_length);
108 if (response->length) {
109 SCJbAppendStringFromBytes(js_resplist, (
const uint8_t *)response->response,
110 (uint32_t)response->length);
115 if (is_cc_array_open) {
119 SCJbClose(js_resplist);
120 SCJbSetObject(jb,
"reply", js_resplist);
122 SCJbFree(js_resplist);
126 SCJbSetUint(jb,
"dynamic_port", tx->
dyn_port);
130 case FTP_COMMAND_PORT:
131 case FTP_COMMAND_EPRT:
132 case FTP_COMMAND_PASV:
133 case FTP_COMMAND_EPSV:
149 if (reply_truncated) {