-- works as of Wireshark v0.99.7 do local pdm_proto = Proto("PDM", "PDM protocol"); -- (to confirm this worked, check that this protocol appears at the bottom of the "Filter Expression" dialog) -- our new fields local tb = ProtoField.string("pdm.tb", "Time Base (Granularity of Time)") local scaledtlr = ProtoField.uint16("pdm.scaledtlr", "Scale of Delta Time Last Received", base.HEX, nil, 0x3f80) local scaledtls = ProtoField.uint16("pdm.scaledtls", "Scale of Delta Time Last Sent", base.HEX, nil, 0x007f) local psntp = ProtoField.uint16("pdm.psntp", "Packet Sequence Number This Packet", base.DEC) local psnlr = ProtoField.uint16("pdm.psnlr", "Packet Sequence Number Last Received", base.DEC) local deltatlr = ProtoField.uint16("pdm.deltatlr", "Delta Time Last Received", base.HEX) local deltatls = ProtoField.uint16("pdm.deltatls", "Delta Time Last Sent", base.HEX) -- add the fields to the protocol -- (to confirm this worked, check that these fields appeared in the "Filter Expression" dialog) pdm_proto.fields = {tb, scaledtlr, scaledtls, psntp, psnlr, deltatlr, deltatls} -- declare the fields we need to read local original_dstopt_dissector function pdm_proto.dissector(tvbuffer, pinfo, treeitem) original_dstopt_dissector:call(tvbuffer, pinfo, treeitem) local subtreeitem = treeitem:add(pdm_proto, tvbuffer) local tb_int = tvbuffer(4,2):uint()/16384 if tb_int == 0 then subtreeitem:add(tb, tvbuffer(), "Timebase: milliseconds") elseif tb_int == 1 then subtreeitem:add(tb, tvbuffer(), "Timebase: microseconds") elseif tb_int == 2 then subtreeitem:add(tb, tvbuffer(), "Timebase: nanoseconds") else subtreeitem:add(tb, tvbuffer(), "Timebase: picoseconds") end subtreeitem:add(scaledtlr, tvbuffer(), "Scale of Delta Time Last Received:", tvbuffer(4,2):uint()) subtreeitem:add(scaledtls, tvbuffer(), "Scale of Delta Time Last Sent:", tvbuffer(4,2):uint()) subtreeitem:add(psntp, tvbuffer(), "Packet Sequence Number This Packet:", tvbuffer(6,2):uint()) subtreeitem:add(psnlr, tvbuffer(), "Packet Sequence Number Last Received:", tvbuffer(8,2):uint()) subtreeitem:add(deltatlr, tvbuffer(), "Delta Time Last Received:", tvbuffer(10,2):uint()) subtreeitem:add(deltatls, tvbuffer(), "Delta Time Last Sent:", tvbuffer(12,2):uint()) end local ipv6_nxt_table = DissectorTable.get("ipv6.nxt") original_dstopt_dissector = ipv6_nxt_table:get_dissector(60) -- save the original dissector so we can still get to it ipv6_nxt_table:add(60, pdm_proto) -- and take its place in the dissector table end