You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.9 KiB

  1. From 91ac4e4beed953fc9d2185ca2e6813dde47e8d5a Mon Sep 17 00:00:00 2001
  2. From: Guido Falsi <mad@madpilot.net>
  3. Date: Mon, 27 Aug 2018 17:52:56 +0200
  4. Subject: [PATCH 1/9] Move the configure include file inclusion and code
  5. depending on it in code protected by the NDPI_LIB_COMPILATION define, this
  6. should avoid it polluting the environment when including this file from
  7. ntopng, version against stable branch.
  8. ---
  9. src/include/ndpi_typedefs.h | 15 ++++++++++-----
  10. src/lib/ndpi_main.c | 7 -------
  11. 2 files changed, 10 insertions(+), 12 deletions(-)
  12. diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
  13. index 6a61b44..386b217 100644
  14. --- a/src/include/ndpi_typedefs.h
  15. +++ b/src/include/ndpi_typedefs.h
  16. @@ -26,9 +26,6 @@
  17. #include "ndpi_define.h"
  18. -/* Needed to have access to HAVE_* defines */
  19. -#include "ndpi_config.h"
  20. -
  21. /* NDPI_LOG_LEVEL */
  22. typedef enum {
  23. NDPI_LOG_ERROR,
  24. @@ -854,7 +851,17 @@ typedef struct ndpi_proto {
  25. #define NUM_CUSTOM_CATEGORIES 5
  26. #define CUSTOM_CATEGORY_LABEL_LEN 32
  27. +#ifdef NDPI_LIB_COMPILATION
  28. +
  29. +/* Needed to have access to HAVE_* defines */
  30. +#include "ndpi_define.h"
  31. +
  32. #ifdef HAVE_HYPERSCAN
  33. +struct hs {
  34. + hs_database_t *database;
  35. + hs_scratch_t *scratch;
  36. +};
  37. +
  38. struct hs_list {
  39. char *expression;
  40. unsigned int id;
  41. @@ -862,8 +869,6 @@ struct hs_list {
  42. };
  43. #endif
  44. -#ifdef NDPI_LIB_COMPILATION
  45. -
  46. struct ndpi_detection_module_struct {
  47. NDPI_PROTOCOL_BITMASK detection_bitmask;
  48. NDPI_PROTOCOL_BITMASK generic_http_packet_bitmask;
  49. diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
  50. index b002126..8061aa1 100644
  51. --- a/src/lib/ndpi_main.c
  52. +++ b/src/lib/ndpi_main.c
  53. @@ -51,13 +51,6 @@
  54. #include <hs/hs.h>
  55. #endif
  56. -#ifdef HAVE_HYPERSCAN
  57. -struct hs {
  58. - hs_database_t *database;
  59. - hs_scratch_t *scratch;
  60. -};
  61. -#endif
  62. -
  63. #define NDPI_CONST_GENERIC_PROTOCOL_NAME "GenericProtocol"
  64. static int _ndpi_debug_callbacks = 0;
  65. --
  66. 2.19.1