aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2024-06-14 20:20:58 +0200
committerIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-06-17 10:19:55 +0200
commit526cf6f2919398e1c9c5698b1b5783f18ed41fff (patch)
tree52efef17aefb9aa01ca702b53b4831a199b17b5e /src/lib/ndpi_main.c
parent2bedd14aae1294528bafbe03b9307a4eacb09bcb (diff)
Zoom: remove "stun_zoom" LRU cache
Since 070a0908b we are able to detect P2P calls directly from the packet content, without any correlation among flows
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index fe8c7086c..c0cb12fa8 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -3250,8 +3250,6 @@ void ndpi_global_deinit(struct ndpi_global_context *g_ctx) {
ndpi_lru_free_cache(g_ctx->bittorrent_global_cache);
if(g_ctx->stun_global_cache)
ndpi_lru_free_cache(g_ctx->stun_global_cache);
- if(g_ctx->stun_zoom_global_cache)
- ndpi_lru_free_cache(g_ctx->stun_zoom_global_cache);
if(g_ctx->tls_cert_global_cache)
ndpi_lru_free_cache(g_ctx->tls_cert_global_cache);
if(g_ctx->mining_global_cache)
@@ -3823,22 +3821,6 @@ int ndpi_finalize_initialization(struct ndpi_detection_module_struct *ndpi_str)
ndpi_str->cfg.msteams_cache_num_entries);
}
}
- if(ndpi_str->cfg.stun_zoom_cache_num_entries > 0) {
- if(ndpi_str->cfg.stun_zoom_cache_scope == NDPI_LRUCACHE_SCOPE_GLOBAL) {
- if(!ndpi_str->g_ctx->stun_zoom_global_cache) {
- ndpi_str->g_ctx->stun_zoom_global_cache = ndpi_lru_cache_init(ndpi_str->cfg.stun_zoom_cache_num_entries,
- ndpi_str->cfg.stun_zoom_cache_ttl, 1);
- }
- ndpi_str->stun_zoom_cache = ndpi_str->g_ctx->stun_zoom_global_cache;
- } else {
- ndpi_str->stun_zoom_cache = ndpi_lru_cache_init(ndpi_str->cfg.stun_zoom_cache_num_entries,
- ndpi_str->cfg.stun_zoom_cache_ttl, 0);
- }
- if(!ndpi_str->stun_zoom_cache) {
- NDPI_LOG_ERR(ndpi_str, "Error allocating lru cache (num_entries %u)\n",
- ndpi_str->cfg.stun_zoom_cache_num_entries);
- }
- }
ndpi_automa * const automa[] = { &ndpi_str->host_automa,
&ndpi_str->tls_cert_subject_automa,
@@ -4165,10 +4147,6 @@ void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_str) {
ndpi_str->stun_cache)
ndpi_lru_free_cache(ndpi_str->stun_cache);
- if(!ndpi_str->cfg.stun_zoom_cache_scope &&
- ndpi_str->stun_zoom_cache)
- ndpi_lru_free_cache(ndpi_str->stun_zoom_cache);
-
if(!ndpi_str->cfg.tls_cert_cache_scope &&
ndpi_str->tls_cert_cache)
ndpi_lru_free_cache(ndpi_str->tls_cert_cache);
@@ -7703,13 +7681,6 @@ ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_st
ret.app_protocol = flow->detected_protocol_stack[0];
}
- /* Does it looks like Zoom (via STUN)? */
- if(ret.app_protocol == NDPI_PROTOCOL_UNKNOWN &&
- stun_search_into_zoom_cache(ndpi_str, flow)) {
- ndpi_set_detected_protocol(ndpi_str, flow, NDPI_PROTOCOL_ZOOM, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI_PARTIAL_CACHE);
- ret.app_protocol = flow->detected_protocol_stack[0];
- }
-
/* Does it looks like Ookla? */
if(ret.app_protocol == NDPI_PROTOCOL_UNKNOWN &&
ntohs(flow->s_port) == 8080 && ookla_search_into_cache(ndpi_str, flow)) {
@@ -10186,9 +10157,6 @@ int ndpi_get_lru_cache_stats(struct ndpi_global_context *g_ctx,
case NDPI_LRUCACHE_MSTEAMS:
ndpi_lru_get_stats(is_local ? ndpi_struct->msteams_cache : g_ctx->msteams_global_cache, stats);
return 0;
- case NDPI_LRUCACHE_STUN_ZOOM:
- ndpi_lru_get_stats(is_local ? ndpi_struct->stun_zoom_cache : g_ctx->stun_zoom_global_cache, stats);
- return 0;
default:
return -1;
}
@@ -11233,10 +11201,6 @@ static const struct cfg_param {
{ NULL, "lru.msteams.ttl", "60", "0", "16777215", CFG_PARAM_INT, __OFF(msteams_cache_ttl), NULL },
{ NULL, "lru.msteams.scope", "0", "0", "1", CFG_PARAM_INT, __OFF(msteams_cache_scope), clbk_only_with_global_ctx },
- { NULL, "lru.stun_zoom.size", "1024", "0", "16777215", CFG_PARAM_INT, __OFF(stun_zoom_cache_num_entries), NULL },
- { NULL, "lru.stun_zoom.ttl", "60", "0", "16777215", CFG_PARAM_INT, __OFF(stun_zoom_cache_ttl), NULL },
- { NULL, "lru.stun_zoom.scope", "0", "0", "1", CFG_PARAM_INT, __OFF(stun_zoom_cache_scope), clbk_only_with_global_ctx },
-
{ NULL, NULL, NULL, NULL, NULL, 0, -1, NULL },
};