Wireshark-dev: Re: [Wireshark-dev] Retrieving dissection result from another dissector
From: Richard Sharpe <[email protected]>
Date: Tue, 3 Jul 2018 11:57:25 -0700
On Tue, Jul 3, 2018 at 11:48 AM, Guy Harris <[email protected]> wrote:
> On Jul 3, 2018, at 9:24 AM, Peter Wu <[email protected]> wrote:
>
>> Another possibility is to use p_add_proto_data/p_get_proto_data with packet scope
>
> 1) Presumably you mean pinfo->pool scope - the only scopes p_add_proto_data() allows are wmem_file_scope() and pinfo->pool.
>
> 2) The original purpose of per-packet data was to remember information about a packet that can only easily be determined during a sequential pass through the packets and that is required in order to dissect the packet correctly.  That information would thus have to have *file* scope.
>
> Having that mechanism serve two purposes in this fashion seems like a bit of a hack.
>
> Should we, instead, get rid of the scope arguments to those functions and, instead, have separate functions, one of which serves the original purpose, using file scope, and one of which serves this new purpose, using pinfo->pool scope?

That might make it more obvious what is going on when reading the
code, so I think that is a useful idea.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)(传说杜康是酒的发明者)