From 29be01ef3a111fe467eb59876864574c168560df Mon Sep 17 00:00:00 2001 From: Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> Date: Tue, 17 Jan 2023 08:31:59 +0100 Subject: Add some fuzzers to test algorithms and data structures (#1852) Fix some issues found with these new fuzzers --- src/include/ndpi_api.h | 5 +++-- src/include/ndpi_typedefs.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index 5214c054f..f1a64f26b 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -1123,6 +1123,7 @@ extern "C" { size_t ndpi_patricia_walk_tree_inorder(ndpi_patricia_tree_t *patricia, ndpi_void_fn3_t func, void *data); size_t ndpi_patricia_walk_inorder(ndpi_patricia_node_t *node, ndpi_void_fn3_t func, void *data); void ndpi_patricia_remove(ndpi_patricia_tree_t *patricia, ndpi_patricia_node_t *node); + void ndpi_patricia_process (ndpi_patricia_tree_t *patricia, ndpi_void_fn2_t func); void ndpi_patricia_set_node_u64(ndpi_patricia_node_t *node, u_int64_t value); u_int64_t ndpi_patricia_get_node_u64(ndpi_patricia_node_t *node); @@ -1677,13 +1678,13 @@ extern "C" { /* ******************************* */ int ndpi_ses_init(struct ndpi_ses_struct *ses, double alpha, float significance); - int ndpi_ses_add_value(struct ndpi_ses_struct *ses, const u_int64_t _value, double *forecast, double *confidence_band); + int ndpi_ses_add_value(struct ndpi_ses_struct *ses, const double _value, double *forecast, double *confidence_band); void ndpi_ses_fitting(double *values, u_int32_t num_values, float *ret_alpha); /* ******************************* */ int ndpi_des_init(struct ndpi_des_struct *des, double alpha, double beta, float significance); - int ndpi_des_add_value(struct ndpi_des_struct *des, const u_int64_t _value, double *forecast, double *confidence_band); + int ndpi_des_add_value(struct ndpi_des_struct *des, const double _value, double *forecast, double *confidence_band); void ndpi_des_fitting(double *values, u_int32_t num_values, float *ret_alpha, float *ret_beta); /* ******************************* */ diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 949db82a7..022c21ce0 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -1787,6 +1787,8 @@ enum ndpi_bin_family { ndpi_bin_family16, ndpi_bin_family32, ndpi_bin_family64, + + kMaxValue = ndpi_bin_family64, /* To ease fuzzing */ }; struct ndpi_bin { -- cgit v1.2.3