Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] create_dissector_handle - what's occuring?

From: Pascal Quantin <pascal.quantin@xxxxxxxxx>
Date: Sun, 29 Nov 2015 21:20:51 +0100


2015-11-29 21:14 GMT+01:00 Paul Offord <Paul.Offord@xxxxxxxxxxxx>:

I was a relatively happy camper until about 30 mins ago when I did a git pull to refresh my build environment.  Now IntelliSense is telling me that create_dissector_handle is an unfound identifier.

 

I notice that new_create_dissector_handle has appeared.  I’ve tried just changing the call to new_create_dissector_handle but then I get errors complaining about incompatible parameters. What’s the story here?

 

Thanks and regards…Paul


Hi Paul,

create_dissector_handle was an old interface that was obsolete since years and that got removed in current master branch. Now all dissectors must be of "new" type and you must use new_create_dissector_handle instead.
Note that the dissector function prototype changed from:
typedef void (*dissector_t)(tvbuff_t *, packet_info *, proto_tree *);
to
typedef int (*new_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, void *);
So your dissector function must return the number of bytes consumed, and the dissector entry point has an extra parameter named data allowing to exchange structure between dissectors.

Regards,
Pascal.