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