Join us June 15-20 for SharkFest'24 US, the official Wireshark Developer & User Conference

Wireshark-dev: Re: [Wireshark-dev] dissection question

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Tue, 16 Feb 2010 11:32:23 -0800
On Feb 16, 2010, at 11:18 AM, Brian Oleksa wrote:

>                    guint8 sizeofroutername;

That should presumably be

                   guint16 sizeofroutername;

as, according to

it's a 2-byte field, and...

>                        //Size of router name
>                        sizeofroutername = tvb_get_guint8(tvb, offset);

...that should presumably be tvb_get_ntohs() for the same reason.

If you fix that, then I suspect that

>                        //Router Name
>                        proto_tree_add_item(helen_sub_tree, hf_helen_routername, tvb, offset, sizeofroutername, FALSE);
>                        offset += sizeofroutername;

will work.