Wireshark-users: [Wireshark-users] Problem with LUA API
From: Florian GIRAULT <zi_omnislasher@xxxxxxxxxxx>
Date: Fri, 11 Jan 2008 17:01:59 +0900
Hello there,

I have some problems in writing lua scripts for wireshark. It's seems
that the API does not corresponds to the doc:

For example, how do I get a sub tvb from a tvb ? I thought that by doing :

    function myproto.dissector(buffer,pinfo,mytree)

    pinfo.cols.protocol = "myProto"
    local subtree = mytree:add(NNC_proto,buffer(),"Myprotodata")

    --UDP header
    local myheader = Tvb.new_subset(buffer(0,8))

    end


I could get the sub tvb from a tvb, but it simply says that
Tvb.new_subset is a nil value !

It does not exist. Neither do Tvb.new_real(...) !

So how can we do to create a Tvb, or a subset if we need to ???

What puzzles me is that someone posted a script in which Tvb.new_real
seemed to work fine... So Is there something wrong in my code ?