I've got an interesting problem. I need to create a dissector for a custom protocol, The protocol is very simple and is designed to work on a point to point link as follows. 1 DWORD (32 bits) of Header, the lowest 16 bits of which are a sequence number. Multiples of 8DWORDS which represent Data samples. I've got the header dissection working, but I can't work out a neat way of chunking up the Data into samples (32 byte chunks following the header). I've already read the README.developer but couldn't see anything that looks like what I want to do. If anyone could point towards some documentation or an example protocol that would be great. Thanks in advance! asked 18 Sep '12, 04:21 CTNOBLE edited 18 Sep '12, 08:41 |
One Answer:
Use say a DWORD is 32-bits (4 bytes) and that there are multiple of 8 DWORDS following the header, so 8 * 4 = 32 bytes, but then you say you want to chunk the data samples into 64 byte chunks? I'll assume somewhere there's a typo and just pick 32 bytes for the chunk size. If it's 64 byte chunks you want, then it's trivial to change. So, given:
If the field I've marked above as
answered 18 Sep ‘12, 08:09 cmaynard ♦♦ Sorry, yes, 64 was a typo (I’m too used to working with Hex nibbles). The unknown feild is currently reserved (this may change in future to provide more information on the chunk size, but never the full packet size.) The protocol is basically sitting in layer 1 and packet begin/end is managed by hardware, similar to ETHERNET. This looks great! Thanks for the pointers to the string functs. I’ve got somthing that works for me now. Thanks guys! (18 Sep ‘12, 08:34) CTNOBLE |
How are you capturing the data ? or: is the captured data being read from a file ? or what ?
If the data is being read from a file, what is the format ?
How much data is your dissector receiving each time it is called ? 1 DWORD ?
Basically: more information on your setup will help to provide a better answer...
Sorry, data is being generated by a packet simulator and echo'd on the local loopback device. It will eventually come from the hardware but right now I have to create the dissector so it's best to not have potentially buggy hardware in the loop.