Wireshark mailing list archives

Proper private_data usage


From: Christopher Maynard <Christopher.Maynard () gtech com>
Date: Tue, 15 Oct 2013 16:00:18 +0000 (UTC)

What is the proper, safe and recommended way to use pinfo->private_data?

If you look at the TCP dissector, you see the following:

        pd_save = pinfo->private_data;
        TRY {
            (*dissect_pdu)(next_tvb, pinfo, tree);
        }
        CATCH_NONFATAL_ERRORS {
            /*  Restore the private_data structure in case one of the
             *  called dissectors modified it (and, due to the exception,
             *  was unable to restore it).
             */
            pinfo->private_data = pd_save;
            show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE);
        }
        ENDTRY;

I did not check all dissectors, but this is certainly not done for all of
them.  I guess the question I have is, should it?  Is this the recommended
approach?

- Chris


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: