Fix PPP support (closes #41)

This commit is contained in:
Steven Barth 2009-01-25 12:16:33 +00:00
parent 767e03b575
commit 5be014ef72
6 changed files with 110 additions and 3 deletions

View file

@ -223,6 +223,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'

View file

@ -227,6 +227,9 @@
<i18n:msg xml:id="network_interface_service">Service type</i18n:msg>
<i18n:msg xml:id="network_interface_maxwait">Setup wait time</i18n:msg>
<i18n:msg xml:id="network_interface_maxwait_desc">Seconds to wait for the modem to become ready before attempting to connect</i18n:msg>
<i18n:msg xml:id="network_interface_encaps">PPPoA Encapsulation</i18n:msg>
<i18n:msg xml:id="a_n_r_routes1">Routes specify over which interface and gateway a certain host or network can be reached.</i18n:msg>
<i18n:msg xml:id="a_n_routes_static">Static Routes</i18n:msg>
<i18n:msg xml:id="a_n_routes_static4">Static IPv4 Routes</i18n:msg>

View file

@ -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'

View file

@ -238,6 +238,7 @@
<i18n:msg xml:id="network_interface_maxwait">Initialisierungszeit</i18n:msg>
<i18n:msg xml:id="network_interface_maxwait_desc">Zeit in Sekunden um auf die Initialisierung des Modems zu warten bevor ein Verbindungsversuch unternommen wird</i18n:msg>
<i18n:msg xml:id="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.</i18n:msg>
<i18n:msg xml:id="network_interface_encaps">PPPoA Kapselung</i18n:msg>
<i18n:msg xml:id="noise">Rausch</i18n:msg>
<i18n:msg xml:id="power">Leistung</i18n:msg>

View file

@ -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'

View file

@ -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",