proto_dhcp.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. -- Copyright 2011-2012 Jo-Philipp Wich <jow@openwrt.org>
  2. -- Licensed to the public under the Apache License 2.0.
  3. local map, section, net = ...
  4. local ifc = net:get_interface()
  5. local hostname, accept_ra, send_rs
  6. local bcast, defaultroute, peerdns, dns, metric, clientid, vendorclass
  7. hostname = section:taboption("general", Value, "hostname",
  8. translate("Hostname to send when requesting DHCP"))
  9. hostname.placeholder = luci.sys.hostname()
  10. hostname.datatype = "hostname"
  11. bcast = section:taboption("advanced", Flag, "broadcast",
  12. translate("Use broadcast flag"),
  13. translate("Required for certain ISPs, e.g. Charter with DOCSIS 3"))
  14. bcast.default = bcast.disabled
  15. defaultroute = section:taboption("advanced", Flag, "defaultroute",
  16. translate("Use default gateway"),
  17. translate("If unchecked, no default route is configured"))
  18. defaultroute.default = defaultroute.enabled
  19. peerdns = section:taboption("advanced", Flag, "peerdns",
  20. translate("Use DNS servers advertised by peer"),
  21. translate("If unchecked, the advertised DNS server addresses are ignored"))
  22. peerdns.default = peerdns.enabled
  23. dns = section:taboption("advanced", DynamicList, "dns",
  24. translate("Use custom DNS servers"))
  25. dns:depends("peerdns", "")
  26. dns.datatype = "ipaddr"
  27. dns.cast = "string"
  28. metric = section:taboption("advanced", Value, "metric",
  29. translate("Use gateway metric"))
  30. metric.placeholder = "0"
  31. metric.datatype = "uinteger"
  32. clientid = section:taboption("advanced", Value, "clientid",
  33. translate("Client ID to send when requesting DHCP"))
  34. vendorclass = section:taboption("advanced", Value, "vendorid",
  35. translate("Vendor Class to send when requesting DHCP"))
  36. luci.tools.proto.opt_macaddr(section, ifc, translate("Override MAC address"))
  37. mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
  38. mtu.placeholder = "1500"
  39. mtu.datatype = "max(9200)"