I am trying to implement, using Lua, a dissector which tells me whether the packets sent are arriving or not. To achieve this, on top of UDP I have implemented a custom protocol with a field "ID" which is auto-incremented by one on each packet.
I got the dissector to process the fields, but I am not able to make it read the previous packet ID and report whether the current packet ID is in the expected order.
function ogg.dissector(buffer, pinfo, tree)
--Get the expected index and store it to a global (and unique per packet) variable
if (not pinfo.private.expected) then
--Get the new index (the current packet ID field)
--Set it as the new expected packet
if (tree) then
--Make all the packet processing here. Somewhere among this:
if (tonumber(pinfo.private.expected) ~= index) then
pinfo.cols.info = "ID: "..index.." is Invalid! Expected ".. pinfo.private.expected
I am getting several packets with the information correct, but other packets are getting the
packet_counter variable different than what it should be, i.e. the previous packet was 100, current is 101, and it is saying that expected is 154, as if the processing order of the packets weren’t sequential.
What is wrong here?
asked 23 Oct ‘12, 08:31
accept rate: 0%
edited 23 Oct ‘12, 18:18