From a3cf7f25cd74cd328dcdeb56869102906253abb2 Mon Sep 17 00:00:00 2001 From: Jan Huwald Date: Wed, 26 Jun 2013 17:47:13 +0200 Subject: dissector: allow zero length tasks, reformat diff --git a/wireshark/hbbp_dissector.lua b/wireshark/hbbp_dissector.lua index 73316f5..ca58d35 100644 --- a/wireshark/hbbp_dissector.lua +++ b/wireshark/hbbp_dissector.lua @@ -1,24 +1,22 @@ -hbbp_proto = Proto("hbbp","Home Brew Broadcast Protocol") +hbbp_proto = Proto("hbbp", "Home Brew Broadcast Protocol") + -- create a function to dissect it -function hbbp_proto.dissector(buffer,pinfo,tree) +function hbbp_proto.dissector(buffer, pinfo, tree) pinfo.cols.protocol = "HBBP" - local subtree = tree:add(hbbp_proto,buffer(),"HBBP Data") - + local subtree = tree:add(hbbp_proto, buffer(), "HBBP Data") + + -- find the \0 that seperates task and payload local i = 0 local b = buffer():bytes() - - while (i