From 27060c997af66245d1b574f171e77a78e9e9c9b2 Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Mon, 9 Aug 2021 22:34:49 +0800 Subject: [PATCH] libpcap: add rpcapd as package (#7631) This enables building of rpcapd and adds it as a package. It is a daemon that allows remote packet capturing from another machine. E.g. Wireshark can talk to it using the Remote Capture Protocol (RPCAP). https://www.tcpdump.org/manpages/rpcapd.8.html Compile and run tested: OpenWrt SNAPSHOT r17190-2801fe6132 on x86/64 Signed-off-by: Stephan Schmidtmer Co-authored-by: Stephan Schmidtmer --- package/libs/libpcap/Makefile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 6fb55f89d..7493315dd 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libpcap -PKG_VERSION:=1.10.1 -PKG_RELEASE:=$(AUTORELEASE) +PKG_VERSION:=1.10.0 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ @@ -44,6 +44,19 @@ define Package/libpcap/config source "$(SOURCE)/Config.in" endef +define Package/rpcapd + SECTION:=net + CATEGORY:=Network + TITLE:=Capture daemon to be controlled by a remote libpcap application + URL:=http://www.tcpdump.org/ + DEPENDS+= +libpcap +endef + +ifdef CONFIG_PACKAGE_rpcapd + CMAKE_OPTIONS += \ + -DENABLE_REMOTE=ON +endif + CMAKE_OPTIONS += \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_WITH_LIBNL=OFF \ @@ -82,4 +95,10 @@ define Package/libpcap/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcap.so.* $(1)/usr/lib/ endef +define Package/rpcapd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rpcapd $(1)/usr/sbin/ +endef + $(eval $(call BuildPackage,libpcap)) +$(eval $(call BuildPackage,rpcapd))