luci-app-mwan3: remove/unify lua require order
[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
18 m = Map("mwan3", translate("MWAN - Globals"))
19
20 s = m:section(NamedSection, "globals", "globals", nil)
21 n = s:option(ListValue, "local_source",
22         translate("Local source interface"),
23         translate("Use the IP address of this interface as source IP " ..
24         "address for traffic initiated by the router itself"))
25 n:value("none")
26 n.default = "none"
27 for _, net in ipairs(net:get_networks()) do
28         if net:name() ~= "loopback" then
29                 n:value(net:name())
30         end
31 end
32 n.rmempty = false
33
34 mask = s:option(
35         Value,
36         "mmx_mask",
37         translate("Firewall mask"),
38         translate("Enter value in hex, starting with <code>0x</code>"))
39 mask.datatype = "hex(4)"
40 mask.default = "0xff00"
41
42 return m