proto_relay.lua 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. -- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. local map, section, net = ...
  4. local ipaddr, network
  5. local forward_bcast, forward_dhcp, gateway, expiry, retry, table
  6. ipaddr = section:taboption("general", Value, "ipaddr",
  7. translate("Local IPv4 address"),
  8. translate("Address to access local relay bridge"))
  9. ipaddr.datatype = "ip4addr"
  10. network = s:taboption("general", DynamicList, "network", translate("Relay between networks"))
  11. network.widget = "checkbox"
  12. network.exclude = arg[1]
  13. network.template = "cbi/network_netlist"
  14. network.nocreate = true
  15. network.nobridges = true
  16. network.novirtual = true
  17. network:depends("proto", "relay")
  18. forward_bcast = section:taboption("advanced", Flag, "forward_bcast",
  19. translate("Forward broadcast traffic"))
  20. forward_bcast.default = forward_bcast.enabled
  21. forward_dhcp = section:taboption("advanced", Flag, "forward_dhcp",
  22. translate("Forward DHCP traffic"))
  23. forward_dhcp.default = forward_dhcp.enabled
  24. gateway = section:taboption("advanced", Value, "gateway",
  25. translate("Use DHCP gateway"),
  26. translate("Override the gateway in DHCP responses"))
  27. gateway.datatype = "ip4addr"
  28. gateway:depends("forward_dhcp", forward_dhcp.enabled)
  29. expiry = section:taboption("advanced", Value, "expiry",
  30. translate("Host expiry timeout"),
  31. translate("Specifies the maximum amount of seconds after which hosts are presumed to be dead"))
  32. expiry.placeholder = "30"
  33. expiry.datatype = "min(1)"
  34. retry = section:taboption("advanced", Value, "retry",
  35. translate("ARP retry threshold"),
  36. translate("Specifies the maximum amount of failed ARP requests until hosts are presumed to be dead"))
  37. retry.placeholder = "5"
  38. retry.datatype = "min(1)"
  39. table = section:taboption("advanced", Value, "table",
  40. translate("Use routing table"),
  41. translate("Override the table used for internal routes"))
  42. table.placeholder = "16800"
  43. table.datatype = "range(0,65535)"