Ethereal-dev: Re: [Ethereal-dev] error in a simple dissector of DSR

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sun, 26 Feb 2006 12:57:27 -0800
david martinez wrote:

here is the code: i don't find the error in this
simple code!!!!:

	...

static void
dissect_dsr(tvbuff_t *tvb,packet_info
*pinfo,proto_tree *tree)
{



proto_item *tp,*t0,*t1,*t2;

	...

dsr_tree=proto_item_add_subtree(tp,ett_dsr);

You never set "tp" to anything.

If you look at other dissectors, they do something similar to

	tp = proto_tree_add_item(tree, proto_dsr, tvb, 0, -1, FALSE);

to create a top-level protocol item for the protocol.