From 56d87186f7e6d7dba042961be86d1b4b5ae9f2e3 Mon Sep 17 00:00:00 2001 From: Nardi Ivan Date: Sun, 14 Jun 2020 14:42:39 +0200 Subject: Fix compilation with --enable-debug-messages flag NDPI_LOG* macros dereference ndpi_detection_module_struct object which is private to ndpi library (via NDPI_LIB_COMPILATION define). So we can't use them outside the library itself, i.e. in ndpiReader code Therefore, in files in example/, convert all (rare) uses of NDPI_LOG* macros to a new very simple macro, private to ndpiReader program. If necessary, such macro may be improved. According to a comment in ndpi_define.h, each dissector must define its own NDPI_CURRENT_PROTO macro before including ndpi_api.h file --- src/lib/protocols/modbus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/lib/protocols/modbus.c') diff --git a/src/lib/protocols/modbus.c b/src/lib/protocols/modbus.c index 2a6dd2a49..c98c71298 100644 --- a/src/lib/protocols/modbus.c +++ b/src/lib/protocols/modbus.c @@ -24,9 +24,8 @@ #include "ndpi_protocol_ids.h" -#include "ndpi_api.h" - #define NDPI_CURRENT_PROTO NDPI_PROTOCOL_MODBUS +#include "ndpi_api.h" void ndpi_search_modbus_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { -- cgit v1.2.3