Wireshark-dev: Re: [Wireshark-dev] Stats/tap plugin problem
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 26 Jul 2010 23:51:29 -0700
On Jul 26, 2010, at 10:32 AM, Floris van Nee wrote:

> When I try to do some more advanced stuff I run into a couple of problems. The main problem is that I'd like to be able to access the tree (or at least some information, like sequence number of packet, data of ACK etc.) of the protocol which I have encapsulated (802.11). I can't save the 'tree' variable in my dissector to the tap information or to the private_data field, because it seems that when the stats plugin is called, the dissector is also called with tree=NULL, so it skips the whole tree creating part.

If you're developing for Wireshark 1.4.x or 1.5.x, try, when calling stats_tree_register_with_group() or stats_tree_register(), passing in a flags argument with TL_REQUIRES_PROTO_TREE (as defined in epan/tap.h) set.  That *should* cause the protocol tree to be built and a non-null tree argument to be passed to the tap.

(If you're developing for Wireshark 1.2.x, that option isn't available.)