ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Store a string in temporary tvb buffer and read it using fun

From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Thu, 18 Aug 2011 12:55:38 -0400
On 08/18/2011 12:41 PM, Mrunal Upadhyay wrote:
Dear All,

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.

Sure, use tvb_new_real_data() to create a TVB which points to some memory. Do be aware that the memory has to stick around for a while so you may also need to use tvb_set_free_cb() so you can know when to free it.