From 706da44cf275dc20426a55a4d01ed79026d3eb80 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 27 Apr 2008 11:04:48 +0000 Subject: * Reworked Luci-Splash * Created ffluci-system-addons package for Kamikaze addons --- core/src/ffluci/sys.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/src') diff --git a/core/src/ffluci/sys.lua b/core/src/ffluci/sys.lua index cde1877ded..8aa77cf13b 100644 --- a/core/src/ffluci/sys.lua +++ b/core/src/ffluci/sys.lua @@ -134,6 +134,19 @@ function net.devices() return devices end +-- Returns the MAC-Address belonging to the given IP-Address +function net.ip4mac(ip) + local mac = nil + + for i, l in ipairs(net.arptable()) do + if l["IP address"] == ip then + mac = l["HW address"] + end + end + + return mac +end + -- Returns the prefix to a given netmask function net.mask4prefix(mask) local bin = net.ip4bin(mask) -- cgit v1.2.3