On Mon, Sep 03, 2012 at 06:00:06PM -0700, Guy Harris wrote:
>
> On Sep 3, 2012, at 4:35 PM, Jakub Zawadzki wrote:
>
> > I plan to replace:
> > typedef void (*dissector_t)(tvbuff_t *, packet_info *, proto_tree *);
> > typedef int (*new_dissector_t)(tvbuff_t *, packet_info *, proto_tree *);
> >
> > with:
> > typedef int (*real_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, void *data);
>
> "Replace"? That means changing *all* dissectors to have the new function signature (not that doing so is the wrong thing to do; it's just going to be a lot of work, even if it's work with a shell script or something such as that).
>
> Did you mean "I plan to add to ... this", i.e. keep dissector_t and new_dissector_t around, and add real_dissector_t and have new routines with which "new new style" dissectors can register themselves, with older dissectors not being passed the additional argument when called through call_dissector(), etc.?
I want to have one API, so yes, replace. I know it's monkey job ;-)
> Don't forget to change heur_dissector_t - or add real_heur_dissector_t - and the calls to invoke a heuristic dissector.
Ok, good point, what about another try[1] of merging heur_dissector_t into real_dissector_t,
heuristic dissectors which haven't accept tvb just return -1.
[1] http://www.wireshark.org/lists/wireshark-dev/201207/msg00197.html