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

Ethereal-dev: Re: [Ethereal-dev] calling a new dissector from another new dissector

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date Prev · Date Next · Thread Prev · Thread Next
From: Guy Harris <gharris@xxxxxxxxx>
Date: Fri, 30 Apr 2004 17:43:04 -0700
On Fri, Apr 30, 2004 at 08:10:53PM -0400, Jonathan Margulies wrote:
> In packet-fip.c:
> static void
> dissect_fip(...
> ...
> 	/* call the next dissector */
> 	next_tvb = tvb_new_subset(tvb, hlen, MIN(fiph->ip_len - hlen,
> tvb_length(tvb) - hlen),
> 		fiph->ip_len - hlen);
> 
> 	call_dissector(data_handle, next_tvb, pinfo, tree);
> }

That's not going to hand off to any dissector other than the data
dissector.

> void
> proto_register_fip(void)
> {
> ...
>   proto_fip = proto_register_protocol("Fake Internet Protocol", "FIP", "fip");
>   proto_register_field_array(proto_fip, hf, array_length(hf));
>   proto_register_subtree_array(ett, array_length(ett));
>   fip_dissector_table = register_dissector_table("fip.proto",
> 	    "FIP Protocol", FT_UINT8, BASE_DEC);

You'll have to *use* "fip_dissector_table" - merely creating it doesn't
cause it to be used.  See "dissector_try_port()".