From 4c753f3917f9f78829f022a1d4b067f3c6f27a0e Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Wed, 17 Jun 2026 07:26:43 +0200 Subject: [PATCH] OpenWrt build support Signed-off-by: Toni Uhlig --- CMakeLists.txt | 7 +++++++ examples/c-captured/c-captured.c | 2 +- packages/openwrt/net/nDPId-testing/Makefile | 20 ++++++++++++++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed13a36fb..93454fe1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -416,6 +416,8 @@ if(ENABLE_EPAN) DOWNLOAD_EXTRACT_TIMESTAMP FALSE PREFIX ${CMAKE_BINARY_DIR}/wireshark_ext CMAKE_ARGS + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH} -DCMAKE_INSTALL_PREFIX= -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} @@ -458,6 +460,11 @@ if(ENABLE_EPAN) -DENABLE_AMRNB=OFF -DENABLE_ILBC=OFF -DENABLE_OPUS=OFF + -DENABLE_ZLIB=OFF # does not work with OpenWrt + -DENABLE_ZLIBNG=OFF + -DENABLE_ZSTD=OFF + -DHAVE_C99_VSNPRINTF_EXITCODE=0 # fix C99 vsnprintf check + -DLEMON_EXECUTABLE=false # important for XCompilation # No Qt GUI -DUSE_qt6=OFF BUILD_BYPRODUCTS /lib/${nDPId_EPAN_LIBNAME} diff --git a/examples/c-captured/c-captured.c b/examples/c-captured/c-captured.c index 630d22256..2b0612b7c 100644 --- a/examples/c-captured/c-captured.c +++ b/examples/c-captured/c-captured.c @@ -1287,7 +1287,7 @@ static int mainloop(void) if (read_ret == READ_TIMEOUT) { logger(0, - "No data received during the last %llu second(s).\n", + "No data received during the last %llu second(s).", (long long unsigned int)ndpisrvd_socket->read_timeout.tv_sec); continue; } diff --git a/packages/openwrt/net/nDPId-testing/Makefile b/packages/openwrt/net/nDPId-testing/Makefile index 6c5344bde..3b6d5054a 100644 --- a/packages/openwrt/net/nDPId-testing/Makefile +++ b/packages/openwrt/net/nDPId-testing/Makefile @@ -26,7 +26,7 @@ define Package/nDPId-testing TITLE:=nDPId is a tiny nDPI based daemons / toolkit (nDPId source repository) SECTION:=net CATEGORY:=Network - DEPENDS:=@!SMALL_FLASH @!LOW_MEMORY_FOOTPRINT +libpcap +zlib +LIBNDPI_GCRYPT:libgcrypt +NDPID_TESTING_ENABLE_TLS:libopenssl +NDPID_TESTING_INFLUXDB:libcurl +NDPID_TESTING_PFRING:libpfring + DEPENDS:=@!SMALL_FLASH @!LOW_MEMORY_FOOTPRINT +libpcap +zlib +LIBNDPI_GCRYPT:libgcrypt +NDPID_TESTING_ENABLE_TLS:libopenssl +NDPID_TESTING_INFLUXDB:libcurl +NDPID_TESTING_PFRING:libpfring +NDPID_TESTING_PFRING:kmod-pf-ring +NDPID_TESTING_ENABLE_EPAN:libcares +NDPID_TESTING_ENABLE_EPAN:glib2 +NDPID_TESTING_ENABLE_EPAN:libgcrypt URL:=http://github.com/lnslbrty/nDPId endef @@ -38,7 +38,7 @@ endef define Package/nDPId-testing/config config NDPID_TESTING_COLLECTD_SUPPORT bool "nDPId collectd support" - depends on PACKAGE_nDPId-testing && PACKAGE_collectd-mod-exec && !CONFIG_NDPID_COLLECTD_SUPPORT + depends on PACKAGE_nDPId-testing default n help This option enables collectd to gather nDPId statistics via plugin-exec. @@ -60,6 +60,14 @@ config NDPID_TESTING_ENABLE_TLS help Enable TLS for Collector (nDPId / nDPIsrvd) and Distributor (nDPIsrvd). +config NDPID_TESTING_ENABLE_EPAN + bool "nDPId Wireshark EPAN support" + depends on PACKAGE_nDPId-testing + default n + help + Enable additional dissection support with Wireshark EPAN. + EPAN: Ethereal Packet Analyzer. + config NDPID_TESTING_INFLUXDB bool "nDPIsrvd-influxdb" depends on PACKAGE_nDPId-testing @@ -88,13 +96,17 @@ CMAKE_OPTIONS += -DSTATIC_LIBNDPI_INSTALLDIR="$(PKG_BUILD_DIR)/libnDPI/install" TARGET_CFLAGS += -DLIBNDPI_STATIC=1 TARGET_CFLAGS += -Werror -ifneq ($(CONFIG_NDPID_TESTING_PFRING),) +ifneq ($(CONFIG_NDPID_TESTING_ENABLE_TLS),) CMAKE_OPTIONS += -DENABLE_CRYPTO=ON endif +ifneq ($(CONFIG_NDPID_TESTING_ENABLE_EPAN),) +CMAKE_OPTIONS += -DENABLE_EPAN=ON +endif + ifneq ($(CONFIG_NDPID_TESTING_PFRING),) # FIXME: PFRING kernel include directory is hardcoded (not installed to linux header directory). -PF_RING_DIR := $(firstword $(wildcard $(KERNEL_BUILD_DIR)/libpfring-*)) +PF_RING_DIR := $(firstword $(wildcard $(BUILD_DIR)/PF_RING-*)) CMAKE_OPTIONS += -DENABLE_PFRING=ON \ -DPFRING_KERNEL_INC="$(PF_RING_DIR)/kernel" \ -DPFRING_INSTALLDIR="$(STAGING_DIR)/usr" \