From c0b7bdacbc15c1cf5eaeb9faefc088aa698e94ba Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 21 Mar 2022 15:56:01 +0100 Subject: Reworked nDPIsrvd.h C-API. * nDPIsrvd.h: Provide nDPId thread storage. * nDPIsrvd.py: Fixed instance cleanup bug. * nDPIsrvd.h: Support for instance/thread user data and cleanup callback. * nDPIsrvd.h: Most recent flow time stored in thread ht instead of instance ht. * nDPId: Moved flow logger out the memory profilier into SIGUSR1 signal handling. * nDPId: Added signal fd to be usable within epoll's event handling (live-capture only!) * nDPId: Added information about ZLib compressions to daemon status/shutdown events. Signed-off-by: Toni Uhlig --- examples/c-collectd/c-collectd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples/c-collectd/c-collectd.c') diff --git a/examples/c-collectd/c-collectd.c b/examples/c-collectd/c-collectd.c index c16a0847d..aef84239a 100644 --- a/examples/c-collectd/c-collectd.c +++ b/examples/c-collectd/c-collectd.c @@ -440,10 +440,12 @@ static uint64_t get_total_flow_bytes(struct nDPIsrvd_socket * const sock) static enum nDPIsrvd_callback_return captured_json_callback(struct nDPIsrvd_socket * const sock, struct nDPIsrvd_instance * const instance, + struct nDPIsrvd_thread_data * const thread_data, struct nDPIsrvd_flow * const flow) { (void)sock; (void)instance; + (void)thread_data; (void)flow; struct nDPIsrvd_json_token const * const flow_event_name = TOKEN_GET_SZ(sock, "flow_event_name"); @@ -682,7 +684,7 @@ int main(int argc, char ** argv) openlog("nDPIsrvd-collectd", LOG_CONS, LOG_DAEMON); - struct nDPIsrvd_socket * sock = nDPIsrvd_socket_init(0, 0, captured_json_callback, NULL); + struct nDPIsrvd_socket * sock = nDPIsrvd_socket_init(0, 0, 0, 0, captured_json_callback, NULL, NULL); if (sock == NULL) { LOG(LOG_DAEMON | LOG_ERR, "%s", "nDPIsrvd socket memory allocation failed!"); -- cgit v1.2.3