Wireshark-dev: Re: [Wireshark-dev] Store a string in temporary tvb buffer and read it using fun
From: Guy Harris <guy@xxxxxxxxxxxx>
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().