diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/ndpiReader.c | 18 | ||||
-rw-r--r-- | example/reader_util.c | 3 | ||||
-rw-r--r-- | example/reader_util.h | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index b79b2573b..dd908e5ce 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1747,6 +1747,24 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa flow->detected_protocol) ? "Encrypted" : "ClearText"); fprintf(out, "[Confidence: %s]", ndpi_confidence_get_name(flow->confidence)); + + if(flow->fpc.master_protocol == NDPI_PROTOCOL_UNKNOWN) { + fprintf(out, "[FPC: %u/%s, ", + flow->fpc.app_protocol, + ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, + flow->fpc.app_protocol)); + } else { + fprintf(out, "[FPC: %u.%u/%s.%s, ", + flow->fpc.master_protocol, + flow->fpc.app_protocol, + ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, + flow->fpc.master_protocol), + ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, + flow->fpc.app_protocol)); + } + fprintf(out, "Confidence: %s]", + ndpi_fpc_confidence_get_name(flow->fpc.confidence)); + /* If someone wants to have the num_dissector_calls variable per flow, he can print it here. Disabled by default to avoid too many diffs in the unit tests... */ diff --git a/example/reader_util.c b/example/reader_util.c index cc74778e3..fdb01e2ba 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1055,6 +1055,9 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl flow->risk_str = ndpi_strdup(s); flow->confidence = flow->ndpi_flow->confidence; + + flow->fpc = flow->ndpi_flow->fpc; + flow->num_dissector_calls = flow->ndpi_flow->num_dissector_calls; ndpi_snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s", diff --git a/example/reader_util.h b/example/reader_util.h index 945b88d84..27b8e1c0b 100644 --- a/example/reader_util.h +++ b/example/reader_util.h @@ -208,6 +208,7 @@ typedef struct ndpi_flow_info { // result only, not used for flow identification ndpi_protocol detected_protocol; ndpi_confidence_t confidence; + struct ndpi_fpc_info fpc; u_int16_t num_dissector_calls; u_int16_t dpi_packets; |