Add realtime protocol output to ndpiReader. (#2197)
* support for using a new flow callback invoked before the flow memory is free'd * minor fixes Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -374,6 +374,9 @@ typedef struct ndpi_workflow {
|
||||
struct ndpi_workflow_prefs prefs;
|
||||
struct ndpi_stats stats;
|
||||
|
||||
ndpi_workflow_callback_ptr flow_callback;
|
||||
void * flow_callback_userdata;
|
||||
|
||||
/* outside referencies */
|
||||
pcap_t *pcap_handle;
|
||||
|
||||
@@ -408,6 +411,13 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
||||
const u_char *packet,
|
||||
ndpi_risk *flow_risk);
|
||||
|
||||
|
||||
/* Flow callback for completed flows, before the flow memory will be freed. */
|
||||
static inline void ndpi_workflow_set_flow_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * userdata) {
|
||||
workflow->flow_callback = callback;
|
||||
workflow->flow_callback_userdata = userdata;
|
||||
}
|
||||
|
||||
int ndpi_is_datalink_supported(int datalink_type);
|
||||
|
||||
/* compare two nodes in workflow */
|
||||
|
||||
Reference in New Issue
Block a user