2018-01-23 12:12:53 +00:00
|
|
|
-- Copyright 2017 Florian Eckert <fe@dev.tdt.de>
|
|
|
|
-- Licensed to the public under the GNU General Public License v2.
|
2017-08-11 06:53:00 +00:00
|
|
|
|
|
|
|
local net = require "luci.model.network".init()
|
|
|
|
|
2018-10-16 10:43:18 +00:00
|
|
|
local s, m, local_source, mask, rtmon, rtlookup
|
2018-01-18 06:26:27 +00:00
|
|
|
|
2018-01-12 09:50:58 +00:00
|
|
|
m = Map("mwan3", translate("MWAN - Globals"))
|
2017-08-11 06:53:00 +00:00
|
|
|
|
2018-01-12 09:50:58 +00:00
|
|
|
s = m:section(NamedSection, "globals", "globals", nil)
|
2018-10-16 07:34:28 +00:00
|
|
|
|
|
|
|
local_source = s:option(ListValue, "local_source",
|
2017-08-11 06:53:00 +00:00
|
|
|
translate("Local source interface"),
|
2018-01-18 06:26:27 +00:00
|
|
|
translate("Use the IP address of this interface as source IP " ..
|
|
|
|
"address for traffic initiated by the router itself"))
|
2018-10-16 07:34:28 +00:00
|
|
|
local_source:value("none")
|
|
|
|
local_source.default = "none"
|
2017-08-11 06:53:00 +00:00
|
|
|
for _, net in ipairs(net:get_networks()) do
|
|
|
|
if net:name() ~= "loopback" then
|
2018-10-16 07:34:28 +00:00
|
|
|
local_source:value(net:name())
|
2017-08-11 06:53:00 +00:00
|
|
|
end
|
|
|
|
end
|
2018-10-16 07:34:28 +00:00
|
|
|
local_source.rmempty = false
|
2017-08-11 06:53:00 +00:00
|
|
|
|
2017-08-14 08:08:28 +00:00
|
|
|
mask = s:option(
|
|
|
|
Value,
|
|
|
|
"mmx_mask",
|
|
|
|
translate("Firewall mask"),
|
|
|
|
translate("Enter value in hex, starting with <code>0x</code>"))
|
|
|
|
mask.datatype = "hex(4)"
|
|
|
|
mask.default = "0xff00"
|
|
|
|
|
2018-10-16 07:45:41 +00:00
|
|
|
rtmon = s:option(
|
|
|
|
Value,
|
|
|
|
"rtmon_interval",
|
|
|
|
translate("Update interval"),
|
|
|
|
translate("How often should rtmon update the interface routing table"))
|
|
|
|
rtmon.datatype = "integer"
|
|
|
|
rtmon.default = "5"
|
|
|
|
rtmon:value("1", translatef("%d second", 1))
|
|
|
|
rtmon:value("3", translatef("%d seconds", 3))
|
|
|
|
rtmon:value("5", translatef("%d seconds", 5))
|
|
|
|
rtmon:value("7", translatef("%d seconds", 7))
|
|
|
|
rtmon:value("10", translatef("%d seconds", 10))
|
|
|
|
|
2018-10-16 10:43:18 +00:00
|
|
|
rtlookup = s:option(DynamicList,
|
|
|
|
"rt_table_lookup",
|
|
|
|
translate("Routing table lookup"),
|
|
|
|
translate("Also scan this Routing table for connected networks"))
|
|
|
|
rtlookup.datatype = "integer"
|
|
|
|
rtlookup:value("1", translatef("Routing table %d", 1))
|
|
|
|
rtlookup:value("2", translatef("Routing table %d", 2))
|
|
|
|
rtlookup:value("220", translatef("Routing table %d", 220))
|
|
|
|
|
2017-08-11 06:53:00 +00:00
|
|
|
return m
|