From 231748bb0e6f274eb91824bf1e3b1693370ec0de Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Fri, 15 Mar 2024 10:12:51 +0100 Subject: LRU cache: move to 64 bits long keys (#2346) Tradeoff between key comparison efficiency (i.e. no `memcmp`) and key length. At least in the ipv4 cases, we have no more different entries with the same key. --- src/include/ndpi_api.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/include/ndpi_api.h') diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index 33a2c0e84..db1e12ebd 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -1058,9 +1058,9 @@ extern "C" { /* LRU cache */ struct ndpi_lru_cache* ndpi_lru_cache_init(u_int32_t num_entries, u_int32_t ttl, int shared); void ndpi_lru_free_cache(struct ndpi_lru_cache *c); - u_int8_t ndpi_lru_find_cache(struct ndpi_lru_cache *c, u_int32_t key, + u_int8_t ndpi_lru_find_cache(struct ndpi_lru_cache *c, u_int64_t key, u_int16_t *value, u_int8_t clean_key_when_found, u_int32_t now_sec); - void ndpi_lru_add_to_cache(struct ndpi_lru_cache *c, u_int32_t key, u_int16_t value, u_int32_t now_sec); + void ndpi_lru_add_to_cache(struct ndpi_lru_cache *c, u_int64_t key, u_int16_t value, u_int32_t now_sec); void ndpi_lru_get_stats(struct ndpi_lru_cache *c, struct ndpi_lru_cache_stats *stats); int ndpi_get_lru_cache_stats(struct ndpi_global_context *g_ctx, -- cgit v1.2.3