Ethereal-dev: Re: [Ethereal-dev] LDP common hello param fixes

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

From: "Aamer Akhter" <aakhter@xxxxxxxxx>
Date: Fri, 15 Mar 2002 23:02:18 -0500
thanks guy, i got carried away with the changes. i should have checked the
decl of _item. i guess somebody should change the decl in README.developer it
says that value follows length in the arglist.

it's late friday night, so that's prob it. ;-) you still need to change the
length in the last two calls (_val_target and _val_request) to 1.

why is proto_tree_add_item() favored over boolean? is there any place where
boolean would be favored over item.

----- Original Message -----
From: "Guy Harris" <guy@xxxxxxxxxx>
To: "Aamer Akhter" <aakhter@xxxxxxxxx>
Cc: <ethereal-dev@xxxxxxxxxxxx>
Sent: Friday, March 15, 2002 9:09 PM
Subject: Re: [Ethereal-dev] LDP common hello param fixes


> On Fri, Mar 15, 2002 at 09:00:48PM -0500, Aamer Akhter wrote:
> > Please find attached fixes for decoding the LDP common hello parameters.
> > The values were not being passed to the proto_tree_* functions.
>
> The patch is partially incorrect.
>
>     proto_tree_add_item(val_tree, hf_ldp_tlv_val_hold, tvb, offset, 2,
FALSE);
>
> is a correct call.  The call the patch changes it to:
>
>     proto_tree_add_item(val_tree, hf_ldp_tlv_val_hold, tvb, offset, 2,
tvb_get_ntohs(tvb,offset));
>
> is an incorrect call.  The last argument to "proto_tree_add_item()" is a
> Boolean indicating whether the value "proto_tree_add_item()" should
> fetch from the tvbuff is (if byte order matters) to be treated as
> big-endian or little-endian; it is not the value for the item.
>
> The other two changes are correct, but a better change is to change
> "proto_tree_add_boolean()" to "proto_tree_add_item()".  I've checked in
> that change.