From 396e72f4fe79f9579f36a0ec963e12c29fddb0d1 Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Mon, 27 Aug 2018 17:23:53 +0200 Subject: Move the configure include file inclusion and code depending on it in code protected by the NDPI_LIB_COMPILATION define, this should avoid it polluting the environment when including this file from ntopng. --- src/include/ndpi_typedefs.h | 16 ++++++++++++++++ src/lib/ndpi_main.c | 11 ----------- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index a3ed39c2d..8a2aec2c5 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -854,6 +854,22 @@ typedef struct ndpi_proto { #ifdef NDPI_LIB_COMPILATION +/* Needed to have access to HAVE_* defines */ +#include "ndpi_config.h" + +#ifdef HAVE_HYPERSCAN +struct hs_list { + char *expression; + unsigned int id; + struct hs_list *next; +}; + +struct hs { + hs_database_t *database; + hs_scratch_t *scratch; +}; +#endif + struct ndpi_detection_module_struct { NDPI_PROTOCOL_BITMASK detection_bitmask; NDPI_PROTOCOL_BITMASK generic_http_packet_bitmask; diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 2a51316fa..b8e22abe6 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -49,17 +49,6 @@ #ifdef HAVE_HYPERSCAN #include - -struct hs_list { - char *expression; - unsigned int id; - struct hs_list *next; -}; - -struct hs { - hs_database_t *database; - hs_scratch_t *scratch; -}; #endif #define NDPI_CONST_GENERIC_PROTOCOL_NAME "GenericProtocol" -- cgit v1.2.3