Wireshark-bugs: [Wireshark-bugs] [Bug 8266] post-dissector fields not saved in pdml

Date: Tue, 29 Jan 2013 04:28:14 +0000

Comment # 4 on bug 8266 from
Hi, yes sorry.

The Lua code below is my post-dissector plugin, run from init.lua.

It adds nodes to the tree displayed in Wireshark as expected, but if I export
the result using:   File->Export packet dissections->As XML ("PDML") .. the
nodes don't appear in the XML.

Cheers,
Jono
=====================================================

ip_src_f = Field.new("ip.src")
ip_dst_f = Field.new("ip.dst")
udp_src_f = Field.new("udp.srcport")
udp_dst_f = Field.new("udp.dstport")

rtp_setup_f = Field.new("rtp.setup-frame")
trivial_proto = Proto("trivial","Trivial Postdissector")
src_F = ProtoField.string("trivial.src","Source")
dst_F = ProtoField.string("trivial.dst","Destination")
conv_F = ProtoField.string("trivial.conv","Conversation","A Conversation")

rtp_setup_F = ProtoField.string("trivial.rtp_setup","Setup","A Setup")
trivial_proto.fields = {src_F, dst_F, conv_F}
function trivial_proto.dissector(buffer,pinfo,tree)
    local udp_src = udp_src_f()
    local udp_dst = udp_dst_f()
    local ip_src = ip_src_f()
    local ip_dst = ip_dst_f()
    local rtp_setup = rtp_setup_f()

    if udp_src then
       local subtree = tree:add(trivial_proto,"Trivial Protocol Data")
       local src = "" .. ":" tostring(udp_src)
       local dst = tostring(ip_dst) .. ":" tostring(udp_dst)
       local conv = src  .. "->" .. dst
       subtree:add(src_F,src)
       subtree:add(dst_F,dst)
       subtree:add(conv_F,conv)

    if rtp_setup then
    subtree:add(rtp_setup_F, tostring(rtp_setup))
    end
   end
end
register_postdissector(trivial_proto)


=====================================================


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