bins: add support for 64bit bins (#1626)

This commit is contained in:
Ivan Nardi
2022-07-03 19:25:15 +02:00
committed by GitHub
parent 422d002542
commit b5fb2066cb
4 changed files with 58 additions and 7 deletions
+3 -3
View File
@@ -1661,9 +1661,9 @@ extern "C" {
int ndpi_init_bin(struct ndpi_bin *b, enum ndpi_bin_family f, u_int16_t num_bins);
void ndpi_free_bin(struct ndpi_bin *b);
struct ndpi_bin* ndpi_clone_bin(struct ndpi_bin *b);
void ndpi_inc_bin(struct ndpi_bin *b, u_int16_t slot_id, u_int32_t val);
void ndpi_set_bin(struct ndpi_bin *b, u_int16_t slot_id, u_int32_t value);
u_int32_t ndpi_get_bin_value(struct ndpi_bin *b, u_int16_t slot_id);
void ndpi_inc_bin(struct ndpi_bin *b, u_int16_t slot_id, u_int64_t val);
void ndpi_set_bin(struct ndpi_bin *b, u_int16_t slot_id, u_int64_t value);
u_int64_t ndpi_get_bin_value(struct ndpi_bin *b, u_int16_t slot_id);
void ndpi_reset_bin(struct ndpi_bin *b);
void ndpi_normalize_bin(struct ndpi_bin *b);
char* ndpi_print_bin(struct ndpi_bin *b, u_int8_t normalize_first, char *out_buf, u_int out_buf_len);
+3 -1
View File
@@ -1602,7 +1602,8 @@ struct ndpi_hll {
enum ndpi_bin_family {
ndpi_bin_family8,
ndpi_bin_family16,
ndpi_bin_family32
ndpi_bin_family32,
ndpi_bin_family64,
};
struct ndpi_bin {
@@ -1614,6 +1615,7 @@ struct ndpi_bin {
u_int8_t *bins8; /* num_bins bins */
u_int16_t *bins16; /* num_bins bins */
u_int32_t *bins32; /* num_bins bins */
u_int64_t *bins64; /* num_bins bins */
} u;
};