diff options
Diffstat (limited to 'protocols')
26 files changed, 373 insertions, 225 deletions
diff --git a/protocols/luci-proto-ipv6/luasrc/model/network/proto_aiccu.lua b/protocols/luci-proto-3g/luasrc/model/network/proto_3g.lua index 5896a278ce..b2454838f9 100644 --- a/protocols/luci-proto-ipv6/luasrc/model/network/proto_aiccu.lua +++ b/protocols/luci-proto-3g/luasrc/model/network/proto_3g.lua @@ -1,17 +1,17 @@ --- Copyright 2015 Paul Oranje <por@xs4all.nl> --- Licensed to the public under GPLv2 +-- Copyright 2018 Florian Eckert <fe@dev.tdt.de> +-- 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("aiccu") +local proto = netmod:register_protocol("3g") function proto.get_i18n(self) - return luci.i18n.translate("AICCU (SIXXS)") + return luci.i18n.translate("UMTS/GPRS/EV-DO") end function proto.ifname(self) - return "aiccu-" .. self.sid + return "3g-" .. self.sid end function proto.get_interface(self) @@ -19,11 +19,11 @@ function proto.get_interface(self) end function proto.is_installed(self) - return nixio.fs.access("/lib/netifd/proto/aiccu.sh") + return nixio.fs.access("/lib/netifd/proto/3g.sh") end function proto.opkg_package(self) - return "aiccu" + return "comgt" end function proto.is_floating(self) @@ -46,4 +46,4 @@ function proto.contains_interface(self, ifname) end end -netmod:register_pattern_virtual("^aiccu-%%w") +netmod:register_pattern_virtual("^3g%-%w") diff --git a/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua b/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua index 5c3761c9cb..04d2e78b09 100644 --- a/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua +++ b/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua @@ -37,4 +37,4 @@ function proto.contains_interface(self, ifc) return (netmod:ifnameof(ifc) == self:ifname()) end -netmod:register_pattern_virtual("^ipip-%w") +netmod:register_pattern_virtual("^ipip%-%w") diff --git a/protocols/luci-proto-ipv6/Makefile b/protocols/luci-proto-ipv6/Makefile index e749bc9e83..b28c8d5895 100644 --- a/protocols/luci-proto-ipv6/Makefile +++ b/protocols/luci-proto-ipv6/Makefile @@ -6,9 +6,11 @@ include $(TOPDIR)/rules.mk -LUCI_TITLE:=Support for DHCPv6/6in4/6to4/6rd/DS-Lite/aiccu +LUCI_TITLE:=Support for DHCPv6/6in4/6to4/6rd/DS-Lite LUCI_DEPENDS:= +PKG_LICENSE:=Apache-2.0 + include ../../luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_6in4.lua b/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_6in4.lua index 88dfe09289..16245b80e5 100644 --- a/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_6in4.lua +++ b/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_6in4.lua @@ -24,7 +24,7 @@ peeraddr.datatype = "ip4addr" ip6addr = s:taboption("general", Value, "ip6addr", translate("Local IPv6 address"), - translate("This is the local endpoint address assigned by the tunnel broker, it usually ends with <code>:2</code>")) + translate("This is the local endpoint address assigned by the tunnel broker, it usually ends with <code>...:2/64</code>")) ip6addr.datatype = "ip6addr" diff --git a/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_aiccu.lua b/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_aiccu.lua deleted file mode 100644 index 7b5e6043cc..0000000000 --- a/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_aiccu.lua +++ /dev/null @@ -1,136 +0,0 @@ --- Copyright 2015 Paul Oranje <por@xs4all.nl> --- Licensed to the public under the Apache License 2.0. - -local map, section, net = ... - --- config read by /lib/netifd/proto/aiccu.sh -local username, password, protocol, server, tunnelid, ip6prefix, requiretls, nat, heartbeat, - verbose, ntpsynctimeout, ip6addr, sourcerouting, defaultroute - --- generic parameters -local metric, ttl, mtu - - -username = section:taboption("general", Value, "username", - translate("Server username"), - translate("SIXXS-handle[/Tunnel-ID]")) -username.datatype = "string" - -password = section:taboption("general", Value, "password", - translate("Server password"), - translate("Server password, enter the specific password of the tunnel when the username contains the tunnel ID")) -password.datatype = "string" -password.password = true - - ---[[ SIXXS supports only TIC as tunnel broker protocol, no use setting it. -protocol = section:taboption("general", ListValue, "protocol", - translate("Tunnel broker protocol"), - translate("SIXXS supports TIC only, for static tunnels using IP protocol 41 (RFC4213) use 6in4 instead")) - -protocol:value("tic", "TIC") -protocol:value("tsp", "TSP") -protocol:value("l2tp", "L2TP") -protocol.default = "tic" -protocol.optional = true ---]] - - -server = section:taboption("general", Value, "server", - translate("Tunnel setup server"), - translate("Optional, specify to override default server (tic.sixxs.net)")) -server.datatype = "host(0)" -server.optional = true - - -tunnelid = section:taboption("general", Value, "tunnelid", - translate("Tunnel ID"), - translate("Optional, use when the SIXXS account has more than one tunnel")) -tunnelid.datatype = "string" -tunnelid.optional = true - - -local ip6prefix = section:taboption("general", Value, "ip6prefix", - translate("IPv6 prefix"), - translate("Routed IPv6 prefix for downstream interfaces")) -ip6prefix.datatype = "ip6addr" -ip6prefix.optional = true - - -heartbeat = s:taboption("general", ListValue, "heartbeat", - translate("Tunnel type"), - translate("Also see <a href=\"https://www.sixxs.net/faq/connectivity/?faq=comparison\">Tunneling Comparison</a> on SIXXS")) -heartbeat:value("0", translate("AYIYA")) -heartbeat:value("1", translate("Heartbeat")) -heartbeat.default = "0" - - -nat = section:taboption("general", Flag, "nat", - translate("Behind NAT"), - translate("The tunnel end-point is behind NAT, defaults to disabled and only applies to AYIYA")) -nat.optional = true -nat.default = nat.disabled - - -requiretls = section:taboption("general", Flag, "requiretls", - translate("Require TLS"), - translate("Connection to server fails when TLS cannot be used")) -requiretls.optional = true -requiretls.default = requiretls.disabled - - -verbose = section:taboption("advanced", Flag, "verbose", - translate("Verbose"), - translate("Verbose logging by aiccu daemon")) -verbose.optional = true -verbose.default = verbose.disabled - - -ntpsynctimeout = section:taboption("advanced", Value, "ntpsynctimeout", - translate("NTP sync time-out"), - translate("Wait for NTP sync that many seconds, seting to 0 disables waiting (optional)")) -ntpsynctimeout.datatype = "uinteger" -ntpsynctimeout.placeholder = "90" -ntpsynctimeout.optional = true - - -ip6addr = section:taboption("advanced", Value, "ip6addr", - translate("Local IPv6 address"), - translate("IPv6 address delegated to the local tunnel endpoint (optional)")) -ip6addr.datatype = "ip6addr" -ip6addr.optional = true - - -defaultroute = section:taboption("advanced", Flag, "defaultroute", - translate("Default route"), - translate("Whether to create an IPv6 default route over the tunnel")) -defaultroute.default = defaultroute.enabled -defaultroute.optional = true - - -sourcerouting = section:taboption("advanced", Flag, "sourcerouting", - translate("Source routing"), - translate("Whether to route only packets from delegated prefixes")) -sourcerouting.default = sourcerouting.enabled -sourcerouting.optional = true - - -metric = section:taboption("advanced", Value, "metric", - translate("Use gateway metric")) -metric.datatype = "uinteger" -metric.placeholder = "0" -metric:depends("defaultroute", defaultroute.enabled) - - -ttl = section:taboption("advanced", Value, "ttl", - translate("Use TTL on tunnel interface")) -ttl.datatype = "range(1,255)" -ttl.placeholder = "64" - - -mtu = section:taboption("advanced", Value, "mtu", - translate("Use MTU on tunnel interface"), - translate("minimum 1280, maximum 1480")) -mtu.datatype = "range(1280,1480)" -mtu.placeholder = "1280" - diff --git a/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_dhcpv6.lua b/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_dhcpv6.lua index c843161c6f..76caedcb37 100644 --- a/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_dhcpv6.lua +++ b/protocols/luci-proto-ipv6/luasrc/model/cbi/admin_network/proto_dhcpv6.lua @@ -14,7 +14,7 @@ o.default = "try" o = section:taboption("general", Value, "reqprefix", translate("Request IPv6-prefix of length")) -o:value("auto", translate("automatic")) +o:value("auto", translate("Automatic")) o:value("no", translate("disabled")) o:value("48") o:value("52") diff --git a/protocols/luci-proto-ipv6/luasrc/model/network/proto_4x6.lua b/protocols/luci-proto-ipv6/luasrc/model/network/proto_4x6.lua index d876d69ba8..7508e0d4b0 100644 --- a/protocols/luci-proto-ipv6/luasrc/model/network/proto_4x6.lua +++ b/protocols/luci-proto-ipv6/luasrc/model/network/proto_4x6.lua @@ -52,12 +52,13 @@ for _, p in ipairs({"dslite", "map", "464xlat"}) do function proto.contains_interface(self, ifname) return (netmod:ifnameof(ifc) == self:ifname()) end - - if p == "dslite" then - netmod:register_pattern_virtual("^ds-%w") - elseif p == "map" then - netmod:register_pattern_virtual("^map-%w") - elseif p == "464xlat" then - netmod:register_pattern_virtual("^464-%w") - end end + +netmod:register_pattern_virtual("^464%-%w") +netmod:register_pattern_virtual("^ds%-%w") +netmod:register_pattern_virtual("^map%-%w") + +netmod:register_error_code("AFTR_DNS_FAIL", luci.i18n.translate("Unable to resolve AFTR host name")) +netmod:register_error_code("INVALID_MAP_RULE", luci.i18n.translate("MAP rule is invalid")) +netmod:register_error_code("NO_MATCHING_PD", luci.i18n.translate("No matching prefix delegation")) +netmod:register_error_code("UNSUPPORTED_TYPE", luci.i18n.translate("Unsupported MAP type")) diff --git a/protocols/luci-proto-ipv6/luasrc/model/network/proto_6x4.lua b/protocols/luci-proto-ipv6/luasrc/model/network/proto_6x4.lua index d267ce9119..9a4396c5be 100644 --- a/protocols/luci-proto-ipv6/luasrc/model/network/proto_6x4.lua +++ b/protocols/luci-proto-ipv6/luasrc/model/network/proto_6x4.lua @@ -46,5 +46,5 @@ for _, p in ipairs({"6in4", "6to4", "6rd"}) do return (netmod:ifnameof(ifc) == self:ifname()) end - netmod:register_pattern_virtual("^%s-%%w" % p) + netmod:register_pattern_virtual("^%s%%-%%w" % p) end diff --git a/protocols/luci-proto-ncm/Makefile b/protocols/luci-proto-ncm/Makefile new file mode 100644 index 0000000000..5fd9c9a266 --- /dev/null +++ b/protocols/luci-proto-ncm/Makefile @@ -0,0 +1,14 @@ +# +# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org> +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=Support for NCM +LUCI_DEPENDS:=+comgt-ncm + +include ../../luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua b/protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua new file mode 100644 index 0000000000..917c88c92c --- /dev/null +++ b/protocols/luci-proto-ncm/luasrc/model/cbi/admin_network/proto_ncm.lua @@ -0,0 +1,157 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2015 Cezary Jackiewicz <cezary.jackiewicz@gmail.com> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/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/cdc-wdm*") + or nixio.fs.glob("/dev/ttyUSB*") + +if device_suggestions then + local node + for node in device_suggestions do + device:value(node) + end +end + + +mode = section:taboption("general", Value, "mode", translate("Service Type")) +mode.default = "auto" +mode:value("preferlte", translate("Prefer LTE")) +mode:value("preferumts", translate("Prefer UMTS")) +mode:value("lte", "LTE") +mode:value("umts", "UMTS/GPRS") +mode:value("gsm", translate("GPRS only")) +mode:value("auto", translate("auto")) + + +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", ListValue, "ipv6") + ipv6:value("auto", translate("Automatic")) + ipv6:value("0", translate("Disabled")) + ipv6:value("1", translate("Manual")) + ipv6.default = "auto" + +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/protocols/luci-proto-ncm/luasrc/model/network/proto_ncm.lua b/protocols/luci-proto-ncm/luasrc/model/network/proto_ncm.lua new file mode 100644 index 0000000000..49abe23472 --- /dev/null +++ b/protocols/luci-proto-ncm/luasrc/model/network/proto_ncm.lua @@ -0,0 +1,69 @@ +--[[ +LuCI - Network model - NCM protocol extension + +Copyright 2015 Cezary Jackiewicz <cezary.jackiewicz@gmail.com> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +]]-- + +local netmod = luci.model.network + +local proto = netmod:register_protocol("ncm") +local interface = luci.model.network.interface + +function proto.get_i18n(self) + return luci.i18n.translate("NCM") +end + +function proto.opkg_package(self) + return "comgt-ncm" +end + +function proto.is_installed(self) + return nixio.fs.access("/lib/netifd/proto/ncm.sh") +end + +function proto.is_floating(self) + return true +end + +function proto.is_virtual(self) + return true +end + +function proto.get_interface(self) + local _ifname=netmod.protocol.ifname(self) + if not _ifname then + _ifname = "wan" + end + return interface(_ifname, self) +end + +function proto.get_interfaces(self) + return nil +end + +function proto.contains_interface(self, ifc) + return (netmod:ifnameof(ifc) == self:ifname()) +end + +netmod:register_pattern_virtual("^ncm%-%w") + +netmod:register_error_code("CONFIGURE_FAILED", luci.i18n.translate("Configuration failed")) +netmod:register_error_code("DISCONNECT_FAILED", luci.i18n.translate("Disconnection attempt failed")) +netmod:register_error_code("FINALIZE_FAILED", luci.i18n.translate("Finalizing failed")) +netmod:register_error_code("GETINFO_FAILED", luci.i18n.translate("Modem information query failed")) +netmod:register_error_code("INITIALIZE_FAILED", luci.i18n.translate("Initialization failure")) +netmod:register_error_code("SETMODE_FAILED", luci.i18n.translate("Setting operation mode failed")) +netmod:register_error_code("UNSUPPORTED_MODEM", luci.i18n.translate("Unsupported modem")) diff --git a/protocols/luci-proto-openconnect/luasrc/model/cbi/admin_network/proto_openconnect.lua b/protocols/luci-proto-openconnect/luasrc/model/cbi/admin_network/proto_openconnect.lua index ad3f2edf0b..5adfccae48 100644 --- a/protocols/luci-proto-openconnect/luasrc/model/cbi/admin_network/proto_openconnect.lua +++ b/protocols/luci-proto-openconnect/luasrc/model/cbi/admin_network/proto_openconnect.lua @@ -19,8 +19,6 @@ port = section:taboption("general", Value, "port", translate("VPN Server port")) port.placeholder = "443" port.datatype = "port" -ifname = section:taboption("general", Value, "interface", translate("Output Interface")) -ifname.template = "cbi/network_netlist" defaultroute = section:taboption("advanced", Flag, "defaultroute", translate("Use default gateway"), @@ -38,11 +36,13 @@ metric:depends("defaultroute", defaultroute.enabled) section:taboption("general", Value, "serverhash", translate("VPN Server's certificate SHA1 hash")) -section:taboption("general", Value, "authgroup", translate("AuthGroup")) +section:taboption("general", Value, "authgroup", translate("Auth Group")) username = section:taboption("general", Value, "username", translate("Username")) password = section:taboption("general", Value, "password", translate("Password")) password.password = true +password2 = section:taboption("general", Value, "password2", translate("Password2")) +password2.password = true cert = section:taboption("advanced", Value, "usercert", translate("User certificate (PEM encoded)")) @@ -84,3 +84,7 @@ function ca.write(self, section, value) value = value:gsub("\r\n?", "\n") nixio.fs.writefile(oc_ca_file, value) end + +mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU")) +mtu.placeholder = "1406" +mtu.datatype = "max(9200)" diff --git a/protocols/luci-proto-openconnect/luasrc/model/network/proto_openconnect.lua b/protocols/luci-proto-openconnect/luasrc/model/network/proto_openconnect.lua index 0af77d0140..0944c7fe6a 100644 --- a/protocols/luci-proto-openconnect/luasrc/model/network/proto_openconnect.lua +++ b/protocols/luci-proto-openconnect/luasrc/model/network/proto_openconnect.lua @@ -42,4 +42,4 @@ function proto.contains_interface(self, ifc) end -netmod:register_pattern_virtual("^vpn-%w") +netmod:register_pattern_virtual("^vpn%-%w") diff --git a/protocols/luci-proto-ppp/Makefile b/protocols/luci-proto-ppp/Makefile index 70db744ea6..dd1859ef54 100644 --- a/protocols/luci-proto-ppp/Makefile +++ b/protocols/luci-proto-ppp/Makefile @@ -9,6 +9,8 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Support for PPP/PPPoE/PPPoA/PPtP LUCI_DEPENDS:= +PKG_LICENSE:=Apache-2.0 + include ../../luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua index 506170c2de..604f019ee6 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_l2tp.lua @@ -18,13 +18,13 @@ password = section:taboption("general", Value, "password", translate("PAP/CHAP p password.password = true if luci.model.network:has_ipv6() then - - ipv6 = section:taboption("advanced", ListValue, "ipv6") - ipv6:value("auto", translate("Automatic")) - ipv6:value("0", translate("Disabled")) - ipv6:value("1", translate("Manual")) - ipv6.default = "auto" - + ipv6 = section:taboption("advanced", ListValue, "ipv6", + translate("Obtain IPv6-Address"), + translate("Enable IPv6 negotiation on the PPP link")) + ipv6:value("auto", translate("Automatic")) + ipv6:value("0", translate("Disabled")) + ipv6:value("1", translate("Manual")) + ipv6.default = "auto" end defaultroute = section:taboption("advanced", Flag, "defaultroute", diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua index b14db5966d..355d9b5b39 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_ppp.lua @@ -30,13 +30,13 @@ password.password = true if luci.model.network:has_ipv6() then - - ipv6 = section:taboption("advanced", ListValue, "ipv6") - ipv6:value("auto", translate("Automatic")) - ipv6:value("0", translate("Disabled")) - ipv6:value("1", translate("Manual")) - ipv6.default = "auto" - + ipv6 = section:taboption("advanced", ListValue, "ipv6", + translate("Obtain IPv6-Address"), + translate("Enable IPv6 negotiation on the PPP link")) + ipv6:value("auto", translate("Automatic")) + ipv6:value("0", translate("Disabled")) + ipv6:value("1", translate("Manual")) + ipv6.default = "auto" end diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua index 8f463e5d76..a5f76a38ad 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoa.lua @@ -36,13 +36,13 @@ password.password = true if luci.model.network:has_ipv6() then - - ipv6 = section:taboption("advanced", ListValue, "ipv6") - ipv6:value("auto", translate("Automatic")) - ipv6:value("0", translate("Disabled")) - ipv6:value("1", translate("Manual")) - ipv6.default = "auto" - + ipv6 = section:taboption("advanced", ListValue, "ipv6", + translate("Obtain IPv6-Address"), + translate("Enable IPv6 negotiation on the PPP link")) + ipv6:value("auto", translate("Automatic")) + ipv6:value("0", translate("Disabled")) + ipv6:value("1", translate("Manual")) + ipv6.default = "auto" end diff --git a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua index 5a05cd2065..078b5ffe94 100644 --- a/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua +++ b/protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua @@ -30,13 +30,13 @@ service.placeholder = translate("auto") if luci.model.network:has_ipv6() then - - ipv6 = section:taboption("advanced", ListValue, "ipv6") - ipv6:value("auto", translate("Automatic")) - ipv6:value("0", translate("Disabled")) - ipv6:value("1", translate("Manual")) - ipv6.default = "auto" - + ipv6 = section:taboption("advanced", ListValue, "ipv6", + translate("Obtain IPv6-Address"), + translate("Enable IPv6 negotiation on the PPP link")) + ipv6:value("auto", translate("Automatic")) + ipv6:value("0", translate("Disabled")) + ipv6:value("1", translate("Manual")) + ipv6.default = "auto" end @@ -114,6 +114,14 @@ keepalive_interval.placeholder = "5" keepalive_interval.datatype = "min(1)" +host_uniq = section:taboption("advanced", Value, "host_uniq", + translate("Host-Uniq tag content"), + translate("Raw hex-encoded bytes. Leave empty unless your ISP require this")) + +host_uniq.placeholder = translate("auto") +host_uniq.datatype = "hex" + + demand = section:taboption("advanced", Value, "demand", translate("Inactivity timeout"), translate("Close inactive connection after the given amount of seconds, use 0 to persist connection")) diff --git a/protocols/luci-proto-ppp/luasrc/model/network/proto_ppp.lua b/protocols/luci-proto-ppp/luasrc/model/network/proto_ppp.lua index 7bbd78fa1e..3afb7de4f5 100644 --- a/protocols/luci-proto-ppp/luasrc/model/network/proto_ppp.lua +++ b/protocols/luci-proto-ppp/luasrc/model/network/proto_ppp.lua @@ -4,7 +4,7 @@ local netmod = luci.model.network local _, p -for _, p in ipairs({"ppp", "pptp", "pppoe", "pppoa", "3g", "l2tp", "pppossh"}) do +for _, p in ipairs({"ppp", "pptp", "pppoe", "pppoa", "l2tp", "pppossh"}) do local proto = netmod:register_protocol(p) @@ -13,8 +13,6 @@ for _, p in ipairs({"ppp", "pptp", "pppoe", "pppoa", "3g", "l2tp", "pppossh"}) d return luci.i18n.translate("PPP") elseif p == "pptp" then return luci.i18n.translate("PPtP") - elseif p == "3g" then - return luci.i18n.translate("UMTS/GPRS/EV-DO") elseif p == "pppoe" then return luci.i18n.translate("PPPoE") elseif p == "pppoa" then @@ -33,8 +31,6 @@ for _, p in ipairs({"ppp", "pptp", "pppoe", "pppoa", "3g", "l2tp", "pppossh"}) d function proto.opkg_package(self) if p == "ppp" then return p - elseif p == "3g" then - return "comgt" elseif p == "pptp" then return "ppp-mod-pptp" elseif p == "pppoe" then @@ -55,8 +51,6 @@ for _, p in ipairs({"ppp", "pptp", "pppoe", "pppoa", "3g", "l2tp", "pppossh"}) d return (nixio.fs.glob("/usr/lib/pppd/*/rp-pppoe.so")() ~= nil) elseif p == "pptp" then return (nixio.fs.glob("/usr/lib/pppd/*/pptp.so")() ~= nil) - elseif p == "3g" then - return nixio.fs.access("/lib/netifd/proto/3g.sh") elseif p == "l2tp" then return nixio.fs.access("/lib/netifd/proto/l2tp.sh") elseif p == "pppossh" then @@ -90,5 +84,5 @@ for _, p in ipairs({"ppp", "pptp", "pppoe", "pppoa", "3g", "l2tp", "pppossh"}) d end end - netmod:register_pattern_virtual("^%s-%%w" % p) + netmod:register_pattern_virtual("^%s%%-%%w" % p) end diff --git a/protocols/luci-proto-qmi/luasrc/model/network/proto_qmi.lua b/protocols/luci-proto-qmi/luasrc/model/network/proto_qmi.lua index cca8af109e..c414378d80 100644 --- a/protocols/luci-proto-qmi/luasrc/model/network/proto_qmi.lua +++ b/protocols/luci-proto-qmi/luasrc/model/network/proto_qmi.lua @@ -48,4 +48,8 @@ function proto.contains_interface(self, ifc) return (netmod:ifnameof(ifc) == self:ifname()) end -netmod:register_pattern_virtual("^qmi-%w") +netmod:register_pattern_virtual("^qmi%-%w") + +netmod:register_error_code("CALL_FAILED", luci.i18n.translate("Call failed")) +netmod:register_error_code("NO_CID", luci.i18n.translate("Unable to obtain client ID")) +netmod:register_error_code("PLMN_FAILED", luci.i18n.translate("Setting PLMN failed")) diff --git a/protocols/luci-proto-relay/luasrc/model/network/proto_relay.lua b/protocols/luci-proto-relay/luasrc/model/network/proto_relay.lua index 5d40fc72d5..a2dabf9afe 100644 --- a/protocols/luci-proto-relay/luasrc/model/network/proto_relay.lua +++ b/protocols/luci-proto-relay/luasrc/model/network/proto_relay.lua @@ -4,7 +4,7 @@ local netmod = luci.model.network local device = luci.util.class(netmod.interface) -netmod:register_pattern_virtual("^relay-%w") +netmod:register_pattern_virtual("^relay%-%w") local proto = netmod:register_protocol("relay") diff --git a/protocols/luci-proto-vpnc/Makefile b/protocols/luci-proto-vpnc/Makefile index 9c77e67a5c..0800e279fe 100644 --- a/protocols/luci-proto-vpnc/Makefile +++ b/protocols/luci-proto-vpnc/Makefile @@ -10,9 +10,6 @@ LUCI_TITLE:=Support for VPNC VPN LUCI_DEPENDS:=+vpnc LUCI_PKGARCH:=all -PKG_NAME:=luci-proto-vpnc -PKG_RELEASE=1 -PKG_VERSION:=1.0.0 PKG_MAINTAINER:=Daniel Dickinson <openwrt@daniel.thecshore.com> PKG_LICENSE:=Apache-2.0 @@ -20,4 +17,4 @@ LUA_TARGET:=source include ../../luci.mk -# call BuildPackage - OpenWrt buildroot signature
\ No newline at end of file +# call BuildPackage - OpenWrt buildroot signature diff --git a/protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua b/protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua index a47ce1588c..d8217ce8d3 100644 --- a/protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua +++ b/protocols/luci-proto-vpnc/luasrc/model/cbi/admin_network/proto_vpnc.lua @@ -67,7 +67,7 @@ enable_no_enc.default = enable_no_enc.disabled enable_single_des = section:taboption("general", Flag, "enable_single_des", translate("Enable Single DES"), - translate("If checked, 1DES is enaled")) + translate("If checked, 1DES is enabled")) enable_no_enc.default = enable_single_des.disabled dpd_idle = section:taboption("general", Value, "dpd_idle", translate("DPD Idle Timeout")) diff --git a/protocols/luci-proto-vpnc/luasrc/model/network/proto_vpnc.lua b/protocols/luci-proto-vpnc/luasrc/model/network/proto_vpnc.lua index f4cae0bd2a..6c3136e384 100644 --- a/protocols/luci-proto-vpnc/luasrc/model/network/proto_vpnc.lua +++ b/protocols/luci-proto-vpnc/luasrc/model/network/proto_vpnc.lua @@ -42,5 +42,5 @@ function proto.contains_interface(self, ifc) end -netmod:register_pattern_virtual("^vpn-%w") +netmod:register_pattern_virtual("^vpn%-%w") diff --git a/protocols/luci-proto-wireguard/Makefile b/protocols/luci-proto-wireguard/Makefile index ed94a557b6..0dc70cf31e 100644 --- a/protocols/luci-proto-wireguard/Makefile +++ b/protocols/luci-proto-wireguard/Makefile @@ -8,6 +8,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=Support for WireGuard VPN LUCI_DEPENDS:=+kmod-wireguard +wireguard-tools +LUCI_PKGARCH:=all PKG_MAINTAINER:=Dan Luedtke <mail@danrl.com> diff --git a/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua b/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua index 774c6db22b..64e256a517 100644 --- a/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua +++ b/protocols/luci-proto-wireguard/luasrc/model/cbi/admin_network/proto_wireguard.lua @@ -1,11 +1,11 @@ --- Copyright 2016 Dan Luedtke <mail@danrl.com> +-- Copyright 2016-2017 Dan Luedtke <mail@danrl.com> -- Licensed to the public under the Apache License 2.0. local map, section, net = ... local ifname = net:get_interface():name() local private_key, listen_port -local metric, mtu, preshared_key +local metric, mtu, preshared_key, description local peers, public_key, allowed_ips, endpoint, persistent_keepalive @@ -19,7 +19,7 @@ private_key = section:taboption( translate("Required. Base64-encoded private key for this interface.") ) private_key.password = true -private_key.datatype = "rangelength(44, 44)" +private_key.datatype = "and(base64,rangelength(44,44))" private_key.optional = false @@ -31,9 +31,19 @@ listen_port = section:taboption( translate("Optional. UDP port used for outgoing and incoming packets.") ) listen_port.datatype = "port" -listen_port.placeholder = "51820" +listen_port.placeholder = translate("random") listen_port.optional = true +addresses = section:taboption( + "general", + DynamicList, + "addresses", + translate("IP Addresses"), + translate("Recommended. IP addresses of the WireGuard interface.") +) +addresses.datatype = "ipaddr" +addresses.optional = true + -- advanced -------------------------------------------------------------------- @@ -42,7 +52,7 @@ metric = section:taboption( Value, "metric", translate("Metric"), - translate("Optional.") + translate("Optional") ) metric.datatype = "uinteger" metric.placeholder = "0" @@ -56,22 +66,20 @@ mtu = section:taboption( translate("MTU"), translate("Optional. Maximum Transmission Unit of tunnel interface.") ) -mtu.datatype = "range(1280,1423)" -mtu.placeholder = "1423" +mtu.datatype = "range(1280,1420)" +mtu.placeholder = "1420" mtu.optional = true - -preshared_key = section:taboption( +fwmark = section:taboption( "advanced", Value, - "preshared_key", - translate("Preshared Key"), - translate("Optional. Adds in an additional layer of symmetric-key " .. - "cryptography for post-quantum resistance.") + "fwmark", + translate("Firewall Mark"), + translate("Optional. 32-bit mark for outgoing encrypted packets. " .. + "Enter value in hex, starting with <code>0x</code>.") ) -preshared_key.password = true -preshared_key.datatype = "rangelength(44, 44)" -preshared_key.optional = true +fwmark.datatype = "hex(4)" +fwmark.optional = true -- peers ----------------------------------------------------------------------- @@ -81,23 +89,46 @@ peers = map:section( "wireguard_" .. ifname, translate("Peers"), translate("Further information about WireGuard interfaces and peers " .. - "at <a href=\"http://wireguard.io\">wireguard.io</a>.") + "at <a href=\"http://wireguard.com\">wireguard.com</a>.") ) peers.template = "cbi/tsection" peers.anonymous = true peers.addremove = true +description = peers:option( + Value, + "description", + translate("Description"), + translate("Optional. Description of peer.")) +description.placeholder = "My Peer" +description.datatype = "string" +description.optional = true + + public_key = peers:option( Value, "public_key", translate("Public Key"), - translate("Required. Public key of peer.") + translate("Required. Base64-encoded public key of peer.") ) -public_key.datatype = "rangelength(44, 44)" +public_key.datatype = "and(base64,rangelength(44,44))" public_key.optional = false +preshared_key = peers:option( + Value, + "preshared_key", + translate("Preshared Key"), + translate("Optional. Base64-encoded preshared key. " .. + "Adds in an additional layer of symmetric-key " .. + "cryptography for post-quantum resistance.") +) +preshared_key.password = true +preshared_key.datatype = "and(base64,rangelength(44,44))" +preshared_key.optional = true + + allowed_ips = peers:option( DynamicList, "allowed_ips", @@ -144,5 +175,5 @@ persistent_keepalive = peers:option( translate("Optional. Seconds between keep alive messages. " .. "Default is 0 (disabled). Recommended value if " .. "this device is behind a NAT is 25.")) -persistent_keepalive.datatype = "range(0, 65535)" +persistent_keepalive.datatype = "range(0,65535)" persistent_keepalive.placeholder = "0" |