diff options
author | Luca Deri <deri@ntop.org> | 2023-09-02 19:16:40 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2023-09-02 19:16:40 +0200 |
commit | 1d480c18e381f393bd25352c6140e9651f3e3a76 (patch) | |
tree | 9a9f9b28b301dc917de817330810cbda1ba0bd75 /src/include/ndpi_typedefs.h | |
parent | 854c2d80f1cf5c567a602ce25f8fd7e166bc4c2f (diff) |
Reworked domain classification based on binary filters
Diffstat (limited to 'src/include/ndpi_typedefs.h')
-rw-r--r-- | src/include/ndpi_typedefs.h | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 1106f7768..142eed0a2 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -1175,7 +1175,32 @@ typedef struct ndpi_proto { #define NUM_CUSTOM_CATEGORIES 5 #define CUSTOM_CATEGORY_LABEL_LEN 32 -typedef void ndpi_domain_classify; +typedef void ndpi_bitmap; +typedef void ndpi_bitmap_iterator; +typedef void ndpi_filter; + +/* Save memory limiting the key to 56 bit */ +#define SAVE_BINARY_BITMAP_MEMORY + +PACK_ON +struct ndpi_binary_bitmap_entry { +#ifdef SAVE_BINARY_BITMAP_MEMORY + u_int64_t value:56, category:8; +#else + u_int64_t value; + u_int8_t category; +#endif +} PACK_OFF; + +typedef struct { + u_int32_t num_allocated_entries, num_used_entries; + struct ndpi_binary_bitmap_entry *entries; + bool is_compressed; +} ndpi_binary_bitmap; + +typedef struct { + ndpi_binary_bitmap *bitmap; +} ndpi_domain_classify; #ifdef NDPI_LIB_COMPILATION @@ -2027,24 +2052,4 @@ typedef int (*ndpi_custom_dga_predict_fctn)(const char* domain, int domain_lengt /* **************************************** */ -typedef void ndpi_bitmap; -typedef void ndpi_bitmap_iterator; -typedef void ndpi_filter; - -#define MAX_NUM_NDPI_DOMAIN_CLASSIFICATIONS 16 - -PACK_ON -struct ndpi_binary_bitmap_entry { - u_int32_t value; - u_int8_t category; -} PACK_OFF; - -typedef struct { - u_int32_t num_allocated_entries, num_used_entries; - struct ndpi_binary_bitmap_entry *entries; - bool is_compressed; -} ndpi_binary_bitmap; - -/* **************************************** */ - #endif /* __NDPI_TYPEDEFS_H__ */ |