Fixes asn message label (#9322)

This commit is contained in:
Matteo Biscosi 2025-07-02 10:36:11 +02:00
parent 79b3a92d87
commit 705050938f
7 changed files with 217 additions and 183 deletions

View file

@ -755,4 +755,27 @@ end
-- ######################################################
-- @brief Given an asn id, it will return a string with the
-- asn name formatted consistently
-- @params asn: ASN Id
-- @returns The formatted ASN name
function format_utils.formatASN(asn)
local name = ""
if asn then
asn = tonumber(asn)
name = asn
if (asn ~= 0) then
local as_info = interface.getASInfo(asn)
if (as_info) then
name = string.format("%s (%s)", as_info.asname, asn)
end
end
end
return name
end
-- ######################################################
return format_utils