mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Add max value checks for traffic and packets metrics
This commit is contained in:
parent
4622ba92cd
commit
354dd697c0
7 changed files with 92 additions and 61 deletions
|
|
@ -2271,22 +2271,6 @@ function getservbyport(port_num, proto)
|
|||
return(ntop.getservbyport(port_num, proto))
|
||||
end
|
||||
|
||||
-- getSpeedMax
|
||||
function getSpeedMax(ifname)
|
||||
|
||||
if(ifname == nil) then
|
||||
return -1
|
||||
end
|
||||
|
||||
if(ifname ~= "eth0") then
|
||||
return -1
|
||||
end
|
||||
|
||||
ifname = tostring(ifname)
|
||||
|
||||
return(ntop.getSpeedMax(ifname))
|
||||
end
|
||||
|
||||
function intToIPv4(num)
|
||||
return(math.floor(num / 2^24).. "." ..math.floor((num % 2^24) / 2^16).. "." ..math.floor((num % 2^16) / 2^8).. "." ..num % 2^8)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue