ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] Equivalency between APIs

From: Juan Jose Martin Carrascosa <juanjo@xxxxxxx>
Date: Tue, 26 Aug 2014 15:41:43 +0200
Hi all, 

I need to remove the proto_tree_add_text calls, and I wanted to know if this is equivalent:

Before:

        ti_channel = proto_tree_add_text(rtps_parameter_tree, tvb, off, 0, "Channel[%u]", ch);
        channel_tree = proto_item_add_subtree(ti_channel, ett_rtps_locator_filter_channel);

Now:
        channel_tree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, off, 0,
           ett_rtps_locator_filter_channel, &ti_channel, "Channel[%u]", ch);


Thanks!
Juanjo