Added ndpi_bin_XXX API
Added packet lenght distribution bins
This commit is contained in:
@@ -1064,6 +1064,13 @@ extern "C" {
|
||||
|
||||
/* Get cardinality estimation */
|
||||
double ndpi_hll_count(struct ndpi_hll *hll);
|
||||
|
||||
/* ******************************* */
|
||||
|
||||
int ndpi_init_bin(struct ndpi_bin *b, enum ndpi_bin_family f, u_int8_t num_bins);
|
||||
void ndpi_free_bin(struct ndpi_bin *b);
|
||||
void ndpi_inc_bin(struct ndpi_bin *b, u_int8_t slot_id);
|
||||
void ndpi_normalize_bin(struct ndpi_bin *b);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1498,4 +1498,25 @@ struct ndpi_hll {
|
||||
u_int8_t *registers;
|
||||
};
|
||||
|
||||
/* **************************************** */
|
||||
|
||||
enum ndpi_bin_family {
|
||||
ndpi_bin_family8,
|
||||
ndpi_bin_family16,
|
||||
ndpi_bin_family32
|
||||
};
|
||||
|
||||
struct ndpi_bin {
|
||||
u_int8_t num_bins;
|
||||
enum ndpi_bin_family family;
|
||||
u_int32_t num_incs;
|
||||
|
||||
union {
|
||||
u_int8_t *bins8; /* num_bins bins */
|
||||
u_int16_t *bins16; /* num_bins bins */
|
||||
u_int32_t *bins32; /* num_bins bins */
|
||||
} u;
|
||||
};
|
||||
|
||||
|
||||
#endif /* __NDPI_TYPEDEFS_H__ */
|
||||
|
||||
Reference in New Issue
Block a user