From 918e1f8658a34a52a7f97512d15ad234913d89b5 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 25 Jan 2009 12:15:39 +0000 Subject: [PATCH] Fix PPP support (closes #41) --- i18n/english/luasrc/i18n/admin-core.en.lua | 2 + i18n/english/luasrc/i18n/admin-core.en.xml | 3 + i18n/german/luasrc/i18n/admin-core.de.lua | 2 + i18n/german/luasrc/i18n/admin-core.de.xml | 1 + .../root/lib/uci/schema/default/network | 59 +++++++++++++++++++ .../luasrc/model/cbi/admin_network/ifaces.lua | 46 ++++++++++++++- 6 files changed, 110 insertions(+), 3 deletions(-) diff --git a/i18n/english/luasrc/i18n/admin-core.en.lua b/i18n/english/luasrc/i18n/admin-core.en.lua index 29b03ae9a1..3f2991c298 100644 --- a/i18n/english/luasrc/i18n/admin-core.en.lua +++ b/i18n/english/luasrc/i18n/admin-core.en.lua @@ -227,6 +227,8 @@ network_interface_pincode_desc = 'Make sure that you provide the correct pin cod network_interface_service = 'Service type' network_interface_maxwait = 'Setup wait time' network_interface_maxwait_desc = 'Seconds to wait for the modem to become ready before attempting to connect' +network_interface_encaps = 'PPPoA Encapsulation' + a_n_r_routes1 = 'Routes specify over which interface and gateway a certain host or network can be reached.' a_n_routes_static = 'Static Routes' a_n_routes_static4 = 'Static IPv4 Routes' diff --git a/i18n/english/luasrc/i18n/admin-core.en.xml b/i18n/english/luasrc/i18n/admin-core.en.xml index 16c4bdbd27..1040a1726f 100644 --- a/i18n/english/luasrc/i18n/admin-core.en.xml +++ b/i18n/english/luasrc/i18n/admin-core.en.xml @@ -227,6 +227,9 @@ Service type Setup wait time Seconds to wait for the modem to become ready before attempting to connect +PPPoA Encapsulation + + Routes specify over which interface and gateway a certain host or network can be reached. Static Routes Static IPv4 Routes diff --git a/i18n/german/luasrc/i18n/admin-core.de.lua b/i18n/german/luasrc/i18n/admin-core.de.lua index ec1b5f951a..ee3cbefbf1 100644 --- a/i18n/german/luasrc/i18n/admin-core.de.lua +++ b/i18n/german/luasrc/i18n/admin-core.de.lua @@ -235,6 +235,8 @@ network_interface_service = 'Dienstart' network_interface_maxwait = 'Initialisierungszeit' network_interface_maxwait_desc = 'Zeit in Sekunden um auf die Initialisierung des Modems zu warten bevor ein Verbindungsversuch unternommen wird' network_switch_desc = 'Die zu einem VLAN gehörenden Schnittstellen werden durch Leerzeichen getrennt. Die Schnittstelle mit der höchsten Nummer (meistens 5) bildet in der Regel die Verbindung zur internen Netzschnittstelle des Routers. Bei Geräten mit 5 Schnittstellen ist in der Regel die Schnittstelle mit der niedrigsten Nummer (0) die standardmäßige Uplinkschnittstelle des Routers.' +network_interface_encaps = 'PPPoA Kapselung' + noise = 'Rausch' power = 'Leistung' routes = 'Routen' diff --git a/i18n/german/luasrc/i18n/admin-core.de.xml b/i18n/german/luasrc/i18n/admin-core.de.xml index 5f4e3a7d02..b3555ee1f9 100644 --- a/i18n/german/luasrc/i18n/admin-core.de.xml +++ b/i18n/german/luasrc/i18n/admin-core.de.xml @@ -238,6 +238,7 @@ Initialisierungszeit Zeit in Sekunden um auf die Initialisierung des Modems zu warten bevor ein Verbindungsversuch unternommen wird Die zu einem VLAN gehörenden Schnittstellen werden durch Leerzeichen getrennt. Die Schnittstelle mit der höchsten Nummer (meistens 5) bildet in der Regel die Verbindung zur internen Netzschnittstelle des Routers. Bei Geräten mit 5 Schnittstellen ist in der Regel die Schnittstelle mit der niedrigsten Nummer (0) die standardmäßige Uplinkschnittstelle des Routers. +PPPoA Kapselung Rausch Leistung diff --git a/modules/admin-core/root/lib/uci/schema/default/network b/modules/admin-core/root/lib/uci/schema/default/network index e74d9d76d6..0ea439d2d1 100644 --- a/modules/admin-core/root/lib/uci/schema/default/network +++ b/modules/admin-core/root/lib/uci/schema/default/network @@ -10,6 +10,7 @@ config section list depends 'proto=static, ipaddr, netmask' list depends 'proto=static, ip6addr' list depends 'proto=pppoe, username, password' + list depends 'proto=pppoa, username, password, encaps, vpi, vci' list depends 'proto=ppp, device' list depends 'proto=3g, device' list depends 'proto=pptp, username, password, server' @@ -88,6 +89,7 @@ config variable list depends 'proto=pptp' list depends 'proto=ppp' list depends 'proto=3g' + list depends 'proto=pppoa' config variable option name 'demand' @@ -96,6 +98,7 @@ config variable option section 'network.interface' option datatype 'uint' list depends 'proto=pppoe' + list depends 'proto=pppoa' list depends 'proto=pptp' list depends 'proto=ppp' list depends 'proto=3g' @@ -105,6 +108,7 @@ config variable option title 'Username' option section 'network.interface' option datatype 'string' + list depends 'proto=pppoa' list depends 'proto=pppoe' list depends 'proto=pptp' list depends 'proto=ppp' @@ -116,10 +120,42 @@ config variable option section 'network.interface' option datatype 'string' list depends 'proto=pppoe' + list depends 'proto=pppoa' list depends 'proto=pptp' list depends 'proto=ppp' list depends 'proto=3g' +config variable + option name 'encaps' + option title 'PPPoA encapsulation mode' + option section 'network.interface' + option type 'enum' + list depends 'proto=pppoa' + +config enum + option variable 'network.interface.encaps' + option value 'vc' + option title 'VC' + +config enum + option variable 'network.interface.encaps' + option value 'llc' + option title 'LLC' + +config variable + option name 'vpi' + option title 'PPPoA VPI' + option section 'network.interface' + option datatype 'uint' + list depends 'proto=pppoa' + +config variable + option name 'vci' + option title 'PPPoA VCI' + option section 'network.interface' + option datatype 'uint' + list depends 'proto=pppoa' + config variable option name 'server' option title 'PPTP server' @@ -141,6 +177,9 @@ config variable option section 'network.interface' option datatype 'boolean' list depends 'proto=ppp' + list depends 'proto=pppoa' + list depends 'proto=pppoe' + list depends 'proto=pptp' list depends 'proto=3g' config variable @@ -149,6 +188,9 @@ config variable option section 'network.interface' option datatype 'boolean' list depends 'proto=ppp' + list depends 'proto=pppoe' + list depends 'proto=pppoa' + list depends 'proto=pptp' list depends 'proto=3g' config variable @@ -157,6 +199,9 @@ config variable option section 'network.interface' option datatype 'boolean' list depends 'proto=ppp' + list depends 'proto=pppoe' + list depends 'proto=pppoa' + list depends 'proto=pptp' list depends 'proto=3g' config variable @@ -165,6 +210,9 @@ config variable option section 'network.interface' option datatype 'file' list depends 'proto=ppp' + list depends 'proto=pppoe' + list depends 'proto=pppoa' + list depends 'proto=pptp' list depends 'proto=3g' config variable @@ -173,6 +221,9 @@ config variable option section 'network.interface' option datatype 'file' list depends 'proto=ppp' + list depends 'proto=pppoe' + list depends 'proto=pppoa' + list depends 'proto=pptp' list depends 'proto=3g' config variable @@ -181,6 +232,9 @@ config variable option section 'network.interface' option datatype 'string' list depends 'proto=ppp' + list depends 'proto=pppoe' + list depends 'proto=pppoa' + list depends 'proto=pptp' list depends 'proto=3g' config variable @@ -260,6 +314,11 @@ config enum option value 'pppoe' option title 'Interface is a PPPoE connection' +config enum + option variable 'network.interface.proto' + option value 'pppoa' + option title 'Interface is a PPPoA connection' + config enum option variable 'network.interface.proto' option value 'ppp' diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua index 0530b5d57a..986c7e36ff 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -165,11 +165,12 @@ if has_3g then pincode:depends("proto", "3g") end -if has_pppd or has_pppoe or has_3g or has_pptp then +if has_pppd or has_pppoe or has_pppoa or has_3g or has_pptp then user = s:option(Value, "username", translate("username")) user.rmempty = true user:depends("proto", "pptp") user:depends("proto", "pppoe") + user:depends("proto", "pppoa") user:depends("proto", "ppp") user:depends("proto", "3g") @@ -178,6 +179,7 @@ if has_pppd or has_pppoe or has_3g or has_pptp then pass.password = true pass:depends("proto", "pptp") pass:depends("proto", "pppoe") + pass:depends("proto", "pppoa") pass:depends("proto", "ppp") pass:depends("proto", "3g") @@ -188,6 +190,7 @@ if has_pppd or has_pppoe or has_3g or has_pptp then ka.optional = true ka:depends("proto", "pptp") ka:depends("proto", "pppoe") + ka:depends("proto", "pppoa") ka:depends("proto", "ppp") ka:depends("proto", "3g") @@ -198,11 +201,29 @@ if has_pppd or has_pppoe or has_3g or has_pptp then demand.optional = true demand:depends("proto", "pptp") demand:depends("proto", "pppoe") + demand:depends("proto", "pppoa") demand:depends("proto", "ppp") demand:depends("proto", "3g") end -if has_pppd or has_3g then +if has_pppoa then + encaps = s:option(ListValue, "encaps", translate("network_interface_encaps")) + encaps.optional = false + encaps:depends("proto", "pppoa") + encaps:value("", translate("cbi_select")) + encaps:value("vc", "VC") + encaps:value("llc", "LLC") + + vpi = s:option(Value, "vpi", "VPI") + vpi.optional = false + vpi:depends("proto", "pppoa") + + vci = s:option(Value, "vci", "VCI") + vci.optional = false + vci:depends("proto", "pppoa") +end + +if has_pptp or has_pppd or has_pppoe or has_pppoa or has_3g then device = s:option(Value, "device", translate("network_interface_device"), translate("network_interface_device_desc") @@ -215,6 +236,9 @@ if has_pppd or has_3g then translate("network_interface_defaultroute_desc") ) defaultroute:depends("proto", "ppp") + defaultroute:depends("proto", "pppoa") + defaultroute:depends("proto", "pppoe") + defaultroute:depends("proto", "pptp") defaultroute:depends("proto", "3g") defaultroute.rmempty = false function defaultroute.cfgvalue(...) @@ -226,6 +250,10 @@ if has_pppd or has_3g then translate("network_interface_peerdns_desc") ) peerdns:depends("proto", "ppp") + peerdns:depends("proto", "pppoa") + peerdns:depends("proto", "pppoe") + peerdns:depends("proto", "pptp") + peerdns:depends("proto", "3g") peerdns.rmempty = false function peerdns.cfgvalue(...) return ( AbstractValue.cfgvalue(...) or '1' ) @@ -233,7 +261,10 @@ if has_pppd or has_3g then ipv6 = s:option(Flag, "ipv6", translate("network_interface_ipv6") ) ipv6:depends("proto", "ppp") - --ipv6:depends("proto", "3g") + ipv6:depends("proto", "pppoa") + ipv6:depends("proto", "pppoe") + ipv6:depends("proto", "pptp") + ipv6:depends("proto", "3g") connect = s:option(Value, "connect", translate("network_interface_connect"), @@ -241,6 +272,9 @@ if has_pppd or has_3g then ) connect.optional = true connect:depends("proto", "ppp") + connect:depends("proto", "pppoe") + connect:depends("proto", "pppoa") + connect:depends("proto", "pptp") connect:depends("proto", "3g") disconnect = s:option(Value, "disconnect", @@ -249,6 +283,9 @@ if has_pppd or has_3g then ) disconnect.optional = true disconnect:depends("proto", "ppp") + disconnect:depends("proto", "pppoe") + disconnect:depends("proto", "pppoa") + disconnect:depends("proto", "pptp") disconnect:depends("proto", "3g") pppd_options = s:option(Value, "pppd_options", @@ -257,6 +294,9 @@ if has_pppd or has_3g then ) pppd_options.optional = true pppd_options:depends("proto", "ppp") + pppd_options:depends("proto", "pppoa") + pppd_options:depends("proto", "pppoe") + pppd_options:depends("proto", "pptp") pppd_options:depends("proto", "3g") maxwait = s:option(Value, "maxwait", -- 2.30.2