Wireshark-dev: Re: [Wireshark-dev] Adding numbers to the tree

Date: Fri, 13 Feb 2009 20:27:54 +0000
Hi,

i have looked at those and it doesnt seem to be what i'm looking for. I want to do something such as
proto_tree_add_text(tree, "TEST", tvb, 0, 0, function_call_that_returns_"TEST"() );

so that in the tree it will output something like TEST: TEST. 
however, the first "TEST" is supposed to be an int, but i do not know how to get around not using a static const value_string.

Unless i have missed a function that you would like to point out that makes that easy. 

Thanks, 
Greg
______________________________
Hi,

If you look at the other proto_tree_add.... functions you will probably find one which suits your needs.

Thanx,
Jaap

gogrady@xxxxxxxxx wrote:
> Ahh thank you, i think i get that. But also, for "id". It takes an int, but what if i want to put a different string there? I want to be able to include my own string for output that isn't in a static const value_string. I will be return data from a function from a loaded dll. And just something like:
> 
> proto_tree_add_uint(tree, "Test: ", tvb, 0, 0, 7)
> 
> or
> 
> proto_tree_add_uint(tree, testfunction(), tvb, 0, 0, 7)
> 
> where testfunction() would return a char * or something of the sort. Is there an easy way to do something like this?
> 
> Greg