Hide zero MAC address in remote to remote alerts

Addresses #3644
This commit is contained in:
emanuele-f 2020-05-19 14:37:30 +02:00
parent 6daf449e31
commit 39d76d233d
7 changed files with 53 additions and 43 deletions

View file

@ -2277,6 +2277,7 @@ function get_mac_classification(m, extended_name)
end
local magic_macs = {
["00:00:00:00:00:00"] = "",
["FF:FF:FF:FF:FF:FF"] = "Broadcast",
["01:00:0C:CC:CC:CC"] = "CDP",
["01:00:0C:CC:CC:CD"] = "CiscoSTP",
@ -2328,6 +2329,18 @@ function get_symbolic_mac(mac_address, only_symbolic)
end
end
function get_mac_url(mac)
local m = get_symbolic_mac(mac, true)
if isEmptyString(m) then
return ""
end
local url = ntop.getHttpPrefix() .."/lua/mac_details.lua?host="..mac
return string.format('[ <a href=\"%s\">%s</a> ]', url, m)
end
function get_manufacturer_mac(mac_address)
local m = string.sub(mac_address, 1, 8)
local ret = get_mac_classification(m, true --[[ extended name --]])