This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Is private_data working correctly ?

0

Hi,

I'm having some issues with pinfo->private_data method , I think I'm using it correctly and I'v seen in some revision that private_data is removed. So is private_data working ? Is there another method to pass data to a sub-dissector ?

asked 10 Jan '14, 07:28

Afrim's gravatar image

Afrim
160101116
accept rate: 22%


One Answer:

2

Passing data between dissectors using pinfo->private_data still mostly works (for example, there can be problems if exceptions occur), but it is not the recommended method and one day this method may disappear altogether. It is far better to pass the data using the "new-style" dissection API's. Look into using such functions as, new_create_dissector_handle(), dissector_try_uint_new(), ...

You can see the difference in coding by looking at several fairly recent commits by Michael Mann, who spent some time converting many cases:

... etc.

answered 10 Jan '14, 07:50

cmaynard's gravatar image

cmaynard ♦♦
9.4k1038142
accept rate: 20%

Ok that's what I needed thank you

(10 Jan '14, 08:17) Afrim