move protocol support into a new protocols/ subdir
[project/luci.git] / protocols / relay / luasrc / model / cbi / admin_network / proto_relay.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2011 Jo-Philipp Wich <xm@subsignal.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
13 local map, section, net = ...
14
15 local ipaddr, network
16 local forward_bcast, forward_dhcp, gateway, expiry, retry, table
17
18
19 ipaddr = section:taboption("general", Value, "ipaddr",
20         translate("Local IPv4 address"),
21         translate("Address to access local relay bridge"))
22
23 ipaddr.datatype = "ip4addr"
24
25
26 network = s:taboption("general", DynamicList, "network", translate("Relay between networks"))
27 network.widget = "checkbox"
28 network.exclude = arg[1]
29 network.template = "cbi/network_netlist"
30 network.nocreate = true
31 network.nobridges = true
32 network.novirtual = true
33 network:depends("proto", "relay")
34
35
36 forward_bcast = section:taboption("advanced", Flag, "forward_bcast",
37         translate("Forward broadcast traffic"))
38
39 forward_bcast.default = forward_bcast.enabled
40
41
42 forward_dhcp = section:taboption("advanced", Flag, "forward_dhcp",
43         translate("Forward DHCP traffic"))
44
45 forward_dhcp.default = forward_dhcp.enabled
46
47
48 gateway = section:taboption("advanced", Value, "gateway",
49         translate("Use DHCP gateway"),
50         translate("Override the gateway in DHCP responses"))
51
52 gateway.datatype = "ip4addr"
53 gateway:depends("forward_dhcp", forward_dhcp.enabled)
54
55
56 expiry = section:taboption("advanced", Value, "expiry",
57         translate("Host expiry timeout"),
58         translate("Specifies the maximum amount of seconds after which hosts are presumed to be dead"))
59
60 expiry.placeholder = "30"
61 expiry.datatype    = "min(1)"
62
63
64 retry = section:taboption("advanced", Value, "retry",
65         translate("ARP retry threshold"),
66         translate("Specifies the maximum amount of failed ARP requests until hosts are presumed to be dead"))
67
68 retry.placeholder = "5"
69 retry.datatype    = "min(1)"
70
71
72 table = section:taboption("advanced", Value, "table",
73         translate("Use routing table"),
74         translate("Override the table used for internal routes"))
75
76 table.placeholder = "16800"
77 table.datatype    = "range(0,65535)"