Wireshark-dev: Re: [Wireshark-dev] Inconsistent availability of proto_tree values during the fi

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 10 Apr 2017 20:24:58 -0700
On Apr 10, 2017, at 3:04 PM, Paul Offord <Paul.Offord@xxxxxxxxxxxx> wrote:

>> If a tree isn't being generated, because it isn't necessary (e.g., if the code calling the dissectors is only trying to get the column contents) there's presumably no need for TRANSUM - or any other dissector or post-dissector - to add anything to the non-existent tree.
> 
> Agreed, except in the case of TRANSUM the user will probably want to add a TRANSUM-computed value as a column.  For example, if you use tshark to just output the Packet List entries (summary lines) it's likely that TRANSUM-computed values would be included in that listing.

That's not a TRANSUM-specific issue.  If the user wants to use *any* custom columns, from *any* dissector or post-dissector field, the protocol tree currently has to be generated - and, given that custom columns work, we *already* arrange to construct the protocol tree whenever we're asking for columns and at least one column is a custom column (see various calls to have_custom_cols()), so if the code calling the dissectors is only trying to get the column contents *but* at least one column is a custom column, the tree will be constructed.