Wireshark-dev: Re: [Wireshark-dev] dynamic dissector

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 10 Nov 2006 09:39:21 -0800
Naveen Kumar wrote:

If one dissector is registered for multiple protocols is it possible to distinguish between them at dissection time. basically do an of the args to the dissector callback contain information about which protocol is being dissected ???
dissect( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)

No.

The right way to do that is not to register on dissector for multiple protocols; if they're mostly the same, have a routine that does the dissection and that takes a "what protocol is this?" argument, and have separate dissectors for each of the protocols that calls the common routine with the appropriate value for the "what protocol is this?" argument.