diff options
author | emanuele-f <black.silver@hotmail.it> | 2016-04-20 15:36:44 +0200 |
---|---|---|
committer | emanuele-f <black.silver@hotmail.it> | 2016-04-20 15:36:44 +0200 |
commit | 5386aede36b8abdd55a60a302913436859448377 (patch) | |
tree | de28b52d862af04f20c17a00d2046d308a2dc245 /src/include | |
parent | 4e1317cd0f94f7238ed28c2ba130308c5034874f (diff) |
Integrate root flows free and little changes
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ndpi_util.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/include/ndpi_util.h b/src/include/ndpi_util.h index a23c5a0da..44f7be03d 100644 --- a/src/include/ndpi_util.h +++ b/src/include/ndpi_util.h @@ -24,13 +24,13 @@ /** * This module contains routines to help setup a simple nDPI program. - * + * * If you concern about performance or have to integrate nDPI in your * application, you could need to reimplement them yourself. - * + * * WARNING: this API is unstable! Use it at your own risk! */ - + #ifndef __NDPI_UTIL_H__ #define __NDPI_UTIL_H__ @@ -93,15 +93,15 @@ typedef void (*ndpi_workflow_callback_ptr) (struct ndpi_workflow *, struct ndpi_ typedef struct ndpi_workflow { u_int64_t last_time; - + struct ndpi_workflow_prefs prefs; struct ndpi_stats stats; - + ndpi_workflow_callback_ptr __flow_detected_callback; void * __flow_detected_udata; ndpi_workflow_callback_ptr __flow_giveup_callback; void * __flow_giveup_udata; - + /* outside referencies */ pcap_t *pcap_handle; @@ -116,14 +116,20 @@ struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * pre void * (*malloc_wrapper)(size_t), void (*free_wrapper)(void*), ndpi_debug_function_ptr ndpi_debug_printf); - + void ndpi_workflow_free(struct ndpi_workflow * workflow); +/** Free flow_info ndpi support structures but not the flow_info itself + * + * TODO remove! Half freeing things is bad! + */ +void ndpi_free_flow_info_half(struct ndpi_flow_info *flow); + /** Process a @packet and update the @workflow. */ void ndpi_workflow_process_packet (struct ndpi_workflow * workflow, const struct pcap_pkthdr *header, const u_char *packet); - + /* flow callbacks: ndpi_flow_info will be freed right after */ static inline void ndpi_workflow_set_flow_detected_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, |