Wireshark mailing list archives

How to call a sub-dissector many times without knowing the exact data size


From: wsgd <wsgd () free fr>
Date: Sat, 31 Jan 2015 22:46:31 +0100

Hello,


I want to call a sub-dissector many times.
I know the total size of my data.
I do NOT know the size to give to the sub-dissector.
The sub-dissector will know (by itself) the size to dissect.

The corresponding scheme from the parent dissector point of view :

|-----------------------------------Packet data (total size is known)--------------------------------| |--Parent dissector--|--sub-dissector 1 (size is unknown)--|...|--sub-dissector N (size is unknown)--|


The sub-dissector will be called by dissector_try_uint (or call_dissector or eventually dissector_try_heuristic).


Question 1)
Is it possible to call dissector_try_uint (or ...) with more data than needed by the sub-dissector ?
It seems not a problem.

Question 2)
How to know how many bytes have been dissected by the sub-dissector ?



Regards,
Olivier

--
Wireshark Generic Dissectorhttp://wsgd.free.fr

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: