+if has_pppd or has_pppoe or has_pppoa or has_3g or has_pptp then
+ ka = s:taboption("ppp", Value, "keepalive",
+ translate("Keep-Alive"),
+ translate("Number of failed connection tests to initiate automatic reconnect")
+ )
+ ka:depends("proto", "pptp")
+ ka:depends("proto", "pppoe")
+ ka:depends("proto", "pppoa")
+ ka:depends("proto", "ppp")
+ ka:depends("proto", "3g")
+
+ demand = s:taboption("ppp", Value, "demand",
+ translate("Automatic Disconnect"),
+ translate("Time (in seconds) after which an unused connection will be closed")
+ )
+ demand.optional = true
+ demand.datatype = "uinteger"
+ demand:depends("proto", "pptp")
+ demand:depends("proto", "pppoe")
+ demand:depends("proto", "pppoa")
+ demand:depends("proto", "ppp")
+ demand:depends("proto", "3g")
+end
+
+if has_pppoa then
+ encaps = s:taboption("atm", ListValue, "encaps", translate("PPPoA Encapsulation"))
+ encaps:depends("proto", "pppoa")
+ encaps:value("vc", "VC-Mux")
+ encaps:value("llc", "LLC")
+
+ atmdev = s:taboption("atm", Value, "atmdev", translate("ATM device number"))
+ atmdev:depends("proto", "pppoa")
+ atmdev.default = "0"
+ atmdev.datatype = "uinteger"
+
+ vci = s:taboption("atm", Value, "vci", translate("ATM Virtual Channel Identifier (VCI)"))
+ vci:depends("proto", "pppoa")
+ vci.default = "35"
+ vci.datatype = "uinteger"
+
+ vpi = s:taboption("atm", Value, "vpi", translate("ATM Virtual Path Identifier (VPI)"))
+ vpi:depends("proto", "pppoa")
+ vpi.default = "8"
+ vpi.datatype = "uinteger"
+end
+
+if has_pptp or has_pppd or has_pppoe or has_pppoa or has_3g then
+ device = s:taboption("general", Value, "device",
+ translate("Modem device"),
+ translate("The device node of your modem, e.g. /dev/ttyUSB0")
+ )
+ device:depends("proto", "ppp")
+ device:depends("proto", "3g")
+
+ defaultroute = s:taboption("ppp", Flag, "defaultroute",
+ translate("Replace default route"),
+ translate("Let pppd replace the current default route to use the PPP interface after successful connect")
+ )
+ 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(...)
+ return ( AbstractValue.cfgvalue(...) or '1' )
+ end
+
+ peerdns = s:taboption("ppp", Flag, "peerdns",
+ translate("Use peer DNS"),
+ translate("Configure the local DNS server to use the name servers adverticed by the PPP peer")
+ )
+ 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' )
+ end
+
+ if has_ipv6 then
+ ipv6 = s:taboption("ppp", Flag, "ipv6", translate("Enable IPv6 on PPP link") )
+ ipv6:depends("proto", "ppp")
+ ipv6:depends("proto", "pppoa")
+ ipv6:depends("proto", "pppoe")
+ ipv6:depends("proto", "pptp")
+ ipv6:depends("proto", "3g")
+ end
+
+ connect = s:taboption("ppp", Value, "connect",
+ translate("Connect script"),
+ translate("Let pppd run this script after establishing the PPP link")
+ )
+ connect:depends("proto", "ppp")
+ connect:depends("proto", "pppoe")
+ connect:depends("proto", "pppoa")
+ connect:depends("proto", "pptp")
+ connect:depends("proto", "3g")
+
+ disconnect = s:taboption("ppp", Value, "disconnect",
+ translate("Disconnect script"),
+ translate("Let pppd run this script before tearing down the PPP link")
+ )
+ disconnect:depends("proto", "ppp")
+ disconnect:depends("proto", "pppoe")
+ disconnect:depends("proto", "pppoa")
+ disconnect:depends("proto", "pptp")
+ disconnect:depends("proto", "3g")
+
+ pppd_options = s:taboption("ppp", Value, "pppd_options",
+ translate("Additional pppd options"),
+ translate("Specify additional command line arguments for pppd here")
+ )
+ 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:taboption("ppp", Value, "maxwait",
+ translate("Setup wait time"),
+ translate("Seconds to wait for the modem to become ready before attempting to connect")
+ )
+ maxwait:depends("proto", "3g")
+ maxwait.default = "0"
+ maxwait.optional = true
+ maxwait.datatype = "uinteger"
+end
+
+s2 = m:section(TypedSection, "alias", translate("IP-Aliases"))
+s2.addremove = true
+
+s2:depends("interface", arg[1])
+s2.defaults.interface = arg[1]
+
+s2:tab("general", translate("General Setup"))