Update my email addresses in the license headers
[project/luci.git] / protocols / luci-proto-relay / luasrc / model / cbi / admin_network / proto_relay.lua
1 -- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
3
4 local map, section, net = ...
5
6 local ipaddr, network
7 local forward_bcast, forward_dhcp, gateway, expiry, retry, table
8
9
10 ipaddr = section:taboption("general", Value, "ipaddr",
11         translate("Local IPv4 address"),
12         translate("Address to access local relay bridge"))
13
14 ipaddr.datatype = "ip4addr"
15
16
17 network = s:taboption("general", DynamicList, "network", translate("Relay between networks"))
18 network.widget = "checkbox"
19 network.exclude = arg[1]
20 network.template = "cbi/network_netlist"
21 network.nocreate = true
22 network.nobridges = true
23 network.novirtual = true
24 network:depends("proto", "relay")
25
26
27 forward_bcast = section:taboption("advanced", Flag, "forward_bcast",
28         translate("Forward broadcast traffic"))
29
30 forward_bcast.default = forward_bcast.enabled
31
32
33 forward_dhcp = section:taboption("advanced", Flag, "forward_dhcp",
34         translate("Forward DHCP traffic"))
35
36 forward_dhcp.default = forward_dhcp.enabled
37
38
39 gateway = section:taboption("advanced", Value, "gateway",
40         translate("Use DHCP gateway"),
41         translate("Override the gateway in DHCP responses"))
42
43 gateway.datatype = "ip4addr"
44 gateway:depends("forward_dhcp", forward_dhcp.enabled)
45
46
47 expiry = section:taboption("advanced", Value, "expiry",
48         translate("Host expiry timeout"),
49         translate("Specifies the maximum amount of seconds after which hosts are presumed to be dead"))
50
51 expiry.placeholder = "30"
52 expiry.datatype    = "min(1)"
53
54
55 retry = section:taboption("advanced", Value, "retry",
56         translate("ARP retry threshold"),
57         translate("Specifies the maximum amount of failed ARP requests until hosts are presumed to be dead"))
58
59 retry.placeholder = "5"
60 retry.datatype    = "min(1)"
61
62
63 table = section:taboption("advanced", Value, "table",
64         translate("Use routing table"),
65         translate("Override the table used for internal routes"))
66
67 table.placeholder = "16800"
68 table.datatype    = "range(0,65535)"