This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Dissector handle

0

I'm trying to develop my own dissector for some protocol I've analysed. I took skeleton dissector from README.developer and filled it. Now that I'm trying to compile it I get following error, and cannot figure out what's wrong:

/home/andrey/grive/wireshark-dissector-template/packet-intl.c: In function     ‘proto_reg_handoff_intl’:
/home/andrey/grive/wireshark-dissector-template/packet-intl.c:370:58: warning: passing argument 1 of ‘new_create_dissector_handle’ from incompatible pointer type [enabled by default]
                                                      proto_intl);
                                                      ^
In file included from /home/andrey/grive/wireshark-dissector-template/packet-intl.c:46:0:
/usr/include/wireshark/epan/packet.h:322:34: note: expected ‘new_dissector_t’ but argument is of type ‘int (*)(struct tvbuff_t *, struct packet_info *, struct proto_tree *)’
WS_DLL_PUBLIC dissector_handle_t new_create_dissector_handle(new_dissector_t dissector,

asked 03 Jul '13, 02:25

Andrey's gravatar image

Andrey
21447
accept rate: 50%


One Answer:

1

Presumably you're building from trunk, the dissector function now has four parameters which the skeleton code hasn't caught up with yet.

You'll need to append a void * to the parameter list for your dissector function, the usual format is void *data _U_. The signature of a dissector function is defined in epan\packet.h as:

typedef int (*new_dissector_t)(tvbuff_t *, packet_info *, proto_tree *, void *);

answered 03 Jul '13, 02:42

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Thanks, it helped

(03 Jul '13, 03:47) Andrey