add heuristic packet matcher

This commit is contained in:
David Ventura
2024-05-01 10:47:00 +02:00
parent 5bb0038d9b
commit e2a4352659
+11 -1
View File
@@ -151,5 +151,15 @@ function ilnk_proto.dissector(buffer, pinfo, tree)
-- subtree:add(ilnk_proto.fields.payload, buffer(2, packet_length-2))
end
udp_table = DissectorTable.get("udp.port"):add(50563, ilnk_proto)
local function heuristic_checker(buffer, pinfo, tree)
length = buffer:len()
if length < 2 then return false end
local packetname = lut[buffer(0, 2):uint()]
if packetname ~= nil then
ilnk_proto.dissector(buffer, pinfo, tree)
return true
end
return false
end
udp_table2 = DissectorTable.get("udp.port"):add(32108, ilnk_proto)
h = ilnk_proto:register_heuristic("udp", heuristic_checker)