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

wireshark pinfo->private data field

0

What is the substitute of private_data field in packet_info structure? I checked the old and the new code and figured out that the private_data field is removed. The replacement from the code which i can make out is removing the private_data, but what if we have no option of removing it?

I am here trying to convert my plugins from old Wireshark version 1.2.10 to latest version.

Please help me with this.

asked 12 Jan '17, 01:06

chirag's gravatar image

chirag
11448
accept rate: 0%


One Answer:

2

What kind of data were you storing in pinfo->private_data field ? Without knowing, here is already a few suggestions.

If it's data for a sub dissector, use the the data parameter that is now the 4th parameter of the dissector_t structure.

If it is data used internally in the dissector, you can eventually use the p_add_proto_data() / p_get_proto_data() function

answered 12 Jan '17, 01:55

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

Hi pascal, thanks for the answer. yes I used the extra param void *data in place of private_data. In the old code it was used to share the data between the dissector. After understanding the code I was able to replace it. Anyways thanks for the quick answer.

(12 Jan '17, 01:59) chirag

If an answer has solved your issue, please accept the answer for the benefit of other users by clicking the checkmark icon next to the answer. Please read the FAQ for more information.

(12 Jan '17, 02:07) Jaap ♦