mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Improves ICMPv6 types/codes support
This commit is contained in:
parent
08c487ad05
commit
539f82a153
6 changed files with 132 additions and 28 deletions
|
|
@ -1,8 +1,8 @@
|
|||
--
|
||||
-- (C) 2013-18 - ntop.org
|
||||
-- (C) 2013-19 - ntop.org
|
||||
--
|
||||
|
||||
dirs = ntop.getDirs()
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
|
|
@ -13,7 +13,7 @@ require "historical_utils"
|
|||
sendHTTPContentTypeHeader('text/html')
|
||||
|
||||
interface.select(ifname)
|
||||
host_info = url2hostinfo(_GET)
|
||||
local host_info = url2hostinfo(_GET)
|
||||
|
||||
-- #####################################################################
|
||||
|
||||
|
|
@ -24,6 +24,7 @@ end
|
|||
-- #####################################################################
|
||||
|
||||
local is_host
|
||||
local stats
|
||||
|
||||
if(host_info["host"] ~= nil) then
|
||||
stats = interface.getHostInfo(host_info["host"], host_info["vlan"])
|
||||
|
|
@ -38,20 +39,23 @@ if(stats ~= nil) then
|
|||
|
||||
for _, k in pairs(icmp_keys) do
|
||||
local icmp = stats[k]
|
||||
|
||||
|
||||
if(icmp ~= nil) then
|
||||
local tot = 0
|
||||
local is_v4
|
||||
|
||||
if(k == "ICMPv4") then is_v4 = true else is_v4 = false end
|
||||
|
||||
|
||||
for key, value in pairsByKeys(icmp) do
|
||||
local keys = string.split(key, ",")
|
||||
local icmp_type = keys[1]
|
||||
local icmp_value = keys[2]
|
||||
print('<tr><td><a href="'..ntop.getHttpPrefix()..'/lua/flows_stats.lua?icmp_type='..
|
||||
icmp_type..'&icmp_cod='..icmp_value..'&version='.. ternary(is_v4, "4", "6") ..'">'..
|
||||
get_icmp_label(icmp_type, icmp_value, is_v4)..'</a>')
|
||||
icmp_type..'&icmp_cod='..icmp_value..'&version='.. ternary(is_v4, "4", "6") ..'">'..
|
||||
get_icmp_label(icmp_type, icmp_value, is_v4)..'</a>')
|
||||
|
||||
print(string.format("<td>%u</td>", icmp_type))
|
||||
print(string.format("<td>%u</td>", icmp_value))
|
||||
|
||||
if(is_host) then
|
||||
print('<td>')
|
||||
|
|
@ -75,8 +79,8 @@ if(stats ~= nil) then
|
|||
print('</td><td align=right>'..formatPackets(value.rcvd))
|
||||
|
||||
end
|
||||
|
||||
print("</td><td align=right>".. (value.sent+value.rcvd) .."</td></tr>\n")
|
||||
|
||||
print("</td><td align=right>".. formatPackets(value.sent + value.rcvd) .."</td></tr>\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue