ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-users: [Wireshark-users] LUA Postdissector

From: "Bilger, Matthias" <Matthias.Bilger@xxxxxxxxx>
Date: Fri, 30 Jan 2009 14:15:23 +0100
Hi all,

I've got stuck writing a simple post-dissector.
I can't get any data of the dissectors, here's my example

-------8<--------
data_f = Field.new("ip.addr")
example = Proto("example","example","DoIP Postdissector")
msg_F = ProtoField.string("example.msg","Message")
example.fields = {msg_F, p_F}
function doip.dissector(buffer,pinfo,tree)
   local info = data_f()
   local subtree = tree:add(example,"example data")
   local msg = tostring(info)
   subtree:add(msg_F,msg)
end
register_postdissector(example)
---------8<-------

The only thing i get in the tree is 

Message: nil

What am I doing wrong?

Thanks a lot
Matthias Bilger