aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/stun.c
diff options
context:
space:
mode:
authorLuca <deri@ntop.org>2019-09-05 10:45:08 +0200
committerLuca <deri@ntop.org>2019-09-05 10:45:08 +0200
commit241cfb319b0a1c8650c6ccd2574fade467036297 (patch)
tree7703eecb99724945f2ccab9560df6b27a90acc0d /src/lib/protocols/stun.c
parent9b80c6314d9862c716f77bc2814bd28e8ede2f54 (diff)
Enhanced Signal detection
Diffstat (limited to 'src/lib/protocols/stun.c')
-rw-r--r--src/lib/protocols/stun.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index 44c7ada3f..5a2156e71 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -30,10 +30,11 @@
#define MAX_NUM_STUN_PKTS 8
-/*
+#if 0
#define DEBUG_STUN 1
#define DEBUG_LRU 1
-*/
+#endif
+
struct stun_packet_header {
u_int16_t msg_type, msg_len;
@@ -167,9 +168,17 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
u_int32_t key = get_stun_lru_key(flow, 0);
int rc = ndpi_lru_find_cache(ndpi_struct->stun_cache, key, &proto, 0 /* Don't remove it as it can be used for other connections */);
+#ifdef DEBUG_LRU
+ printf("[LRU] Searching %u\n", key);
+#endif
+
if(!rc) {
key = get_stun_lru_key(flow, 1);
rc = ndpi_lru_find_cache(ndpi_struct->stun_cache, key, &proto, 0 /* Don't remove it as it can be used for other connections */);
+
+#ifdef DEBUG_LRU
+ printf("[LRU] Searching %u\n", key);
+#endif
}
if(rc) {
@@ -184,7 +193,7 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct *
*is_whatsapp = 1;
break;
case NDPI_PROTOCOL_MESSENGER:
- *is_messenger;
+ *is_messenger = 1;
break;
case NDPI_PROTOCOL_HANGOUT_DUO:
*is_duo = 1;