netsniff-ng: Build and package mausezahn

mausezahn is a multicast traffic generator which is part of the
netsniff-ng sources. This utility is needed for the upcoming
kernel-selftests-net-forwarding package. Add a new package for it.

netsniff-ng will automatically detect all installed dependencies and
build only the utilities whose dependencies are installed (meaning:
mausezahn is not build when for example libcli is not installed and
other tools are not build if for example zlib is missing). Depending
on the selected packages (netsniff-ng or mausezahn) the OpenWrt build
system has to trigger netsniff-ng's configure script, which will then
pick up and automatically build the programs (mausezahn, netsniff-ng,
trafgen, ...) for which all dependencies are installed.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
This commit is contained in:
Martin Blumenstingl 2022-07-07 01:46:02 +02:00 committed by Rosen Penev
parent 8cead176bd
commit 5bc5270af0
1 changed files with 31 additions and 4 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=netsniff-ng
PKG_VERSION:=0.6.8
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/netsniff-ng/netsniff-ng/tar.gz/v$(PKG_VERSION)?
@ -15,22 +15,43 @@ PKG_LICENSE_FILES:=COPYING
PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_mausezahn \
CONFIG_PACKAGE_netsniff-ng
include $(INCLUDE_DIR)/package.mk
define Package/netsniff-ng
define Package/netsniff-ng/Default
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libpthread +libpcap +libncurses +zlib +liburcu +libsodium +libnetfilter-conntrack
TITLE:=netsniff-ng
DEPENDS:=+libpthread +libpcap
URL:=https://github.com/netsniff-ng/netsniff-ng
endef
define Package/netsniff-ng
$(call Package/netsniff-ng/Default)
DEPENDS+=+libncurses +libnetfilter-conntrack +libsodium +liburcu +zlib
TITLE:=netsniff-ng
endef
define Package/netsniff-ng/description
netsniff-ng is a free, performant Linux network analyzer and
networking toolkit. If you will, the Swiss army knife for network
packets.
endef
define Package/mausezahn
$(call Package/netsniff-ng/Default)
DEPENDS+=+libcli +libnet-1.2.x
TITLE:=mausezahn
endef
define Package/mausezahn/description
Mausezahn is a traffic generator written which allows sending
nearly every possible and impossible packet. It is mainly used
to test VoIP or multicast networks.
endef
define Build/Configure
( cd $(PKG_BUILD_DIR); \
CC="$(TARGET_CC)" \
@ -66,4 +87,10 @@ define Package/netsniff-ng/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/curvetun/curvetun $(1)/usr/sbin/
endef
define Package/mausezahn/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mausezahn/mausezahn $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,netsniff-ng))
$(eval $(call BuildPackage,mausezahn))