mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Always show IPv6 suffix in IPv6 host names
This commit is contained in:
parent
1e4068b798
commit
9097333cf1
34 changed files with 138 additions and 115 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue