Implement sort by IP in network discovery page

Fixes #2197
This commit is contained in:
emanuele-f 2018-12-03 23:22:58 +01:00
parent 6574acde53
commit 9dd33409df
4 changed files with 43 additions and 2 deletions

View file

@ -3398,6 +3398,17 @@ end
-- ###########################################
-- Compares IPv4 / IPv6 addresses
function ip_address_asc(a, b)
return(ntop.ipCmp(a, b) < 0)
end
function ip_address_rev(a, b)
return(ntop.ipCmp(a, b) > 0)
end
-- ###########################################
--
-- IMPORTANT
-- Leave it at the end so it can use the functions