Always show IPv6 suffix in IPv6 host names

This commit is contained in:
emanuele-f 2017-05-04 21:28:11 +02:00
parent 1e4068b798
commit 9097333cf1
34 changed files with 138 additions and 115 deletions

View file

@ -1212,6 +1212,39 @@ end
-- #################################
function hostVisualization(ip, name)
if (ip ~= name) and isIPv6(ip) then
return name.." [IPv6]"
end
return name
end
-- #################################
function resolveAddress(hostinfo)
local hostname = ntop.resolveName(hostinfo["host"])
return hostVisualization(hostinfo["host"], hostname)
end
-- #################################
function getResolvedAddress(hostinfo)
local hostname = ntop.getResolvedName(hostinfo["host"])
return hostVisualization(hostinfo["host"], hostname)
end
-- #################################
function getIpUrl(ip)
if isIPv6(ip) then
-- https://www.ietf.org/rfc/rfc2732.txt
return "["..ip.."]"
end
return ip
end
-- #################################
function getOSIcon(name)
icon = ""
@ -1372,7 +1405,7 @@ function host2name(name, vlan)
name = getHostAltName(name)
if(name == orig_name) then
rname = ntop.getResolvedAddress(name)
rname = getResolvedAddress({host=name, vlan=vlan})
if((rname ~= nil) and (rname ~= "")) then
name = rname