aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-08-31 08:47:16 +0200
committerLuca Deri <deri@ntop.org>2020-08-31 08:47:16 +0200
commit460ff3c7aba42d0e7b99a227e0cb846af296e4e0 (patch)
tree8f8cf5b66e98d0dd32802c0c52e1776c8bea9776 /src/lib/ndpi_main.c
parent029448759b4036f7c26444b5055ac3a2607de972 (diff)
Added (optional) notifier for LRU add
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index a84d650bc..efd8a18a5 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -1968,6 +1968,15 @@ static const char *categories[] = {
/* ******************************************************************** */
+#ifdef TEST_LRU_HANDLER
+void test_lru_handler(ndpi_lru_cache_type cache_type, u_int32_t proto, u_int32_t app_proto) {
+
+ printf("[test_lru_handler] %u / %u / %u\n", cache_type, proto, app_proto);
+}
+#endif
+
+/* ******************************************************************** */
+
struct ndpi_detection_module_struct *ndpi_init_detection_module(ndpi_init_prefs prefs) {
struct ndpi_detection_module_struct *ndpi_str = ndpi_malloc(sizeof(struct ndpi_detection_module_struct));
int i;
@@ -1982,6 +1991,10 @@ struct ndpi_detection_module_struct *ndpi_init_detection_module(ndpi_init_prefs
memset(ndpi_str, 0, sizeof(struct ndpi_detection_module_struct));
+#ifdef TEST_LRU_HANDLER
+ ndpi_str->ndpi_notify_lru_add_handler_ptr = test_lru_handler;
+#endif
+
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
set_ndpi_debug_function(ndpi_str, (ndpi_debug_function_ptr) ndpi_debug_printf);
NDPI_BITMASK_RESET(ndpi_str->debug_bitmask);