Cache host labels

This commit is contained in:
Alfredo Cardigliano 2020-07-01 18:34:45 +02:00
parent 0a6b6a41a8
commit c5b308618b
4 changed files with 14 additions and 10 deletions

View file

@ -1343,16 +1343,16 @@ end
-- ##############################################
function getHostAltNamesKey()
return "ntopng.host_labels"
function getHostAltNamesKey(ip)
return "ntopng.cache.host_labels."..ip
end
function getHostAltName(host_ip)
return ntop.getHashCache(getHostAltNamesKey(), host_ip)
return ntop.getCache(getHostAltNamesKey(host_ip))
end
function setHostAltName(host_ip, alt_name)
ntop.setHashCache(getHostAltNamesKey(), host_ip, alt_name)
ntop.setCache(getHostAltNamesKey(host_ip), alt_name)
end
-- ##############################################