aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorToni <matzeton@googlemail.com>2024-11-11 15:17:33 +0100
committerGitHub <noreply@github.com>2024-11-11 15:17:33 +0100
commitccbbcdf2834c84ab6a379c19dab7a4b7636fd412 (patch)
tree7982c4f50c7c845a051161f2ff8e4db44887a80d /src
parent35ef56cc2467e907fa1827a4e8058893dea0b8a7 (diff)
Unify ndpi debug logging to always use a u16 protocol id (#2613)
* fixes SonarCloud complaint Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_replace_printf.h2
-rw-r--r--src/include/ndpi_typedefs.h2
-rw-r--r--src/lib/ndpi_main.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/include/ndpi_replace_printf.h b/src/include/ndpi_replace_printf.h
index 73313386c..2dea4288c 100644
--- a/src/include/ndpi_replace_printf.h
+++ b/src/include/ndpi_replace_printf.h
@@ -50,7 +50,7 @@
#endif
-void ndpi_debug_printf(unsigned int proto, struct ndpi_detection_module_struct *ndpi_str, ndpi_log_level_t log_level,
+void ndpi_debug_printf(u_int16_t proto, struct ndpi_detection_module_struct *ndpi_str, ndpi_log_level_t log_level,
const char *file_name, const char *func_name, int line_number, const char *format, ...);
#endif
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index e60c88ded..b720bbe00 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -273,7 +273,7 @@ typedef struct ndpi_protocol_bitmask_struct {
struct ndpi_detection_module_struct;
/* NDPI_DEBUG_FUNCTION_PTR (cast) */
-typedef void (*ndpi_debug_function_ptr) (u_int32_t protocol, struct ndpi_detection_module_struct *module_struct,
+typedef void (*ndpi_debug_function_ptr) (u_int16_t protocol, struct ndpi_detection_module_struct *module_struct,
ndpi_log_level_t log_level, const char *file,
const char *func, unsigned line,
const char *format, ...);
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 700016378..f722cca0e 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -3158,7 +3158,7 @@ void set_ndpi_flow_free(void (*__ndpi_flow_free)(void *ptr)) {
}
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
-void ndpi_debug_printf(unsigned int proto, struct ndpi_detection_module_struct *ndpi_str, ndpi_log_level_t log_level,
+void ndpi_debug_printf(u_int16_t proto, struct ndpi_detection_module_struct *ndpi_str, ndpi_log_level_t log_level,
const char *file_name, const char *func_name, unsigned int line_number, const char *format, ...) {
va_list args;
#define MAX_STR_LEN 250