applications/luci-fw: Added support for luci-mini
[project/luci.git] / applications / luci-fw / luasrc / model / cbi / luci_fw / miniportfw.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
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 require("luci.sys")
15 m = Map("luci_fw", translate("fw_portfw"), translate("fw_portfw1"))
16
17
18 s = m:section(TypedSection, "portfw", "")
19 s:depends("iface", "wan")
20 s.defaults.iface = "wan"
21
22 s.template  = "cbi/tblsection"
23 s.addremove = true
24 s.anonymous = true
25
26 name = s:option(Value, "_name", translate("name") .. translate("cbi_optional"))
27
28 proto = s:option(ListValue, "proto", translate("protocol"))
29 proto:value("tcp", "TCP")
30 proto:value("udp", "UDP")
31 proto:value("tcpudp", "TCP + UDP")
32
33 dport = s:option(Value, "dport")
34
35 to = s:option(Value, "to")
36
37 return m