mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Add get_portidx_by_name and snmp_mappings.get_iface_idx
This commit is contained in:
parent
39aaaf58da
commit
a206f83b4b
4 changed files with 78 additions and 11 deletions
|
|
@ -86,4 +86,21 @@ end
|
|||
|
||||
-- ################################################################################
|
||||
|
||||
function snmp_mappings.get_iface_idx(snmp_device_ip, if_name)
|
||||
local ports
|
||||
|
||||
_cache_device(snmp_device_ip)
|
||||
ports = _localcache[snmp_device_ip]
|
||||
|
||||
for idx, info in pairs(ports) do
|
||||
if info.name and info.name == if_name then
|
||||
return idx
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
-- ################################################################################
|
||||
|
||||
return snmp_mappings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue