I'm just getting started in Lua for wireshark and I'm already baffled. According to http://wiki.wireshark.org/LuaAPI/Tvb#tvb:len.28.29 a Tvb has the function "len" but when I call it on buf or pkt in the below code, I'm getting an "attemt to call method 'len' (a number value)" error. What is the proper way to get the length of buf, or pkt, (which are "tvb" objects)?
local myprotocol = Proto("proto","My Protocol Title");
function myprotocol.dissector(buf,pkt,root)
local test = pkt:len() -- <--Throws error