From c5ebd84fd80d75dfdbd93fceb3e2d70a54328a47 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Tue, 5 Sep 2023 00:21:16 +0200 Subject: Added ndpi_bitmap64 support --- src/include/ndpi_api.h | 16 +++++++++++++++- src/include/ndpi_typedefs.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index 82c7a307b..76ff9fadd 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -1801,11 +1801,12 @@ extern "C" { /* ******************************* */ u_int32_t ndpi_quick_hash(unsigned char *str, u_int str_len); + u_int64_t ndpi_quick_hash64(char *str, u_int str_len); u_int32_t ndpi_hash_string(char *str); u_int32_t ndpi_rev_hash_string(char *str); u_int32_t ndpi_hash_string_len(char *str, u_int len); u_int32_t ndpi_murmur_hash(char *str, u_int str_len); - + /* ******************************* */ int ndpi_des_init(struct ndpi_des_struct *des, double alpha, double beta, float significance); @@ -2029,6 +2030,19 @@ extern "C" { void ndpi_bitmap_iterator_free(ndpi_bitmap* b); bool ndpi_bitmap_iterator_next(ndpi_bitmap_iterator* i, u_int32_t *value); + /* ******************************* */ + + /* + Bitmap with 64 bit values based + on https://github.com/FastFilter/xor_singleheader/tree/master + */ + + ndpi_bitmap64* ndpi_bitmap64_alloc_size(u_int32_t size); + void ndpi_bitmap64_free(ndpi_bitmap64* b); + void ndpi_bitmap64_set(ndpi_bitmap64* b, u_int64_t value); + bool ndpi_bitmap64_isset(ndpi_bitmap64* b, u_int64_t value); + u_int32_t ndpi_bitmap64_size(ndpi_bitmap64 *b); + /* ******************************* */ /* Bloom-filter on steroids based on ndpi_bitmap diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 142eed0a2..db2e53a3f 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -1176,6 +1176,7 @@ typedef struct ndpi_proto { #define CUSTOM_CATEGORY_LABEL_LEN 32 typedef void ndpi_bitmap; +typedef void ndpi_bitmap64; typedef void ndpi_bitmap_iterator; typedef void ndpi_filter; -- cgit v1.2.3