From b24ff2e1e0f79a24a40abe7f5d77ee0f6eb0ddd8 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Tue, 29 Jun 2021 18:38:39 +0200 Subject: [PATCH] udhcpsnoop: import package from TIP Import the udhcpsnoop package from the TIP feed. The original Makefile in TIP repo spcifies GPL-2.0 as the PKG_LICENSE. However this is a mistake, as the SPDX headers of the repos source files all specify BSD-3-Clause as their license. See https://github.com/Telecominfraproject/wlan-ap/blob/uCentral-trunk/feeds/ucentral/udhcpsnoop/Makefile Signed-off-by: David Bauer --- net/udhcpsnoop/Makefile | 31 +++++++++++++++++++++++ net/udhcpsnoop/files/etc/config/dhcpsnoop | 4 +++ net/udhcpsnoop/files/etc/init.d/dhcpsnoop | 22 ++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 net/udhcpsnoop/Makefile create mode 100644 net/udhcpsnoop/files/etc/config/dhcpsnoop create mode 100755 net/udhcpsnoop/files/etc/init.d/dhcpsnoop diff --git a/net/udhcpsnoop/Makefile b/net/udhcpsnoop/Makefile new file mode 100644 index 000000000..c30648a9a --- /dev/null +++ b/net/udhcpsnoop/Makefile @@ -0,0 +1,31 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=udhcpsnoop +PKG_RELEASE:=1 + +PKG_LICENSE:=BSD-3-Clause +PKG_MAINTAINER:=John Crispin + +PKG_SOURCE_URL=https://github.com/blogic/udhcpsnoop.git +PKG_MIRROR_HASH:=64d9d2cb93bd67d55aa08328ef6aa1412e6c1a827e3eccec784a3ba65be2596f +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2021-05-30 +PKG_SOURCE_VERSION:=b86639904147a40be32ac43cd89c21109ffc3543 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/udhcpsnoop + SECTION:=net + CATEGORY:=Network + TITLE:=DHCP Snooping Daemon + DEPENDS:=+libubox +libubus +libuci +endef + +define Package/udhcpsnoop/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/udhcpsnoop $(1)/usr/sbin/ + $(CP) ./files/* $(1) +endef + +$(eval $(call BuildPackage,udhcpsnoop)) diff --git a/net/udhcpsnoop/files/etc/config/dhcpsnoop b/net/udhcpsnoop/files/etc/config/dhcpsnoop new file mode 100644 index 000000000..21b1c41be --- /dev/null +++ b/net/udhcpsnoop/files/etc/config/dhcpsnoop @@ -0,0 +1,4 @@ +config snooping + option enable 0 + #list network lan + #list network wan diff --git a/net/udhcpsnoop/files/etc/init.d/dhcpsnoop b/net/udhcpsnoop/files/etc/init.d/dhcpsnoop new file mode 100755 index 000000000..30fe27247 --- /dev/null +++ b/net/udhcpsnoop/files/etc/init.d/dhcpsnoop @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common + +START=80 + +USE_PROCD=1 +PROG=/usr/sbin/udhcpsnoop + +service_triggers() { + procd_add_reload_trigger dhcpsnoop +} + +start_service() { + [ "$(uci get dhcpsnoop.@snooping[-1].enable)" -eq 1 ] || return + procd_open_instance + procd_set_param command "$PROG" + procd_set_param respawn + procd_close_instance +} + +reload_service() { + restart +}