Wireshark-dev: Re: [Wireshark-dev] Usage of BASE_CUSTOM
From: Juan Jose Martin Carrascosa <[email protected]>
Date: Thu, 28 Aug 2014 13:59:35 +0200
Alexis,

I finally decided to create the subtree with inner elements as you suggested.

Thanks!
Juanjo


On Thu, Aug 28, 2014 at 12:39 PM, Alexis La Goutte <[email protected]> wrote:
On Thu, Aug 28, 2014 at 11:45 AM, Juan Jose Martin Carrascosa
<[email protected]> wrote:
> Hi all,
>
> In a code review I was told to use proto_tree_add_item and BASE_CUSTOM to
> replace this deprecated call:
>
>       proto_tree_add_text(rtps_parameter_tree, tvb, offset, param_length,
>         "productVersion: %d.%d%c rev%d",
>         major, minor, release, revision);

It will be better to use a proto_tree_add_item for each value ?
 subtree= proto_tree_add_subtree_format(rtps_parameter_tree, tvb, off, 4,
                                ett_rtps_locator_filter_channel,
NULL"productVersion: %d.%d%c rev%d", major, minor, release, revision);

proto_tree_add_item(subtree, hf_rtps_param_product_version_major ,
tvb, offset, ENC_NA);
proto_tree_add_item(subtree, hf_rtps_param_product_version_minor, tvb,
offset+1, ENC_NA);
proto_tree_add_item(subtree, hf_rtps_param_product_version_release ,
tvb, offset+2, ENC_NA);
proto_tree_add_item(subtree, hf_rtps_param_product_version_revision ,
tvb, offset+3, ENC_NA);

>
> I have been looking for documentation or guidelines but I can't find
> anything. Can anyone help me with this? What would be the change? Pointing
> me to any doc would be OK also.

You can look packet-ieee80211.c, there is some case with BASE_CUSTOM
>
> Thanks,
> Juanjo
>
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <[email protected]>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>              mailto:[email protected]?subject=unsubscribe
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]?subject=unsubscribe