This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Hi Forum

I am writing a protocol dissector. The protocol data packets are small and always prefixed with a message length. Multiple messages are contained inside one TCP packet.

To date I have process the tvb buffer and called tvb_new_subset with the length and offset to -1 and processed the new packet. But this leads me to a problem is the message length (currently unused in my approach) is actually greater than the fields I am aware of in the packet I end up starting thinking I have a new message before I have consumed all the previous packet.

Is there a way I can read n bytes from main tvb buffer into a tmp tvb for processing and continue using the tvb_new_subset to recursively continue processing the messages.

If there an example protocol I could look at for achieving this?

Thanks

Stuart

asked 22 Jan '13, 11:54

StuieNorris's gravatar image

StuieNorris
6557
accept rate: 0%


Have a look at "tcp_dissect_pdus()" (see also paragraph 2.7.1 in doc/README.developer). It might be just the thing you're looking for.

permanent link

answered 22 Jan '13, 13:39

SYN-bit's gravatar image

SYN-bit ♦♦
17.1k957245
accept rate: 20%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×63
×1

question asked: 22 Jan '13, 11:54

question was seen: 1,316 times

last updated: 22 Jan '13, 13:39

p​o​w​e​r​e​d by O​S​Q​A