Wireshark-dev: [Wireshark-dev] Lua Dissector <lua fake item>
From: Matthew Parlane <parlane@xxxxxxxxx>
Date: Fri, 4 Apr 2014 16:04:34 +1300
Hey everyone,

I grabbed the latest Wireshark-win64-1.11.3-2224-gdf52f81.exe install.

Made a lua script for decoding a simple protocol header and I am getting:

User Datagram Protocol
<lua fake item>
Blah Protocol

Basically my lua is


    local p_blah = Proto("blah","Blah Protocol");
    blah.fields = {... }
    function p_blah.dissector(buf, pinfo, root)
      local t = root:add(p_blah, buf(0,BLAH_HEADER_SIZE))
      t:add(f_item1, buf(0,4))
      -- root:set_text("What?")
    end

Now if I do the root:set_text("What?"), it changes from <lua fake item> to <Text item>


User Datagram Protocol
<Text item>
Blah Protocol


The Blah protocol decodes perfectly, so that's fine. Just curious how to correctly add the nodes so that it doesn't give this extra row of fake lua ?


p.s. Sorry on light details, I can't share the specs.

Cheers,
Matthew Parlane