Sizes of LRU caches are now configurable

0 as size value disable the cache.

The diffs in unit tests are due to the fact that some lookups are
performed before the first insert: before this change these lookups
weren't counted because the cache was not yet initialized, now they are.
This commit is contained in:
Nardi Ivan
2022-09-23 18:33:48 +02:00
committed by Toni
parent 83de3e4716
commit 1f345b311f
133 changed files with 345 additions and 232 deletions
+7
View File
@@ -1005,6 +1005,13 @@ extern "C" {
lru_cache_type cache_type,
struct ndpi_lru_cache_stats *stats);
int ndpi_get_lru_cache_size(struct ndpi_detection_module_struct *ndpi_struct,
lru_cache_type cache_type,
u_int32_t *num_entries);
int ndpi_set_lru_cache_size(struct ndpi_detection_module_struct *ndpi_struct,
lru_cache_type cache_type,
u_int32_t num_entries);
int ndpi_set_opportunistic_tls(struct ndpi_detection_module_struct *ndpi_struct,
u_int16_t proto, int value);
int ndpi_get_opportunistic_tls(struct ndpi_detection_module_struct *ndpi_struct,