Wireshark-bugs: [Wireshark-bugs] [Bug 11356] New: Wireshark Lua dissectors: both expand together

Date: Sun, 12 Jul 2015 20:05:40 +0000
Bug ID 11356
Summary Wireshark Lua dissectors: both expand together
Product Wireshark
Version 1.12.4
Hardware x86
OS Windows 7
Status UNCONFIRMED
Severity Trivial
Priority Low
Component Dissection engine (libwireshark)
Assignee [email protected]
Reporter [email protected]

Build Information:
Version 1.12.4 (v1.12.4-0-gb4861da from master-1.12)

--
Example of two simple Wireshark Lua dissectors for chained protocols:

local proto1 = Proto("proto1","First Layer")
local page = ProtoField.uint16("proto1.page", "Page", base.HEX)
proto1.fields = {page}

function proto1.dissector(buffer, pinfo, tree)
    pinfo.cols.protocol = proto1.name;
    local ptree = tree:add(proto1,buffer(1,5))
    ptree:add(page, buffer(1,2))
    Dissector.get("proto2"):call(buffer(6, 4):tvb(),  pinfo, tree) 
end

local proto2 = Proto("proto2","Second Layer")
local len = ProtoField.uint8("proto2.len", "Payload Length")
proto2.fields = {len}

function proto2.dissector(buffer, pinfo, tree)
    pinfo.cols.protocol = proto2.name;
    local ptree = tree:add(proto2,buffer())
    ptree:add(len, buffer(1,2))
end

DissectorTable.get("tcp.port"):add(3456, proto1)

The dissectors do work and display protocols in a tree one after another. Now
if one of the protocols is expanded and another packet is selected, then both
proto1 and proto2 in a tree are expanded. The same with collapse.


You are receiving this mail because:
  • You are watching all bug changes.