Thursday, 15 March 2012

Lua Wireshark Scripting -



Lua Wireshark Scripting -

i'm getting started in lua wireshark , i'm baffled. according http://wiki.wireshark.org/luaapi/tvb#tvb:len.28.29 tvb has function "len" when phone call on buf or pkt in below code, i'm getting "attemt phone call method 'len' (a number value)" error. proper way length of buf, or pkt, (which "tvb" objects)?

local myprotocol = proto("proto","my protocol title"); function myprotocol.dissector(buf,pkt,root) local test = pkt:len() -- <--throws error

i think there confusion parameters; according dissectors page: "when called wireshark, passed (1) tvb buffer of info (a tvb object), (2) tree root (treeitem object), , (3) packet info record (pinfo object)." illustration on same page: function trivial_proto.dissector(buffer,pinfo,tree).

it appears buffer tvb object, pkt pinfo object, should seek buf:len() instead of pkt:len().

lua wireshark

No comments:

Post a Comment