mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
fixed add active monitoring with ipv4 and ports combination (#4677)
This commit is contained in:
parent
edb215487b
commit
9dfed97e56
7 changed files with 26 additions and 6 deletions
|
|
@ -861,6 +861,18 @@ function isIPv4(address)
|
|||
return false
|
||||
end
|
||||
|
||||
--- Return true if the address is made up with <IPv4-Address>:<Port>
|
||||
function isIPv4WithPort(address)
|
||||
|
||||
local parts = split(address, ":")
|
||||
if #parts ~= 2 then return false end
|
||||
|
||||
local isPortValid = ternary(tonumber(parts[2]) > 65535, false, true)
|
||||
local isAddressValid = isIPv4(parts[1])
|
||||
|
||||
return isAddressValid and isPortValid
|
||||
end
|
||||
|
||||
function isIPv4Network(address)
|
||||
local parts = split(address, "/")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue