Wireshark mailing list archives

Re: Adding data parameter to dissector handler


From: Jakub Zawadzki <darkjames-ws () darkjames pl>
Date: Wed, 12 Sep 2012 12:48:26 +0200

On Tue, Sep 11, 2012 at 12:22:02AM +0200, Jakub Zawadzki wrote:
Btw. I was thinking it'd be great to have some magic number on begin of
dissector data, instead of 'void *data' we could use some 'struct dissector_data',
defined like:
  struct dissector_data {
    uint32_t magic;
  };

  struct dissector_xml_data {
    struct dissector_data top;
    xml_frame_t *frame;
  };

FYI, MichaƂ is first user of call_dissector_with_data[1][2]
His use of data argument is really simple, no strcture passing, just TRUE value or FALSE/NULL.

I'd prefer to only pass strctures (flexible, easy to maintain), with magic numbers on begin 
of structure + document every use in some doc/ file.

These rules might be too strict, and I don't want to enforce only my rules,
so how do we want to use data argument?


[1] https://bugs.wireshark.org/bugzilla/attachment.cgi?id=9132
[2] https://bugs.wireshark.org/bugzilla/attachment.cgi?id=9133
___________________________________________________________________________
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: