protocols/core: write override mac to wifi-iface for wifi interfaces
[project/luci.git] / protocols / core / luasrc / model / cbi / admin_network / proto_static.lua
index 8ae9b7e..e6bfcbb 100644 (file)
@@ -13,8 +13,8 @@ You may obtain a copy of the License at
 local map, section, net = ...
 local ifc = net:get_interface()
 
-local ipaddr, netmask, gateway, broadcast, accept_ra, send_rs, ip6addr, ip6gw
-local macaddr, mtu, metric
+local ipaddr, netmask, gateway, broadcast, dns, accept_ra, send_rs, ip6addr, ip6gw
+local mtu, metric
 
 
 ipaddr = section:taboption("general", Value, "ipaddr", translate("IPv4 address"))
@@ -38,6 +38,13 @@ broadcast = section:taboption("general", Value, "broadcast", translate("IPv4 bro
 broadcast.datatype = "ip4addr"
 
 
+dns = section:taboption("general", DynamicList, "dns",
+       translate("Use custom DNS servers"))
+
+dns.datatype = "ipaddr"
+dns.cast     = "string"
+
+
 if luci.model.network:has_ipv6() then
 
        accept_ra = s:taboption("general", Flag, "accept_ra", translate("Accept router advertisements"))
@@ -57,13 +64,11 @@ if luci.model.network:has_ipv6() then
        ip6gw = section:taboption("general", Value, "ip6gw", translate("IPv6 gateway"))
        ip6gw.datatype = "ip6addr"
        ip6gw:depends("accept_ra", "")
-       
+
 end
 
 
-macaddr = section:taboption("advanced", Value, "macaddr", translate("Override MAC address"))
-macaddr.placeholder = ifc and ifc:mac() or "00:00:00:00:00:00"
-macaddr.datatype    = "macaddr"
+luci.tools.proto.opt_macaddr(section, ifc, translate("Override MAC address"))
 
 
 mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))