1 -- Copyright 2012 Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
4 module("luci.tools.proto", package.seeall)
6 function opt_macaddr(s, ifc, ...)
7 local v = luci.cbi.Value
8 local o = s:taboption("advanced", v, "macaddr", ...)
10 o.placeholder = ifc and ifc:mac()
11 o.datatype = "macaddr"
13 function o.cfgvalue(self, section)
14 local w = ifc and ifc:get_wifinet()
16 return w:get("macaddr")
18 return v.cfgvalue(self, section)
22 function o.write(self, section, value)
23 local w = ifc and ifc:get_wifinet()
25 w:set("macaddr", value)
27 v.write(self, section, value)
29 v.remove(self, section)
33 function o.remove(self, section)
34 self:write(section, nil)