From 460ff3c7aba42d0e7b99a227e0cb846af296e4e0 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 31 Aug 2020 08:47:16 +0200 Subject: Added (optional) notifier for LRU add --- src/lib/protocols/hangout.c | 2 ++ src/lib/protocols/stun.c | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'src/lib/protocols') diff --git a/src/lib/protocols/hangout.c b/src/lib/protocols/hangout.c index fe0d3cb05..acddfed7f 100644 --- a/src/lib/protocols/hangout.c +++ b/src/lib/protocols/hangout.c @@ -108,6 +108,8 @@ void ndpi_search_hangout(struct ndpi_detection_module_struct *ndpi_struct, #endif ndpi_lru_add_to_cache(ndpi_struct->stun_cache, key, NDPI_PROTOCOL_HANGOUT_DUO); + if(ndpi_struct->ndpi_notify_lru_add_handler_ptr) + ndpi_struct->ndpi_notify_lru_add_handler_ptr(ndpi_hangout_cache, key, NDPI_PROTOCOL_HANGOUT_DUO); } ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HANGOUT_DUO, diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c index 87d090daf..703b46be7 100644 --- a/src/lib/protocols/stun.c +++ b/src/lib/protocols/stun.c @@ -88,7 +88,12 @@ void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *ndpi_stru #endif ndpi_lru_add_to_cache(ndpi_struct->stun_cache, key, app_proto); + if(ndpi_struct->ndpi_notify_lru_add_handler_ptr) + ndpi_struct->ndpi_notify_lru_add_handler_ptr(ndpi_stun_cache, key, app_proto); + ndpi_lru_add_to_cache(ndpi_struct->stun_cache, key_rev, app_proto); + if(ndpi_struct->ndpi_notify_lru_add_handler_ptr) + ndpi_struct->ndpi_notify_lru_add_handler_ptr(ndpi_stun_cache, key_rev, app_proto); } } } -- cgit v1.2.3