Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Modbus/TCP hookup for subdissector

From: Roland Knall <rknall@xxxxxxxxx>
Date: Sat, 2 Apr 2011 00:05:01 +0200
There is no specific need for data to the subdissector. It was just an
idea I was thinking out loud. The basic idea would be, that there
could be a case, where a subdissector would need information from the
calling dissector. Especially if the subdissector only sees part of
the packet data. Some information is passed down by the packet_info
package, but I was thinking of finding a way to access the complete
information. In the case of the ModbusTCP diessector, the dissector
has a struct, which contains all fields dissected so far. They could
be interesting to a subdissector.

But just to clarify, this is just an idea I had, not a requirement.
And specifically my patch does not provide or need such functionality.

The main reason for my patch has been to be able to access the data
payload, which is accomplished by the patch on

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5786

And therefore I would kindly ask you to consider adding the patch to
the subversion repository.

kind regards,
Roland


On Fri, Mar 25, 2011 at 5:17 PM, Anders Broman
<anders.broman@xxxxxxxxxxxx> wrote:
>
>
> -----Original Message-----
> From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Roland Knall
> Sent: den 25 mars 2011 17:10
> To: Developer support list for Wireshark
> Subject: Re: [Wireshark-dev] Modbus/TCP hookup for subdissector
>
> Am 25.03.2011 um 17:06 schrieb Chris Maynard <chris.maynard@xxxxxxxxx>:
>
>> Roland Knall <rknall@...> writes:
>>
>>> 1. Is there a way to provide additional information to the
>>> subdissector? Someone could use private_data, but that field I need
>>> somewhere else, therefore can not be used here.
>>
>> I haven't looked at the patch or anything, but I just wanted to
>> comment on this part.  If you want/need to use the private data, you
>> can do what several dissectors do and save a pointer to the current
>> private_data before replacing the pinfo->private_data with your own, then restore the original afterwards.
>> One example is packet-http.c, but there are others.  (search for
>> "save_private_data")
>
> I thought of that. But the main argument against the use of the private data would be, that the subdissector isn't expecting the data in that place.
>
> Anyway, I do not need the functionality anyway, just thought that there should be a way of dealing with such cases.
>
> kind regards,
> Roland
>
> What type of information does the subdisector need? Glancing at the patch it looks like you might as well
> Call the subdisector via a handle as it will allways be called(if present)
> If it's using the function code you could use a uint table registering for the function code(s)
>
> Regards
> Anders
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
>