summaryrefslogtreecommitdiff
path: root/net-analyzer/pmacct/files/pmacct-1.7.4-nDPI-3.2.patch
blob: bcbdbc834cad1307d76e4986c21a2cab3f0bb24a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- a/configure.ac
+++ b/configure.ac
@@ -900,7 +900,7 @@
   [ case "$enableval" in
   yes)
     AC_MSG_RESULT(yes)
-    PKG_CHECK_MODULES([NDPI], [libndpi >= 2.4], [
+    PKG_CHECK_MODULES([NDPI], [libndpi >= 3.2], [
       SUPPORTS="${SUPPORTS} ndpi"
       USING_NDPI="yes"
 
--- a/src/ndpi/ndpi_util.c
+++ b/src/ndpi/ndpi_util.c
@@ -29,7 +29,8 @@
     
   NDPI_PROTOCOL_BITMASK all;
     
-  struct ndpi_detection_module_struct *module = ndpi_init_detection_module();
+  ndpi_init_prefs pm_ndpi_init_prefs = ndpi_no_prefs;
+  struct ndpi_detection_module_struct *module = ndpi_init_detection_module(pm_ndpi_init_prefs);
   struct pm_ndpi_workflow *workflow = ndpi_calloc(1, sizeof(struct pm_ndpi_workflow));
 
   log_notification_init(&log_notifications.ndpi_cache_full);
@@ -77,6 +78,8 @@
   NDPI_BITMASK_SET_ALL(all);
   ndpi_set_protocol_detection_bitmask2(workflow->ndpi_struct, &all);
 
+  ndpi_finalize_initalization(workflow->ndpi_struct);
+
   return workflow;
 }
 
--- a/src/ndpi/ndpi.c
+++ b/src/ndpi/ndpi.c
@@ -373,11 +373,7 @@
 
   if (flow->detection_completed || flow->tcp_finished) {
     if (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UNKNOWN)
-#ifdef WITH_NDPI26
-      flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow, workflow->prefs.protocol_guess);
-#else
-      flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow);
-#endif
+      flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow, 1, workflow->prefs.protocol_guess);
 
     if (workflow->prefs.protocol_guess) {
       if (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UNKNOWN && !flow->guess_completed) {