mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Add l4_proto_list
This commit is contained in:
parent
d0371222c5
commit
a2863d5b9e
1 changed files with 13 additions and 1 deletions
|
|
@ -210,7 +210,6 @@ l4_keys = {
|
|||
{ "Other IP", "other_ip", -1 }
|
||||
}
|
||||
|
||||
|
||||
L4_PROTO_KEYS = {tcp=6, udp=17, icmp=1, other_ip=-1}
|
||||
|
||||
function __FILE__() return debug.getinfo(2,'S').source end
|
||||
|
|
@ -702,6 +701,19 @@ function l4_proto_to_string(proto_id)
|
|||
return string.format("%d", proto_id)
|
||||
end
|
||||
|
||||
-- Return the list of L4 proto (key = name, value = id)
|
||||
function l4_proto_list()
|
||||
local list = {}
|
||||
|
||||
for _, proto in pairs(l4_keys) do
|
||||
if L4_PROTO_KEYS[proto[2]] then -- add L4 proto only
|
||||
list[proto[1]] = proto[3]
|
||||
end
|
||||
end
|
||||
|
||||
return list
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
function noHtml(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue