Wireshark-dev: Re: [Wireshark-dev] [PATCH] draft-ietf-behave-rfc3489bis-07

From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Fri, 20 Jul 2007 14:40:59 -0400
Marc Petit-Huguenin wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

This is an update to the STUN2 dissector using the last draft,
draft-ietf-behave-rfc3489bis-07.

It doesn't compile as is:

 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I./../.. -I./.. -I/usr/include -I/usr/local/include -Werror -DINET6 "-D_U_=__attribute__((unused))" -g -O2 -Wall -W -Wdeclaration-after-statement -Wendif-labels -Wpointer-arith -I/usr/local/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib64/glib/include -I/usr/X11R6/include -MT libcleandissectors_la-packet-stun2.lo -MD -MP -MF .deps/libcleandissectors_la-packet-stun2.Tpo -c packet-stun2.c  -fPIC -DPIC -o .libs/libcleandissectors_la-packet-stun2.o
packet-stun2.c: In function `dissect_stun2_tcp':
packet-stun2.c:398: warning: implicit declaration of function `tcp_dissect_pdus'
packet-stun2.c: In function `proto_reg_handoff_stun2':
packet-stun2.c:548: warning: passing arg 1 of `create_dissector_handle' from incompatible pointer type
packet-stun2.c:549: warning: passing arg 1 of `create_dissector_handle' from incompatible pointer type
packet-stun2.c: At top level:
packet-stun2.c:146: warning: unused parameter 'pinfo'
packet-stun2.c:60: warning: 'stun2_att_password' defined but not used
packet-stun2.c:73: warning: 'stun2_att_refresh_interval' defined but not used
make[1]: *** [libcleandissectors_la-packet-stun2.lo] Error 1

Probably due to mixing new-style (returns int) and old style (returns nothing) dissectors. For example:

static int
dissect_stun2_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
        tcp_dissect_pdus(tvb, pinfo, tree, TRUE, STUN2_HDR_LEN,
                        get_stun2_message_len, dissect_stun2_message);
}

will (eventually) generate a warning that the function's not calling return.

Sorry, I don't really have time to clean it up myself now.