From 04f5c5196e790db8b8cc39e42c8645fb7f3dd141 Mon Sep 17 00:00:00 2001 From: Toni Date: Tue, 30 May 2023 08:27:37 +0200 Subject: Changed logging callback function sig. (#2000) * make user data available for any build config Signed-off-by: lns --- src/include/ndpi_api.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/include/ndpi_api.h') diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index 0a420accb..eac4bcd25 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -1942,6 +1942,25 @@ extern "C" { char *out, u_int out_len, u_int8_t use_json); + /* ******************************* */ + + /** + * Set user data which can later retrieved with `ndpi_get_user_data()`. + * + * @par ndpi_str = the struct created for the protocol detection + * @par user_data = user data pointer you want to retrieve later with `ndpi_get_user_data()` + * + */ + void ndpi_set_user_data(struct ndpi_detection_module_struct *ndpi_str, void *user_data); + + /** + * Get user data which was previously set with `ndpi_set_user_data()`. + * + * @return the user data pointer + * + */ + void *ndpi_get_user_data(struct ndpi_detection_module_struct *ndpi_str); + #ifdef __cplusplus } #endif -- cgit v1.2.3