# Version == major.minor.patch
# increase on new functionality (minor) or patches (patch)
-PKG_VERSION:=2.2.2
+PKG_VERSION:=2.2.4
# Release == build
# increase on changes of translation files
local DDNS = require "luci.tools.ddns" -- ddns multiused functions
local UTIL = require "luci.util"
-DDNS_MIN = "2.2.0-1" -- minimum version of service required
+DDNS_MIN = "2.4.2-1" -- minimum version of service required
function index()
local nxfs = require "nixio.fs" -- global definitions not available
end
-- retry_count (NEW) -- ########################################################
-rc = ns:taboption("timer", Value, "retry_count",
- translate("Error Retry Counter"),
- translate("On Error the script will stop execution after given number of retrys") )
-rc.default = 5
-rc.rmempty = false -- validate ourselves for translatable error messages
+rc = ns:taboption("timer", Value, "retry_count")
+rc.title = translate("Error Retry Counter")
+rc.description = translate("On Error the script will stop execution after given number of retrys")
+ .. "<br />"
+ .. translate("The default setting of '0' will retry infinite.")
+rc.default = 0
+rc.rmempty = false -- validate ourselves for translatable error messages
function rc.validate(self, value)
if not DTYP.uinteger(value) then
return nil, err_tab_timer(self) .. translate("minimum value '0'")
-- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>"
function ipkg_ver_compare(ver1, comp, ver2)
- if not ver1 or not (#ver1 > 0)
- or not ver2 or not (#ver2 > 0)
+ if not ver1 or not ver2
or not comp or not (#comp > 0) then return nil end
-- correct compare string
if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~="
for i = 1, math.max(table.getn(av1),table.getn(av2)), 1 do
local s1 = av1[i] or ""
local s2 = av2[i] or ""
- local n1 = tonumber(s1)
- local n2 = tonumber(s2)
- -- one numeric and other empty string then set other to 0
- if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end
- if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end
-
- local nc = (n1 and n2) -- numeric compare
-
- if nc then
- -- first "not equal" found return true
- if comp == "~=" and (n1 ~= n2) then return true end
- -- first "lower" found return true
- if (comp == "<" or comp == "<=") and (n1 < n2) then return true end
- -- first "greater" found return true
- if (comp == ">" or comp == ">=") and (n1 > n2) then return true end
- -- not equal then return false
- if (n1 ~= n2) then return false end
- else
- if comp == "~=" and (s1 ~= s2) then return true end
- if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
- if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
- if (s1 ~= s2) then return false end
- end
+ -- first "not equal" found return true
+ if comp == "~=" and (s1 ~= s2) then return true end
+ -- first "lower" found return true
+ if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
+ -- first "greater" found return true
+ if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
+ -- not equal then return false
+ if (s1 ~= s2) then return false end
end
- -- all equal then true
- return true
+
+ -- all equal and not compare greater or lower then true
+ return not (comp == "<" or comp == ">")
end
-- read version information for given package if installed
msgid ""
msgstr ""
"Project-Id-Version: luci-app-ddns\n"
-"POT-Creation-Date: 2015-02-08 18:30+0100\n"
-"PO-Revision-Date: 2015-02-08 18:36+0100\n"
+"POT-Creation-Date: 2015-05-08 21:29+0100\n"
+"PO-Revision-Date: 2015-05-08 21:47+0100\n"
"Last-Translator: Christian Schoenebeck <christian.schoenebeck@gmail.com>\n"
"Language-Team: \n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 1.5.4\n"
+"X-Generator: Poedit 1.7.5\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: .\n"
"wiederholen"
msgid "On Error the script will stop execution after given number of retrys"
-msgstr "Das Skript wird nach der gegebener Anzahlt von Fehlversuchen beendet"
+msgstr "Das Skript wird nach der gegebenen Anzahl von Fehlversuchen beendet."
msgid "Overview"
msgstr "Übersicht"
"Die installierte Software 'ddns-scripts' unterstützt nicht alle verfügbaren "
"Optionen."
+msgid "The default setting of '0' will retry infinite."
+msgstr "Der Standard-Wert von '0' wird es endlosen erneut versuchen."
+
msgid "There is no service configured."
msgstr "Kein Dienst konfiguriert"
"settings."
msgstr ""
+msgid "The default setting of '0' will retry infinite."
+msgstr ""
+
msgid "There is no service configured."
msgstr ""
local fs = require("nixio.fs")
local uci = require("luci.model.uci")
local datatypes = require("luci.cbi.datatypes")
+local dispatcher = require("luci.dispatcher")
local class = util.class
local instanceof = util.instanceof
self.changed = false
- if not self.uci:load(self.config) then
- error("Unable to read UCI data: " .. self.config)
+ local path = "%s/%s" %{ self.uci:get_confdir(), self.config }
+ if fs.stat(path, "type") ~= "reg" then
+ fs.writefile(path, "")
+ end
+
+ local ok, err = self.uci:load(self.config)
+ if not ok then
+ local url = dispatcher.build_url(unpack(dispatcher.context.request))
+ local source = self:formvalue("cbi.source")
+ if type(source) == "string" then
+ fs.writefile(path, source:gsub("\r\n", "\n"))
+ ok, err = self.uci:load(self.config)
+ if ok then
+ luci.http.redirect(url)
+ end
+ end
+ end
+
+ if not ok then
+ self.template = "cbi/error"
+ self.error = err
+ self.source = fs.readfile(path) or ""
+ self.pageaction = false
end
end
--- /dev/null
+<div class="cbi-map" id="cbi-<%=self.config%>">
+ <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
+ <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
+
+ <p class="alert-message danger">
+ <%: The configuration file could not be loaded due to the following error: %><br />
+ <code><%=pcdata(self.error)%></code>
+ </p>
+
+ <textarea name="cbi.source" style="width:100%; margin-bottom:1em" rows="<%=math.max(self.source:cmatch("\n"), 10)%>"><%=pcdata(self.source)%></textarea>
+
+ <p class="alert-message">
+ <%: Edit the raw configuration data above to fix any error and hit "Save" to reload the page. %>
+ </p>
+
+ <div class="cbi-page-actions">
+ <input class="cbi-button cbi-button-apply" type="submit" name="cbi.save" value="<%:Save%>" />
+ </div>
+</div>
msgid "Edit"
msgstr "Edita"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Edita aquesta interfície"
"Els caràcters permets són: <code>A-Z</code>, <code>a-z</code>, <code>0-9</"
"code> i <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Upravit"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Upravit toto rozhraní"
"Povolené znaky jsou: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> a "
"<code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Bearbeiten"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Diese Schnittstelle bearbeiten"
"Erlaubte Buchstaben sind: <code>A-Z</code>, <code>a-z</code>, <code>0-9</"
"code> and <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Επεξεργασία"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Επεξεργασία αυτής της διεπαφής"
"Οι επιτρεπόμενοι χαρακτήρες είναι: <code>A-Z</code>, <code>a-z</code>, "
"<code>0-9</code> και <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Edit"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr ""
"code> and <code>_</code>"
msgstr ""
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Editar"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Editar esta interfaz"
"Los caracteres permitidos son: <code>A-Z</code>, <code>a-z</code>, "
"<code>0-9</code> y <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Éditer"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Éditer cette interface"
"Les caractères autorisés sont : <code>A-Z</code>, <code>a-z</code>, "
"<code>0-9</code> et <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "ערוך"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "ערוך ממשק זה"
"code> and <code>_</code>"
msgstr ""
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Szerkesztés"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Interfész szerkesztése"
"A következő karakterek használhatók: <code>A-Z</code>, <code>a-z</code>, "
"<code>0-9</code> and <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Modifica"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Modifica questa interfaccia"
"code> and <code>_</code>"
msgstr ""
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "編集"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "インターフェースを編集"
"使用可能な文字は右記の通りです: <code>A-Z</code>, <code>a-z</code>, "
"<code>0-9</code>, <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Sunting"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr ""
"Karakter yang diizinkan adalah: <code>A-Z</code>, <code>a-z</code>, "
"<code>0-9</code> dan <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Endre"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Endre dette grensesnittet"
"Gyldige tegn er: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> og "
"<code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Edycja"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Edytuj ten interfejs"
"Dozwolone znaki to: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> "
"oraz <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Editar"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Editar esta interface"
"Os caracteres permitidos são: <code>A-Z</code>, <code>a-z</code>, <code>0-9</"
"code> e <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Editar"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Editar esta interface"
"Os caracteres permitidos são: <code>A-Z</code>, <code>a-z</code>, <code>0-9</"
"code> e <code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Editeaza"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Editeaza aceasta interfata"
"code> and <code>_</code>"
msgstr ""
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Редактировать"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
#, fuzzy
msgid "Edit this interface"
msgstr "Редактировать этот интерфейс"
"Допустимые символы: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> и "
"<code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr ""
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr ""
"code> and <code>_</code>"
msgstr ""
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr ""
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr ""
"code> and <code>_</code>"
msgstr ""
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr ""
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr ""
"code> and <code>_</code>"
msgstr ""
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Редагувати"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "Редагувати цей інтерфейс"
"Дозволені символи: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> та "
"<code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "Edit"
msgstr "Chỉnh sửa"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr ""
"code> and <code>_</code>"
msgstr ""
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "CPU"
msgstr "CPU"
-msgid "CPU frequency"
-msgstr "CPU 频率"
-
msgid "CPU usage (%)"
msgstr "CPU使用率(%)"
msgid "Checksum"
msgstr "校验值"
-msgid "Chip Model"
-msgstr "芯片型号"
-
msgid ""
"Choose the firewall zone you want to assign to this interface. Select "
"<em>unspecified</em> to remove the interface from the associated zone or "
msgid "Edit"
msgstr "修改"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "修改此接口"
"合法字符:<code>A-Z</code>, <code>a-z</code>, <code>0-9</code> 和 <code>_</"
"code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
msgid "« Back"
msgstr "« 后退"
+#~ msgid "CPU frequency"
+#~ msgstr "CPU 频率"
+
+#~ msgid "Chip Model"
+#~ msgstr "芯片型号"
+
#~ msgid ""
#~ "Always use 40MHz channels even if the secondary channel overlaps. Using "
#~ "this option does not comply with IEEE 802.11n-2009!"
msgid "Edit"
msgstr "編輯"
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
msgid "Edit this interface"
msgstr "修改這個介面"
"所允許的字元是: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> and "
"<code>_</code>"
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
msgid ""
"The device file of the memory or partition (<abbr title=\"for example\">e.g."
"</abbr> <code>/dev/sda1</code>)"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
+<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="refresh" content="0; URL=/cgi-bin/luci" />
</head>
<body style="background-color: black">
if luci.model.network:has_ipv6() then
- ipv6 = section:taboption("advanced", Flag, "ipv6",
- translate("Enable IPv6 negotiation on the PPP link"))
-
- ipv6.default = ipv6.disabled
+ ipv6 = section:taboption("advanced", ListValue, "ipv6")
+ ipv6:value("auto", translate("Automatic"))
+ ipv6:value("0", translate("Disabled"))
+ ipv6:value("1", translate("Manual"))
+ ipv6.default = "auto"
end
--- /dev/null
+-- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
+-- Copyright 2013 Steven Barth <steven@midlink.org>
+-- Licensed to the public under the Apache License 2.0.
+
+local map, section, net = ...
+local tunlink, defaultroute, metric, mtu
+
+section:taboption("general", Value, "ip6prefix",
+ translate("NAT64 Prefix"), translate("Leave empty to autodetect"))
+
+tunlink = section:taboption("advanced", DynamicList, "tunlink", translate("Tunnel Link"))
+tunlink.template = "cbi/network_netlist"
+tunlink.nocreate = true
+
+
+defaultroute = section:taboption("advanced", Flag, "defaultroute",
+ translate("Default gateway"),
+ translate("If unchecked, no default route is configured"))
+
+defaultroute.default = defaultroute.enabled
+
+
+metric = section:taboption("advanced", Value, "metric",
+ translate("Use gateway metric"))
+
+metric.placeholder = "0"
+metric.datatype = "uinteger"
+metric:depends("defaultroute", defaultroute.enabled)
+
+
+mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
+mtu.placeholder = "1280"
+mtu.datatype = "max(9200)"
--- /dev/null
+-- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
+-- Copyright 2013 Steven Barth <steven@midlink.org>
+-- Licensed to the public under the Apache License 2.0.
+
+local map, section, net = ...
+
+local peeraddr, ip6addr
+local tunlink, defaultroute, metric, ttl, mtu
+
+
+maptype = section:taboption("general", ListValue, "type", translate("Type"))
+maptype:value("map-e", "MAP-E")
+maptype:value("map-t", "MAP-T")
+maptype:value("lw4o6", "LW4over6")
+
+
+peeraddr = section:taboption("general", Value, "peeraddr",
+ translate("BR / DMR / AFTR"))
+
+peeraddr.rmempty = false
+peeraddr.datatype = "ip6addr"
+
+
+ipaddr = section:taboption("general", Value, "ipaddr",
+ translate("IPv4 prefix"))
+ipaddr.datatype = "ip4addr"
+
+
+ip4prefixlen = s:taboption("general", Value, "ip4prefixlen",
+ translate("IPv4 prefix length"),
+ translate("The length of the IPv4 prefix in bits, the remainder is used in the IPv6 addresses."))
+
+ip4prefixlen.placeholder = "32"
+ip4prefixlen.datatype = "range(0,32)"
+
+ip6addr = s:taboption("general", Value, "ip6prefix",
+ translate("IPv6 prefix"),
+ translate("The IPv6 prefix assigned to the provider, usually ends with <code>::</code>"))
+
+ip6addr.rmempty = false
+ip6addr.datatype = "ip6addr"
+
+
+ip6prefixlen = s:taboption("general", Value, "ip6prefixlen",
+ translate("IPv6 prefix length"),
+ translate("The length of the IPv6 prefix in bits"))
+
+ip6prefixlen.placeholder = "16"
+ip6prefixlen.datatype = "range(0,64)"
+
+
+s:taboption("general", Value, "ealen",
+ translate("EA-bits length")).datatype = "range(0,16)"
+
+s:taboption("general", Value, "psidlen",
+ translate("PSID-bits length")).datatype = "range(0,16)"
+
+s:taboption("general", Value, "offset",
+ translate("PSID offset")).datatype = "range(0,16)"
+
+tunlink = section:taboption("advanced", DynamicList, "tunlink", translate("Tunnel Link"))
+tunlink.template = "cbi/network_netlist"
+tunlink.nocreate = true
+
+
+defaultroute = section:taboption("advanced", Flag, "defaultroute",
+ translate("Default gateway"),
+ translate("If unchecked, no default route is configured"))
+
+defaultroute.default = defaultroute.enabled
+
+
+metric = section:taboption("advanced", Value, "metric",
+ translate("Use gateway metric"))
+
+metric.placeholder = "0"
+metric.datatype = "uinteger"
+metric:depends("defaultroute", defaultroute.enabled)
+
+
+ttl = section:taboption("advanced", Value, "ttl", translate("Use TTL on tunnel interface"))
+ttl.placeholder = "64"
+ttl.datatype = "range(1,255)"
+
+
+mtu = section:taboption("advanced", Value, "mtu", translate("Use MTU on tunnel interface"))
+mtu.placeholder = "1280"
+mtu.datatype = "max(9200)"
local netmod = luci.model.network
local _, p
-for _, p in ipairs({"dslite"}) do
+for _, p in ipairs({"dslite", "map", "464xlat"}) do
local proto = netmod:register_protocol(p)
function proto.get_i18n(self)
if p == "dslite" then
return luci.i18n.translate("Dual-Stack Lite (RFC6333)")
+ elseif p == "map" then
+ return luci.i18n.translate("MAP / LW4over6")
+ elseif p == "464xlat" then
+ return luci.i18n.translate("464XLAT (CLAT)")
end
end
function proto.opkg_package(self)
if p == "dslite" then
return "ds-lite"
+ elseif p == "map" then
+ return "map-t"
+ elseif p == "464xlat" then
+ return "464xlat"
end
end
return (netmod:ifnameof(ifc) == self:ifname())
end
- netmod:register_pattern_virtual("^%s-%%w" % p)
+ if p == "dslite" then
+ netmod:register_pattern_virtual("^ds-%w")
+ elseif p == "map" then
+ netmod:register_pattern_virtual("^map-%w")
+ elseif p == "464xlat" then
+ netmod:register_pattern_virtual("^464-%w")
+ end
end
if luci.model.network:has_ipv6() then
- ipv6 = section:taboption("advanced", Flag, "ipv6",
- translate("Enable IPv6 negotiation on the PPP link"))
-
- ipv6.default = ipv6.disabled
+ ipv6 = section:taboption("advanced", ListValue, "ipv6")
+ ipv6:value("auto", translate("Automatic"))
+ ipv6:value("0", translate("Disabled"))
+ ipv6:value("1", translate("Manual"))
+ ipv6.default = "auto"
end
if luci.model.network:has_ipv6() then
- ipv6 = section:taboption("advanced", Flag, "ipv6",
- translate("Enable IPv6 negotiation on the PPP link"))
-
- ipv6.default = ipv6.disabled
+ ipv6 = section:taboption("advanced", ListValue, "ipv6")
+ ipv6:value("auto", translate("Automatic"))
+ ipv6:value("0", translate("Disabled"))
+ ipv6:value("1", translate("Manual"))
+ ipv6.default = "auto"
end
if luci.model.network:has_ipv6() then
- ipv6 = section:taboption("advanced", Flag, "ipv6",
- translate("Enable IPv6 negotiation on the PPP link"))
-
- ipv6.default = ipv6.disabled
+ ipv6 = section:taboption("advanced", ListValue, "ipv6")
+ ipv6:value("auto", translate("Automatic"))
+ ipv6:value("0", translate("Disabled"))
+ ipv6:value("1", translate("Manual"))
+ ipv6.default = "auto"
end
if luci.model.network:has_ipv6() then
- ipv6 = section:taboption("advanced", Flag, "ipv6",
- translate("Enable IPv6 negotiation on the PPP link"))
-
- ipv6.default = ipv6.disabled
+ ipv6 = section:taboption("advanced", ListValue, "ipv6")
+ ipv6:value("auto", translate("Automatic"))
+ ipv6:value("0", translate("Disabled"))
+ ipv6:value("1", translate("Manual"))
+ ipv6.default = "auto"
end