diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/ndpiReader.c | 4 | ||||
-rw-r--r-- | example/reader_util.c | 3 | ||||
-rw-r--r-- | example/reader_util.h | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index d5bc9f382..08e0023f2 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -2095,6 +2095,10 @@ static void printFlow(u_int32_t id, struct ndpi_flow_info *flow, u_int16_t threa print_ndpi_address_port_list_file(out, "Rsp Origin IP/Port", &flow->stun.response_origin); print_ndpi_address_port_list_file(out, "Other IP/Port", &flow->stun.other_address); + /* These counters make sense only if the flow entered the monitor state */ + if(flow->num_packets_before_monitoring > 0) + fprintf(out, "[RTP packets: %d/%d]", flow->stun.rtp_counters[0], flow->stun.rtp_counters[1]); + if(flow->http.url[0] != '\0') { ndpi_risk_enum risk = ndpi_validate_url(flow->http.url); diff --git a/example/reader_util.c b/example/reader_util.c index c22290025..6400d2260 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1199,6 +1199,9 @@ static void process_ndpi_monitoring_info(struct ndpi_flow_info *flow) { 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; + + flow->stun.rtp_counters[0] = flow->ndpi_flow->stun.rtp_counters[0]; + flow->stun.rtp_counters[1] = flow->ndpi_flow->stun.rtp_counters[1]; } } diff --git a/example/reader_util.h b/example/reader_util.h index 5b0e36cde..6a44ae022 100644 --- a/example/reader_util.h +++ b/example/reader_util.h @@ -323,6 +323,7 @@ typedef struct ndpi_flow_info { struct { ndpi_address_port_list mapped_address, peer_address, relayed_address, response_origin, other_address; + u_int16_t rtp_counters[2]; } stun; struct { |