On Jul 3, 2018, at 9:24 AM, Peter Wu <peter@xxxxxxxxxxxxx> 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?