ndpi: updated to 2.8 2.8 Stable New Supported Protocols and Services * Added Modbus over TCP dissector Improvements * Wireshark Lua plugin compatibility with Wireshark 3 * Improved MDNS dissection * Improved HTTP response code handling * Full dissection of HTTP responses Fixes * Fixed false positive mining detection * Fixed invalid TCP DNS dissection * Releasing buffers upon realloc failures * ndpiReader: Prevents references after free * Endianness fixes * Fixed IPv6 HTTP traffic dissection * Fixed H.323 detection Other * Disabled ookla statistics which need to be improved * Support for custom protocol files of arbitrary length * Update radius.c to RFC2865diff -r1.5 -r1.6 pkgsrc/net/ndpi/Makefile
(adam)
@@ -1,32 +1,32 @@ | @@ -1,32 +1,32 @@ | |||
1 | # $NetBSD: Makefile,v 1.5 2018/10/18 16:24:29 adam Exp $ | 1 | # $NetBSD: Makefile,v 1.6 2019/07/12 09:30:34 adam Exp $ | |
2 | 2 | |||
3 | DISTNAME= nDPI-2.4 | 3 | DISTNAME= nDPI-2.8 | |
4 | PKGNAME= ${DISTNAME:tl} | 4 | PKGNAME= ${DISTNAME:tl} | |
5 | CATEGORIES= net | 5 | CATEGORIES= net | |
6 | MASTER_SITES= ${MASTER_SITE_GITHUB:=ntop/} | 6 | MASTER_SITES= ${MASTER_SITE_GITHUB:=ntop/} | |
7 | GITHUB_PROJECT= nDPI | 7 | GITHUB_PROJECT= nDPI | |
8 | 8 | |||
9 | MAINTAINER= adam@NetBSD.org | 9 | MAINTAINER= adam@NetBSD.org | |
10 | HOMEPAGE= https://www.ntop.org/ | 10 | HOMEPAGE= https://www.ntop.org/ | |
11 | COMMENT= Library for deep-packet inspection | 11 | COMMENT= Library for deep-packet inspection | |
12 | LICENSE= gnu-lgpl-v3 | 12 | LICENSE= gnu-lgpl-v3 | |
13 | 13 | |||
14 | USE_LANGUAGES= c c++ | 14 | USE_LANGUAGES= c c++ | |
15 | USE_LIBTOOL= yes | 15 | USE_LIBTOOL= yes | |
16 | USE_TOOLS+= autoconf automake gmake pkg-config | 16 | USE_TOOLS+= autoconf automake gmake pkg-config | |
17 | GNU_CONFIGURE= yes | 17 | GNU_CONFIGURE= yes | |
18 | PKGCONFIG_OVERRIDE= libndpi.pc.in | 18 | PKGCONFIG_OVERRIDE= libndpi.pc.in | |
19 | MAKE_ENV+= OS=${OPSYS} | 19 | MAKE_ENV+= OS=${OPSYS} | |
20 | 20 | |||
21 | # Portable types | 21 | # Portable types | |
22 | CFLAGS.SunOS+= -Du_int8_t=uint8_t | 22 | CFLAGS.SunOS+= -Du_int8_t=uint8_t | |
23 | CFLAGS.SunOS+= -Du_int16_t=uint16_t | 23 | CFLAGS.SunOS+= -Du_int16_t=uint16_t | |
24 | CFLAGS.SunOS+= -Du_int32_t=uint32_t | 24 | CFLAGS.SunOS+= -Du_int32_t=uint32_t | |
25 | CFLAGS.SunOS+= -Du_int64_t=uint64_t | 25 | CFLAGS.SunOS+= -Du_int64_t=uint64_t | |
26 | 26 | |||
27 | pre-configure: | 27 | pre-configure: | |
28 | cd ${WRKSRC} && ./autogen.sh | 28 | cd ${WRKSRC} && ./autogen.sh | |
29 | 29 | |||
30 | .include "../../net/libpcap/buildlink3.mk" | 30 | .include "../../net/libpcap/buildlink3.mk" | |
31 | .include "../../textproc/json-c/buildlink3.mk" | 31 | .include "../../textproc/json-c/buildlink3.mk" | |
32 | .include "../../mk/bsd.pkg.mk" | 32 | .include "../../mk/bsd.pkg.mk" |
@@ -1,16 +1,17 @@ | @@ -1,16 +1,17 @@ | |||
1 | @comment $NetBSD: PLIST,v 1.2 2018/10/18 16:24:29 adam Exp $ | 1 | @comment $NetBSD: PLIST,v 1.3 2019/07/12 09:30:34 adam Exp $ | |
2 | bin/ndpiReader | 2 | bin/ndpiReader | |
3 | include/ndpi/ndpi_api.h | 3 | include/ndpi/ndpi_api.h | |
4 | include/ndpi/ndpi_config.h | 4 | include/ndpi/ndpi_config.h | |
5 | include/ndpi/ndpi_define.h | 5 | include/ndpi/ndpi_define.h | |
6 | include/ndpi/ndpi_includes.h | 6 | include/ndpi/ndpi_includes.h | |
7 | include/ndpi/ndpi_main.h | 7 | include/ndpi/ndpi_main.h | |
8 | include/ndpi/ndpi_protocol_ids.h | 8 | include/ndpi/ndpi_protocol_ids.h | |
9 | include/ndpi/ndpi_protocols.h | 9 | include/ndpi/ndpi_protocols.h | |
10 | include/ndpi/ndpi_typedefs.h | 10 | include/ndpi/ndpi_typedefs.h | |
11 | include/ndpi/ndpi_unix.h | 11 | include/ndpi/ndpi_unix.h | |
12 | include/ndpi/ndpi_win32.h | 12 | include/ndpi/ndpi_win32.h | |
13 | lib/libndpi.a | 13 | lib/libndpi.a | |
14 | lib/libndpi.so | 14 | lib/libndpi.so | |
15 | lib/libndpi.so.${PKGVERSION}.0 | 15 | lib/libndpi.so.${PKGVERSION}.0 | |
16 | lib/libndpi.so.2 | |||
16 | lib/pkgconfig/libndpi.pc | 17 | lib/pkgconfig/libndpi.pc |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: buildlink3.mk,v 1.1 2016/04/08 16:51:23 adam Exp $ | 1 | # $NetBSD: buildlink3.mk,v 1.2 2019/07/12 09:30:34 adam Exp $ | |
2 | 2 | |||
3 | BUILDLINK_TREE+= ndpi | 3 | BUILDLINK_TREE+= ndpi | |
4 | 4 | |||
5 | .if !defined(NDPI_BUILDLINK3_MK) | 5 | .if !defined(NDPI_BUILDLINK3_MK) | |
6 | NDPI_BUILDLINK3_MK:= | 6 | NDPI_BUILDLINK3_MK:= | |
7 | 7 | |||
8 | BUILDLINK_API_DEPENDS.ndpi+= ndpi>=1.7 | 8 | BUILDLINK_API_DEPENDS.ndpi+= ndpi>=2.8 | |
9 | BUILDLINK_PKGSRCDIR.ndpi?= ../../net/ndpi | 9 | BUILDLINK_PKGSRCDIR.ndpi?= ../../net/ndpi | |
10 | 10 | |||
11 | .include "../../textproc/json-c/buildlink3.mk" | 11 | .include "../../textproc/json-c/buildlink3.mk" | |
12 | .endif # NDPI_BUILDLINK3_MK | 12 | .endif # NDPI_BUILDLINK3_MK | |
13 | 13 | |||
14 | BUILDLINK_TREE+= -ndpi | 14 | BUILDLINK_TREE+= -ndpi |
@@ -1,12 +1,10 @@ | @@ -1,12 +1,10 @@ | |||
1 | $NetBSD: distinfo,v 1.4 2018/10/18 16:24:29 adam Exp $ | 1 | $NetBSD: distinfo,v 1.5 2019/07/12 09:30:34 adam Exp $ | |
2 | 2 | |||
3 | SHA1 (nDPI-2.4.tar.gz) = 6ff0d034a2badade2e1deb835594a42fc297646a | 3 | SHA1 (nDPI-2.8.tar.gz) = 5b5f613cf55deeb040483f7c04ede7a2ed415c26 | |
4 | RMD160 (nDPI-2.4.tar.gz) = 5f022327354c55a773d17e83f76d50cc68fa3c78 | 4 | RMD160 (nDPI-2.8.tar.gz) = c26bfadeee1db4abbf86a06fdfa338cbfaf42d9b | |
5 | SHA512 (nDPI-2.4.tar.gz) = 7c746c167ab3ebafbe8646f752c95e32d66237a0a86adeec9ded1ec7e20f62170a9b1c4e5d25594f6459f5c0f616c27c5b393151d936471590f16df3fa3fa884 | 5 | SHA512 (nDPI-2.8.tar.gz) = aae757047810bbc32700ecf7ac2e5df4b93528021a50da4a0b83865a5248dfca8b1643c75aa7eeb6eac4f155638d45666db487318b2be9adb2f3412cb8ec8497 | |
6 | Size (nDPI-2.4.tar.gz) = 19308586 bytes | 6 | Size (nDPI-2.8.tar.gz) = 19754226 bytes | |
7 | SHA1 (patch-autogen.sh) = 61dbff4cce826994726da317667de9534030c5c1 | 7 | SHA1 (patch-Makefile.am) = 3f4649a55e519a21e1c5b645669f1febcef82d4e | |
8 | SHA1 (patch-configure.seed) = 885956b856b37d3f77e2c05630eee60af8ba5759 | 8 | SHA1 (patch-configure.seed) = 154f2d6a690bd6e7e01862769bcf0fa4b1a86ad6 | |
9 | SHA1 (patch-src_include_ndpi__includes.h) = db5da9ca24ecf32fd8c264e193af280814dc74c6 | 9 | SHA1 (patch-src_include_ndpi__includes.h) = db5da9ca24ecf32fd8c264e193af280814dc74c6 | |
10 | SHA1 (patch-src_lib_Makefile.in) = 60b03e8e6daaa9d882732c6fcf9897f5d843c3de | 10 | SHA1 (patch-src_lib_Makefile.in) = 458e095e55a3b6f24166813a249350a32a1e0589 | |
11 | SHA1 (patch-src_lib_ndpi__main.c) = 6a10a5318a033ce686b7fef37b0f2bf597b4eb06 | |||
12 | SHA1 (patch-src_lib_third__party_include_hash.h) = af82b9a7b418a5cba0c678c40d331dc5bffc0f0b |
$NetBSD: patch-Makefile.am,v 1.1 2019/07/12 09:30:34 adam Exp $
Use standard pkgconfigdir.
--- Makefile.am.orig 2019-07-11 10:20:02.000000000 +0000
+++ Makefile.am
@@ -1,7 +1,7 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src/lib example tests
-pkgconfigdir = $(prefix)/libdata/pkgconfig
+pkgconfigdir = $(prefix)/lib/pkgconfig
pkgconfig_DATA = libndpi.pc
EXTRA_DIST = autogen.sh
@@ -1,39 +1,15 @@ | @@ -1,39 +1,15 @@ | |||
1 | $NetBSD: patch-configure.seed,v 1.1 2018/10/18 16:24:29 adam Exp $ | 1 | $NetBSD: patch-configure.seed,v 1.2 2019/07/12 09:30:34 adam Exp $ | |
2 | 2 | |||
3 | Fixes from https://github.com/ntop/nDPI/issues/600 | |||
4 | Portability fix. | 3 | Portability fix. | |
5 | 4 | |||
6 | --- configure.seed.orig 2018-08-22 06:29:35.000000000 +0000 | 5 | --- configure.seed.orig 2019-03-01 17:04:18.000000000 +0000 | |
7 | +++ configure.seed | 6 | +++ configure.seed | |
8 | @@ -10,6 +10,7 @@ AC_PROG_CC | 7 | @@ -124,7 +124,7 @@ AC_ARG_ENABLE([json-c], | |
9 | AM_PROG_CC_C_O | |||
10 | AX_PTHREAD | |||
11 | ||||
12 | +NDPI_VERSION_SHORT="@NDPI_VERSION_SHORT@" | |||
13 | NDPI_MAJOR="@NDPI_MAJOR@" | |||
14 | NDPI_MINOR="@NDPI_MINOR@" | |||
15 | NDPI_PATCH="@NDPI_PATCH@" | |||
16 | @@ -104,7 +105,7 @@ AC_ARG_ENABLE([json-c], | |||
17 | AS_IF([test "x$enable_json_c" != "xno"], [ | 8 | AS_IF([test "x$enable_json_c" != "xno"], [ | |
18 | PKG_CONFIG_PATH=/usr/local/share/pkgconfig:$PKG_CONFIG_PATH | 9 | PKG_CONFIG_PATH=/usr/local/share/pkgconfig:$PKG_CONFIG_PATH | |
19 | pkg-config --exists json-c | 10 | pkg-config --exists json-c | |
20 | - AS_IF([test "$?" == "0"], | 11 | - AS_IF([test "$?" == "0"], | |
21 | + AS_IF([test "$?" = "0"], | 12 | + AS_IF([test "$?" = "0"], | |
22 | [ | 13 | [ | |
23 | CFLAGS="$CFLAGS $(pkg-config --cflags json-c)" | 14 | CFLAGS="$CFLAGS $(pkg-config --cflags json-c)" | |
24 | LDFLAGS="$LDFLAGS $(pkg-config --libs json-c)" | 15 | LDFLAGS="$LDFLAGS $(pkg-config --libs json-c)" | |
25 | @@ -127,12 +128,13 @@ AC_ARG_ENABLE([debug-messages], | |||
26 | ||||
27 | AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np])) | |||
28 | ||||
29 | -AC_CONFIG_FILES([Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h]) | |||
30 | +AC_CONFIG_FILES([Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile]) | |||
31 | AC_CONFIG_HEADERS(src/include/ndpi_config.h) | |||
32 | AC_SUBST(GIT_RELEASE) | |||
33 | AC_SUBST(NDPI_MAJOR) | |||
34 | AC_SUBST(NDPI_MINOR) | |||
35 | AC_SUBST(NDPI_PATCH) | |||
36 | +AC_SUBST(NDPI_VERSION_SHORT) | |||
37 | AC_SUBST(SVN_DATE) | |||
38 | AC_SUBST(JSON_C_LIB) | |||
39 | AC_SUBST(PCAP_INC) |
@@ -1,61 +1,49 @@ | @@ -1,61 +1,49 @@ | |||
1 | $NetBSD: patch-src_lib_Makefile.in,v 1.1 2018/10/18 16:24:29 adam Exp $ | 1 | $NetBSD: patch-src_lib_Makefile.in,v 1.2 2019/07/12 09:30:34 adam Exp $ | |
2 | 2 | |||
3 | Add missing src/lib/Makefile.in | 3 | Fix building on Darwin. | |
4 | 4 | |||
5 | --- /dev/null 2018-10-18 13:00:10.000000000 +0000 | 5 | --- src/lib/Makefile.in.orig 2019-03-01 17:04:18.000000000 +0000 | |
6 | +++ src/lib/Makefile.in | 6 | +++ src/lib/Makefile.in | |
7 | @@ -0,0 +1,54 @@ | 7 | @@ -21,8 +21,15 @@ OBJECTS = $(patsubst protocols/%.c, pr | |
8 | +# | 8 | HEADERS = $(wildcard ../include/*.h) | |
9 | +# Simple non-autotools dependent makefile | 9 | NDPI_VERSION_MAJOR = @NDPI_MAJOR@ | |
10 | +# | 10 | NDPI_LIB_STATIC = libndpi.a | |
11 | +# ./autogen.sh | |||
12 | +# cd src/lib | |||
13 | +# make Makefile | |||
14 | +# | |||
15 | + | |||
16 | + | |||
17 | +# | |||
18 | +# Installation directories | |||
19 | +# | |||
20 | +libdir = ${PREFIX}/lib | |||
21 | +includedir = ${PREFIX}/include/ndpi | |||
22 | +CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION | |||
23 | +RANLIB = ranlib | |||
24 | + | |||
25 | +OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) ndpi_main.o | |||
26 | +HEADERS = $(wildcard ../include/*.h) | |||
27 | +NDPI_LIB_STATIC = libndpi.a | |||
28 | +ifeq ($(OS),Darwin) | 11 | +ifeq ($(OS),Darwin) | |
29 | +NDPI_LIB_SHARED_BASE = libndpi.dylib | 12 | +NDPI_LIB_SHARED_BASE = libndpi.dylib | |
30 | +NDPI_LIB_SHARED = libndpi.@NDPI_VERSION_SHORT@.dylib | 13 | +NDPI_LIB_SHARED = libndpi.@NDPI_VERSION_SHORT@.dylib | |
31 | +LDFLAGS += -install_name ${PREFIX}/lib/${NDPI_LIB_SHARED} | 14 | +NDPI_LIB_SHARED_SHORT= libndpi.@NDPI_MAJOR@.dylib | |
32 | +else | 15 | +else | |
33 | +NDPI_LIB_SHARED_BASE = libndpi.so | 16 | NDPI_LIB_SHARED_BASE = libndpi.so | |
34 | +NDPI_LIB_SHARED = $(NDPI_LIB_SHARED_BASE).@NDPI_VERSION_SHORT@ | 17 | NDPI_LIB_SHARED = $(NDPI_LIB_SHARED_BASE).@NDPI_VERSION_SHORT@ | |
18 | +NDPI_LIB_SHARED_SHORT= $(NDPI_LIB_SHARED_BASE).@NDPI_MAJOR@ | |||
35 | +endif | 19 | +endif | |
36 | +NDPI_LIBS = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED) | 20 | NDPI_LIBS = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED) | |
37 | + | 21 | ||
38 | +all: $(NDPI_LIBS) | 22 | ifneq ($(OS),Windows_NT) | |
39 | + | 23 | @@ -30,8 +37,7 @@ OS := $(shell uname) | |
40 | +ndpi_main.c: ndpi_content_match.c.inc | 24 | endif | |
41 | + | 25 | ||
42 | +$(NDPI_LIB_STATIC): $(OBJECTS) | 26 | ifeq ($(OS),Darwin) | |
43 | + ar rc $@ $(OBJECTS) | 27 | -CC=clang | |
44 | + $(RANLIB) $@ | 28 | -SONAME_FLAG= | |
45 | + | 29 | +SONAME_FLAG=-install_name $(libdir)/${NDPI_LIB_SHARED} | |
46 | +$(NDPI_LIB_SHARED): $(OBJECTS) | 30 | else | |
47 | + $(CC) -shared -fPIC ${LDFLAGS} -o $@ $(OBJECTS) | 31 | SONAME_FLAG=-Wl,-soname,$(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR) | |
48 | + ln -Fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE) | 32 | endif | |
49 | + | 33 | @@ -47,7 +53,7 @@ $(NDPI_LIB_STATIC): $(OBJECTS) | |
50 | +%.o: %.c $(HEADERS) Makefile | 34 | $(NDPI_LIB_SHARED): $(OBJECTS) | |
51 | + $(CC) $(CFLAGS) -c $< -o $@ | 35 | $(CC) -shared -fPIC $(SONAME_FLAG) -o $@ $(OBJECTS) | |
52 | + | 36 | ln -Ffs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE) | |
53 | +clean: | 37 | - ln -Ffs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR) | |
54 | + /bin/rm -f $(NDPI_LIB_STATIC) $(OBJECTS) *.o *.so *.lo | 38 | + ln -Ffs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_SHORT) | |
55 | + | 39 | ||
56 | +install: $(NDPI_LIBS) | 40 | %.o: %.c $(HEADERS) Makefile | |
57 | + mkdir -p $(DESTDIR)$(libdir) | 41 | $(CC) $(CFLAGS) -c $< -o $@ | |
58 | + cp $(NDPI_LIBS) $(DESTDIR)$(libdir)/ | 42 | @@ -62,6 +68,6 @@ install: $(NDPI_LIBS) | |
59 | + ln -Fs $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_BASE) | 43 | mkdir -p $(DESTDIR)$(libdir) | |
60 | + mkdir -p $(DESTDIR)$(includedir) | 44 | cp $(NDPI_LIBS) $(DESTDIR)$(libdir)/ | |
61 | + cp ../include/*.h $(DESTDIR)$(includedir) | 45 | ln -Ffs $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_BASE) | |
46 | - ln -Ffs $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR) | |||
47 | + ln -Ffs $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED) $(DESTDIR)$(libdir)/$(NDPI_LIB_SHARED_SHORT) | |||
48 | mkdir -p $(DESTDIR)$(includedir) | |||
49 | cp ../include/*.h $(DESTDIR)$(includedir) |