Hi, Then i must be confused about what it is hfindex are doing and where they show up in the tree. Could you explain / how to use format?
Sorry for the trouble, Greg -----Original Message----- From: Jaap Keuter [mailto:[email protected]] Sent: Friday, February 13, 2009 3:35 PM To: [email protected] Subject: Re: [Wireshark-dev] Adding numbers to the tree Hi, What's wrong with proto_tree_add_uint_format()? You'll have to format the presentation of your data completely. proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length, guint32 value, const char *format, ...) tree: the tree you want to add to; hfindex: headerfield index of the definition of the header field. Applicable for filtering; tvb: the TVB you work from; start: start offset in TVB, maybe 0 if N/A; length: length of data in TVB, maybe 0 if N/A; value: value you want to be able to filter with; format: printf format string; ...: any format string parameters. Thanx, Jaap [email protected] wrote: > 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 > > [email protected] 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 ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <[email protected]> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:[email protected]?subject=unsubscribe
