From 918e1f8658a34a52a7f97512d15ad234913d89b5 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 25 Jan 2009 12:15:39 +0000 Subject: Fix PPP support (closes #41) --- .../admin-core/root/lib/uci/schema/default/network | 59 ++++++++++++++++++++++ .../luasrc/model/cbi/admin_network/ifaces.lua | 46 +++++++++++++++-- 2 files changed, 102 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/admin-core/root/lib/uci/schema/default/network b/modules/admin-core/root/lib/uci/schema/default/network index e74d9d76d..0ea439d2d 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 0530b5d57..986c7e36f 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", -- cgit v1.2.3