luci-app-wman3: add license header to all files
[project/luci.git] / applications / luci-app-mwan3 / luasrc / model / cbi / mwan / globalsconfig.lua
1 -- Copyright 2017 Florian Eckert <fe@dev.tdt.de>
2 -- Licensed to the public under the GNU General Public License v2.
3
4 local net = require "luci.model.network".init()
5
6
7 m = Map("mwan3", translate("MWAN - Globals"))
8
9 s = m:section(NamedSection, "globals", "globals", nil)
10 n = s:option(ListValue, "local_source",
11         translate("Local source interface"),
12         translate("Use the IP address of this interface as source IP " ..
13         "address for traffic initiated by the router itself"))
14 n:value("none")
15 n.default = "none"
16 for _, net in ipairs(net:get_networks()) do
17         if net:name() ~= "loopback" then
18                 n:value(net:name())
19         end
20 end
21 n.rmempty = false
22
23 mask = s:option(
24         Value,
25         "mmx_mask",
26         translate("Firewall mask"),
27         translate("Enter value in hex, starting with <code>0x</code>"))
28 mask.datatype = "hex(4)"
29 mask.default = "0xff00"
30
31 return m