Initial work towards traffic classification
This commit is contained in:
@@ -891,6 +891,17 @@ extern "C" {
|
||||
ndpi_string *key, float *value);
|
||||
int ndpi_deserialize_end_of_record(ndpi_deserializer *deserializer);
|
||||
|
||||
/* Data analysis */
|
||||
struct ndpi_analyze_struct* ndpi_init_data_analysis(u_int16_t _max_series_len);
|
||||
void ndpi_free_data_analysis(struct ndpi_analyze_struct *d);
|
||||
void ndpi_data_add_value(struct ndpi_analyze_struct *s, const u_int32_t value);
|
||||
|
||||
float ndpi_data_average(struct ndpi_analyze_struct *s);
|
||||
float ndpi_data_window_average(struct ndpi_analyze_struct *s);
|
||||
|
||||
float ndpi_entropy(struct ndpi_analyze_struct *s);
|
||||
|
||||
void ndpi_data_print_window_values(struct ndpi_analyze_struct *s); /* debug */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1363,4 +1363,16 @@ typedef struct {
|
||||
u_int16_t str_len;
|
||||
} ndpi_string;
|
||||
|
||||
/* **************************************** */
|
||||
|
||||
struct ndpi_analyze_struct {
|
||||
u_int32_t *values;
|
||||
u_int32_t sum_total, num_data_entries, next_value_insert_index;
|
||||
u_int16_t num_values_array_len /* lenght of the values array */;
|
||||
};
|
||||
|
||||
#define DEFAULT_SERIES_LEN 64
|
||||
#define MAX_SERIES_LEN 512
|
||||
#define MIN_SERIES_LEN 8
|
||||
|
||||
#endif /* __NDPI_TYPEDEFS_H__ */
|
||||
|
||||
Reference in New Issue
Block a user