Wireshark mailing list archives

Re: Store a string in temporary tvb buffer and read it using function proto_tree_add_item


From: Guy Harris <guy () alum mit edu>
Date: Thu, 18 Aug 2011 11:26:46 -0700


On Aug 18, 2011, at 9:41 AM, Mrunal Upadhyay wrote:

Is there a way to store a string in a temporary tvb buffer and then in the dissection logic use this tvb buffer in 
the in order to read this temporary string using function proto_tree_add_item and assign it to one of the filter 
fields.
 
The reason for creating a temporary buffer is because this information is not supplied in the default tvb buffer 
which contains all the packet information. And I want this information so that I can filter the column on the basis 
of the value fetched from this temporary buffer tvb.

So where does that information come from?

If it's something your dissector calculates based on data from the packet, or based on information it's saved from 
previous packets, or something such as that, you should just use one of the other proto_tree_add_ routines and directly 
pass that value to the routine, rather than adding it to a tvbuff and using proto_tree_add_item().

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


Current thread: