2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
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
10 http://www.apache.org/licenses/LICENSE-2.0
15 m = Map("firewall", translate("Port forwarding"), translate("Port forwarding allows to provide network services in the internal network to an external network."))
18 s = m:section(TypedSection, "redirect", "")
19 s:depends("src", "wan")
20 s.defaults.src = "wan"
22 s.template = "cbi/tblsection"
26 name = s:option(Value, "_name", translate("Name"), translate(" (optional)"))
29 proto = s:option(ListValue, "proto", translate("Protocol"))
30 proto:value("tcp", "TCP")
31 proto:value("udp", "UDP")
32 proto:value("tcpudp", "TCP+UDP")
34 dport = s:option(Value, "src_dport")
37 to = s:option(Value, "dest_ip")
38 for i, dataset in ipairs(luci.sys.net.arptable()) do
39 to:value(dataset["IP address"])
42 toport = s:option(Value, "dest_port")