From 51f5fc714015c312622ed4ee1820518d26edee65 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 25 Mar 2024 08:15:19 +0100 Subject: Added support for roaring bitmap v3 (#2355) * Integrated RoaringBitmap v3 * Renamed ndpi_bitmap64 ro ndpi_bitmap64_fuse * Fixes to ndpi_bitmap for new roaring library * Fixes for bitmap serialization * Fixed format * Warning fix * Conversion fix * Warning fix * Added check for roaring v3 support * Updated file name * Updated path * Uses clang-9 (instead of clang-7) for builds * Fixed fuzz_ds_bitmap64_fuse * Fixes nDPI printf handling * Disabled printf * Yet another printf fix * Cleaup * Fx for compiling on older platforms * Fixes for old compilers * Initialization changes * Added compiler check * Fixes for old compilers * Inline function is not static inline * Added missing include --- src/lib/ndpi_domain_classify.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/lib/ndpi_domain_classify.c') diff --git a/src/lib/ndpi_domain_classify.c b/src/lib/ndpi_domain_classify.c index 812412080..fce10d072 100644 --- a/src/lib/ndpi_domain_classify.c +++ b/src/lib/ndpi_domain_classify.c @@ -57,7 +57,7 @@ void ndpi_domain_classify_free(ndpi_domain_classify *s) { for(i=0; iclasses[i].domains != NULL) { - ndpi_bitmap64_free(s->classes[i].domains); + ndpi_bitmap64_fuse_free(s->classes[i].domains); } else break; } @@ -75,7 +75,7 @@ u_int32_t ndpi_domain_classify_size(ndpi_domain_classify *s) { for(i=0; iclasses[i].domains != NULL) { - tot_len += ndpi_bitmap64_size(s->classes[i].domains); + tot_len += ndpi_bitmap64_fuse_size(s->classes[i].domains); } else break; } @@ -111,7 +111,7 @@ bool ndpi_domain_classify_add(ndpi_domain_classify *s, break; } else if(s->classes[i].class_id == 0) { s->classes[i].class_id = class_id; - s->classes[i].domains = ndpi_bitmap64_alloc(); + s->classes[i].domains = ndpi_bitmap64_fuse_alloc(); if(!s->classes[i].domains) s->classes[i].class_id = 0; @@ -125,7 +125,7 @@ bool ndpi_domain_classify_add(ndpi_domain_classify *s, hash = ndpi_quick_hash64(domain, strlen(domain)); - return(ndpi_bitmap64_set(s->classes[i].domains, hash)); + return(ndpi_bitmap64_fuse_set(s->classes[i].domains, hash)); } /* ********************************************************** */ @@ -146,7 +146,7 @@ u_int32_t ndpi_domain_classify_add_domains(ndpi_domain_classify *s, break; } else if(s->classes[i].class_id == 0) { s->classes[i].class_id = class_id; - s->classes[i].domains = ndpi_bitmap64_alloc(); + s->classes[i].domains = ndpi_bitmap64_fuse_alloc(); if(!s->classes[i].domains) s->classes[i].class_id = 0; break; @@ -179,7 +179,7 @@ u_int32_t ndpi_domain_classify_add_domains(ndpi_domain_classify *s, hash = ndpi_quick_hash64(line, strlen(line)); - if(ndpi_bitmap64_set(s->classes[i].domains, hash)) + if(ndpi_bitmap64_fuse_set(s->classes[i].domains, hash)) num_added++; } @@ -198,7 +198,7 @@ bool ndpi_domain_classify_finalize(ndpi_domain_classify *s) { for(i=0; iclasses[i].class_id != 0) { - ndpi_bitmap64_compress(s->classes[i].domains); + ndpi_bitmap64_fuse_compress(s->classes[i].domains); } } return(true); @@ -258,7 +258,7 @@ const char* ndpi_domain_classify_longest_prefix(ndpi_domain_classify *s, for(i=0; iclasses[i].class_id != 0) { - if(ndpi_bitmap64_isset(s->classes[i].domains, hash)) { + if(ndpi_bitmap64_fuse_isset(s->classes[i].domains, hash)) { #ifdef DEBUG_CONTAINS printf("[contains] %s = %d [%llu]\n", hostname, s->classes[i].class_id, hash); -- cgit v1.2.3