aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-11-27 07:13:32 +0000
committerGuy Harris <guy@alum.mit.edu>2001-11-27 07:13:32 +0000
commit07b2709f8a32951cc2503d2e048d662a01cb472c (patch)
tree21d265bf7402a2739905bd87227383ae0a9f78ab
parentfd456eaf0b5af46449882983b95529e073fd989f (diff)
Change "conversation_set_dissector()" to take a dissector handle, rather
than a pointer to a dissector function, as an argument. This means that the conversation dissector is called through "call_dissector()", so the dissector itself doesn't have to worry about checking whether the protocol is enabled or setting "pinfo->current_proto", so get rid of the code that does that in conversation dissectors. Also, make the conversation dissectors static. Get rid of some direct calls to dissectors; replace them with calls through handles, and, again, get rid of code to check whether a protocol is enabled and set "pinfo->current_proto" where that code isn't needed. Make those dissectors static if they aren't already static. Add a routine "create_dissector_handle()" to create a dissector handle without registering it by name, if the dissector isn't used outside the module in which it's defined. svn path=/trunk/; revision=4281
-rw-r--r--Makefile.am3
-rw-r--r--epan/conversation.c15
-rw-r--r--epan/conversation.h7
-rw-r--r--epan/packet.c16
-rw-r--r--epan/packet.h6
-rw-r--r--packet-arp.c18
-rw-r--r--packet-dsi.c7
-rw-r--r--packet-fr.c14
-rw-r--r--packet-fr.h27
-rw-r--r--packet-ftp.c8
-rw-r--r--packet-ipp.c9
-rw-r--r--packet-msproxy.c13
-rw-r--r--packet-quake.c17
-rw-r--r--packet-quake2.c13
-rw-r--r--packet-quakeworld.c13
-rw-r--r--packet-rpc.c10
-rw-r--r--packet-rtcp.c16
-rw-r--r--packet-rtcp.h3
-rw-r--r--packet-rtp.c18
-rw-r--r--packet-rtp.h4
-rw-r--r--packet-rtsp.c6
-rw-r--r--packet-snmp.c15
-rw-r--r--packet-socks.c15
-rw-r--r--packet-tftp.c13
-rw-r--r--packet-wcp.c12
-rw-r--r--packet-wsp.c29
26 files changed, 150 insertions, 177 deletions
diff --git a/Makefile.am b/Makefile.am
index 258a636350..a1f5b6c9b8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
# Makefile.am
# Automake file for Ethereal
#
-# $Id: Makefile.am,v 1.384 2001/11/24 08:14:10 guy Exp $
+# $Id: Makefile.am,v 1.385 2001/11/27 07:13:25 guy Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com>
@@ -350,7 +350,6 @@ noinst_HEADERS = \
packet-esis.h \
packet-eth.h \
packet-fddi.h \
- packet-fr.h \
packet-frame.h \
packet-giop.h \
packet-gnutella.h \
diff --git a/epan/conversation.c b/epan/conversation.c
index 036a94ddc2..527119fe65 100644
--- a/epan/conversation.c
+++ b/epan/conversation.c
@@ -1,7 +1,7 @@
/* conversation.c
* Routines for building lists of packets that are part of a "conversation"
*
- * $Id: conversation.c,v 1.15 2001/11/21 01:00:37 guy Exp $
+ * $Id: conversation.c,v 1.16 2001/11/27 07:13:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -462,8 +462,8 @@ conversation_new(address *addr1, address *addr2, port_type ptype,
conversation->index = new_index;
conversation->data_list = NULL;
-/* clear dissector pointer */
- conversation->dissector = NULL;
+/* clear dissector handle */
+ conversation->dissector_handle = NULL;
/* set the options and key pointer */
conversation->options = options;
@@ -902,9 +902,9 @@ conversation_delete_proto_data(conversation_t *conv, int proto)
void
conversation_set_dissector(conversation_t *conversation,
- dissector_t dissector)
+ dissector_handle_t handle)
{
- conversation->dissector = dissector;
+ conversation->dissector_handle = handle;
}
/*
@@ -923,9 +923,10 @@ try_conversation_dissector(address *addr_a, address *addr_b, port_type ptype,
port_b, 0);
if (conversation != NULL) {
- if (conversation->dissector == NULL)
+ if (conversation->dissector_handle == NULL)
return FALSE;
- (*conversation->dissector)(tvb, pinfo, tree);
+ call_dissector(conversation->dissector_handle, tvb, pinfo,
+ tree);
return TRUE;
}
return FALSE;
diff --git a/epan/conversation.h b/epan/conversation.h
index bf4c6fb13f..517af05e8f 100644
--- a/epan/conversation.h
+++ b/epan/conversation.h
@@ -1,7 +1,7 @@
/* conversation.h
* Routines for building lists of packets that are part of a "conversation"
*
- * $Id: conversation.h,v 1.8 2001/11/04 03:55:52 guy Exp $
+ * $Id: conversation.h,v 1.9 2001/11/27 07:13:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -57,7 +57,8 @@ typedef struct conversation {
struct conversation *next; /* pointer to next conversation on hash chain */
guint32 index; /* unique ID for conversation */
GSList *data_list; /* list of data associated with conversation */
- dissector_t dissector; /* protocol dissector client can associate with conversation */
+ dissector_handle_t dissector_handle;
+ /* handle for protocol dissector client associated with conversation */
guint options; /* wildcard flags */
conversation_key *key_ptr; /* pointer to the key for this conversation */
} conversation_t;
@@ -76,7 +77,7 @@ extern void *conversation_get_proto_data(conversation_t *conv, int proto);
extern void conversation_delete_proto_data(conversation_t *conv, int proto);
extern void conversation_set_dissector(conversation_t *conversation,
- dissector_t dissector);
+ dissector_handle_t handle);
extern gboolean
try_conversation_dissector(address *addr_a, address *addr_b, port_type ptype,
guint32 port_a, guint32 port_b, tvbuff_t *tvb, packet_info *pinfo,
diff --git a/epan/packet.c b/epan/packet.c
index a1701bb38e..ad0e9a69c1 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.42 2001/11/26 05:41:12 hagbard Exp $
+ * $Id: packet.c,v 1.43 2001/11/27 07:13:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -790,6 +790,20 @@ find_dissector(const char *name)
return g_hash_table_lookup(registered_dissectors, name);
}
+/* Create an anonymous handle for a dissector. */
+dissector_handle_t
+create_dissector_handle(dissector_t dissector, int proto)
+{
+ struct dissector_handle *handle;
+
+ handle = g_malloc(sizeof (struct dissector_handle));
+ handle->name = NULL;
+ handle->dissector = dissector;
+ handle->proto_index = proto;
+
+ return handle;
+}
+
/* Register a dissector by name. */
void
register_dissector(const char *name, dissector_t dissector, int proto)
diff --git a/epan/packet.h b/epan/packet.h
index c9cfc5bca6..6af0d154af 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -1,7 +1,7 @@
/* packet.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet.h,v 1.41 2001/11/26 05:41:13 hagbard Exp $
+ * $Id: packet.h,v 1.42 2001/11/27 07:13:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -194,6 +194,10 @@ extern void register_dissector(const char *name, dissector_t dissector,
/* Find a dissector by name. */
extern dissector_handle_t find_dissector(const char *name);
+/* Create an anonymous handle for a dissector. */
+extern dissector_handle_t create_dissector_handle(dissector_t dissector,
+ int proto);
+
/* Call a dissector through a handle. */
extern void call_dissector(dissector_handle_t handle, tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree);
diff --git a/packet-arp.c b/packet-arp.c
index 678cc9fe48..7193b67e8c 100644
--- a/packet-arp.c
+++ b/packet-arp.c
@@ -1,12 +1,11 @@
/* packet-arp.c
* Routines for ARP packet disassembly
*
- * $Id: packet-arp.c,v 1.45 2001/11/26 05:13:11 hagbard Exp $
+ * $Id: packet-arp.c,v 1.46 2001/11/27 07:13:25 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
- *
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -70,7 +69,7 @@ static gint ett_arp = -1;
static gint ett_atmarp_nsap = -1;
static gint ett_atmarp_tl = -1;
-static dissector_handle_t data_handle;
+static dissector_handle_t atmarp_handle;
/* Definitions taken from Linux "linux/if_arp.h" header file, and from
@@ -412,8 +411,6 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *tl_tree;
proto_item *tl;
- CHECK_DISPLAY_AS_X(data_handle,proto_arp, tvb, pinfo, tree);
-
/* Override the setting to "ARP/RARP". */
pinfo->current_proto = "ATMARP";
@@ -652,10 +649,6 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
const guint8 *sha_val, *spa_val, *tha_val, *tpa_val;
gchar *sha_str, *spa_str, *tha_str, *tpa_str;
- CHECK_DISPLAY_AS_X(data_handle,proto_arp, tvb, pinfo, tree);
-
- pinfo->current_proto = "ARP";
-
/* Call it ARP, for now, so that if we throw an exception before
we decide whether it's ARP or RARP or IARP or ATMARP, it shows
up in the packet list as ARP.
@@ -669,7 +662,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ar_hrd = tvb_get_ntohs(tvb, AR_HRD);
if (ar_hrd == ARPHRD_ATM2225) {
- dissect_atmarp(tvb, pinfo, tree);
+ call_dissector(atmarp_handle, tvb, pinfo, tree);
return;
}
ar_pro = tvb_get_ntohs(tvb, AR_PRO);
@@ -940,12 +933,13 @@ proto_register_arp(void)
"ARP/RARP", "arp");
proto_register_field_array(proto_arp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ atmarp_handle = create_dissector_handle(dissect_atmarp, proto_arp);
}
void
proto_reg_handoff_arp(void)
{
- data_handle = find_dissector("data");
dissector_add("ethertype", ETHERTYPE_ARP, dissect_arp, proto_arp);
dissector_add("ethertype", ETHERTYPE_REVARP, dissect_arp, proto_arp);
}
diff --git a/packet-dsi.c b/packet-dsi.c
index 7ef81a6dc5..d11fbe0e63 100644
--- a/packet-dsi.c
+++ b/packet-dsi.c
@@ -2,7 +2,7 @@
* Routines for dsi packet dissection
* Copyright 2001, Randy McEoin <rmceoin@pe.com>
*
- * $Id: packet-dsi.c,v 1.4 2001/11/26 04:52:49 hagbard Exp $
+ * $Id: packet-dsi.c,v 1.5 2001/11/27 07:13:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -75,6 +75,7 @@ static int hf_dsi_reserved = -1;
static gint ett_dsi = -1;
+static dissector_handle_t dsi_handle;
static dissector_handle_t data_handle;
#define TCP_PORT_DSI 548
@@ -324,7 +325,7 @@ dissect_dsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
conversation = conversation_new(&pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
}
- conversation_set_dissector(conversation, dissect_dsi);
+ conversation_set_dissector(conversation, dsi_handle);
hash_info = conversation_get_proto_data(conversation, proto_dsi);
if (hash_info == NULL)
{
@@ -483,6 +484,8 @@ proto_register_dsi(void)
proto_register_subtree_array(ett, array_length(ett));
register_init_routine( &dsi_reinit);
+
+ dsi_handle = create_dissector_handle(dissect_dsi, proto_dsi);
}
void
diff --git a/packet-fr.c b/packet-fr.c
index 76854b634e..c03160ba7d 100644
--- a/packet-fr.c
+++ b/packet-fr.c
@@ -3,12 +3,11 @@
*
* Copyright 2001, Paul Ionescu <paul@acorp.ro>
*
- * $Id: packet-fr.c,v 1.20 2001/11/26 05:13:11 hagbard Exp $
+ * $Id: packet-fr.c,v 1.21 2001/11/27 07:13:25 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
- *
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -48,7 +47,6 @@
#include <string.h>
#include <glib.h>
#include "packet.h"
-#include "packet-fr.h"
#include "packet-osi.h"
#include "packet-llc.h"
#include "packet-chdlc.h"
@@ -234,14 +232,12 @@ static void dissect_fr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
-void dissect_fr_uncompressed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static void dissect_fr_uncompressed(tvbuff_t *tvb, packet_info *pinfo,
+ proto_tree *tree)
{
proto_item *ti = NULL;
proto_tree *fr_tree = NULL;
- CHECK_DISPLAY_AS_X(data_handle,proto_fr, tvb, pinfo, tree);
-
- pinfo->current_proto = "Frame Relay";
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "FR");
if (check_col(pinfo->fd, COL_INFO))
@@ -422,6 +418,8 @@ void proto_register_fr(void)
proto_register_subtree_array(ett, array_length(ett));
fr_subdissector_table = register_dissector_table("fr.ietf");
+
+ register_dissector("fr", dissect_fr_uncompressed, proto_fr);
}
void proto_reg_handoff_fr(void)
diff --git a/packet-fr.h b/packet-fr.h
deleted file mode 100644
index 3185739553..0000000000
--- a/packet-fr.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* packet-fr.h
- * Declaration of routines for Frame Relay dissection
- *
- * $Id: packet-fr.h,v 1.1 2001/03/30 10:51:50 guy Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
- * Copyright 1998 Gerald Combs
- *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-void dissect_fr_uncompressed(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree);
diff --git a/packet-ftp.c b/packet-ftp.c
index a2119e1d86..d80ed89a8d 100644
--- a/packet-ftp.c
+++ b/packet-ftp.c
@@ -3,7 +3,7 @@
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
* Copyright 2001, Juan Toledo <toledo@users.sourceforge.net> (Passive FTP)
*
- * $Id: packet-ftp.c,v 1.36 2001/11/21 02:01:06 guy Exp $
+ * $Id: packet-ftp.c,v 1.37 2001/11/27 07:13:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -60,6 +60,8 @@ static int hf_ftp_response_data = -1;
static gint ett_ftp = -1;
static gint ett_ftp_data = -1;
+static dissector_handle_t ftpdata_handle;
+
#define TCP_PORT_FTPDATA 20
#define TCP_PORT_FTP 21
@@ -188,7 +190,7 @@ handle_pasv_response(const u_char *line, int linelen, packet_info *pinfo)
&pinfo->dst, PT_TCP, server_port, 0,
NO_PORT2);
conversation_set_dissector(conversation,
- dissect_ftpdata);
+ ftpdata_handle);
}
break;
}
@@ -432,6 +434,8 @@ proto_register_ftp(void)
proto_ftp_data = proto_register_protocol("FTP Data", "FTP-DATA", "ftp-data");
proto_register_field_array(proto_ftp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ ftpdata_handle = create_dissector_handle(dissect_ftpdata, proto_ftp_data);
}
void
diff --git a/packet-ipp.c b/packet-ipp.c
index 1854990b63..faf7b57572 100644
--- a/packet-ipp.c
+++ b/packet-ipp.c
@@ -3,12 +3,11 @@
*
* Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-ipp.c,v 1.24 2001/11/26 05:13:11 hagbard Exp $
+ * $Id: packet-ipp.c,v 1.25 2001/11/27 07:13:25 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
- *
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -171,10 +170,6 @@ dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint16 status_code;
gchar *status_fmt;
- CHECK_DISPLAY_AS_X(data_handle,proto_ipp, tvb, pinfo, tree);
-
- pinfo->current_proto = "IPP";
-
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "IPP");
if (check_col(pinfo->fd, COL_INFO)) {
diff --git a/packet-msproxy.c b/packet-msproxy.c
index 65b80c0bdc..fa265f6844 100644
--- a/packet-msproxy.c
+++ b/packet-msproxy.c
@@ -2,7 +2,7 @@
* Routines for Microsoft Proxy packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-msproxy.c,v 1.22 2001/09/03 10:33:05 guy Exp $
+ * $Id: packet-msproxy.c,v 1.23 2001/11/27 07:13:25 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -100,6 +100,8 @@ static int hf_msproxy_server_int_port = -1;
static int hf_msproxy_server_ext_addr = -1;
static int hf_msproxy_server_ext_port = -1;
+static dissector_handle_t msproxy_sub_handle;
+
#define UDP_PORT_MSPROXY 1745
@@ -207,7 +209,7 @@ static void msproxy_sub_dissector( tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree) {
/* Conversation dissector called from TCP or UDP dissector. Decode and */
-/* display the socks header, the pass the rest of the data to the tcp */
+/* display the msproxy header, the pass the rest of the data to the tcp */
/* or udp port decode routine to handle the payload. */
guint32 *ptr;
@@ -301,7 +303,7 @@ static void add_msproxy_conversation( packet_info *pinfo,
hash_info->proto, hash_info->server_int_port,
hash_info->clnt_port, 0);
}
- conversation_set_dissector(conversation, msproxy_sub_dissector);
+ conversation_set_dissector(conversation, msproxy_sub_handle);
new_conv_info = g_mem_chunk_alloc(redirect_vals);
@@ -1288,6 +1290,9 @@ proto_register_msproxy( void){
proto_register_subtree_array(ett, array_length(ett));
register_init_routine( &msproxy_reinit); /* register re-init routine */
+
+ msproxy_sub_handle = create_dissector_handle(msproxy_sub_dissector,
+ proto_msproxy);
}
@@ -1295,7 +1300,7 @@ void
proto_reg_handoff_msproxy(void) {
/* dissector install routine */
-
+
dissector_add("udp.port", UDP_PORT_MSPROXY, dissect_msproxy,
proto_msproxy);
}
diff --git a/packet-quake.c b/packet-quake.c
index 66cd853282..172aa2ebe9 100644
--- a/packet-quake.c
+++ b/packet-quake.c
@@ -4,7 +4,7 @@
* Uwe Girlich <uwe@planetquake.com>
* http://www.idsoftware.com/q1source/q1source.zip
*
- * $Id: packet-quake.c,v 1.20 2001/11/26 05:13:11 hagbard Exp $
+ * $Id: packet-quake.c,v 1.21 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -80,6 +80,7 @@ static gint ett_quake_control = -1;
static gint ett_quake_control_colors = -1;
static gint ett_quake_flags = -1;
+static dissector_handle_t quake_handle;
static dissector_handle_t data_handle;
/* I took these names directly out of the Q1 source. */
@@ -244,7 +245,7 @@ dissect_quake_CCREP_ACCEPT
c = conversation_new( &pinfo->src, &pinfo->dst, PT_UDP, port,
pinfo->destport, 0);
if (c) {
- conversation_set_dissector(c, dissect_quake);
+ conversation_set_dissector(c, quake_handle);
}
if (tree) {
proto_tree_add_uint(tree, hf_quake_CCREP_ACCEPT_port,
@@ -519,15 +520,6 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint rest_length;
tvbuff_t *next_tvb;
- /*
- * XXX - this is a conversation dissector, and the code to
- * call a conversation dissector doesn't check for disabled
- * protocols or set "pinfo->current_proto".
- */
- CHECK_DISPLAY_AS_X(data_handle,proto_quake, tvb, pinfo, tree);
-
- pinfo->current_proto = "QUAKE";
-
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "QUAKE");
if (check_col(pinfo->fd, COL_INFO))
@@ -743,6 +735,8 @@ proto_register_quake(void)
proto_register_field_array(proto_quake, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ quake_handle = create_dissector_handle(dissect_quake, proto_quake);
+
/* Register a configuration option for port */
quake_module = prefs_register_protocol(proto_quake,
proto_reg_handoff_quake);
@@ -752,4 +746,3 @@ proto_register_quake(void)
10, &gbl_quakeServerPort);
}
-
diff --git a/packet-quake2.c b/packet-quake2.c
index fb8bbf3259..666f1d8255 100644
--- a/packet-quake2.c
+++ b/packet-quake2.c
@@ -7,10 +7,10 @@
* http://www.dgs.monash.edu.au/~timf/bottim/
* http://www.opt-sci.Arizona.EDU/Pandora/default.asp
*
- * $Id: packet-quake2.c,v 1.4 2001/11/26 05:13:11 hagbard Exp $
+ * $Id: packet-quake2.c,v 1.5 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
* Copied from packet-quakeworld.c
@@ -270,18 +270,9 @@ dissect_quake2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *quake2_item = NULL;
int direction;
- /*
- * XXX - this is a conversation dissector, and the code to
- * call a conversation dissector doesn't check for disabled
- * protocols or set "pinfo->current_proto".
- */
- CHECK_DISPLAY_AS_X(data_handle,proto_quake2, tvb, pinfo, tree);
-
direction = (pinfo->destport == gbl_quake2ServerPort) ?
DIR_C2S : DIR_S2C;
- pinfo->current_proto = "QUAKE2";
-
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "QUAKE2");
if (check_col(pinfo->fd, COL_INFO))
diff --git a/packet-quakeworld.c b/packet-quakeworld.c
index 268275814f..68fa541c34 100644
--- a/packet-quakeworld.c
+++ b/packet-quakeworld.c
@@ -4,10 +4,10 @@
* Uwe Girlich <uwe@planetquake.com>
* http://www.idsoftware.com/q1source/q1source.zip
*
- * $Id: packet-quakeworld.c,v 1.6 2001/11/26 05:13:12 hagbard Exp $
+ * $Id: packet-quakeworld.c,v 1.7 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@zing.org>
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1998 Gerald Combs
*
* Copied from packet-quake.c
@@ -720,18 +720,9 @@ dissect_quakeworld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *quakeworld_item = NULL;
int direction;
- /*
- * XXX - this is a conversation dissector, and the code to
- * call a conversation dissector doesn't check for disabled
- * protocols or set "pinfo->current_proto".
- */
- CHECK_DISPLAY_AS_X(data_handle,proto_quakeworld, tvb, pinfo, tree);
-
direction = (pinfo->destport == gbl_quakeworldServerPort) ?
DIR_C2S : DIR_S2C;
- pinfo->current_proto = "QUAKEWORLD";
-
if (check_col(pinfo->fd, COL_PROTOCOL))
col_set_str(pinfo->fd, COL_PROTOCOL, "QUAKEWORLD");
if (check_col(pinfo->fd, COL_INFO))
diff --git a/packet-rpc.c b/packet-rpc.c
index aefb61eb6d..fe79535c2d 100644
--- a/packet-rpc.c
+++ b/packet-rpc.c
@@ -2,7 +2,7 @@
* Routines for rpc dissection
* Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de>
*
- * $Id: packet-rpc.c,v 1.75 2001/11/26 04:52:51 hagbard Exp $
+ * $Id: packet-rpc.c,v 1.76 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -193,6 +193,8 @@ static gint ett_rpc_gids = -1;
static gint ett_rpc_gss_data = -1;
static gint ett_rpc_array = -1;
+static dissector_handle_t rpc_tcp_handle;
+static dissector_handle_t rpc_handle;
static dissector_handle_t data_handle;
/* Hash table with info on RPC program numbers */
@@ -1176,7 +1178,7 @@ dissect_rpc_indir_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Make the dissector for this conversation the non-heuristic
RPC dissector. */
conversation_set_dissector(conversation,
- (pinfo->ptype == PT_TCP) ? dissect_rpc_tcp : dissect_rpc);
+ (pinfo->ptype == PT_TCP) ? rpc_tcp_handle : rpc_handle);
/* Prepare the key data.
@@ -1711,7 +1713,7 @@ dissect_rpc_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* Make the dissector for this conversation the non-heuristic
RPC dissector. */
conversation_set_dissector(conversation,
- (pinfo->ptype == PT_TCP) ? dissect_rpc_tcp : dissect_rpc);
+ (pinfo->ptype == PT_TCP) ? rpc_tcp_handle : rpc_handle);
/* prepare the key data */
rpc_call_key.xid = xid;
@@ -2381,6 +2383,8 @@ proto_register_rpc(void)
proto_register_field_array(proto_rpc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
register_init_routine(&rpc_init_protocol);
+ rpc_tcp_handle = create_dissector_handle(dissect_rpc_tcp, proto_rpc);
+ rpc_handle = create_dissector_handle(dissect_rpc, proto_rpc);
rpc_module = prefs_register_protocol(proto_rpc, NULL);
prefs_register_bool_preference(rpc_module, "desegment_rpc_over_tcp",
"Desegment all RPC over TCP commands",
diff --git a/packet-rtcp.c b/packet-rtcp.c
index ffb94eb50b..053b25e4a6 100644
--- a/packet-rtcp.c
+++ b/packet-rtcp.c
@@ -1,6 +1,6 @@
/* packet-rtcp.c
*
- * $Id: packet-rtcp.c,v 1.23 2001/11/26 05:13:12 hagbard Exp $
+ * $Id: packet-rtcp.c,v 1.24 2001/11/27 07:13:26 guy Exp $
*
* Routines for RTCP dissection
* RTCP = Real-time Transport Control Protocol
@@ -178,10 +178,10 @@ static gint ett_sdes_item = -1;
static address fake_addr;
static int heur_init = FALSE;
-static dissector_handle_t data_handle;
-
static gboolean dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree );
+static void dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo,
+ proto_tree *tree );
void rtcp_add_address( packet_info *pinfo, const unsigned char* ip_addr,
int prt )
@@ -251,9 +251,6 @@ dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
{
conversation_t* pconv;
- if (!proto_is_protocol_enabled(proto_rtcp))
- return FALSE; /* RTCP has been disabled */
-
/* This is a heuristic dissector, which means we get all the UDP
* traffic not sent to a known dissector and not claimed by
* a heuristic dissector called before us!
@@ -626,7 +623,7 @@ dissect_rtcp_sr( tvbuff_t *tvb, int offset, frame_data *fd, proto_tree *tree,
return offset;
}
-void
+static void
dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
{
proto_item *ti = NULL;
@@ -638,10 +635,6 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
unsigned int offset = 0;
guint16 packet_length = 0;
- CHECK_DISPLAY_AS_X(data_handle,proto_rtcp, tvb, pinfo, tree);
-
- pinfo->current_proto = "RTCP";
-
if ( check_col( pinfo->fd, COL_PROTOCOL ) ) {
col_set_str( pinfo->fd, COL_PROTOCOL, "RTCP" );
}
@@ -1230,7 +1223,6 @@ proto_register_rtcp(void)
void
proto_reg_handoff_rtcp(void)
{
- data_handle = find_dissector("data");
/*
* Register this dissector as one that can be assigned to a
* UDP conversation.
diff --git a/packet-rtcp.h b/packet-rtcp.h
index d9b01e09b5..3c5e35911c 100644
--- a/packet-rtcp.h
+++ b/packet-rtcp.h
@@ -1,6 +1,6 @@
/* packet-rtcp.h
*
- * $Id: packet-rtcp.h,v 1.6 2001/09/03 10:33:06 guy Exp $
+ * $Id: packet-rtcp.h,v 1.7 2001/11/27 07:13:26 guy Exp $
*
* Routines for RTCP dissection
* RTCP = Real-time Transport Control Protocol
@@ -28,5 +28,4 @@
*/
void rtcp_add_address ( packet_info *pinfo, const unsigned char* ip_addr, int prt );
-void dissect_rtcp ( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree );
void proto_register_rtcp( void );
diff --git a/packet-rtp.c b/packet-rtp.c
index 7af447fcb7..076a824b44 100644
--- a/packet-rtp.c
+++ b/packet-rtp.c
@@ -6,7 +6,7 @@
* Copyright 2000, Philips Electronics N.V.
* Written by Andreas Sikkema <andreas.sikkema@philips.com>
*
- * $Id: packet-rtp.c,v 1.27 2001/11/26 05:13:12 hagbard Exp $
+ * $Id: packet-rtp.c,v 1.28 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -102,6 +102,11 @@ static dissector_handle_t h261_handle;
static dissector_handle_t mpeg1_handle;
static dissector_handle_t data_handle;
+static gboolean dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo,
+ proto_tree *tree );
+static void dissect_rtp( tvbuff_t *tvb, packet_info *pinfo,
+ proto_tree *tree );
+
/*
* Fields in the first octet of the RTP header.
*/
@@ -258,14 +263,11 @@ static void rtp_init( void )
}
#endif
-gboolean
+static gboolean
dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
{
conversation_t* pconv;
- if (!proto_is_protocol_enabled(proto_rtp))
- return FALSE; /* RTP has been disabled */
-
/* This is a heuristic dissector, which means we get all the TCP
* traffic not sent to a known dissector and not claimed by
* a heuristic dissector called before us!
@@ -322,7 +324,7 @@ dissect_rtp_data( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
-void
+static void
dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
{
proto_item *ti = NULL;
@@ -345,10 +347,6 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
guint32 sync_src;
guint32 csrc_item;
- CHECK_DISPLAY_AS_X(data_handle,proto_rtp, tvb, pinfo, tree);
-
- pinfo->current_proto = "RTP";
-
/* Get the fields in the first octet */
octet = tvb_get_guint8( tvb, offset );
version = RTP_VERSION( octet );
diff --git a/packet-rtp.h b/packet-rtp.h
index fb982031a5..e64ed3d623 100644
--- a/packet-rtp.h
+++ b/packet-rtp.h
@@ -3,7 +3,7 @@
* Routines for RTP dissection
* RTP = Real time Transport Protocol
*
- * $Id: packet-rtp.h,v 1.5 2001/09/03 10:33:06 guy Exp $
+ * $Id: packet-rtp.h,v 1.6 2001/11/27 07:13:26 guy Exp $
*
* Copyright 2000, Philips Electronics N.V.
* Written by Andreas Sikkema <andreas.sikkema@philips.com>
@@ -28,6 +28,4 @@
*/
void rtp_add_address ( packet_info *pinfo, const unsigned char* ip_addr, int prt );
-gboolean dissect_rtp_heur ( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree );
-void dissect_rtp ( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree );
void proto_register_rtp( void );
diff --git a/packet-rtsp.c b/packet-rtsp.c
index 4b3183efca..3cd944f8de 100644
--- a/packet-rtsp.c
+++ b/packet-rtsp.c
@@ -4,7 +4,7 @@
* Jason Lango <jal@netapp.com>
* Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu>
*
- * $Id: packet-rtsp.c,v 1.42 2001/09/08 00:43:51 guy Exp $
+ * $Id: packet-rtsp.c,v 1.43 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -352,14 +352,14 @@ rtsp_create_conversation(packet_info *pinfo, const u_char *line_begin,
conv = conversation_new(&pinfo->dst, &null_addr, PT_UDP, c_data_port,
s_data_port, NO_ADDR2 | (!s_data_port ? NO_PORT2 : 0));
- conversation_set_dissector(conv, dissect_rtp);
+ conversation_set_dissector(conv, rtp_handle);
if (!c_mon_port)
return;
conv = conversation_new(&pinfo->dst, &null_addr, PT_UDP, c_mon_port,
s_mon_port, NO_ADDR2 | (!s_mon_port ? NO_PORT2 : 0));
- conversation_set_dissector(conv, dissect_rtcp);
+ conversation_set_dissector(conv, rtcp_handle);
}
static const char rtsp_content_length[] = "Content-Length:";
diff --git a/packet-snmp.c b/packet-snmp.c
index 0e4a05553d..63082af4a7 100644
--- a/packet-snmp.c
+++ b/packet-snmp.c
@@ -8,7 +8,7 @@
*
* See RFCs 1905, 1906, 1909, and 1910 for SNMPv2u.
*
- * $Id: packet-snmp.c,v 1.73 2001/11/26 05:13:12 hagbard Exp $
+ * $Id: packet-snmp.c,v 1.74 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -223,6 +223,7 @@ static int hf_snmpv3_flags_auth = -1;
static int hf_snmpv3_flags_crypt = -1;
static int hf_snmpv3_flags_report = -1;
+static dissector_handle_t snmp_handle;
static dissector_handle_t data_handle;
#define TH_AUTH 0x01
@@ -2101,15 +2102,6 @@ dissect_snmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
conversation_t *conversation;
/*
- * XXX - this is a conversation dissector, and the code to
- * call a conversation dissector doesn't check for disabled
- * protocols or set "pinfo->current_proto".
- */
- CHECK_DISPLAY_AS_X(data_handle,proto_snmp, tvb, pinfo, tree);
-
- pinfo->current_proto = "SNMP";
-
- /*
* The first SNMP packet goes to the SNMP port; the second one
* may come from some *other* port, but goes back to the same
* IP address and port as the ones from which the first packet
@@ -2133,7 +2125,7 @@ dissect_snmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (conversation == NULL) {
conversation = conversation_new(&pinfo->src, &pinfo->dst, PT_UDP,
pinfo->srcport, 0, NO_PORT2);
- conversation_set_dissector(conversation, dissect_snmp);
+ conversation_set_dissector(conversation, snmp_handle);
}
}
@@ -2298,6 +2290,7 @@ proto_register_snmp(void)
"SMUX", "smux");
proto_register_field_array(proto_snmp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ snmp_handle = create_dissector_handle(dissect_snmp, proto_snmp);
}
void
diff --git a/packet-socks.c b/packet-socks.c
index 0509708f72..4a31977a9c 100644
--- a/packet-socks.c
+++ b/packet-socks.c
@@ -2,7 +2,7 @@
* Routines for socks versions 4 &5 packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-socks.c,v 1.28 2001/11/21 23:16:21 gram Exp $
+ * $Id: packet-socks.c,v 1.29 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -122,6 +122,11 @@ static int hf_socks_dstport = -1;
static int hf_socks_command = -1;
+/************* Dissector handles ***********/
+
+static dissector_handle_t socks_handle;
+static dissector_handle_t socks_udp_handle;
+
/************* State Machine names ***********/
enum SockState {
@@ -420,7 +425,7 @@ new_udp_conversation( socks_hash_entry_t *hash_info, packet_info *pinfo){
g_assert( conversation);
conversation_add_proto_data(conversation, proto_socks, hash_info);
- conversation_set_dissector(conversation, socks_udp_dissector);
+ conversation_set_dissector(conversation, socks_udp_handle);
}
@@ -950,7 +955,7 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
hash_info);
/* set dissector for now */
- conversation_set_dissector(conversation, dissect_socks);
+ conversation_set_dissector(conversation, socks_handle);
}
/* display summary window information */
@@ -1115,6 +1120,10 @@ proto_register_socks( void){
proto_register_subtree_array(ett, array_length(ett));
register_init_routine( &socks_reinit); /* register re-init routine */
+
+ socks_udp_handle = create_dissector_handle(socks_udp_dissector,
+ proto_socks);
+ socks_handle = create_dissector_handle(dissect_socks, proto_socks);
}
diff --git a/packet-tftp.c b/packet-tftp.c
index 39c40324db..7bd1ffa5ad 100644
--- a/packet-tftp.c
+++ b/packet-tftp.c
@@ -5,7 +5,7 @@
* Craig Newell <CraigN@cheque.uq.edu.au>
* RFC2347 TFTP Option Extension
*
- * $Id: packet-tftp.c,v 1.31 2001/11/26 05:13:12 hagbard Exp $
+ * $Id: packet-tftp.c,v 1.32 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -55,7 +55,7 @@ static int hf_tftp_error_string = -1;
static gint ett_tftp = -1;
-static dissector_handle_t data_handle;
+static dissector_handle_t tftp_handle;
#define UDP_PORT_TFTP 69
@@ -101,10 +101,6 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
u_int i1;
guint16 error;
- CHECK_DISPLAY_AS_X(data_handle,proto_tftp, tvb, pinfo, tree);
-
- pinfo->current_proto = "TFTP";
-
/*
* The first TFTP packet goes to the TFTP port; the second one
* comes from some *other* port, but goes back to the same
@@ -129,7 +125,7 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (conversation == NULL) {
conversation = conversation_new(&pinfo->src, &pinfo->dst, PT_UDP,
pinfo->srcport, 0, NO_PORT2);
- conversation_set_dissector(conversation, dissect_tftp);
+ conversation_set_dissector(conversation, tftp_handle);
}
}
@@ -343,11 +339,12 @@ proto_register_tftp(void)
"TFTP", "tftp");
proto_register_field_array(proto_tftp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ tftp_handle = create_dissector_handle(dissect_tftp, proto_tftp);
}
void
proto_reg_handoff_tftp(void)
{
- data_handle = find_dissector("data");
dissector_add("udp.port", UDP_PORT_TFTP, dissect_tftp, proto_tftp);
}
diff --git a/packet-wcp.c b/packet-wcp.c
index ab47a90385..aaaa68919a 100644
--- a/packet-wcp.c
+++ b/packet-wcp.c
@@ -2,7 +2,7 @@
* Routines for Wellfleet Compression frame disassembly
* Copyright 2001, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-wcp.c,v 1.14 2001/11/21 21:37:26 guy Exp $
+ * $Id: packet-wcp.c,v 1.15 2001/11/27 07:13:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -109,7 +109,6 @@
#include <string.h>
#include "packet.h"
#include "packet-frame.h"
-#include "packet-fr.h"
#include "conversation.h"
#include "etypes.h"
#include "nlpid.h"
@@ -177,6 +176,8 @@ static int hf_wcp_offset = -1;
static gint ett_wcp = -1;
static gint ett_wcp_field = -1;
+static dissector_handle_t fr_handle;
+
/*
* Bits in the address field.
*/
@@ -400,7 +401,7 @@ void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
tvb_reported_length( tvb)-1, 1,
tvb_get_guint8( tvb, tvb_reported_length(tvb)-1));
- dissect_fr_uncompressed(next_tvb, pinfo, tree);
+ call_dissector(fr_handle, next_tvb, pinfo, tree);
return;
}
@@ -731,6 +732,11 @@ proto_register_wcp(void)
void
proto_reg_handoff_wcp(void) {
+ /*
+ * Get handle for the Frame Relay (uncompressed) dissector.
+ */
+ fr_handle = find_dissector("fr");
+
dissector_add("fr.ietf", NLPID_COMPRESSED, dissect_wcp, proto_wcp);
dissector_add("ethertype", ETHERTYPE_WCP, dissect_wcp, proto_wcp);
}
diff --git a/packet-wsp.c b/packet-wsp.c
index 51d7190802..af4e9fd955 100644
--- a/packet-wsp.c
+++ b/packet-wsp.c
@@ -2,7 +2,7 @@
*
* Routines to dissect WSP component of WAP traffic.
*
- * $Id: packet-wsp.c,v 1.44 2001/11/21 01:21:08 guy Exp $
+ * $Id: packet-wsp.c,v 1.45 2001/11/27 07:13:27 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -168,6 +168,12 @@ static gint ett_content_type = ETT_EMPTY;
static gint ett_redirect_flags = ETT_EMPTY;
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 */
+static dissector_handle_t wtp_fromudp_handle;
+
/* Handle for WMLC dissector */
static dissector_handle_t wmlc_handle;
@@ -799,7 +805,7 @@ static gint get_integer (tvbuff_t *, guint, guint, value_type_t, guint *);
/* Code to actually dissect the packets */
static void
dissect_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo,
- proto_tree *tree, dissector_t dissector)
+ proto_tree *tree, dissector_handle_t dissector_handle)
{
guint8 flags;
proto_item *ti;
@@ -924,7 +930,7 @@ dissect_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo,
conv = conversation_new(&redir_address,
&pinfo->dst, PT_UDP, port_num, 0, NO_PORT2);
}
- conversation_set_dissector(conv, dissector);
+ conversation_set_dissector(conv, dissector_handle);
break;
case BT_IPv6:
@@ -958,7 +964,7 @@ dissect_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo,
conv = conversation_new(&redir_address,
&pinfo->dst, PT_UDP, port_num, 0, NO_PORT2);
}
- conversation_set_dissector(conv, dissector);
+ conversation_set_dissector(conv, dissector_handle);
break;
unknown_address_type:
@@ -979,7 +985,7 @@ dissect_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo,
static void
dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- dissector_t dissector, gboolean is_connectionless)
+ dissector_handle_t dissector_handle, gboolean is_connectionless)
{
frame_data *fdata = pinfo->fd;
int offset = 0;
@@ -1112,7 +1118,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case REDIRECT:
dissect_redirect(tvb, offset, pinfo, wsp_tree,
- dissector);
+ dissector_handle);
break;
case DISCONNECT:
@@ -1280,7 +1286,7 @@ dissect_wsp_fromudp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->fd, COL_INFO))
col_clear(pinfo->fd, COL_INFO);
- dissect_wsp_common(tvb, pinfo, tree, dissect_wsp_fromudp, TRUE);
+ dissect_wsp_common(tvb, pinfo, tree, wsp_fromudp_handle, TRUE);
}
/*
@@ -1294,7 +1300,7 @@ dissect_wsp_fromwap_co(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* XXX - what about WTLS->WTP->WSP?
*/
- dissect_wsp_common(tvb, pinfo, tree, dissect_wtp_fromudp, FALSE);
+ dissect_wsp_common(tvb, pinfo, tree, wtp_fromudp_handle, FALSE);
}
/*
@@ -1312,7 +1318,7 @@ dissect_wsp_fromwap_cl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
col_clear(pinfo->fd, COL_INFO);
}
- dissect_wsp_common(tvb, pinfo, tree, dissect_wtp_fromudp, TRUE);
+ dissect_wsp_common(tvb, pinfo, tree, wtp_fromudp_handle, TRUE);
}
static void
@@ -4052,6 +4058,11 @@ proto_register_wsp(void)
register_dissector("wsp-co", dissect_wsp_fromwap_co, proto_wsp);
register_dissector("wsp-cl", dissect_wsp_fromwap_cl, proto_wsp);
register_heur_dissector_list("wsp", &heur_subdissector_list);
+
+ wsp_fromudp_handle = create_dissector_handle(dissect_wsp_fromudp,
+ proto_wsp);
+ wtp_fromudp_handle = create_dissector_handle(dissect_wtp_fromudp,
+ proto_wsp);
};
void