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

How stop the dissection when tvb buffer ends ?????

0

I want to stop the dissection of the packet when tvb buffer ends.

Is there any API for stop the dissection of that packet??????

asked 01 Nov '12, 22:49

Akhil's gravatar image

Akhil
53272831
accept rate: 0%

What do you mean? The "normal" thing is that the dissector keeps track of how many bytes that should be dissected either from length information in the protocol or by checking the (reported) length of the tvb.

(02 Nov '12, 04:19) Anders ♦

One Answer:

0

If you don't want to keep track of when the buffer ends (which you can detect by looking at the TVB length(s) as Anders said), you can also just keep reading/dissecting: when you get past the end of the buffer your access with throw an exception and stop dissection for you (of course it will also report your packet as malformed or cut short during capture).

answered 02 Nov '12, 09:30

JeffMorriss's gravatar image

JeffMorriss ♦
6.2k572
accept rate: 27%

I am checking the end of the buffer by if(tvb_length_remaining()<=0). If the condition is true which api/function should i call to stop the dissection?????. If i call exit(1) then i guess whireshark will terminate....I want to stop the dissection of that particular packet.

(04 Nov '12, 21:52) Akhil

just 'return' from your dissector.

(05 Nov '12, 00:43) Kurt Knochner ♦

Thanks a lot Kurt

(05 Nov '12, 00:48) Akhil