diff --git a/net/bsbf-resources/Makefile b/net/bsbf-resources/Makefile new file mode 100644 index 0000000000..e4e069d41b --- /dev/null +++ b/net/bsbf-resources/Makefile @@ -0,0 +1,104 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright (C) 2025-2026 Chester A. Unal + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bsbf-resources +PKG_RELEASE:=1 + +PKG_LICENSE:=AGPL-3.0-or-later +PKG_MAINTAINER:=Chester A. Unal + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/bondingshouldbefree/bsbf-resources.git +PKG_SOURCE_DATE:=2026-02-28 +PKG_SOURCE_VERSION:=87d2cb705bae377a1726a87d8450c9bb381367d3 +PKG_MIRROR_HASH:=5d3fd1106f1bab4c603e2d6f76df983601266e1604765310d2f97486c98dfe55 + +include $(INCLUDE_DIR)/package.mk + +define Package/bsbf-mptcp + SECTION:=net + CATEGORY:=Network + TITLE:=bsbf-mptcp + DEPENDS:=+fping +ip-full +endef + +define Package/bsbf-netspeed + SECTION:=net + CATEGORY:=Network + TITLE:=bsbf-netspeed +endef + +define Package/bsbf-quectel-usbnet + SECTION:=net + CATEGORY:=Network + TITLE:=bsbf-quectel-usbnet +endef + +define Package/bsbf-route + SECTION:=net + CATEGORY:=Network + TITLE:=bsbf-route + DEPENDS:=+fping +endef + +define Package/bsbf-tcp-in-udp + SECTION:=net + CATEGORY:=Network + TITLE:=bsbf-tcp-in-udp + DEPENDS:=+ethtool +tc-full +tcp-in-udp +endef + +define Build/Compile +endef + +define Package/bsbf-mptcp/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/etc/config/bsbf-mptcp $(1)/etc/config + + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) ./files/etc/hotplug.d/iface/99-bsbf-mptcp $(1)/etc/hotplug.d/iface + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/etc/init.d/bsbf-mptcp $(1)/etc/init.d + + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-mptcp $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-mptcp-helper $(1)/usr/sbin +endef + +define Package/bsbf-netspeed/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-netspeed $(1)/usr/sbin +endef + +define Package/bsbf-quectel-usbnet/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/etc/init.d/bsbf-quectel-usbnet $(1)/etc/init.d + + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-quectel-usbnet $(1)/usr/sbin +endef + +define Package/bsbf-route/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/etc/init.d/bsbf-route $(1)/etc/init.d + + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-route $(1)/usr/sbin +endef + +define Package/bsbf-tcp-in-udp/install + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) ./files/etc/hotplug.d/iface/99-bsbf-tcp-in-udp $(1)/etc/hotplug.d/iface + + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/resources-client/bsbf-tcp-in-udp $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,bsbf-mptcp)) +$(eval $(call BuildPackage,bsbf-netspeed)) +$(eval $(call BuildPackage,bsbf-quectel-usbnet)) +$(eval $(call BuildPackage,bsbf-route)) +$(eval $(call BuildPackage,bsbf-tcp-in-udp)) diff --git a/net/bsbf-resources/files/etc/config/bsbf-mptcp b/net/bsbf-resources/files/etc/config/bsbf-mptcp new file mode 100644 index 0000000000..52108d8390 --- /dev/null +++ b/net/bsbf-resources/files/etc/config/bsbf-mptcp @@ -0,0 +1,3 @@ + +config endpoints 'main' +# list subflow_backup 'example' diff --git a/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-mptcp b/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-mptcp new file mode 100644 index 0000000000..30e8f88432 --- /dev/null +++ b/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-mptcp @@ -0,0 +1,8 @@ +#!/bin/sh +# SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright (C) 2025-2026 Chester A. Unal + +[ "$ACTION" = "ifdown" ] || exit + +DEVICE=$(ubus call network.interface."$INTERFACE" status | grep -m1 '"device"' | cut -d'"' -f4) +bsbf-mptcp-helper remove "$DEVICE" diff --git a/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-tcp-in-udp b/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-tcp-in-udp new file mode 100644 index 0000000000..db79b4067d --- /dev/null +++ b/net/bsbf-resources/files/etc/hotplug.d/iface/99-bsbf-tcp-in-udp @@ -0,0 +1,12 @@ +#!/bin/sh +# SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright (C) 2025-2026 Chester A. Unal + +[ "$ACTION" = "ifup" ] || exit + +case "$INTERFACE" in + wan*|wwan*|ifWan*|mob*_*) + [ "$DEVICE" = qmimux* ] && { bsbf-tcp-in-udp l3 "$DEVICE"; exit; } + bsbf-tcp-in-udp l2 "$DEVICE" + ;; +esac diff --git a/net/bsbf-resources/files/etc/init.d/bsbf-mptcp b/net/bsbf-resources/files/etc/init.d/bsbf-mptcp new file mode 100644 index 0000000000..5194716308 --- /dev/null +++ b/net/bsbf-resources/files/etc/init.d/bsbf-mptcp @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright (C) 2025-2026 Chester A. Unal + +START=99 +USE_PROCD=1 + +start_service() { + procd_open_instance "bsbf-mptcp" + procd_set_param command "/usr/sbin/bsbf-mptcp" + procd_close_instance +} diff --git a/net/bsbf-resources/files/etc/init.d/bsbf-quectel-usbnet b/net/bsbf-resources/files/etc/init.d/bsbf-quectel-usbnet new file mode 100644 index 0000000000..f687cb7873 --- /dev/null +++ b/net/bsbf-resources/files/etc/init.d/bsbf-quectel-usbnet @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright (C) 2025-2026 Chester A. Unal + +START=99 +USE_PROCD=1 + +start_service() { + procd_open_instance "bsbf-quectel-usbnet" + procd_set_param command "/usr/sbin/bsbf-quectel-usbnet" + procd_close_instance +} diff --git a/net/bsbf-resources/files/etc/init.d/bsbf-route b/net/bsbf-resources/files/etc/init.d/bsbf-route new file mode 100644 index 0000000000..b280a89def --- /dev/null +++ b/net/bsbf-resources/files/etc/init.d/bsbf-route @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# SPDX-License-Identifier: AGPL-3.0-or-later +# Copyright (C) 2025-2026 Chester A. Unal + +START=99 +USE_PROCD=1 + +start_service() { + procd_open_instance "bsbf-route" + procd_set_param command "/usr/sbin/bsbf-route" + procd_close_instance +}