aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/ndpiReader.c24
-rw-r--r--example/reader_util.c4
-rw-r--r--example/reader_util.h2
3 files changed, 7 insertions, 23 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 9f355087b..630daa43f 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -1810,28 +1810,10 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa
ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
flow->detected_protocol.protocol_by_ip));
- if(flow->multimedia_flow_type != ndpi_multimedia_unknown_flow) {
- const char *content;
+ if(flow->multimedia_flow_types != ndpi_multimedia_unknown_flow) {
+ char content[64] = {0};
- switch(flow->multimedia_flow_type) {
- case ndpi_multimedia_audio_flow:
- content = "Audio";
- break;
-
- case ndpi_multimedia_video_flow:
- content = "Video";
- break;
-
- case ndpi_multimedia_screen_sharing_flow:
- content = "Screen Sharing";
- break;
-
- default:
- content = "???";
- break;
- }
-
- fprintf(out, "[Stream Content: %s]", content);
+ fprintf(out, "[Stream Content: %s]", ndpi_multimedia_flowtype2str(content, sizeof(content), flow->multimedia_flow_types));
}
fprintf(out, "[%s]",
diff --git a/example/reader_util.c b/example/reader_util.c
index 7329c2e10..e31dc0624 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -1198,6 +1198,8 @@ static void process_ndpi_monitoring_info(struct ndpi_flow_info *flow) {
add_to_address_port_list(&flow->stun.peer_address, &flow->ndpi_flow->monit->protos.dtls_stun_rtp.peer_address);
add_to_address_port_list(&flow->stun.relayed_address, &flow->ndpi_flow->monit->protos.dtls_stun_rtp.relayed_address);
add_to_address_port_list(&flow->stun.response_origin, &flow->ndpi_flow->monit->protos.dtls_stun_rtp.response_origin);
+
+ flow->multimedia_flow_types |= flow->ndpi_flow->flow_multimedia_types;
}
}
@@ -1607,7 +1609,7 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
add_to_address_port_list(&flow->stun.other_address, &flow->ndpi_flow->stun.other_address);
}
- flow->multimedia_flow_type = flow->ndpi_flow->flow_multimedia_type;
+ flow->multimedia_flow_types |= flow->ndpi_flow->flow_multimedia_types;
if(flow->ndpi_flow->tcp.fingerprint) {
char buf[128];
diff --git a/example/reader_util.h b/example/reader_util.h
index 41bea5ba0..5b0e36cde 100644
--- a/example/reader_util.h
+++ b/example/reader_util.h
@@ -333,7 +333,7 @@ typedef struct ndpi_flow_info {
char geolocation_iata_code[4];
} dns;
- ndpi_multimedia_flow_type multimedia_flow_type;
+ u_int8_t multimedia_flow_types;
void *src_id, *dst_id;
char *tcp_fingerprint;