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] proto_tree -> proto_item

From: wsgd <wsgd@xxxxxxx>
Date: Wed, 25 Feb 2009 21:37:16 +0100
From proto.h :
/** A protocol tree element. */
typedef proto_node proto_tree;
/** A protocol item element. */
typedef proto_node proto_item;

So :
current proto_tree implementation = current proto_item implementation

So your code works now, perhaps not later.


Perhaps other identical errors elsewhere into wireshark sources ?


Olivier

Luca Ceresoli a �crit :
S�bastien Tandel ha scritto:
proto_item_set_text is meant to work with proto_item*
Sure, as declared in epan/proto.h.
What do you mean by it compiles and works with a proto_tree*?
I mean this:

  proto_tree * my_tree;
  const gchar *my_string;
  /* ... */
  my_tree =  ptvcursor_add_text_with_subtree(cursor, .....,  "foo");
  /* ...do some more decoding, including some ptvcursor_add()... */
  /* now I know which text to place there instead of "foo": */
  my_string = val_to_str(...);
  proto_item_set_text(my_tree, "<%s>", my_string);

The last line compiles and runs without runtime errors, and the text of the node created by ptvcursor_add_text_with_subtree() changes from "foo" to "<" + my_string + ">".

Could you describe what is not "working" when you're passing a proto_item*? Compilation error, which? other?
Nothing. I just have no proto_item* to pass, since ptvcursor_add_text_with_subtree() doesn't return any.

Luca

___________________________________________________________________________
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




--
Wireshark Generic Dissector http://wsgd.free.fr