aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gryphon/packet-gryphon.c16
-rw-r--r--plugins/mgcp/packet-mgcp.c33
-rw-r--r--plugins/plugin_api.c3
-rw-r--r--plugins/plugin_api.h3
-rw-r--r--plugins/plugin_api_defs.h3
-rw-r--r--plugins/plugin_table.h11
6 files changed, 37 insertions, 32 deletions
diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c
index 70a97d3df0..48eee98004 100644
--- a/plugins/gryphon/packet-gryphon.c
+++ b/plugins/gryphon/packet-gryphon.c
@@ -1,12 +1,13 @@
/* packet-gryphon.c
* Routines for Gryphon protocol packet disassembly
- *
- * $Id: packet-gryphon.c,v 1.24 2001/10/31 10:40:57 guy Exp $
- *
- * Ethereal - Network traffic analyzer
* By Steve Limkemann <stevelim@dgtech.com>
* Copyright 1998 Steve Limkemann
*
+ * $Id: packet-gryphon.c,v 1.25 2001/12/03 04:00:24 guy Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * By Gerald Combs <gerald@ethereal.com>
+ * Copyright 1998
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -21,8 +22,6 @@
* 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.
- *
- *
*/
#ifdef HAVE_CONFIG_H
@@ -1873,7 +1872,10 @@ proto_register_gryphon(void)
void
proto_reg_handoff_gryphon(void)
{
- dissector_add("tcp.port", 7000, &dissect_gryphon, proto_gryphon);
+ dissector_handle_t gryphon_handle;
+
+ gryphon_handle = create_dissector_handle(dissect_gryphon, proto_gryphon);
+ dissector_add("tcp.port", 7000, gryphon_handle);
}
/* Start the functions we need for the plugin stuff */
diff --git a/plugins/mgcp/packet-mgcp.c b/plugins/mgcp/packet-mgcp.c
index 85f32f6a2e..21b14036e5 100644
--- a/plugins/mgcp/packet-mgcp.c
+++ b/plugins/mgcp/packet-mgcp.c
@@ -2,13 +2,14 @@
* Routines for mgcp packet disassembly
* RFC 2705
*
- * $Id: packet-mgcp.c,v 1.27 2001/10/31 10:40:58 guy Exp $
+ * $Id: packet-mgcp.c,v 1.28 2001/12/03 04:00:26 guy Exp $
*
* Copyright (c) 2000 by Ed Warnicke <hagbard@physics.rutgers.edu>
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs
+ * By Gerald Combs <gerald@ethereal.com>
* Copyright 1999 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
@@ -565,20 +566,22 @@ void
proto_reg_handoff_mgcp(void)
{
static int mgcp_prefs_initialized = FALSE;
+ static dissector_handle_t mgcp_handle;
/*
* Get a handle for the SDP dissector.
*/
sdp_handle = find_dissector("sdp");
- if (mgcp_prefs_initialized) {
- dissector_delete("tcp.port", gateway_tcp_port, dissect_mgcp);
- dissector_delete("udp.port", gateway_udp_port, dissect_mgcp);
- dissector_delete("tcp.port", callagent_tcp_port, dissect_mgcp);
- dissector_delete("udp.port", callagent_udp_port, dissect_mgcp);
+ if (!mgcp_prefs_initialized) {
+ mgcp_handle = create_dissector_handle(dissect_mgcp, proto_mgcp);
+ mgcp_prefs_initialized = TRUE;
}
else {
- mgcp_prefs_initialized = TRUE;
+ dissector_delete("tcp.port", gateway_tcp_port, mgcp_handle);
+ dissector_delete("udp.port", gateway_udp_port, mgcp_handle);
+ dissector_delete("tcp.port", callagent_tcp_port, mgcp_handle);
+ dissector_delete("udp.port", callagent_udp_port, mgcp_handle);
}
/* Set our port number for future use */
@@ -589,14 +592,10 @@ proto_reg_handoff_mgcp(void)
callagent_tcp_port = global_mgcp_callagent_tcp_port;
callagent_udp_port = global_mgcp_callagent_udp_port;
- dissector_add("tcp.port", global_mgcp_gateway_tcp_port, dissect_mgcp,
- proto_mgcp);
- dissector_add("udp.port", global_mgcp_gateway_udp_port, dissect_mgcp,
- proto_mgcp);
- dissector_add("tcp.port", global_mgcp_callagent_tcp_port, dissect_mgcp,
- proto_mgcp);
- dissector_add("udp.port", global_mgcp_callagent_udp_port, dissect_mgcp,
- proto_mgcp);
+ dissector_add("tcp.port", global_mgcp_gateway_tcp_port, mgcp_handle);
+ dissector_add("udp.port", global_mgcp_gateway_udp_port, mgcp_handle);
+ dissector_add("tcp.port", global_mgcp_callagent_tcp_port, mgcp_handle);
+ dissector_add("udp.port", global_mgcp_callagent_udp_port, mgcp_handle);
}
@@ -1273,5 +1272,3 @@ plugin_init(plugin_address_table_t *pat){
#endif
/* End the functions we need for plugin stuff */
-
-
diff --git a/plugins/plugin_api.c b/plugins/plugin_api.c
index 2d6dc46134..368585370d 100644
--- a/plugins/plugin_api.c
+++ b/plugins/plugin_api.c
@@ -1,7 +1,7 @@
/* plugin_api.c
* Routines for Ethereal plugins.
*
- * $Id: plugin_api.c,v 1.30 2001/11/26 05:41:15 hagbard Exp $
+ * $Id: plugin_api.c,v 1.31 2001/12/03 04:00:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -55,6 +55,7 @@ plugin_address_table_init(plugin_address_table_t *pat)
p_heur_dissector_add = pat->p_heur_dissector_add;
p_register_dissector = pat->p_register_dissector;
p_find_dissector = pat->p_find_dissector;
+ p_create_dissector_handle = pat->p_create_dissector_handle;
p_call_dissector = pat->p_call_dissector;
p_proto_is_protocol_enabled = pat->p_proto_is_protocol_enabled;
p_proto_item_get_len = pat->p_proto_item_get_len;
diff --git a/plugins/plugin_api.h b/plugins/plugin_api.h
index 1782c06180..37cbda200b 100644
--- a/plugins/plugin_api.h
+++ b/plugins/plugin_api.h
@@ -1,7 +1,7 @@
/* plugin_api.h
* Routines for Ethereal plugins.
*
- * $Id: plugin_api.h,v 1.30 2001/11/26 05:41:15 hagbard Exp $
+ * $Id: plugin_api.h,v 1.31 2001/12/03 04:00:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -60,6 +60,7 @@
#define register_dissector (*p_register_dissector)
#define find_dissector (*p_find_dissector)
+#define create_dissector_handle (*p_create_dissector_handle)
#define call_dissector (*p_call_dissector)
#define proto_is_protocol_enabled (*p_proto_is_protocol_enabled)
diff --git a/plugins/plugin_api_defs.h b/plugins/plugin_api_defs.h
index 357dafdfe9..02facb8185 100644
--- a/plugins/plugin_api_defs.h
+++ b/plugins/plugin_api_defs.h
@@ -1,7 +1,7 @@
/* plugin_api_defs.h
* Define the variables that hold pointers to plugin API functions
*
- * $Id: plugin_api_defs.h,v 1.6 2001/11/26 05:41:15 hagbard Exp $
+ * $Id: plugin_api_defs.h,v 1.7 2001/12/03 04:00:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -49,6 +49,7 @@ addr_heur_dissector_add p_heur_dissector_add;
addr_register_dissector p_register_dissector;
addr_find_dissector p_find_dissector;
+addr_create_dissector_handle p_create_dissector_handle;
addr_call_dissector p_call_dissector;
addr_proto_is_protocol_enabled p_proto_is_protocol_enabled;
diff --git a/plugins/plugin_table.h b/plugins/plugin_table.h
index 17ef80a890..758b65385a 100644
--- a/plugins/plugin_table.h
+++ b/plugins/plugin_table.h
@@ -1,7 +1,7 @@
/* plugin_table.h
* Table of exported addresses for Ethereal plugins.
*
- * $Id: plugin_table.h,v 1.32 2001/11/21 23:34:09 gram Exp $
+ * $Id: plugin_table.h,v 1.33 2001/12/03 04:00:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -37,7 +37,7 @@ typedef void (*addr_col_append_str)(frame_data*, gint, gchar*);
typedef void (*addr_col_set_str)(frame_data*, gint, gchar*);
typedef void (*addr_register_init_routine)(void (*func)(void));
-typedef void (*addr_conv_dissector_add)(const char *, dissector_t, int);
+typedef void (*addr_conv_dissector_add)(const char *, dissector_handle_t);
typedef conversation_t *(*addr_conversation_new)(address *, address *,
port_type, guint32, guint32, guint);
typedef conversation_t *(*addr_find_conversation)(address *, address *,
@@ -49,13 +49,16 @@ typedef int (*addr_proto_register_protocol)(char*, char*, char*);
typedef void (*addr_proto_register_field_array)(int, hf_register_info*, int);
typedef void (*addr_proto_register_subtree_array)(int**, int);
-typedef void (*addr_dissector_add)(const char *, guint32, dissector_t, int);
-typedef void (*addr_dissector_delete)(const char *, guint32, dissector_t);
+typedef void (*addr_dissector_add)(const char *, guint32, dissector_handle_t);
+typedef void (*addr_dissector_delete)(const char *, guint32,
+ dissector_handle_t);
typedef void (*addr_heur_dissector_add)(const char *, heur_dissector_t, int);
typedef void (*addr_register_dissector)(const char *, dissector_t, int);
typedef dissector_handle_t (*addr_find_dissector)(const char *);
+typedef dissector_handle_t (*addr_create_dissector_handle)(dissector_t dissector,
+ int proto);
typedef void (*addr_call_dissector)(dissector_handle_t, tvbuff_t *,
packet_info *, proto_tree *);