3e1a28325bce5117ce5e70526249f00567ad3257
[project/luci.git] / applications / luci-app-mwan3 / luasrc / model / cbi / mwan / globalsconfig.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2017 Florian Eckert <fe@dev.tdt.de>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14
15 local net = require "luci.model.network".init()
16
17 m = Map("mwan3", translate("MWAN - Globals"))
18
19 s = m:section(NamedSection, "globals", "globals", nil)
20 n = s:option(ListValue, "local_source",
21         translate("Local source interface"),
22         translate("Use the IP address of this interface as source IP address for traffic initiated by the router itself"))
23 n:value("none")
24 n.default = "none"
25 for _, net in ipairs(net:get_networks()) do
26         if net:name() ~= "loopback" then
27                 n:value(net:name())
28         end
29 end
30 n.rmempty = false
31
32 mask = s:option(
33         Value,
34         "mmx_mask",
35         translate("Firewall mask"),
36         translate("Enter value in hex, starting with <code>0x</code>"))
37 mask.datatype = "hex(4)"
38 mask.default = "0xff00"
39
40 return m