Ask Your Question
0

Ascii dissector non-constant length

asked 2019-01-31 11:00:12 +0000

updated 2019-01-31 11:54:22 +0000

grahamb gravatar image

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.

edit retag flag offensive close merge delete

Comments

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.

Anders gravatar imageAnders ( 2019-01-31 13:23:10 +0000 )edit

Where can i found those file ?

developer_wiredolphin gravatar imagedeveloper_wiredolphin ( 2019-01-31 13:27:04 +0000 )edit

In the source tree under epan/dissectors https://code.wireshark.org/review/git...

Anders gravatar imageAnders ( 2019-01-31 13:33:47 +0000 )edit

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 ?

$AIPOV,050930.3419,5.000,0.000,0.000,0.000,0.000,0.000,0.00,0.00,0.00,00.00000000,000.00000000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,5.000,00000000*6D
developer_wiredolphin gravatar imagedeveloper_wiredolphin ( 2019-01-31 16:23:23 +0000 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-02-01 07:09:30 +0000

Jaap gravatar image

You should take this up on the [email protected] mailing list

edit flag offensive delete link more

Comments

Ah okay, I will contact them then.

developer_wiredolphin gravatar imagedeveloper_wiredolphin ( 2019-02-01 08:34:01 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2019-01-31 11:00:12 +0000

Seen: 315 times

Last updated: Feb 01 '19