aboutsummaryrefslogtreecommitdiff
path: root/example/reader_util.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-12-03 09:03:56 +0100
committerToni Uhlig <matzeton@googlemail.com>2023-12-14 00:19:35 +0100
commit709e460c896861f413baa5189d46b15ba06c2673 (patch)
tree71ef4908d4778ba2f22bf83bd3f1506698779e71 /example/reader_util.h
parentef62391dba4814ab840539406f276685ba8535f1 (diff)
Add realtime protocol output to `ndpiReader`.add/output-realtime-protocols
* support for using a new flow callback invoked before the flow memory is free'd * minor fixes * Win32 gmtime fix Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'example/reader_util.h')
-rw-r--r--example/reader_util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/example/reader_util.h b/example/reader_util.h
index 9c55355e6..b0e6a88c1 100644
--- a/example/reader_util.h
+++ b/example/reader_util.h
@@ -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 */