Wireshark-bugs: [Wireshark-bugs] [Bug 7639] Bluetooth minor enhancement
Date: Mon, 24 Sep 2012 00:31:33 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7639

--- Comment #80 from Michal Labedzki <michal.labedzki@xxxxxxxxx> 2012-09-24 00:31:32 PDT ---
(In reply to comment #79)
> (In reply to comment #78)
> 
> > Coulden't the newly added feature of adding data to the protocol calls usable
> > in this case? P2 - P4 would have to "know" that data is (to be) passed
> > But as was disscused the data structure and magic number is defined in packet.h
> > that wouldn't be a problem - would it?
> > The data part could be void* and casted to  p1_data_t at the end points
> > P2 - P4 should perhaps check the magic number
> 
> For me it's sound quite complicated, can we do it simpler?
> (don't know how, I'm just asking...)

My idea: use pinfo->private_table instead of pinfo->private_data.
For now private_table does not exist by defaults, but we can create it before
dissecting packet, so dissector may not check and creating it
// pinfo->private_table = g_hash_table_new(g_str_hash, g_str_equal);
Dissectors add interesting fields to the array, like that:

g_hash_table_insert(pinfo->private_table, "btbnep.type",
GUINT_TO_POINTER(bnep_type));

Then another dissector may get this value if need:
type = GPOINTER_TO_UINT(g_hash_table_lookup(pinfo->private_table,
"btbnep.type"));

So there is no need to do anything by intermediate dissectors.

I guess this can be used to transfer non-fields data too, maybe reserved one
middle name like "private_data", so can transfer... for example structure by:
g_hash_table_insert(pinfo->private_table, "btbnep.private_data.foo", foo);

What do you think abut that?

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.