Wireshark-dev: Re: [Wireshark-dev] Correct way to add bytes to tree

From: Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>
Date: Wed, 28 Dec 2016 20:46:20 +0100
You can also look proto_item_append_text

On Wed, Dec 28, 2016 at 7:54 PM, Jaap Keuter <jaap.keuter@xxxxxxxxx> wrote:
Hi,

Sharing part of the relevant code would help answer your question, eg. the proto_add_ calls tested.

Thanks,
Jaap

On 28 Dec 2016, at 19:09, Juan Jose Martin Carrascosa <juanjo@xxxxxxx> wrote:

Hi all,

I have what I need to add bytes to a tree using proto_tree_add_item or proto_tree_add_bytes. The problem is that I want to customize the name of the proto_item adding a couple of parameters that I know from before. Something like this:

given id = 5 and length = 10, tvb, offset and length. Assuming that for example the bytes are "a05651"

Displayed content should be:

Member (id = 5, len = 10): a05651

However, I can't make it work properly using the _format or _format_value variants. It ends not adding the content of the bytes:

Member (id = 5, len = 10):

Any help?

Thanks,
Juanjo Martin



___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe