As you set a conversation dissector by supplying a dissector handle

rather than a function pointer, "dissect_wtp_fromudp()" no longer needs
to be global; make it static, register it by name, and have the WSP
dissector get the handle by calling "find_dissector()" rather than by
constructing its own handle for it.

Fix up some attributions.

svn path=/trunk/; revision=4306
This commit is contained in:
Guy Harris 2001-12-03 02:10:31 +00:00
parent 44a02e37c6
commit 852e3fffe5
5 changed files with 20 additions and 24 deletions

View File

@ -2,11 +2,11 @@
*
* Utility routines for WAP dissectors
*
* $Id: packet-wap.c,v 1.3 2001/06/12 06:31:14 guy Exp $
* $Id: packet-wap.c,v 1.4 2001/12/03 02:10:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Didier Jorand
* Copyright 1998 Gerald Combs
*
* WAP dissector based on original work by Ben Fowler
* Updated by Neil Hunter <neil.hunter@energis-squared.com>

View File

@ -2,10 +2,10 @@
*
* Declarations for WAP packet disassembly
*
* $Id: packet-wap.h,v 1.5 2001/10/19 21:34:28 guy Exp $
* $Id: packet-wap.h,v 1.6 2001/12/03 02:10:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
* WAP dissector based on original work by Ben Fowler
@ -85,14 +85,6 @@ guint tvb_get_guintvar (tvbuff_t *, guint , guint *);
/* Character set encoding */
extern const value_string vals_character_sets[];
/*
* WTP-over-UDP dissector; the WSP dissector may need to associate it with
* a conversation if it sees a redirect.
*
* XXX - this is ugly; there needs to be a better way of doing this.
*/
extern void dissect_wtp_fromudp(tvbuff_t *, packet_info *, proto_tree *);
/*
* Misc TODO:
*

View File

@ -2,11 +2,11 @@
*
* Routines to dissect WSP component of WAP traffic.
*
* $Id: packet-wsp.c,v 1.45 2001/11/27 07:13:27 guy Exp $
* $Id: packet-wsp.c,v 1.46 2001/12/03 02:10:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Didier Jorand
* Copyright 1998 Gerald Combs
*
* WAP dissector based on original work by Ben Fowler
* Updated by Neil Hunter <neil.hunter@energis-squared.com>
@ -171,7 +171,7 @@ static gint ett_redirect_afl = ETT_EMPTY;
/* Handle for WSP-over-UDP dissector */
static dissector_handle_t wsp_fromudp_handle;
/* Handle for WSP-over-WTP-over-UDP dissector */
/* Handle for WTP-over-UDP dissector */
static dissector_handle_t wtp_fromudp_handle;
/* Handle for WMLC dissector */
@ -4061,18 +4061,21 @@ proto_register_wsp(void)
wsp_fromudp_handle = create_dissector_handle(dissect_wsp_fromudp,
proto_wsp);
wtp_fromudp_handle = create_dissector_handle(dissect_wtp_fromudp,
proto_wsp);
};
void
proto_reg_handoff_wsp(void)
{
/*
* Get a handle for the WMLC dissector
* Get a handle for the WMLC dissector.
*/
wmlc_handle = find_dissector("wmlc"); /* Coming soon :) */
/*
* And get a handle for the WTP-over-UDP dissector.
*/
wtp_fromudp_handle = find_dissector("wtp-udp");
/* Only connection-less WSP has no previous handler */
dissector_add("udp.port", UDP_PORT_WSP, dissect_wsp_fromudp, proto_wsp);
dissector_add("udp.port", UDP_PORT_WSP_PUSH, dissect_wsp_fromudp, proto_wsp);

View File

@ -2,11 +2,11 @@
*
* Routines to dissect WTLS component of WAP traffic.
*
* $Id: packet-wtls.c,v 1.13 2001/09/28 18:59:30 guy Exp $
* $Id: packet-wtls.c,v 1.14 2001/12/03 02:10:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Didier Jorand
* Copyright 1998 Gerald Combs
*
* WAP dissector based on original work by Ben Fowler
* Updated by Neil Hunter <neil.hunter@energis-squared.com>

View File

@ -2,11 +2,11 @@
*
* Routines to dissect WTP component of WAP traffic.
*
* $Id: packet-wtp.c,v 1.20 2001/10/07 08:37:28 guy Exp $
* $Id: packet-wtp.c,v 1.21 2001/12/03 02:10:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
* Copyright 1998 Didier Jorand
* By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
* WAP dissector based on original work by Ben Fowler
* Updated by Neil Hunter <neil.hunter@energis-squared.com>
@ -481,7 +481,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Called directly from UDP.
* Put "WTP+WSP" into the "Protocol" column.
*/
void
static void
dissect_wtp_fromudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (check_col(pinfo->fd, COL_PROTOCOL))
@ -719,6 +719,7 @@ proto_register_wtp(void)
proto_register_subtree_array(ett, array_length(ett));
register_dissector("wtp", dissect_wtp_fromwap, proto_wtp);
register_dissector("wtp-udp", dissect_wtp_fromudp, proto_wtp);
};
void