netsniff-ng: Build and package mausezahn
authorMartin Blumenstingl <redacted>
Wed, 6 Jul 2022 23:46:02 +0000 (01:46 +0200)
committerRosen Penev <redacted>
Thu, 22 Sep 2022 08:30:14 +0000 (01:30 -0700)
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 <redacted>
net/netsniff-ng/Makefile

index 0d34c985bd014051995b7dfa6ea36d063efc109f..396cc6c86aff95c99931344f44bf0b64adb1c4f8 100644 (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))
git clone https://git.99rst.org/PROJECT