mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Added vlan utility function
This commit is contained in:
parent
2c61e9725b
commit
506426c3b8
1 changed files with 17 additions and 1 deletions
|
|
@ -5291,7 +5291,7 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
-- @brief This function format the info field used in tables
|
||||
-- @brief This function format the info field used in tables
|
||||
-- @params info: A string containing the info field
|
||||
-- no_html: A boolean, true if no_html is requested (e.g. Download in CSV format),
|
||||
-- false otherwise
|
||||
|
|
@ -5309,6 +5309,22 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
-- @brief This function, given an IP and a vlan return the concat of host@vlan
|
||||
-- @params host_ip: A string containing the IP
|
||||
-- vlan: A string or a number containing the vlan id
|
||||
-- @return A string IP@vlan
|
||||
function format_ip_vlan(ip, vlan)
|
||||
local host = ip
|
||||
|
||||
if (vlan) and (tonumber(vlan) ~= 0) then
|
||||
host = host .. '@' .. tonumber(vlan)
|
||||
end
|
||||
|
||||
return host
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
--
|
||||
-- IMPORTANT
|
||||
-- Leave it at the end so it can use the functions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue