From: Jo-Philipp Wich Date: Sun, 9 Oct 2011 21:16:59 +0000 (+0000) Subject: libs/core: add luci.model.network.get_protocol(protoname[, networkname]) X-Git-Tag: 0.11.0~1589 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ce024e350a52d8e1520d10d3e5c648e44f63edfe;p=project%2Fluci.git libs/core: add luci.model.network.get_protocol(protoname[, networkname]) --- diff --git a/libs/core/luasrc/model/network.lua b/libs/core/luasrc/model/network.lua index b1db9dbfce..a85def89a2 100644 --- a/libs/core/luasrc/model/network.lua +++ b/libs/core/luasrc/model/network.lua @@ -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