summaryrefslogtreecommitdiffhomepage
path: root/libs/core/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-10-09 21:16:59 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-10-09 21:16:59 +0000
commitce024e350a52d8e1520d10d3e5c648e44f63edfe (patch)
tree0fdc71ebdee349861c093364b8a531539f8b78d3 /libs/core/luasrc
parent63608d2636baaab72037564f3c5885087f4a3454 (diff)
libs/core: add luci.model.network.get_protocol(protoname[, networkname])
Diffstat (limited to 'libs/core/luasrc')
-rw-r--r--libs/core/luasrc/model/network.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/core/luasrc/model/network.lua b/libs/core/luasrc/model/network.lua
index b1db9dbfc..a85def89a 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