aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/Makefile.am2
-rw-r--r--src/include/ndpi_api.h6
-rw-r--r--src/include/ndpi_typedefs.h6
3 files changed, 12 insertions, 2 deletions
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 6eeca93b4..47fcbd224 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -1,4 +1,4 @@
-library_includedir=$(includedir)/libndpi-@VERSION@/libndpi
+plibrary_includedir=$(includedir)/libndpi-@VERSION@/libndpi
library_include_HEADERS = ndpi_api.h \
ndpi_define.h \
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h
index e57f3a568..e09c91c8e 100644
--- a/src/include/ndpi_api.h
+++ b/src/include/ndpi_api.h
@@ -756,6 +756,12 @@ extern "C" {
u_int ndpi_get_ndpi_num_custom_protocols(struct ndpi_detection_module_struct *ndpi_mod);
u_int ndpi_get_ndpi_detection_module_size();
void ndpi_set_log_level(struct ndpi_detection_module_struct *ndpi_mod, u_int l);
+
+ /* LRU cache */
+ struct ndpi_lru_cache* ndpi_lru_cache_init(u_int32_t num_entries);
+ 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 clean_key_when_found);
+ void ndpi_lru_add_to_cache(struct ndpi_lru_cache *c, u_int32_t key);
/**
* Add a string to match to an automata
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index 34d308e2e..cf1af8bc3 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -367,6 +367,10 @@ typedef enum {
HTTP_METHOD_CONNECT
} ndpi_http_method;
+struct ndpi_lru_cache {
+ u_int32_t num_entries, *entries;
+};
+
struct ndpi_id_struct {
/**
detected_protocol_bitmask:
@@ -997,7 +1001,7 @@ struct ndpi_detection_module_struct {
int bt_ann_len;
/* NDPI_PROTOCOL_OOKLA */
- void *ookla_cache;
+ struct ndpi_lru_cache *ookla_cache;
/* NDPI_PROTOCOL_TINC */
struct cache *tinc_cache;