diff options
author | Luca Deri <deri@ntop.org> | 2020-07-15 10:30:45 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-07-15 10:30:45 +0200 |
commit | 9f3e3e8456f204edfc2d626b6473bb2278a1b9cb (patch) | |
tree | 504a68a1dedc607c76ef44277b74638df935ed86 /src/lib/third_party | |
parent | 91d132ea3dd99e10012916f1a1ededad2e0eefab (diff) |
Add ndpi_hll_reset() API call
Fixes bug in ndpi_data_window_average() with zero points
Diffstat (limited to 'src/lib/third_party')
-rw-r--r-- | src/lib/third_party/src/hll/hll.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/third_party/src/hll/hll.c b/src/lib/third_party/src/hll/hll.c index 07d33f6dd..f8cd817db 100644 --- a/src/lib/third_party/src/hll/hll.c +++ b/src/lib/third_party/src/hll/hll.c @@ -67,6 +67,10 @@ void hll_destroy(struct ndpi_hll *hll) { hll->registers = NULL; } +void hll_reset(struct ndpi_hll *hll) { + memset(hll->registers, 0, hll->size); +} + static __inline void _hll_add_hash(struct ndpi_hll *hll, u_int32_t hash) { u_int32_t index = hash >> (32 - hll->bits); u_int8_t rank = _hll_rank(hash, hll->bits); |