Ask Your Question

Revision history [back]

Lua - Get data from buffer when packet size varies

Hello,

Newbie to creating dissectors in Lua, looking for some advice on how to grab a section of data when the payload size varies.

I can grab data using the offset,length method for some items but others shift one or two bytes so i can't rely on it.

What is a suitable method to do this?

I'm using the following function currenty:

function myproto.dissector(buffer, pinfo, tree) length = buffer:len() if length == 0 then return end