ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Adding data parameter to dissector handler

From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
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