Implemented interface.getAddressInfo() API call to return information about IP addresses in a reliable way frm the ntopng engine

This commit is contained in:
Luca Deri 2020-12-15 20:43:20 +01:00
parent c06f05f4e6
commit 4ffff0859a
3 changed files with 31 additions and 15 deletions

View file

@ -827,22 +827,13 @@ function isBroadMulticast(ip)
end
function isBroadcastMulticast(ip)
-- check NoIP
if(ip == "0.0.0.0") then
local ainfo = interface.getAddressInfo(ip)
if(ainfo.is_multicast or ainfo.is_broadcast) then
return true
else
return false
end
-- check IPv6
t = string.split(ip, "%.")
if(t ~= nil) then
-- check Multicast / Broadcast
if(tonumber(t[1]) >= 224) then
return true
end
end
return false
end
function isIPv4(address)