+ Value.write(self, section, "%X" % value)
+ end
+end
+
+mac = s:taboption("physical", Value, "macaddr", translate("<abbr title=\"Media Access Control\">MAC</abbr>-Address"))
+mac:depends("proto", "none")
+mac:depends("proto", "static")
+mac:depends("proto", "dhcp")
+mac.placeholder = ifc and ifc:mac():upper()
+
+if has_3g then
+ service = s:taboption("general", ListValue, "service", translate("Service type"))
+ service:value("", translate("-- Please choose --"))
+ service:value("umts", "UMTS/GPRS")
+ service:value("cdma", "CDMA")
+ service:value("evdo", "EV-DO")
+ service:depends("proto", "3g")
+ service.rmempty = true
+
+ apn = s:taboption("general", Value, "apn", translate("Access point (APN)"))
+ apn:depends("proto", "3g")
+
+ pincode = s:taboption("general", Value, "pincode",
+ translate("PIN code"),
+ translate("Make sure that you provide the correct pin code here or you might lock your sim card!")
+ )
+ pincode:depends("proto", "3g")
+end
+
+if has_6in4 then
+ tunid = s:taboption("general", Value, "tunnelid", translate("HE.net Tunnel ID"))
+ tunid.optional = true
+ tunid.datatype = "uinteger"
+ tunid:depends("proto", "6in4")
+end
+
+if has_pppd or has_pppoe or has_pppoa or has_3g or has_pptp or has_6in4 then
+ user = s:taboption("general", 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")
+ user:depends("proto", "6in4")
+
+ pass = s:taboption("general", Value, "password", translate("Password"))
+ pass.rmempty = true
+ pass.password = true
+ pass:depends("proto", "pptp")
+ pass:depends("proto", "pppoe")
+ pass:depends("proto", "pppoa")
+ pass:depends("proto", "ppp")
+ pass:depends("proto", "3g")
+ pass:depends("proto", "6in4")
+end
+
+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