Ascii dissector non-constant length
Hello, So i am currently creating a dissector for an ascii protocol that look like this
0000 ff ff ff ff ff ff 00 19 8c 30 20 38 08 00 45 00 ÿÿÿÿÿÿ...0 8..E.
0010 00 b8 3a ab 00 00 40 11 b2 af c0 a8 85 8a c0 a8 .¸:«..@.²¯À¨..À¨
0020 85 ff f9 6d 1f b0 00 a4 f2 b7 24 41 49 50 4f 56 .ÿùm.°.¤ò·$AIPOV
0030 2c 30 35 30 39 33 30 2e 33 34 31 39 2c 35 2e 30 ,050930.3419,5.0
0040 30 30 2c 30 2e 30 30 30 2c 30 2e 30 30 30 2c 30 00,0.000,0.000,0
0050 2e 30 30 30 2c 30 2e 30 30 30 2c 30 2e 30 30 30 .000,0.000,0.000
0060 2c 30 2e 30 30 2c 30 2e 30 30 2c 30 2e 30 30 2c ,0.00,0.00,0.00,
0070 30 30 2e 30 30 30 30 30 30 30 30 2c 30 30 30 2e 00.00000000,000.
0080 30 30 30 30 30 30 30 30 2c 30 2e 30 30 30 2c 30 00000000,0.000,0
0090 2e 30 30 30 2c 30 2e 30 30 30 2c 30 2e 30 30 30 .000,0.000,0.000
00a0 2c 30 2e 30 30 30 2c 30 2e 30 30 30 2c 30 2e 30 ,0.000,0.000,0.0
00b0 30 30 2c 35 2e 30 30 30 2c 30 30 30 30 30 30 30 00,5.000,0000000
00c0 30 2a 36 44 0d 0a 0*6D..
It's the frame with $AIPOV and my info are between each comma. But the length of each change like if it's 300 or 5 it will display only 3 or 1 byte. How can do it for a dissector in C please. Thank you.
Not sure what the question is, but you can have a look in packet-sip.c or packet-megaco.c for text based protocol parsing.
Where can i found those file ?
In the source tree under epan/dissectors https://code.wireshark.org/review/git...
I am sorry but the dissector are a little bit complicated. So i have just this simple frame. And i just want to add to the proto tree the different element in the frame and each element is separated by a coma. But the lenght of the element can change. So How can i parse a this ascii frame. And in the worst case how can i transforme a Tvb into a ascii dump or string ?