diff options
author | Luca Deri <deri@ntop.org> | 2021-09-26 22:55:15 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2021-09-26 22:55:15 +0200 |
commit | 1efabef4cfce64a373f014ee43bab371a82f7e87 (patch) | |
tree | 5bf0f85b7ff9c0d0f652192e3f5fba9391925f9b /src/include | |
parent | c40cf4e0ec295dc707e71f1e3adbf0481035af06 (diff) |
Added API for handling compressed bitmaps
ndpi_bitmap* ndpi_bitmap_alloc();
void ndpi_bitmap_free(ndpi_bitmap* b);
u_int64_t ndpi_bitmap_cardinality(ndpi_bitmap* b);
void ndpi_bitmap_set(ndpi_bitmap* b, u_int32_t value);
void ndpi_bitmap_unset(ndpi_bitmap* b, u_int32_t value);
bool ndpi_bitmap_isset(ndpi_bitmap* b, u_int32_t value);
void ndpi_bitmap_clear(ndpi_bitmap* b);
size_t ndpi_bitmap_serialize(ndpi_bitmap* b, char **buf);
ndpi_bitmap* ndpi_bitmap_deserialize(char *buf);
based on https://github.com/RoaringBitmap/CRoaring
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ndpi_api.h.in | 12 | ||||
-rw-r--r-- | src/include/ndpi_typedefs.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/include/ndpi_api.h.in b/src/include/ndpi_api.h.in index 064b4f27d..0af2113fe 100644 --- a/src/include/ndpi_api.h.in +++ b/src/include/ndpi_api.h.in @@ -1610,6 +1610,18 @@ extern "C" { char* ndpi_get_flow_name(struct ndpi_flow_struct *flow); /* ******************************* */ + + ndpi_bitmap* ndpi_bitmap_alloc(); + void ndpi_bitmap_free(ndpi_bitmap* b); + u_int64_t ndpi_bitmap_cardinality(ndpi_bitmap* b); + void ndpi_bitmap_set(ndpi_bitmap* b, u_int32_t value); + void ndpi_bitmap_unset(ndpi_bitmap* b, u_int32_t value); + bool ndpi_bitmap_isset(ndpi_bitmap* b, u_int32_t value); + void ndpi_bitmap_clear(ndpi_bitmap* b); + size_t ndpi_bitmap_serialize(ndpi_bitmap* b, char **buf); + ndpi_bitmap* ndpi_bitmap_deserialize(char *buf); + + /* ******************************* */ #ifdef __cplusplus } diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 6181c21e8..be66f376a 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -1704,4 +1704,8 @@ typedef int (*ndpi_custom_dga_predict_fctn)(const char* domain, int domain_lengt /* **************************************** */ +typedef void ndpi_bitmap; + +/* **************************************** */ + #endif /* __NDPI_TYPEDEFS_H__ */ |