Wireshark mailing list archives

Lua syntax question


From: Beth <beth.tridium () gmail com>
Date: Thu, 19 Nov 2009 17:00:53 -0500

I'm creating a chained dissector in Lua, and all I want to do is strip the
first N bytes off of the tvb and pass the remainder to another dissector.

I've been poring over the Lua section of the Wireshark manual, as well as
the Wireshark-Lua wiki pages, but I can't find the exact syntax I need.
Everything I try gets an error of one type or another, I guess I'm not
reading the API reference correctly.  Can someone tell me the correct
syntax?

Here's a simplified version of my dissector code:

  function chained.dissector( tvbuffer, pinfo, treeitem )
    -- first, create a new tvb that skips the first 50 bytes

    --    Each of these causes a Lua error:
    newtvb = Tvb( tvbuffer(50) )
    newtvb = Tvb.new( tvbuffer(50) )
    newtvb = Tvb.tvb( tvbuffer(50) )
    newtvb = Tvb( tvbuffer(50) )

    -- this doesn't work either!
    tvbrg = tvbuffer(50)
    newtvb = Tvb.new_real(tvbrg.bytes())

    -- then pass the data to the next dissector
    next_dissector:call( newtvb, pinfo, treeitem )

  end


Thanks!!
b.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: