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("Traffic Redirection"),
16 translate("Traffic redirection allows you to change the " ..
17 "destination address of forwarded packets."))
20 s = m:section(TypedSection, "redirect", "")
21 s.template = "cbi/tblsection"
24 s.extedit = luci.dispatcher.build_url("admin", "network", "firewall", "redirect", "%s")
26 name = s:option(Value, "_name", translate("Name"), translate("(optional)"))
29 iface = s:option(ListValue, "src", translate("Zone"))
31 luci.model.uci.cursor():foreach("firewall", "zone",
33 iface:value(section.name)
36 proto = s:option(ListValue, "proto", translate("Protocol"))
37 proto:value("tcp", "TCP")
38 proto:value("udp", "UDP")
39 proto:value("tcpudp", "TCP+UDP")
41 dport = s:option(Value, "src_dport", translate("Source port"))
44 to = s:option(Value, "dest_ip", translate("Destination IP"))
45 for i, dataset in ipairs(luci.sys.net.arptable()) do
46 to:value(dataset["IP address"])
49 toport = s:option(Value, "dest_port", translate("Destination port"))