From 78b0142267993d6ebbbfea329431e159b25d2c16 Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Tue, 7 Feb 2023 22:05:21 +0800 Subject: [PATCH] luci-proto-3x: move to luci feeds --- package/wwan/app/luci-proto-3x/Makefile | 53 ------- .../luci/model/cbi/admin_network/proto_3x.lua | 146 ------------------ .../lib/lua/luci/model/network/proto_3x.lua | 49 ------ .../www/luci-static/resources/protocol/3x.js | 11 -- toolchain/binutils/Config.in | 2 +- toolchain/binutils/Config.version | 2 +- 6 files changed, 2 insertions(+), 261 deletions(-) delete mode 100644 package/wwan/app/luci-proto-3x/Makefile delete mode 100644 package/wwan/app/luci-proto-3x/files/usr/lib/lua/luci/model/cbi/admin_network/proto_3x.lua delete mode 100644 package/wwan/app/luci-proto-3x/files/usr/lib/lua/luci/model/network/proto_3x.lua delete mode 100644 package/wwan/app/luci-proto-3x/files/www/luci-static/resources/protocol/3x.js diff --git a/package/wwan/app/luci-proto-3x/Makefile b/package/wwan/app/luci-proto-3x/Makefile deleted file mode 100644 index a9f098306..000000000 --- a/package/wwan/app/luci-proto-3x/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright (C) 2007-2013 OpenWrt.org -# Copyright (C) 2010 Vertical Communications -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-proto-3x -PKG_VERSION:=1.0 -PKG_RELEASE:=1 -PKG_MAINTAINER:=Dairyman -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE) - -include $(INCLUDE_DIR)/package.mk - -define Package/luci-proto-3x/Default - VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) - URL:=http://openwrt.org/ - MAINTAINER:=Dairyman -endef - -define Package/luci-proto-3x -$(call Package/luci-proto-3x/Default) - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=5. Protocols - TITLE:=Support for 3x -endef - -define Package/luci-proto-3x/description - This package contains LuCI support for 3x -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) -endef - -define Build/Configure -endef - -define Build/Compile/Default -endef - -Build/Compile = $(Build/Compile/Default) - -define Package/luci-proto-3x/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,luci-proto-3x)) diff --git a/package/wwan/app/luci-proto-3x/files/usr/lib/lua/luci/model/cbi/admin_network/proto_3x.lua b/package/wwan/app/luci-proto-3x/files/usr/lib/lua/luci/model/cbi/admin_network/proto_3x.lua deleted file mode 100644 index 59bf2f646..000000000 --- a/package/wwan/app/luci-proto-3x/files/usr/lib/lua/luci/model/cbi/admin_network/proto_3x.lua +++ /dev/null @@ -1,146 +0,0 @@ --- Copyright 2011 Jo-Philipp Wich --- Licensed to the public under the Apache License 2.0. - -local map, section, net = ... - -local device, apn, service, pincode, username, password, dialnumber -local ipv6, maxwait, defaultroute, metric, peerdns, dns, - keepalive_failure, keepalive_interval, demand - - -device = section:taboption("general", Value, "device", translate("Modem device")) -device.rmempty = false - -local device_suggestions = nixio.fs.glob("/dev/tty[A-Z]*") - or nixio.fs.glob("/dev/tts/*") - -if device_suggestions then - local node - for node in device_suggestions do - device:value(node) - end -end - - -service = section:taboption("general", Value, "service", translate("Service Type")) -service:value("", translate("-- Please choose --")) -service:value("umts", "UMTS/GPRS") -service:value("umts_only", translate("UMTS only")) -service:value("gprs_only", translate("GPRS only")) -service:value("evdo", "CDMA/EV-DO") - - -apn = section:taboption("general", Value, "apn", translate("APN")) - - -pincode = section:taboption("general", Value, "pincode", translate("PIN")) - - -username = section:taboption("general", Value, "username", translate("PAP/CHAP username")) - - -password = section:taboption("general", Value, "password", translate("PAP/CHAP password")) -password.password = true - -dialnumber = section:taboption("general", Value, "dialnumber", translate("Dial number")) -dialnumber.placeholder = "*99***1#" - -if luci.model.network:has_ipv6() then - - ipv6 = section:taboption("advanced", Flag, "ipv6", - translate("Enable IPv6 negotiation on the PPP link")) - - ipv6.default = ipv6.disabled - -end - - -maxwait = section:taboption("advanced", Value, "maxwait", - translate("Modem init timeout"), - translate("Maximum amount of seconds to wait for the modem to become ready")) - -maxwait.placeholder = "20" -maxwait.datatype = "min(1)" - - -defaultroute = section:taboption("advanced", Flag, "defaultroute", - translate("Use default gateway"), - translate("If unchecked, no default route is configured")) - -defaultroute.default = defaultroute.enabled - - -metric = section:taboption("advanced", Value, "metric", - translate("Use gateway metric")) - -metric.placeholder = "0" -metric.datatype = "uinteger" -metric:depends("defaultroute", defaultroute.enabled) - - -peerdns = section:taboption("advanced", Flag, "peerdns", - translate("Use DNS servers advertised by peer"), - translate("If unchecked, the advertised DNS server addresses are ignored")) - -peerdns.default = peerdns.enabled - - -dns = section:taboption("advanced", DynamicList, "dns", - translate("Use custom DNS servers")) - -dns:depends("peerdns", "") -dns.datatype = "ipaddr" -dns.cast = "string" - - -keepalive_failure = section:taboption("advanced", Value, "_keepalive_failure", - translate("LCP echo failure threshold"), - translate("Presume peer to be dead after given amount of LCP echo failures, use 0 to ignore failures")) - -function keepalive_failure.cfgvalue(self, section) - local v = m:get(section, "keepalive") - if v and #v > 0 then - return tonumber(v:match("^(%d+)[ ,]+%d+") or v) - end -end - -function keepalive_failure.write() end -function keepalive_failure.remove() end - -keepalive_failure.placeholder = "0" -keepalive_failure.datatype = "uinteger" - - -keepalive_interval = section:taboption("advanced", Value, "_keepalive_interval", - translate("LCP echo interval"), - translate("Send LCP echo requests at the given interval in seconds, only effective in conjunction with failure threshold")) - -function keepalive_interval.cfgvalue(self, section) - local v = m:get(section, "keepalive") - if v and #v > 0 then - return tonumber(v:match("^%d+[ ,]+(%d+)")) - end -end - -function keepalive_interval.write(self, section, value) - local f = tonumber(keepalive_failure:formvalue(section)) or 0 - local i = tonumber(value) or 5 - if i < 1 then i = 1 end - if f > 0 then - m:set(section, "keepalive", "%d %d" %{ f, i }) - else - m:del(section, "keepalive") - end -end - -keepalive_interval.remove = keepalive_interval.write -keepalive_interval.placeholder = "5" -keepalive_interval.datatype = "min(1)" - - -demand = section:taboption("advanced", Value, "demand", - translate("Inactivity timeout"), - translate("Close inactive connection after the given amount of seconds, use 0 to persist connection")) - -demand.placeholder = "0" -demand.datatype = "uinteger" diff --git a/package/wwan/app/luci-proto-3x/files/usr/lib/lua/luci/model/network/proto_3x.lua b/package/wwan/app/luci-proto-3x/files/usr/lib/lua/luci/model/network/proto_3x.lua deleted file mode 100644 index e2ff6b9c8..000000000 --- a/package/wwan/app/luci-proto-3x/files/usr/lib/lua/luci/model/network/proto_3x.lua +++ /dev/null @@ -1,49 +0,0 @@ --- Copyright 2018 Florian Eckert --- Licensed to the public under the Apache License 2.0. - -local netmod = luci.model.network -local interface = luci.model.network.interface - -local proto = netmod:register_protocol("3x") - -function proto.get_i18n(self) - return luci.i18n.translate("UMTS/GPRS/EV-DO") -end - -function proto.ifname(self) - return "3x-" .. self.sid -end - -function proto.get_interface(self) - return interface(self:ifname(), self) -end - -function proto.is_installed(self) - return nixio.fs.access("/lib/netifd/proto/3x.sh") -end - -function proto.opkg_package(self) - return "comgt" -end - -function proto.is_floating(self) - return true -end - -function proto.is_virtual(self) - return true -end - -function proto.get_interfaces(self) - return nil -end - -function proto.contains_interface(self, ifc) - if self:is_floating() then - return (netmod:ifnameof(ifc) == self:ifname()) - else - return netmod.protocol.contains_interface(self, ifc) - end -end - -netmod:register_pattern_virtual("^3x%-%w") diff --git a/package/wwan/app/luci-proto-3x/files/www/luci-static/resources/protocol/3x.js b/package/wwan/app/luci-proto-3x/files/www/luci-static/resources/protocol/3x.js deleted file mode 100644 index a1c213b9e..000000000 --- a/package/wwan/app/luci-proto-3x/files/www/luci-static/resources/protocol/3x.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict';'require rpc';'require uci';'require form';'require network';var callFileList=rpc.declare({object:'file',method:'list',params:['path'],expect:{entries:[]},filter:function(list,params){var rv=[];for(var i=0;i0) -uci.set('network',section_id,'keepalive','%d %d'.format(f,i));else -uci.unset('network',section_id,'keepalive');} -return network.registerProtocol('3x',{getI18n:function(){return _('UMTS/GPRS/EV-DO');},getIfname:function(){return this._ubus('l3_device')||'3x-%s'.format(this.sid);},getOpkgPackage:function(){return'comgt';},isFloating:function(){return true;},isVirtual:function(){return true;},getDevices:function(){return null;},containsDevice:function(ifname){return(network.getIfnameOf(ifname)==this.getIfname());},renderFormOptions:function(s){var o;o=s.taboption('general',form.Value,'device',_('Modem device'));o.rmempty=false;o.load=function(section_id){return callFileList('/dev/').then(L.bind(function(devices){for(var i=0;i