libs/core: add luci.model.network.get_protocol(protoname[, networkname])
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 9 Oct 2011 21:16:59 +0000 (21:16 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 9 Oct 2011 21:16:59 +0000 (21:16 +0000)
libs/core/luasrc/model/network.lua

index b1db9dbfced3c00d1f777893c745246d3243e1c1..a85def89a2619d0189c92b8d1f611eec4e40378b 100644 (file)
@@ -279,6 +279,13 @@ function ifnameof(self, x)
        end
 end
 
+function get_protocol(self, protoname, netname)
+       local v = _protocols[protoname]
+       if v then
+               return v(netname or "__dummy__")
+       end
+end
+
 function get_protocols(self)
        local p = { }
        local _, v