aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2022-07-17 12:45:42 +0200
committerIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2022-07-20 20:36:31 +0200
commit00eb2393f40790ffea13f24a2dd0be7424894982 (patch)
tree9a4130f8c3e7a85b6ab2afd544054ec973edf66c /src
parentd66aa49787cea811a8fcb585b939ce3ca5c6852e (diff)
STUN: improve detection of Hangout/Duo and FB voip calls
Diffstat (limited to 'src')
-rw-r--r--src/lib/protocols/stun.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index f6e6f0592..e6526e144 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -49,9 +49,9 @@ u_int32_t get_stun_lru_key(struct ndpi_packet_struct *packet, u_int8_t rev) {
/* ************************************************************ */
-void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
- struct ndpi_flow_struct *flow,
- u_int proto, u_int app_proto) {
+static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
+ struct ndpi_flow_struct *flow,
+ u_int proto, u_int app_proto) {
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
ndpi_confidence_t confidence = NDPI_CONFIDENCE_DPI;
@@ -531,6 +531,12 @@ void ndpi_search_stun(struct ndpi_detection_module_struct *ndpi_struct, struct n
if(ndpi_int_check_stun(ndpi_struct, flow, packet->payload,
packet->payload_packet_len) == NDPI_IS_STUN) {
udp_stun_match:
+
+ if(flow->guessed_host_protocol_id == NDPI_PROTOCOL_GOOGLE)
+ flow->guessed_host_protocol_id = NDPI_PROTOCOL_HANGOUT_DUO;
+ else if(flow->guessed_host_protocol_id == NDPI_PROTOCOL_FACEBOOK)
+ flow->guessed_host_protocol_id = NDPI_PROTOCOL_FACEBOOK_VOIP;
+
if(flow->guessed_protocol_id == NDPI_PROTOCOL_UNKNOWN)
flow->guessed_protocol_id = NDPI_PROTOCOL_STUN;
@@ -538,7 +544,7 @@ void ndpi_search_stun(struct ndpi_detection_module_struct *ndpi_struct, struct n
flow->guessed_host_protocol_id = flow->guessed_protocol_id;
flow->guessed_protocol_id = NDPI_PROTOCOL_STUN;
}
-
+
ndpi_int_stun_add_connection(ndpi_struct, flow,
flow->guessed_protocol_id,
flow->guessed_host_protocol_id);