aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2022-05-30 00:31:52 +0200
committerLuca Deri <deri@ntop.org>2022-05-30 00:32:32 +0200
commitf25deeccb1ccbebd6346271828762fdd8326c32b (patch)
tree677c846f19b9b1468e6ec62637e77ae354fe0a24 /example/reader_util.c
parenta9d7cc4841ea098074b3dc0b42b7b6e73d4d8cd9 (diff)
Added RiskInfo string
Diffstat (limited to 'example/reader_util.c')
-rw-r--r--example/reader_util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index 49c647516..cb591d52e 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -541,6 +541,8 @@ void ndpi_flow_info_free_data(struct ndpi_flow_info *flow) {
#else
ndpi_free_bin(&flow->payload_len_bin);
#endif
+
+ if(flow->risk_str) ndpi_free(flow->risk_str);
}
/* ***************************************************** */
@@ -1036,11 +1038,17 @@ u_int8_t plen2slot(u_int16_t plen) {
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow) {
u_int i, is_quic = 0;
-
+ char out[128], *s;
+
if(!flow->ndpi_flow) return;
flow->info_type = INFO_INVALID;
+ s = ndpi_get_flow_risk_info(flow->ndpi_flow, out, sizeof(out));
+
+ if(s != NULL)
+ flow->risk_str = ndpi_strdup(s);
+
flow->confidence = flow->ndpi_flow->confidence;
ndpi_snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s",