Add device name into the l2 devices page

This commit is contained in:
emanuele-f 2018-01-17 12:11:08 +01:00
parent 5ae3bb13ba
commit fa6d428b13
5 changed files with 24 additions and 6 deletions

View file

@ -1547,7 +1547,7 @@ end
-- Mac Addresses --
-- A function to give a useful device name
function getDeviceName(device_mac, vlan)
function getDeviceName(device_mac, vlan, skip_manufacturer)
local name = getHostAltName(device_mac)
if name == device_mac then
@ -1576,7 +1576,7 @@ function getDeviceName(device_mac, vlan)
if isEmptyString(name) then
local manufacturer = ntop.getMacManufacturer(device_mac)
if manufacturer ~= nil then
if (not skip_manufacturer) and (manufacturer ~= nil) then
name = manufacturer.extended
else
-- last resort