aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/stun.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-07-24 00:25:00 +0200
committerLuca Deri <deri@ntop.org>2019-07-24 00:25:00 +0200
commitb715467da621b0bb901160a14a01250e54e0b1f9 (patch)
treeaa2255781dc8b84b84063c1c24e8e30179ad6d20 /src/lib/protocols/stun.c
parent63173e7360d5acf6ef8f18a8d98edba48da0d7d6 (diff)
Added -e option to ndpiReader for searchign human readeable strings lenght
Default human readeable strings lenght is not 5 chars (used to be 8)
Diffstat (limited to 'src/lib/protocols/stun.c')
-rw-r--r--src/lib/protocols/stun.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index f4749b71a..202b3d939 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -255,7 +255,11 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
printf("==>> NDPI_PROTOCOL_WHATSAPP_VOICE\n");
#endif
- flow->guessed_host_protocol_id = (is_google_ip_address(ntohl(packet->iph->saddr)) || is_google_ip_address(ntohl(packet->iph->daddr))) ? NDPI_PROTOCOL_HANGOUT_DUO : NDPI_PROTOCOL_WHATSAPP_VOICE;
+ if((ntohs(packet->udp->source) == 3478) || (ntohs(packet->udp->dest) == 3478))
+ flow->guessed_host_protocol_id = NDPI_PROTOCOL_WHATSAPP_VOICE;
+ else
+ flow->guessed_host_protocol_id = (is_google_ip_address(ntohl(packet->iph->saddr)) || is_google_ip_address(ntohl(packet->iph->daddr)))
+ ? NDPI_PROTOCOL_HANGOUT_DUO : NDPI_PROTOCOL_WHATSAPP_VOICE;
return((flow->protos.stun_ssl.stun.num_udp_pkts < MAX_NUM_STUN_PKTS) ? NDPI_IS_NOT_STUN : NDPI_IS_STUN);
} else {
/*
@@ -274,7 +278,12 @@ void ndpi_search_stun(struct ndpi_detection_module_struct *ndpi_struct, struct n
NDPI_LOG_DBG(ndpi_struct, "search stun\n");
- if(packet->payload == NULL) return;
+ if(packet->payload == NULL)
+ return;
+ else if(packet->iphv6 != NULL) {
+ NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ return;
+ }
if(packet->tcp) {
/* STUN may be encapsulated in TCP packets */