tx.type_data = Some(NFSTransactionTypeData::FILE(NFSTransactionFile::new()));
match tx.type_data {
Some(NFSTransactionTypeData::FILE(ref mut d)) => {
- d.file_tracker.tx_id = tx.id;
+ d.file_tracker.tx_id = tx.id - 1;
},
_ => { },
}
#include "output-json-http.h"
#include "output-json-smtp.h"
#include "output-json-email-common.h"
+#include "output-json-nfs.h"
#include "app-layer-htp.h"
#include "util-memcmp.h"
if (hjs)
json_object_set_new(js, "email", hjs);
break;
+#ifdef HAVE_RUST
+ case ALPROTO_NFS:
+ hjs = JsonNFSAddMetadataRPC(p->flow, ff->txid);
+ if (hjs)
+ json_object_set_new(js, "rpc", hjs);
+ hjs = JsonNFSAddMetadata(p->flow, ff->txid);
+ if (hjs)
+ json_object_set_new(js, "nfs", hjs);
+ break;
+#endif
}
json_object_set_new(js, "app_proto",
MemBuffer *buffer;
} LogNFSLogThread;
+json_t *JsonNFSAddMetadataRPC(const Flow *f, uint64_t tx_id)
+{
+ NFSState *state = FlowGetAppState(f);
+ if (state) {
+ NFSTransaction *tx = AppLayerParserGetTx(f->proto, ALPROTO_NFS, state, tx_id);
+ if (tx) {
+ return rs_rpc_log_json_response(tx);
+ }
+ }
+
+ return NULL;
+}
+
+json_t *JsonNFSAddMetadata(const Flow *f, uint64_t tx_id)
+{
+ NFSState *state = FlowGetAppState(f);
+ if (state) {
+ NFSTransaction *tx = AppLayerParserGetTx(f->proto, ALPROTO_NFS, state, tx_id);
+ if (tx) {
+ return rs_nfs_log_json_response(state, tx);
+ }
+ }
+
+ return NULL;
+}
+
static int JsonNFSLogger(ThreadVars *tv, void *thread_data,
const Packet *p, Flow *f, void *state, void *tx, uint64_t tx_id)
{
#define __OUTPUT_JSON_NFS_H__
void JsonNFSLogRegister(void);
-
+#ifdef HAVE_RUST
+json_t *JsonNFSAddMetadataRPC(const Flow *f, uint64_t tx_id);
+json_t *JsonNFSAddMetadata(const Flow *f, uint64_t tx_id);
+#endif /* HAVE_RUST */
#endif /* __OUTPUT_JSON_NFS_H__ */