return nil from packet lut

This commit is contained in:
David Ventura
2024-05-01 11:23:05 +02:00
parent e2a4352659
commit 06cafff105
+4 -6
View File
@@ -49,11 +49,7 @@ lut = {
[0xf169] = "ListenReqAck", [0xf169] = "ListenReqAck",
[0xf170] = "RlyHelloAck", [0xf170] = "RlyHelloAck",
[0xf171] = "RlyHelloAck2", [0xf171] = "RlyHelloAck2",
__index = function(tbl, key)
return "UNK " .. string.format("0x%X", key)
end
} }
setmetatable(lut, lut)
-- Define a function to dissect the packets -- Define a function to dissect the packets
function ilnk_proto.dissector(buffer, pinfo, tree) function ilnk_proto.dissector(buffer, pinfo, tree)
@@ -62,8 +58,10 @@ function ilnk_proto.dissector(buffer, pinfo, tree)
local subtree = tree:add(ilnk_proto, buffer(), "iLnkP2P") local subtree = tree:add(ilnk_proto, buffer(), "iLnkP2P")
-- Add the entire packet as a field -- Add the entire packet as a field
local packetname = lut[buffer(0, 2):uint()] local packettype = buffer(0, 2):uint()
subtree:add(ilnk_proto.fields.type, packetname) local packetname = lut[packettype]
packetname = packetname or "UNK " .. string.format("0x%X", packettype)
subtree:add(ilnk_proto.fields.type, buffer(0, 2), packetname)
-- Set the protocol description in the packet list -- Set the protocol description in the packet list
pinfo.cols.protocol:set("iLnkP2P") pinfo.cols.protocol:set("iLnkP2P")