mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Implemented interface.getAddressInfo() API call to return information about IP addresses in a reliable way frm the ntopng engine
This commit is contained in:
parent
c06f05f4e6
commit
4ffff0859a
3 changed files with 31 additions and 15 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue