aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorToni <matzeton@googlemail.com>2023-09-26 23:10:57 +0200
committerGitHub <noreply@github.com>2023-09-26 23:10:57 +0200
commitef3adb98308f14628e64b918f739e472de00cfcf (patch)
treea4bfc6a5a4e5d419e7088e5176e724990ab033fb /example
parent725fcf4852f06e2f54469c2439d13169d5d68d09 (diff)
Added printf/fprintf replacement for some internal modules. (#1974)
* logging is instead redirected to `ndpi_debug_printf` Signed-off-by: lns <matzeton@googlemail.com> Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'example')
-rw-r--r--example/ndpiReader.c7
-rw-r--r--example/reader_util.c1
2 files changed, 5 insertions, 3 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 9f6643b57..711964695 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -40,6 +40,7 @@
#else
#include <unistd.h>
#include <netinet/in.h>
+#include <netinet/ip.h>
#include <sys/socket.h>
#include <sys/mman.h>
#endif
@@ -612,10 +613,10 @@ static void help(u_int long_help) {
NDPI_BITMASK_SET_ALL(all);
ndpi_set_protocol_detection_bitmask2(ndpi_info_mod, &all);
- ndpi_dump_protocols(ndpi_info_mod);
+ ndpi_dump_protocols(ndpi_info_mod, stdout);
printf("\n\nnDPI supported risks:\n");
- ndpi_dump_risks_score();
+ ndpi_dump_risks_score(stdout);
ndpi_exit_detection_module(ndpi_info_mod);
}
@@ -977,7 +978,7 @@ static void parseOptions(int argc, char **argv) {
switch (opt) {
case 'a':
- ndpi_generate_options(atoi(optarg));
+ ndpi_generate_options(atoi(optarg), stdout);
exit(0);
case 'A':
diff --git a/example/reader_util.c b/example/reader_util.c
index fff77f139..7f8408466 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -40,6 +40,7 @@
#else
#include <unistd.h>
#include <netinet/in.h>
+#include <netinet/ip.h>
#endif
#include "reader_util.h"