Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Displaying a variable in a Dissector Protocol Tree

From: eymanm <eymanm@xxxxxxxxx>
Date: Tue, 15 Jun 2010 16:31:49 -0400
Now I'm trying to make it to work. I start with a perfectly working statement:

proto_tree_add_item(wca_tree, hf_wca_label_2_number, tvb, offset, 4, FALSE);

and transform it to:

proto_tree_add_int(wca_tree, hf_wca_label_2_number, tvb, offset, 4, 26);

When I run it, it troughs an exception: proto.c:2926: failed assertion "DISSECTOR_ASSERT_NOT_REACHED"

What's wrong?
Thanks

On Mon, Jun 14, 2010 at 5:47 PM, Guy Harris <guy@xxxxxxxxxxxx> wrote:

On Jun 14, 2010, at 2:45 PM, Mark Eyman wrote:

> I'd like to add a value that was fetched into a variable to the protocol tree. The README.developer tells that the proto_tree_add_int()routine suppose to do that. Hence if I look on the definition in the epan\proto.h, it requires all the parameters related to the tvb, but no references to the variable itself.

If you look in the declaration in proto.h, you find

/** Add one of FT_INT8, FT_INT16, FT_INT24 or FT_INT32 to a proto_tree.
 @param tree the tree to append this item to
 @param hfindex field index
 @param tvb the tv buffer of the current data
 @param start start of data in tvb
 @param length length of data in tvb
 @param value data to display
 @return the newly created item */
extern proto_item *
proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
       gint length, gint32 value);

"The variable itself" is the last argument, "value".
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe