tidy up dissector

This commit is contained in:
David Ventura
2024-05-01 11:23:16 +02:00
parent 06cafff105
commit 8f4c5f09a4
+2 -1
View File
@@ -65,13 +65,14 @@ function ilnk_proto.dissector(buffer, pinfo, tree)
-- 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")
pinfo.cols.info:set(packetname)
if packetname == "PunchPkt" or packetname == "P2pRdy" then if packetname == "PunchPkt" or packetname == "P2pRdy" then
local len = buffer(2, 2) local len = buffer(2, 2)
subtree:add(ilnk_proto.fields.len, len) subtree:add(ilnk_proto.fields.len, len)
local serial_prefix = buffer(4, 4):string() local serial_prefix = buffer(4, 4):string()
local serial_no = UInt64(buffer(12, 4):uint(), buffer(8, 4):uint()) local serial_no = UInt64(buffer(12, 4):uint(), buffer(8, 4):uint())
local serial_suffix = buffer(16, 5):string() local serial_suffix = buffer(16, 5):string()
subtree:add(ilnk_proto.fields.serial, serial_prefix..serial_no..serial_suffix) subtree:add(ilnk_proto.fields.serial, buffer(4, len:uint()-3), serial_prefix..serial_no..serial_suffix)
end end
if packetname == "DrwAck" then if packetname == "DrwAck" then
subtree:add(ilnk_proto.fields.len, buffer(2, 2)) subtree:add(ilnk_proto.fields.len, buffer(2, 2))