Wireshark-dev: Re: [Wireshark-dev] Adding Buffer Stream View

Date: Wed, 22 Apr 2009 18:34:49 +0000
Thank you both you and Jeff, this is exactly what i was looking for. However, run into a bit of a problem. The buffer that i create, is returned from a dll where i allocate and free the memory from. I put wrapper type of functions in my wireshark dissector that frees the memory after each packet. I ended up with fe ee fe ee fe ee (etc) as my buffer which means it is freed memory. I was wondering if there is a place to put my free memory call, or if there is a way to kind of copy data over to the dissector, free my dll memory, and have wireshark then be incharge of freeing the memory it allocated. I hope you understand what my situation is. 

Greg




---- didier <dgautheron@xxxxxxxx> wrote: 

=============
Hi,
Le mercredi 22 avril 2009 à 17:39 +0000, gogrady@xxxxxxxxx a écrit :
> Hello,
> 
> I cant figure out where it happens but i would to create another buffer view tab. For example, when tcp reassembles, it opens up a new tab with the full buffer of the complete packet. I want to take my own created buffer and open up a new tab for highlighting. Can anyone help or point me in the right direction?
> 
Look at packet-tcp.c around line 1600:

roughly

you create a new tvb with your data:
next_tvb = tvb_new_real_data(data, datalen, datalen);

attached it to the main tvb, mainly for house keeping (freeing and so
on):
tvb_set_child_real_data_tvbuff(tvb, next_tvb);

and then create a new data source:
add_new_data_source(pinfo, next_tvb, "my data");

Didier


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