Fixes circular dependency and lightened some modules

This commit is contained in:
Matteo Biscosi 2024-02-21 10:34:57 +00:00
parent de03d66a73
commit ef27b0b058
14 changed files with 1929 additions and 2045 deletions

View file

@ -673,29 +673,6 @@ function mac2label(mac)
return(mac)
end
-- ##############################################
-- Mac Addresses --
local specialMACs = {
"01:00:0C",
"01:80:C2",
"01:00:5E",
"01:0C:CD",
"01:1B:19",
"FF:FF",
"33:33"
}
function isSpecialMac(mac)
for _,key in pairs(specialMACs) do
if(string.contains(mac, key)) then
return true
end
end
return false
end
-- ##############################################
@ -740,21 +717,6 @@ end
-- ##############################################
function flow2hostinfo(host_info, host_type)
local host_name
local res = interface.getHostMinInfo(host_info[host_type .. ".ip"])
if((res == nil) or (res["name"] == nil)) then
host_name = host_info[host_type .. ".ip"]
else
host_name = res["name"]
end
return({host = host_info[host_type .. ".ip"], vlan = host_info[host_type .. ".vlan"], name = host_name})
end
-- ##############################################
function isHostKey(key)
local info = split(key,"@")
-- Check format
@ -1180,17 +1142,6 @@ end
-- ###########################################
-- @brief Deletes all the cache/prefs keys matching the pattern
function deleteCachePattern(pattern)
local keys = ntop.getKeysCache(pattern)
for key in pairs(keys or {}) do
ntop.delCache(key)
end
end
-- ###########################################
-- version is major.minor.veryminor
function version2int(v)
if(v == nil) then return(0) end