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 b1db9db..a85def8 100644 (file)
@@ -279,6 +279,13 @@ function ifnameof(self, x)
        end
 end
 
        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
 function get_protocols(self)
        local p = { }
        local _, v