diff options
158 files changed, 1169 insertions, 790 deletions
diff --git a/epan/packet.c b/epan/packet.c index 131bc21dc2..1b04a0db03 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.47 2001/12/03 01:35:22 guy Exp $ + * $Id: packet.c,v 1.48 2001/12/03 04:00:14 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -205,21 +205,20 @@ dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header, static GHashTable *dissector_tables = NULL; -typedef struct { +/* + * An dissector handle. + */ +struct dissector_handle { + const char *name; /* dissector name */ dissector_t dissector; int proto_index; -} dissector_entry_t; +}; struct dtbl_entry { - dissector_entry_t initial; - dissector_entry_t current; + dissector_handle_t initial; + dissector_handle_t current; }; -static void -dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) -{ -} - /* Finds a dissector table by field name. */ static dissector_table_t find_dissector_table(const char *name) @@ -229,8 +228,7 @@ find_dissector_table(const char *name) } void -dissector_add(const char *name, guint32 pattern, dissector_t dissector, - int proto) +dissector_add(const char *name, guint32 pattern, dissector_handle_t handle) { dissector_table_t sub_dissectors = find_dissector_table( name); dtbl_entry_t *dtbl_entry; @@ -239,10 +237,8 @@ dissector_add(const char *name, guint32 pattern, dissector_t dissector, g_assert( sub_dissectors); dtbl_entry = g_malloc(sizeof (dtbl_entry_t)); - dtbl_entry->current.dissector = dissector; - dtbl_entry->current.proto_index = proto; + dtbl_entry->current = handle; dtbl_entry->initial = dtbl_entry->current; - proto_set_protocol_dissector(proto, dissector); /* do the table insertion */ g_hash_table_insert( sub_dissectors, GUINT_TO_POINTER( pattern), @@ -257,7 +253,7 @@ dissector_add(const char *name, guint32 pattern, dissector_t dissector, /* If temporary dissectors are deleted, then the original dissector must */ /* be available. */ void -dissector_delete(const char *name, guint32 pattern, dissector_t dissector) +dissector_delete(const char *name, guint32 pattern, dissector_handle_t handle) { dissector_table_t sub_dissectors = find_dissector_table( name); dtbl_entry_t *dtbl_entry; @@ -285,8 +281,7 @@ dissector_delete(const char *name, guint32 pattern, dissector_t dissector) } void -dissector_change(const char *name, guint32 pattern, dissector_t dissector, - int proto) +dissector_change(const char *name, guint32 pattern, dissector_handle_t handle) { dissector_table_t sub_dissectors = find_dissector_table( name); dtbl_entry_t *dtbl_entry; @@ -300,23 +295,21 @@ dissector_change(const char *name, guint32 pattern, dissector_t dissector, dtbl_entry = g_hash_table_lookup(sub_dissectors, GUINT_TO_POINTER(pattern)); if (dtbl_entry != NULL) { - dtbl_entry->current.dissector = dissector ? dissector : dissect_null; - dtbl_entry->current.proto_index = proto; + dtbl_entry->current = handle; return; } /* - * Don't create an entry if there is no dissector - I.E. the + * Don't create an entry if there is no dissector handle - I.E. the * user said not to decode something that wasn't being decoded * in the first place. */ - if (dissector == NULL) + if (handle == NULL) return; dtbl_entry = g_malloc(sizeof (dtbl_entry_t)); - dtbl_entry->initial.proto_index = -1; - dtbl_entry->current.dissector = dissector; - dtbl_entry->current.proto_index = proto; + dtbl_entry->initial = NULL; + dtbl_entry->current = handle; /* do the table insertion */ g_hash_table_insert( sub_dissectors, GUINT_TO_POINTER( pattern), @@ -345,7 +338,7 @@ dissector_reset(const char *name, guint32 pattern) /* * Found - is there an initial value? */ - if (dtbl_entry->initial.dissector != NULL) { + if (dtbl_entry->initial != NULL) { dtbl_entry->current = dtbl_entry->initial; } else { g_hash_table_remove(sub_dissectors, GUINT_TO_POINTER(pattern)); @@ -372,10 +365,22 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port, GUINT_TO_POINTER(port)); if (dtbl_entry != NULL) { /* - * Is this protocol enabled? + * Is there currently a dissector handle for this entry? */ - if (dtbl_entry->current.proto_index != -1 && - !proto_is_protocol_enabled(dtbl_entry->current.proto_index)) { + if (dtbl_entry->current == NULL) { + /* + * No - pretend this dissector didn't exist, + * so that other dissectors might have a chance + * to dissect this packet. + */ + return FALSE; + } + + /* + * Yes - is its protocol enabled? + */ + if (dtbl_entry->current->proto_index != -1 && + !proto_is_protocol_enabled(dtbl_entry->current->proto_index)) { /* * No - pretend this dissector didn't exist, * so that other dissectors might have a chance @@ -401,11 +406,11 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port, */ pinfo->can_desegment = saved_can_desegment-(saved_can_desegment>0); pinfo->match_port = port; - if (dtbl_entry->current.proto_index != -1) { + if (dtbl_entry->current->proto_index != -1) { pinfo->current_proto = - proto_get_protocol_short_name(dtbl_entry->current.proto_index); + proto_get_protocol_short_name(dtbl_entry->current->proto_index); } - (*dtbl_entry->current.dissector)(tvb, pinfo, tree); + (*dtbl_entry->current->dissector)(tvb, pinfo, tree); pinfo->current_proto = saved_proto; pinfo->match_port = saved_match_port; pinfo->can_desegment = saved_can_desegment; @@ -414,18 +419,16 @@ dissector_try_port(dissector_table_t sub_dissectors, guint32 port, return FALSE; } -gint -dissector_get_proto (dtbl_entry_t *dtbl_entry) +dissector_handle_t +dtbl_entry_get_handle (dtbl_entry_t *dtbl_entry) { - g_assert(dtbl_entry); - return(dtbl_entry->current.proto_index); + return dtbl_entry->current; } -gint -dissector_get_initial_proto (dtbl_entry_t *dtbl_entry) +dissector_handle_t +dtbl_entry_get_initial_handle (dtbl_entry_t *dtbl_entry) { - g_assert(dtbl_entry); - return(dtbl_entry->initial.proto_index); + return dtbl_entry->initial; } /**************************************************/ @@ -454,8 +457,16 @@ dissector_table_foreach_func (gpointer key, gpointer value, gpointer user_data) g_assert(user_data); dtbl_entry = value; - if (dtbl_entry->current.proto_index == -1) { - return; + if (dtbl_entry->current == NULL || + dtbl_entry->current->proto_index == -1) { + /* + * Either there is no dissector for this entry, or + * the dissector doesn't have a protocol associated + * with it. + * + * XXX - should the latter check be done? + */ + return; } info = user_data; @@ -530,7 +541,7 @@ dissector_table_foreach_changed_func (gpointer key, gpointer value, gpointer use g_assert(user_data); dtbl_entry = value; - if (dtbl_entry->initial.proto_index == dtbl_entry->current.proto_index) { + if (dtbl_entry->initial == dtbl_entry->current) { /* * Entry hasn't changed - don't call the function. */ @@ -695,11 +706,6 @@ register_heur_dissector_list(const char *name, heur_dissector_list_t *sub_dissec static GHashTable *conv_dissector_lists = NULL; -struct conv_dtbl_entry { - dissector_t dissector; - int proto_index; -}; - /* Finds a conversation dissector table by table name. */ static conv_dissector_list_t * find_conv_dissector_list(const char *name) @@ -709,21 +715,15 @@ find_conv_dissector_list(const char *name) } void -conv_dissector_add(const char *name, dissector_t dissector, int proto) +conv_dissector_add(const char *name, dissector_handle_t handle) { conv_dissector_list_t *sub_dissectors = find_conv_dissector_list(name); - conv_dtbl_entry_t *dtbl_entry; /* sanity check */ g_assert(sub_dissectors != NULL); - dtbl_entry = g_malloc(sizeof (conv_dtbl_entry_t)); - dtbl_entry->dissector = dissector; - dtbl_entry->proto_index = proto; - proto_set_protocol_dissector(proto, dissector); - /* do the table insertion */ - *sub_dissectors = g_slist_append(*sub_dissectors, (gpointer)dtbl_entry); + *sub_dissectors = g_slist_append(*sub_dissectors, (gpointer)handle); } void @@ -743,13 +743,6 @@ register_conv_dissector_list(const char *name, conv_dissector_list_t *sub_dissec (gpointer) sub_dissectors); } -gint -conv_dissector_get_proto (conv_dtbl_entry_t *dtbl_entry) -{ - g_assert(dtbl_entry); - return(dtbl_entry->proto_index); -} - void dissector_conv_foreach (char *name, DATFunc func, @@ -806,14 +799,12 @@ dissector_all_conv_foreach (DATFunc func, */ static GHashTable *registered_dissectors = NULL; -/* - * An entry in the list of registered dissectors. - */ -struct dissector_handle { - const char *name; /* dissector name */ - dissector_t dissector; - int proto_index; -}; +/* Get the short name of the protocol for a dissector handle. */ +char * +dissector_handle_get_short_name(dissector_handle_t handle) +{ + return proto_get_protocol_short_name(handle->proto_index); +} /* Find a registered dissector by name. */ dissector_handle_t diff --git a/epan/packet.h b/epan/packet.h index 6af0d154af..83f69c2ee2 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.42 2001/11/27 07:13:32 guy Exp $ + * $Id: packet.h,v 1.43 2001/12/03 04:00:14 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -80,6 +80,11 @@ typedef struct true_false_string { extern void packet_init(void); extern void packet_cleanup(void); +/* Handle for dissectors you call directly or register with "dissector_add()". + This handle is opaque outside of "packet.c". */ +struct dissector_handle; +typedef struct dissector_handle *dissector_handle_t; + /* Hash table for matching port numbers and dissectors */ typedef GHashTable* dissector_table_t; @@ -92,8 +97,8 @@ typedef void (*DATFunc) (gchar *table_name, gpointer key, gpointer value, gpoint /* Opaque structure - provides type checking but no access to components */ typedef struct dtbl_entry dtbl_entry_t; -extern gint dissector_get_proto (dtbl_entry_t * entry); -extern gint dissector_get_initial_proto (dtbl_entry_t * entry); +extern dissector_handle_t dtbl_entry_get_handle (dtbl_entry_t *dtbl_entry); +extern dissector_handle_t dtbl_entry_get_initial_handle (dtbl_entry_t * entry); extern void dissector_table_foreach_changed (char *name, DATFunc func, gpointer user_data); extern void dissector_table_foreach (char *name, DATFunc func, @@ -107,15 +112,15 @@ extern dissector_table_t register_dissector_table(const char *name); /* Add a sub-dissector to a dissector table. Called by the protocol routine */ /* that wants to register a sub-dissector. */ extern void dissector_add(const char *abbrev, guint32 pattern, - dissector_t dissector, int proto); + dissector_handle_t handle); /* Add a sub-dissector to a dissector table. Called by the protocol routine */ /* that wants to de-register a sub-dissector. */ extern void dissector_delete(const char *name, guint32 pattern, - dissector_t dissector); + dissector_handle_t handle); extern void dissector_change(const char *abbrev, guint32 pattern, - dissector_t dissector, int proto); + dissector_handle_t handle); /* Reset a dissector in a sub-dissector table to its initial value. */ extern void dissector_reset(const char *name, guint32 pattern); @@ -171,26 +176,22 @@ extern void register_conv_dissector_list(const char *name, /* Add a sub-dissector to a conversation dissector list. Called by the protocol routine that wants to register a sub-dissector. */ -extern void conv_dissector_add(const char *name, dissector_t dissector, - int proto); +extern void conv_dissector_add(const char *name, dissector_handle_t handle); /* Opaque structure - provides type checking but no access to components */ typedef struct conv_dtbl_entry conv_dtbl_entry_t; -extern gint conv_dissector_get_proto (conv_dtbl_entry_t * entry); extern void dissector_conv_foreach(char *name, DATFunc func, gpointer user_data); extern void dissector_all_conv_foreach(DATFunc func, gpointer user_data); -/* Handle for dissectors you call directly. - This handle is opaque outside of "packet.c". */ -struct dissector_handle; -typedef struct dissector_handle *dissector_handle_t; - /* Register a dissector. */ extern void register_dissector(const char *name, dissector_t dissector, int proto); +/* Get the short name of the protocol for a dissector handle. */ +extern char *dissector_handle_get_short_name(dissector_handle_t handle); + /* Find a dissector by name. */ extern dissector_handle_t find_dissector(const char *name); diff --git a/epan/plugins.c b/epan/plugins.c index da0509d939..3ba4313d06 100644 --- a/epan/plugins.c +++ b/epan/plugins.c @@ -1,7 +1,7 @@ /* plugins.c * plugin routines * - * $Id: plugins.c,v 1.42 2001/11/26 05:41:13 hagbard Exp $ + * $Id: plugins.c,v 1.43 2001/12/03 04:00:14 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -310,6 +310,7 @@ init_plugins(const char *plugin_dir) patable.p_register_dissector = register_dissector; patable.p_find_dissector = find_dissector; + patable.p_create_dissector_handle = create_dissector_handle; patable.p_call_dissector = call_dissector; patable.p_proto_is_protocol_enabled = proto_is_protocol_enabled; diff --git a/epan/proto.c b/epan/proto.c index 284b437627..d2238f9d14 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -1,7 +1,7 @@ /* proto.c * Routines for protocol tree * - * $Id: proto.c,v 1.45 2001/11/22 03:07:06 hagbard Exp $ + * $Id: proto.c,v 1.46 2001/12/03 04:00:15 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -133,7 +133,6 @@ typedef struct { GList *last_field; /* pointer to end of list of fields */ gboolean is_enabled; /* TRUE if protocol is enabled */ gboolean can_disable; /* TRUE if protocol can be disabled */ - gpointer dissector; } protocol_t; /* List of all protocols */ @@ -1659,7 +1658,6 @@ proto_register_protocol(char *name, char *short_name, char *filter_name) protocol->fields = NULL; protocol->is_enabled = TRUE; /* protocol is enabled by default */ protocol->can_disable = TRUE; - protocol->dissector = NULL; protocols = g_list_insert_sorted(protocols, protocol, proto_compare_name); @@ -1820,32 +1818,6 @@ proto_set_cant_disable(int proto_id) protocol->can_disable = FALSE; } -gpointer -proto_get_protocol_dissector(int proto_id) -{ - protocol_t *protocol; - - protocol = find_protocol_by_id(proto_id); - if (protocol == NULL) - return(NULL); - return protocol->dissector; -} - -void -proto_set_protocol_dissector(int proto_id, gpointer dissector) -{ - protocol_t *protocol; - - protocol = find_protocol_by_id(proto_id); - if (protocol != NULL) { - if (protocol->dissector != NULL) { - /* Already set */ - return; - } - protocol->dissector = dissector; - } -} - /* for use with static arrays only, since we don't allocate our own copies of the header_field_info struct contained withing the hf_register_info struct */ void diff --git a/epan/proto.h b/epan/proto.h index 9e23889b29..8f031b905b 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -1,7 +1,7 @@ /* proto.h * Definitions for protocol display * - * $Id: proto.h,v 1.22 2001/11/26 05:41:13 hagbard Exp $ + * $Id: proto.h,v 1.23 2001/12/03 04:00:15 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -506,9 +506,6 @@ extern void proto_set_decoding(int proto_id, gboolean enabled); /* Disable disabling of protocol */ extern void proto_set_cant_disable(int proto_id); -gpointer proto_get_protocol_dissector(int proto_id); -extern void proto_set_protocol_dissector(int proto_id, gpointer dissector); - /* Get length of registered field according to field type. * 0 means undeterminable at registration time. * -1 means unknown field */ diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c index 7f778579a4..a89cc39d75 100644 --- a/gtk/decode_as_dlg.c +++ b/gtk/decode_as_dlg.c @@ -1,6 +1,6 @@ /* decode_as_dlg.c * - * $Id: decode_as_dlg.c,v 1.13 2001/11/21 23:16:25 gram Exp $ + * $Id: decode_as_dlg.c,v 1.14 2001/12/03 04:00:19 guy Exp $ * * Routines to modify dissector tables on the fly. * @@ -260,18 +260,19 @@ decode_build_show_list (gchar *table_name, gpointer key, gpointer value, gpointer user_data) { GtkCList *clist; + dissector_handle_t current, initial; gchar *current_proto_name, *initial_proto_name, *text[E_CLIST_D_COLUMNS]; gchar string1[20]; - gint current_proto, initial_proto, row; + gint row; g_assert(user_data); g_assert(value); clist = (GtkCList *)user_data; - current_proto = dissector_get_proto(value); - current_proto_name = proto_get_protocol_short_name(current_proto); - initial_proto = dissector_get_initial_proto(value); - initial_proto_name = proto_get_protocol_short_name(initial_proto); + current = dtbl_entry_get_handle(value); + current_proto_name = dissector_handle_get_short_name(current); + initial = dtbl_entry_get_initial_handle(value); + initial_proto_name = dissector_handle_get_short_name(initial); text[E_CLIST_D_TABLE] = table_name; sprintf(string1, "%d", GPOINTER_TO_INT(key)); @@ -479,30 +480,23 @@ decode_show_cb (GtkWidget * w, gpointer data) static void decode_change_one_dissector (gchar *table_name, gint selector, GtkCList *clist) { - dissector_t dissector; - gchar *abbrev; - gint row, proto_num; + dissector_handle_t handle; + gchar *abbrev; + gint row; if (!clist->selection) { - proto_num = -1; abbrev = "(NULL)"; - dissector = NULL; + handle = NULL; } else { row = GPOINTER_TO_INT(clist->selection->data); - proto_num = GPOINTER_TO_INT(gtk_clist_get_row_data(clist, row)); + handle = gtk_clist_get_row_data(clist, row); gtk_clist_get_text(clist, row, E_CLIST_S_PROTO_NAME, &abbrev); - dissector = proto_get_protocol_dissector(proto_num); - if ((proto_num != -1) && (dissector == NULL)) { - simple_dialog(ESD_TYPE_CRIT, NULL, - "Protocol dissector structure disappeared"); - return; - } } if (strcmp(abbrev, "(default)") == 0) { dissector_reset(table_name, selector); } else { - dissector_change(table_name, selector, dissector, proto_num); + dissector_change(table_name, selector, handle); } } @@ -1008,7 +1002,8 @@ decode_add_to_clist (gchar *table_name, gpointer key, GtkCList *clist; gchar *proto_name, *isconv; gchar *text[E_CLIST_S_COLUMNS]; - gint proto, row; + dissector_handle_t handle; + gint row; decode_build_clist_info_t *info; g_assert(user_data); @@ -1017,15 +1012,15 @@ decode_add_to_clist (gchar *table_name, gpointer key, info = user_data; clist = info->clist; if (info->conv) { - proto = conv_dissector_get_proto(value); + handle = value; isconv = "TRUE"; } else { - proto = dissector_get_proto(value); + handle = dtbl_entry_get_handle(value); isconv = "FALSE"; } - proto_name = proto_get_protocol_short_name(proto); + proto_name = dissector_handle_get_short_name(handle); - row = gtk_clist_find_row_from_data(clist, GINT_TO_POINTER(proto)); + row = gtk_clist_find_row_from_data(clist, handle); if (row != -1) { return; } @@ -1034,7 +1029,7 @@ decode_add_to_clist (gchar *table_name, gpointer key, text[E_CLIST_S_TABLE] = table_name; text[E_CLIST_S_ISCONV] = isconv; row = gtk_clist_prepend(clist, text); - gtk_clist_set_row_data(clist, row, GINT_TO_POINTER(proto)); + gtk_clist_set_row_data(clist, row, handle); } diff --git a/packet-aarp.c b/packet-aarp.c index a105d0e8e7..b97947b49d 100644 --- a/packet-aarp.c +++ b/packet-aarp.c @@ -1,10 +1,14 @@ /* packet-aarp.c * Routines for Appletalk ARP packet disassembly * - * $Id: packet-aarp.c,v 1.31 2001/06/18 02:17:44 guy Exp $ + * $Id: packet-aarp.c,v 1.32 2001/12/03 03:59:33 guy Exp $ * * Simon Wilkinson <sxw@dcs.ed.ac.uk> * + * 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 * as published by the Free Software Foundation; either version 2 @@ -288,6 +292,9 @@ proto_register_aarp(void) void proto_reg_handoff_aarp(void) { - dissector_add("ethertype", ETHERTYPE_AARP, dissect_aarp, proto_aarp); - dissector_add("chdlctype", ETHERTYPE_AARP, dissect_aarp, proto_aarp); + dissector_handle_t aarp_handle; + + aarp_handle = create_dissector_handle(dissect_aarp, proto_aarp); + dissector_add("ethertype", ETHERTYPE_AARP, aarp_handle); + dissector_add("chdlctype", ETHERTYPE_AARP, aarp_handle); } diff --git a/packet-aim.c b/packet-aim.c index 77214e7dcd..1235003c4c 100644 --- a/packet-aim.c +++ b/packet-aim.c @@ -2,7 +2,7 @@ * Routines for AIM Instant Messenger (OSCAR) dissection * Copyright 2000, Ralf Hoelzer <ralf@well.com> * - * $Id: packet-aim.c,v 1.9 2001/06/18 02:17:44 guy Exp $ + * $Id: packet-aim.c,v 1.10 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -612,5 +612,8 @@ proto_register_aim(void) void proto_reg_handoff_aim(void) { - dissector_add("tcp.port", TCP_PORT_AIM, &dissect_aim, proto_aim); + dissector_handle_t aim_handle; + + aim_handle = create_dissector_handle(dissect_aim, proto_aim); + dissector_add("tcp.port", TCP_PORT_AIM, aim_handle); } diff --git a/packet-arp.c b/packet-arp.c index 7193b67e8c..a68090fbfc 100644 --- a/packet-arp.c +++ b/packet-arp.c @@ -1,7 +1,7 @@ /* packet-arp.c * Routines for ARP packet disassembly * - * $Id: packet-arp.c,v 1.46 2001/11/27 07:13:25 guy Exp $ + * $Id: packet-arp.c,v 1.47 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -940,6 +940,9 @@ proto_register_arp(void) void proto_reg_handoff_arp(void) { - dissector_add("ethertype", ETHERTYPE_ARP, dissect_arp, proto_arp); - dissector_add("ethertype", ETHERTYPE_REVARP, dissect_arp, proto_arp); + dissector_handle_t arp_handle; + + arp_handle = create_dissector_handle(dissect_arp, proto_arp); + dissector_add("ethertype", ETHERTYPE_ARP, arp_handle); + dissector_add("ethertype", ETHERTYPE_REVARP, arp_handle); } diff --git a/packet-ascend.c b/packet-ascend.c index b0b5d40b73..dfa4269129 100644 --- a/packet-ascend.c +++ b/packet-ascend.c @@ -1,10 +1,10 @@ /* packet-ascend.c * Routines for decoding Lucent/Ascend packet traces * - * $Id: packet-ascend.c,v 1.26 2001/06/18 02:17:44 guy Exp $ + * $Id: packet-ascend.c,v 1.27 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -148,10 +148,14 @@ proto_register_ascend(void) void proto_reg_handoff_ascend(void) { + dissector_handle_t ascend_handle; + /* * Get handles for the Ethernet and PPP-in-HDLC-like-framing dissectors. */ eth_handle = find_dissector("eth"); ppp_hdlc_handle = find_dissector("ppp_hdlc"); - dissector_add("wtap_encap", WTAP_ENCAP_ASCEND, dissect_ascend, proto_ascend); + + ascend_handle = create_dissector_handle(dissect_ascend, proto_ascend); + dissector_add("wtap_encap", WTAP_ENCAP_ASCEND, ascend_handle); } diff --git a/packet-atalk.c b/packet-atalk.c index 4664ab8fd1..ecb2346283 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -1,10 +1,14 @@ /* packet-atalk.c * Routines for Appletalk packet disassembly (DDP, currently). * - * $Id: packet-atalk.c,v 1.57 2001/11/30 07:14:20 guy Exp $ + * $Id: packet-atalk.c,v 1.58 2001/12/03 03:59:33 guy Exp $ * * Simon Wilkinson <sxw@dcs.ed.ac.uk> * + * 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 * as published by the Free Software Foundation; either version 2 @@ -714,13 +718,25 @@ proto_register_atalk(void) void proto_reg_handoff_atalk(void) { - dissector_add("ethertype", ETHERTYPE_ATALK, dissect_ddp, proto_ddp); - dissector_add("chdlctype", ETHERTYPE_ATALK, dissect_ddp, proto_ddp); - dissector_add("ppp.protocol", PPP_AT, dissect_ddp, proto_ddp); - dissector_add("null.type", BSD_AF_APPLETALK, dissect_ddp, proto_ddp); - dissector_add("ddp.type", DDP_NBP, dissect_nbp, proto_nbp); - dissector_add("ddp.type", DDP_RTMPREQ, dissect_rtmp_request, proto_rtmp); - dissector_add("ddp.type", DDP_RTMPDATA, dissect_rtmp_data, proto_rtmp); - dissector_add("wtap_encap", WTAP_ENCAP_LOCALTALK, dissect_llap, proto_llap); + dissector_handle_t ddp_handle, nbp_handle, rtmp_request_handle; + dissector_handle_t rtmp_data_handle, llap_handle; + + ddp_handle = create_dissector_handle(dissect_ddp, proto_ddp); + dissector_add("ethertype", ETHERTYPE_ATALK, ddp_handle); + dissector_add("chdlctype", ETHERTYPE_ATALK, ddp_handle); + dissector_add("ppp.protocol", PPP_AT, ddp_handle); + dissector_add("null.type", BSD_AF_APPLETALK, ddp_handle); + + nbp_handle = create_dissector_handle(dissect_nbp, proto_nbp); + dissector_add("ddp.type", DDP_NBP, nbp_handle); + + rtmp_request_handle = create_dissector_handle(dissect_rtmp_request, proto_rtmp); + rtmp_data_handle = create_dissector_handle(dissect_rtmp_data, proto_rtmp); + dissector_add("ddp.type", DDP_RTMPREQ, rtmp_request_handle); + dissector_add("ddp.type", DDP_RTMPDATA, rtmp_data_handle); + + llap_handle = create_dissector_handle(dissect_llap, proto_llap); + dissector_add("wtap_encap", WTAP_ENCAP_LOCALTALK, llap_handle); + data_handle = find_dissector("data"); } diff --git a/packet-atm.c b/packet-atm.c index b71862b293..d97e93cf03 100644 --- a/packet-atm.c +++ b/packet-atm.c @@ -1,12 +1,11 @@ /* packet-atm.c * Routines for ATM packet disassembly * - * $Id: packet-atm.c,v 1.37 2001/11/26 01:03:35 hagbard Exp $ + * $Id: packet-atm.c,v 1.38 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * 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 @@ -798,6 +797,8 @@ proto_register_atm(void) void proto_reg_handoff_atm(void) { + dissector_handle_t atm_handle; + /* * Get handles for the Ethernet, Token Ring, LLC, SSCOP, LANE, * and ILMI dissectors. @@ -810,6 +811,7 @@ proto_reg_handoff_atm(void) ilmi_handle = find_dissector("ilmi"); data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_ATM_SNIFFER, dissect_atm, - proto_atm); + atm_handle = create_dissector_handle(dissect_atm, proto_atm); + + dissector_add("wtap_encap", WTAP_ENCAP_ATM_SNIFFER, atm_handle); } diff --git a/packet-auto_rp.c b/packet-auto_rp.c index ca113e9836..305b0971f5 100644 --- a/packet-auto_rp.c +++ b/packet-auto_rp.c @@ -4,12 +4,11 @@ * * Heikki Vatiainen <hessu@cs.tut.fi> * - * $Id: packet-auto_rp.c,v 1.14 2001/06/18 02:17:44 guy Exp $ + * $Id: packet-auto_rp.c,v 1.15 2001/12/03 03:59:33 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 @@ -243,8 +242,11 @@ void proto_register_auto_rp(void) void proto_reg_handoff_auto_rp(void) { - dissector_add("udp.port", UDP_PORT_PIM_RP_DISC, dissect_auto_rp, + dissector_handle_t auto_rp_handle; + + auto_rp_handle = create_dissector_handle(dissect_auto_rp, proto_auto_rp); + dissector_add("udp.port", UDP_PORT_PIM_RP_DISC, auto_rp_handle); } /* diff --git a/packet-bacapp.c b/packet-bacapp.c index 6b3feb35c9..c0337319f5 100644 --- a/packet-bacapp.c +++ b/packet-bacapp.c @@ -2,7 +2,7 @@ * Routines for BACnet (APDU) dissection * Copyright 2001, Hartmut Mueller <hartmut@abmlinux.org>, FH Dortmund * - * $Id: packet-bacapp.c,v 1.5 2001/11/26 01:03:35 hagbard Exp $ + * $Id: packet-bacapp.c,v 1.6 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -127,6 +127,9 @@ proto_register_bacapp(void) void proto_reg_handoff_bacapp(void) { - dissector_add("bacnet_control_net", 0, dissect_bacapp, proto_bacapp); + dissector_handle_t bacapp_handle; + + bacapp_handle = create_dissector_handle(dissect_bacapp, proto_bacapp); + dissector_add("bacnet_control_net", 0, bacapp_handle); data_handle = find_dissector("data"); } diff --git a/packet-bacnet.c b/packet-bacnet.c index d4b4f47abc..5cc99c2ba1 100644 --- a/packet-bacnet.c +++ b/packet-bacnet.c @@ -2,7 +2,7 @@ * Routines for BACnet (NPDU) dissection * Copyright 2001, Hartmut Mueller <hartmut@abmlinux.org>, FH Dortmund * - * $Id: packet-bacnet.c,v 1.5 2001/11/26 04:52:49 hagbard Exp $ + * $Id: packet-bacnet.c,v 1.6 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -599,9 +599,12 @@ proto_register_bacnet(void) void proto_reg_handoff_bacnet(void) { - dissector_add("bvlc.function", 0x04, dissect_bacnet, proto_bacnet); - dissector_add("bvlc.function", 0x09, dissect_bacnet, proto_bacnet); - dissector_add("bvlc.function", 0x0a, dissect_bacnet, proto_bacnet); - dissector_add("bvlc.function", 0x0b, dissect_bacnet, proto_bacnet); + dissector_handle_t bacnet_handle; + + bacnet_handle = find_dissector("bacnet"); + dissector_add("bvlc.function", 0x04, bacnet_handle); + dissector_add("bvlc.function", 0x09, bacnet_handle); + dissector_add("bvlc.function", 0x0a, bacnet_handle); + dissector_add("bvlc.function", 0x0b, bacnet_handle); data_handle = find_dissector("data"); } diff --git a/packet-bgp.c b/packet-bgp.c index 49e11db89a..5e40e96cc4 100644 --- a/packet-bgp.c +++ b/packet-bgp.c @@ -2,7 +2,7 @@ * Routines for BGP packet dissection. * Copyright 1999, Jun-ichiro itojun Hagino <itojun@itojun.org> * - * $Id: packet-bgp.c,v 1.48 2001/11/03 21:25:12 guy Exp $ + * $Id: packet-bgp.c,v 1.49 2001/12/03 03:59:33 guy Exp $ * * Supports: * RFC1771 A Border Gateway Protocol 4 (BGP-4) @@ -1835,5 +1835,8 @@ proto_register_bgp(void) void proto_reg_handoff_bgp(void) { - dissector_add("tcp.port", BGP_TCP_PORT, dissect_bgp, proto_bgp); + dissector_handle_t bgp_handle; + + bgp_handle = create_dissector_handle(dissect_bgp, proto_bgp); + dissector_add("tcp.port", BGP_TCP_PORT, bgp_handle); } diff --git a/packet-bootp.c b/packet-bootp.c index 4648245711..dd345e4d2d 100644 --- a/packet-bootp.c +++ b/packet-bootp.c @@ -2,7 +2,7 @@ * Routines for BOOTP/DHCP packet disassembly * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-bootp.c,v 1.57 2001/11/13 23:55:29 gram Exp $ + * $Id: packet-bootp.c,v 1.58 2001/12/03 03:59:33 guy Exp $ * * The information used comes from: * RFC 951: Bootstrap Protocol @@ -1331,5 +1331,8 @@ proto_register_bootp(void) void proto_reg_handoff_bootp(void) { - dissector_add("udp.port", UDP_PORT_BOOTPS, dissect_bootp, proto_bootp); + dissector_handle_t bootp_handle; + + bootp_handle = create_dissector_handle(dissect_bootp, proto_bootp); + dissector_add("udp.port", UDP_PORT_BOOTPS, bootp_handle); } diff --git a/packet-bpdu.c b/packet-bpdu.c index fbbbc39a8a..ec6f63da60 100644 --- a/packet-bpdu.c +++ b/packet-bpdu.c @@ -1,14 +1,13 @@ /* packet-bpdu.c * Routines for BPDU (Spanning Tree Protocol) disassembly * - * $Id: packet-bpdu.c,v 1.28 2001/11/26 04:52:49 hagbard Exp $ + * $Id: packet-bpdu.c,v 1.29 2001/12/03 03:59:33 guy Exp $ * * Copyright 1999 Christophe Tronche <ch.tronche@computer.org> * * Ethereal - Network traffic analyzer * 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 @@ -338,6 +337,8 @@ proto_register_bpdu(void) void proto_reg_handoff_bpdu(void) { + dissector_handle_t bpdu_handle; + /* * Get handle for the GVRP dissector. */ @@ -349,6 +350,7 @@ proto_reg_handoff_bpdu(void) gmrp_handle = find_dissector("gmrp"); data_handle = find_dissector("data"); - dissector_add("llc.dsap", SAP_BPDU, dissect_bpdu, proto_bpdu); - dissector_add("ppp.protocol", PPP_BPDU, dissect_bpdu, proto_bpdu); + bpdu_handle = find_dissector("bpdu"); + dissector_add("llc.dsap", SAP_BPDU, bpdu_handle); + dissector_add("ppp.protocol", PPP_BPDU, bpdu_handle); } diff --git a/packet-bvlc.c b/packet-bvlc.c index 6201724095..abed81f59e 100644 --- a/packet-bvlc.c +++ b/packet-bvlc.c @@ -2,7 +2,7 @@ * Routines for BACnet/IP (BVLL, BVLC) dissection * Copyright 2001, Hartmut Mueller <hartmut@abmlinux.org>, FH Dortmund * - * $Id: packet-bvlc.c,v 1.5 2001/11/26 01:03:35 hagbard Exp $ + * $Id: packet-bvlc.c,v 1.6 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -395,7 +395,10 @@ proto_register_bvlc(void) void proto_reg_handoff_bvlc(void) { - dissector_add("udp.port", 0xBAC0, dissect_bvlc, proto_bvlc); /* added proto_bvlc */ + dissector_handle_t bvlc_handle; + + bvlc_handle = find_dissector("bvlc"); + dissector_add("udp.port", 0xBAC0, bvlc_handle); data_handle = find_dissector("data"); } /* Taken from add-135a (BACnet-IP-standard paper): @@ -411,4 +414,3 @@ proto_reg_handoff_bvlc(void) * If you changed your BACnet port locally, use the ethereal feature * "Decode As". */ - diff --git a/packet-bxxp.c b/packet-bxxp.c index a1ad8e302c..bf07a7ce75 100644 --- a/packet-bxxp.c +++ b/packet-bxxp.c @@ -1,7 +1,7 @@ /* packet-bxxp.c * Routines for BXXP packet disassembly * - * $Id: packet-bxxp.c,v 1.21 2001/09/03 10:33:05 guy Exp $ + * $Id: packet-bxxp.c,v 1.22 2001/12/03 03:59:33 guy Exp $ * * Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com> * @@ -1239,15 +1239,18 @@ void proto_reg_handoff_bxxp(void) { static int bxxp_prefs_initialized = FALSE; + static dissector_handle_t bxxp_handle; - if (bxxp_prefs_initialized) { + if (!bxxp_prefs_initialized) { - dissector_delete("tcp.port", tcp_port, dissect_bxxp); + bxxp_handle = create_dissector_handle(dissect_bxxp, proto_bxxp); + + bxxp_prefs_initialized = TRUE; } else { - bxxp_prefs_initialized = TRUE; + dissector_delete("tcp.port", tcp_port, bxxp_handle); } @@ -1255,6 +1258,6 @@ proto_reg_handoff_bxxp(void) tcp_port = global_bxxp_tcp_port; - dissector_add("tcp.port", global_bxxp_tcp_port, dissect_bxxp, proto_bxxp); + dissector_add("tcp.port", global_bxxp_tcp_port, bxxp_handle); } diff --git a/packet-cdp.c b/packet-cdp.c index e435c12041..1905ddadef 100644 --- a/packet-cdp.c +++ b/packet-cdp.c @@ -2,7 +2,7 @@ * Routines for the disassembly of the "Cisco Discovery Protocol" * (c) Copyright Hannes R. Boehm <hannes@boehm.org> * - * $Id: packet-cdp.c,v 1.40 2001/11/26 04:52:49 hagbard Exp $ + * $Id: packet-cdp.c,v 1.41 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -580,7 +580,10 @@ proto_register_cdp(void) void proto_reg_handoff_cdp(void) { + dissector_handle_t cdp_handle; + data_handle = find_dissector("data"); - dissector_add("llc.cisco_pid", 0x2000, dissect_cdp, proto_cdp); - dissector_add("chdlctype", 0x2000, dissect_cdp, proto_cdp); + cdp_handle = create_dissector_handle(dissect_cdp, proto_cdp); + dissector_add("llc.cisco_pid", 0x2000, cdp_handle); + dissector_add("chdlctype", 0x2000, cdp_handle); } diff --git a/packet-cgmp.c b/packet-cgmp.c index 2fa52de732..0601ba12e6 100644 --- a/packet-cgmp.c +++ b/packet-cgmp.c @@ -1,13 +1,12 @@ /* packet-cgmp.c * Routines for the disassembly of the Cisco Group Management Protocol * - * $Id: packet-cgmp.c,v 1.10 2001/06/18 02:17:45 guy Exp $ + * $Id: packet-cgmp.c,v 1.11 2001/12/03 03:59:33 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 * as published by the Free Software Foundation; either version 2 @@ -140,5 +139,8 @@ proto_register_cgmp(void) void proto_reg_handoff_cgmp(void) { - dissector_add("llc.cisco_pid", 0x2001, dissect_cgmp, proto_cgmp); + dissector_handle_t cgmp_handle; + + cgmp_handle = create_dissector_handle(dissect_cgmp, proto_cgmp); + dissector_add("llc.cisco_pid", 0x2001, cgmp_handle); } diff --git a/packet-chdlc.c b/packet-chdlc.c index 8017145559..5c66ee6b46 100644 --- a/packet-chdlc.c +++ b/packet-chdlc.c @@ -1,7 +1,7 @@ /* packet-chdlc.c * Routines for Cisco HDLC packet disassembly * - * $Id: packet-chdlc.c,v 1.6 2001/11/26 04:52:49 hagbard Exp $ + * $Id: packet-chdlc.c,v 1.7 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -197,8 +197,11 @@ proto_register_chdlc(void) void proto_reg_handoff_chdlc(void) { + dissector_handle_t chdlc_handle; + data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_CHDLC, dissect_chdlc, proto_chdlc); + chdlc_handle = find_dissector("chdlc"); + dissector_add("wtap_encap", WTAP_ENCAP_CHDLC, chdlc_handle); } #define SLARP_REQUEST 0 @@ -311,5 +314,8 @@ proto_register_slarp(void) void proto_reg_handoff_slarp(void) { - dissector_add("chdlctype", CISCO_SLARP, dissect_slarp, proto_slarp); + dissector_handle_t slarp_handle; + + slarp_handle = create_dissector_handle(dissect_slarp, proto_slarp); + dissector_add("chdlctype", CISCO_SLARP, slarp_handle); } diff --git a/packet-clip.c b/packet-clip.c index 24aba5e57d..ab3510abe6 100644 --- a/packet-clip.c +++ b/packet-clip.c @@ -1,7 +1,7 @@ /* packet-clip.c * Routines for clip packet disassembly * - * $Id: packet-clip.c,v 1.16 2001/11/20 21:59:12 guy Exp $ + * $Id: packet-clip.c,v 1.17 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -111,10 +111,14 @@ proto_register_clip(void) void proto_reg_handoff_clip(void) { + dissector_handle_t clip_handle; + /* * Get a handle for the IP dissector. */ ip_handle = find_dissector("ip"); - dissector_add("wtap_encap", WTAP_ENCAP_LINUX_ATM_CLIP, dissect_clip, - -1); /* XXX */ + + clip_handle = create_dissector_handle(dissect_clip, -1); + /* XXX - no protocol, can't be disabled */ + dissector_add("wtap_encap", WTAP_ENCAP_LINUX_ATM_CLIP, clip_handle); } diff --git a/packet-clnp.c b/packet-clnp.c index 7342631699..495ac22a17 100644 --- a/packet-clnp.c +++ b/packet-clnp.c @@ -1,7 +1,7 @@ /* packet-clnp.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-clnp.c,v 1.40 2001/11/26 04:52:49 hagbard Exp $ + * $Id: packet-clnp.c,v 1.41 2001/12/03 03:59:33 guy Exp $ * Laurent Deniel <deniel@worldnet.fr> * Ralf Schneider <Ralf.Schneider@t-online.de> * @@ -2197,9 +2197,11 @@ void proto_register_cltp(void) void proto_reg_handoff_clnp(void) { + dissector_handle_t clnp_handle; + data_handle = find_dissector("data"); - dissector_add("osinl", NLPID_ISO8473_CLNP, dissect_clnp, - proto_clnp); - dissector_add("osinl", NLPID_NULL, dissect_clnp, - proto_clnp); /* Inactive subset */ + + clnp_handle = create_dissector_handle(dissect_clnp, proto_clnp); + dissector_add("osinl", NLPID_ISO8473_CLNP, clnp_handle); + dissector_add("osinl", NLPID_NULL, clnp_handle); /* Inactive subset */ } diff --git a/packet-cops.c b/packet-cops.c index e062bd0a14..926a711299 100644 --- a/packet-cops.c +++ b/packet-cops.c @@ -4,12 +4,11 @@ * * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi> * - * $Id: packet-cops.c,v 1.13 2001/06/18 02:17:45 guy Exp $ + * $Id: packet-cops.c,v 1.14 2001/12/03 03:59:33 guy Exp $ * * Ethereal - Network traffic analyzer * 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 @@ -827,5 +826,8 @@ void proto_register_cops(void) void proto_reg_handoff_cops(void) { - dissector_add("tcp.port", TCP_PORT_COPS, dissect_cops, proto_cops); + dissector_handle_t cops_handle; + + cops_handle = create_dissector_handle(dissect_cops, proto_cops); + dissector_add("tcp.port", TCP_PORT_COPS, cops_handle); } diff --git a/packet-cups.c b/packet-cups.c index aceeaba5f2..509c021b0f 100644 --- a/packet-cups.c +++ b/packet-cups.c @@ -5,8 +5,7 @@ * Charles Levert <charles@comm.polymtl.ca> * Copyright 2001 Charles Levert * -* $Id: packet-cups.c,v 1.6 2001/09/20 02:26:03 guy Exp $ -* +* $Id: packet-cups.c,v 1.7 2001/12/03 03:59:34 guy Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -389,5 +388,8 @@ proto_register_cups(void) void proto_reg_handoff_cups(void) { - dissector_add("udp.port", UDP_PORT_CUPS, dissect_cups, proto_cups); + dissector_handle_t cups_handle; + + cups_handle = create_dissector_handle(dissect_cups, proto_cups); + dissector_add("udp.port", UDP_PORT_CUPS, cups_handle); } diff --git a/packet-ddtp.c b/packet-ddtp.c index 59c7d6d16a..803d1ab580 100644 --- a/packet-ddtp.c +++ b/packet-ddtp.c @@ -3,12 +3,11 @@ * see http://ddt.sourceforge.net/ * Olivier Abad <oabad@cybercable.fr> * - * $Id: packet-ddtp.c,v 1.16 2001/06/18 02:17:45 guy Exp $ + * $Id: packet-ddtp.c,v 1.17 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 2000 - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -213,5 +212,8 @@ proto_register_ddtp(void) void proto_reg_handoff_ddtp(void) { - dissector_add("udp.port", UDP_PORT_DDTP, dissect_ddtp, proto_ddtp); + dissector_handle_t ddtp_handle; + + ddtp_handle = create_dissector_handle(dissect_ddtp, proto_ddtp); + dissector_add("udp.port", UDP_PORT_DDTP, ddtp_handle); } diff --git a/packet-dec-bpdu.c b/packet-dec-bpdu.c index 5a1b0ef7d7..b6c5013aac 100644 --- a/packet-dec-bpdu.c +++ b/packet-dec-bpdu.c @@ -1,14 +1,13 @@ /* packet-dec-bpdu.c * Routines for DEC BPDU (DEC Spanning Tree Protocol) disassembly * - * $Id: packet-dec-bpdu.c,v 1.7 2001/03/15 09:11:00 guy Exp $ + * $Id: packet-dec-bpdu.c,v 1.8 2001/12/03 03:59:34 guy Exp $ * * Copyright 2001 Paul Ionescu <paul@acorp.ro> * * 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 @@ -165,10 +164,11 @@ proto_register_dec_bpdu(void) void proto_reg_handoff_dec_bpdu(void) { - dissector_add("ethertype", ETHERTYPE_DEC_LB, dissect_dec_bpdu, - proto_dec_bpdu); - dissector_add("chdlctype", ETHERTYPE_DEC_LB, dissect_dec_bpdu, - proto_dec_bpdu); - dissector_add("ppp.protocol", PPP_DEC_LB, dissect_dec_bpdu, - proto_dec_bpdu); + dissector_handle_t dec_bpdu_handle; + + dec_bpdu_handle = create_dissector_handle(dissect_dec_bpdu, + proto_dec_bpdu); + dissector_add("ethertype", ETHERTYPE_DEC_LB, dec_bpdu_handle); + dissector_add("chdlctype", ETHERTYPE_DEC_LB, dec_bpdu_handle); + dissector_add("ppp.protocol", PPP_DEC_LB, dec_bpdu_handle); } diff --git a/packet-diameter.c b/packet-diameter.c index 7108ca1838..a4028be99a 100644 --- a/packet-diameter.c +++ b/packet-diameter.c @@ -1,7 +1,7 @@ /* packet-diameter.c * Routines for Diameter packet disassembly * - * $Id: packet-diameter.c,v 1.35 2001/11/27 07:41:39 guy Exp $ + * $Id: packet-diameter.c,v 1.36 2001/12/03 03:59:34 guy Exp $ * * Copyright (c) 2001 by David Frascone <dave@frascone.com> * @@ -1606,12 +1606,18 @@ proto_reg_handoff_diameter(void) static int Initialized=FALSE; static int TcpPort=0; static int SctpPort=0; - - if (Initialized) { - dissector_delete("tcp.port", TcpPort, dissect_diameter_tcp); - dissector_delete("sctp.port", SctpPort, dissect_diameter_sctp); - } else { + static dissector_handle_t diameter_tcp_handle; + static dissector_handle_t diameter_sctp_handle; + + if (!Initialized) { + diameter_tcp_handle = create_dissector_handle(dissect_diameter_tcp, + proto_diameter); + diameter_sctp_handle = create_dissector_handle(dissect_diameter_sctp, + proto_diameter); Initialized=TRUE; + } else { + dissector_delete("tcp.port", TcpPort, diameter_tcp_handle); + dissector_delete("sctp.port", SctpPort, diameter_sctp_handle); } /* set port for future deletes */ @@ -1622,10 +1628,8 @@ proto_reg_handoff_diameter(void) /* g_warning ("Diameter: Adding tcp dissector to port %d", gbl_diameterTcpPort); */ - dissector_add("tcp.port", gbl_diameterTcpPort, dissect_diameter_tcp, - proto_diameter); - dissector_add("sctp.port", gbl_diameterSctpPort, - dissect_diameter_sctp, proto_diameter); + dissector_add("tcp.port", gbl_diameterTcpPort, diameter_tcp_handle); + dissector_add("sctp.port", gbl_diameterSctpPort, diameter_sctp_handle); } /* registration with the filtering engine */ diff --git a/packet-dns.c b/packet-dns.c index 39b3ec55d0..a2c2460349 100644 --- a/packet-dns.c +++ b/packet-dns.c @@ -1,7 +1,7 @@ /* packet-dns.c * Routines for DNS packet disassembly * - * $Id: packet-dns.c,v 1.75 2001/09/17 02:07:00 guy Exp $ + * $Id: packet-dns.c,v 1.76 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2081,6 +2081,11 @@ proto_register_dns(void) void proto_reg_handoff_dns(void) { - dissector_add("udp.port", UDP_PORT_DNS, dissect_dns_udp, proto_dns); - dissector_add("tcp.port", TCP_PORT_DNS, dissect_dns_tcp, proto_dns); + dissector_handle_t dns_udp_handle; + dissector_handle_t dns_tcp_handle; + + dns_udp_handle = create_dissector_handle(dissect_dns_udp, proto_dns); + dns_tcp_handle = create_dissector_handle(dissect_dns_tcp, proto_dns); + dissector_add("udp.port", UDP_PORT_DNS, dns_udp_handle); + dissector_add("tcp.port", TCP_PORT_DNS, dns_tcp_handle); } diff --git a/packet-dsi.c b/packet-dsi.c index d11fbe0e63..376b2b0aa1 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.5 2001/11/27 07:13:25 guy Exp $ + * $Id: packet-dsi.c,v 1.6 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -492,5 +492,5 @@ void proto_reg_handoff_dsi(void) { data_handle = find_dissector("data"); - dissector_add("tcp.port", TCP_PORT_DSI, dissect_dsi, proto_dsi); + dissector_add("tcp.port", TCP_PORT_DSI, dsi_handle); } diff --git a/packet-eap.c b/packet-eap.c index 0f89eba724..27759713d2 100644 --- a/packet-eap.c +++ b/packet-eap.c @@ -1,7 +1,7 @@ /* packet-eap.c * Routines for EAP Extensible Authentication Protocol header disassembly * - * $Id: packet-eap.c,v 1.2 2001/11/26 04:52:49 hagbard Exp $ + * $Id: packet-eap.c,v 1.3 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -154,6 +154,9 @@ proto_register_eap(void) void proto_reg_handoff_eap(void) { + dissector_handle_t eap_handle; + data_handle = find_dissector("data"); - dissector_add("ppp.protocol", PPP_EAP, dissect_eap, proto_eap); + eap_handle = create_dissector_handle(dissect_eap, proto_eap); + dissector_add("ppp.protocol", PPP_EAP, eap_handle); } diff --git a/packet-eapol.c b/packet-eapol.c index de6bbae858..38c3b4c49d 100644 --- a/packet-eapol.c +++ b/packet-eapol.c @@ -1,7 +1,7 @@ /* packet-eapol.c * Routines for EAPOL 802.1X authentication header disassembly * - * $Id: packet-eapol.c,v 1.2 2001/11/26 04:52:49 hagbard Exp $ + * $Id: packet-eapol.c,v 1.3 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -137,6 +137,9 @@ proto_register_eapol(void) void proto_reg_handoff_eapol(void) { + dissector_handle_t eapol_handle; + data_handle = find_dissector("data"); - dissector_add("ethertype", ETHERTYPE_EAPOL, dissect_eapol, proto_eapol); + eapol_handle = create_dissector_handle(dissect_eapol, proto_eapol); + dissector_add("ethertype", ETHERTYPE_EAPOL, eapol_handle); } diff --git a/packet-eigrp.c b/packet-eigrp.c index 9125486f96..7ac54565bd 100644 --- a/packet-eigrp.c +++ b/packet-eigrp.c @@ -2,12 +2,11 @@ * Routines for EIGRP dissection * Copyright 2000, Paul Ionescu <paul@acorp.ro> * - * $Id: packet-eigrp.c,v 1.17 2001/06/18 02:17:46 guy Exp $ + * $Id: packet-eigrp.c,v 1.18 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * 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 @@ -476,8 +475,11 @@ proto_register_eigrp(void) void proto_reg_handoff_eigrp(void) { + dissector_handle_t eigrp_handle; + ipxsap_handle = find_dissector("ipxsap"); - dissector_add("ip.proto", IP_PROTO_EIGRP, dissect_eigrp, proto_eigrp); - dissector_add("ddp.type", DDP_EIGRP, dissect_eigrp, proto_eigrp); - dissector_add("ipx.socket", IPX_SOCKET_EIGRP, dissect_eigrp, proto_eigrp); + eigrp_handle = create_dissector_handle(dissect_eigrp, proto_eigrp); + dissector_add("ip.proto", IP_PROTO_EIGRP, eigrp_handle); + dissector_add("ddp.type", DDP_EIGRP, eigrp_handle); + dissector_add("ipx.socket", IPX_SOCKET_EIGRP, eigrp_handle); } diff --git a/packet-esis.c b/packet-esis.c index cf898c1329..6db393e2ac 100644 --- a/packet-esis.c +++ b/packet-esis.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI End System to Intermediate System * Routing Exchange Protocol ISO 9542. * - * $Id: packet-esis.c,v 1.17 2001/08/13 00:56:18 sharpe Exp $ + * $Id: packet-esis.c,v 1.18 2001/12/03 03:59:34 guy Exp $ * Ralf Schneider <Ralf.Schneider@t-online.de> * * Ethereal - Network traffic analyzer @@ -22,9 +22,7 @@ * 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 # include "config.h" @@ -450,5 +448,8 @@ proto_register_esis(void) { void proto_reg_handoff_esis(void) { - dissector_add("osinl", NLPID_ISO9542_ESIS, dissect_esis, proto_esis); + dissector_handle_t esis_handle; + + esis_handle = create_dissector_handle(dissect_esis, proto_esis); + dissector_add("osinl", NLPID_ISO9542_ESIS, esis_handle); } diff --git a/packet-eth.c b/packet-eth.c index 7ecabd3bec..43e181373a 100644 --- a/packet-eth.c +++ b/packet-eth.c @@ -1,7 +1,7 @@ /* packet-eth.c * Routines for ethernet packet disassembly * - * $Id: packet-eth.c,v 1.69 2001/11/20 22:46:11 guy Exp $ + * $Id: packet-eth.c,v 1.70 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -277,17 +277,16 @@ proto_register_eth(void) void proto_reg_handoff_eth(void) { + dissector_handle_t eth_handle; + /* * Get a handle for the ISL dissector. */ isl_handle = find_dissector("isl"); - dissector_add("wtap_encap", WTAP_ENCAP_ETHERNET, dissect_eth, - proto_eth); - dissector_add("ethertype", ETHERTYPE_ETHBRIDGE, dissect_eth, - proto_eth); - dissector_add("chdlctype", ETHERTYPE_ETHBRIDGE, dissect_eth, - proto_eth); - dissector_add("gre.proto", ETHERTYPE_ETHBRIDGE, dissect_eth, - proto_eth); + eth_handle = find_dissector("eth"); + dissector_add("wtap_encap", WTAP_ENCAP_ETHERNET, eth_handle); + dissector_add("ethertype", ETHERTYPE_ETHBRIDGE, eth_handle); + dissector_add("chdlctype", ETHERTYPE_ETHBRIDGE, eth_handle); + dissector_add("gre.proto", ETHERTYPE_ETHBRIDGE, eth_handle); } diff --git a/packet-fddi.c b/packet-fddi.c index b62b370ea2..d3bedb6b55 100644 --- a/packet-fddi.c +++ b/packet-fddi.c @@ -3,7 +3,7 @@ * * Laurent Deniel <deniel@worldnet.fr> * - * $Id: packet-fddi.c,v 1.53 2001/11/26 01:03:35 hagbard Exp $ + * $Id: packet-fddi.c,v 1.54 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -452,14 +452,18 @@ proto_register_fddi(void) void proto_reg_handoff_fddi(void) { + dissector_handle_t fddi_handle, fddi_bitswapped_handle; + /* * Get a handle for the LLC dissector. */ llc_handle = find_dissector("llc"); data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_FDDI, - dissect_fddi_not_bitswapped, proto_fddi); + fddi_handle = find_dissector("fddi"); + dissector_add("wtap_encap", WTAP_ENCAP_FDDI, fddi_handle); + fddi_bitswapped_handle = + create_dissector_handle(dissect_fddi_bitswapped, proto_fddi); dissector_add("wtap_encap", WTAP_ENCAP_FDDI_BITSWAPPED, - dissect_fddi_bitswapped, proto_fddi); + fddi_bitswapped_handle); } diff --git a/packet-fr.c b/packet-fr.c index f23af06862..5bb4c5ed4c 100644 --- a/packet-fr.c +++ b/packet-fr.c @@ -3,7 +3,7 @@ * * Copyright 2001, Paul Ionescu <paul@acorp.ro> * - * $Id: packet-fr.c,v 1.24 2001/12/02 00:07:46 guy Exp $ + * $Id: packet-fr.c,v 1.25 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -423,7 +423,10 @@ void proto_register_fr(void) void proto_reg_handoff_fr(void) { - dissector_add("wtap_encap", WTAP_ENCAP_FRELAY, dissect_fr, proto_fr); - dissector_add("gre.proto", GRE_FR, dissect_fr, proto_fr); + dissector_handle_t fr_handle; + + fr_handle = create_dissector_handle(dissect_fr, proto_fr); + dissector_add("wtap_encap", WTAP_ENCAP_FRELAY, fr_handle); + dissector_add("gre.proto", GRE_FR, fr_handle); data_handle = find_dissector("data"); } diff --git a/packet-ftp.c b/packet-ftp.c index d80ed89a8d..f41d8afac1 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.37 2001/11/27 07:13:25 guy Exp $ + * $Id: packet-ftp.c,v 1.38 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -441,6 +441,10 @@ proto_register_ftp(void) void proto_reg_handoff_ftp(void) { - dissector_add("tcp.port", TCP_PORT_FTPDATA, &dissect_ftpdata, proto_ftp_data); - dissector_add("tcp.port", TCP_PORT_FTP, &dissect_ftp, proto_ftp); + dissector_handle_t ftpdata_handle, ftp_handle; + + ftpdata_handle = create_dissector_handle(dissect_ftpdata, proto_ftp_data); + dissector_add("tcp.port", TCP_PORT_FTPDATA, ftpdata_handle); + ftp_handle = create_dissector_handle(dissect_ftp, proto_ftp); + dissector_add("tcp.port", TCP_PORT_FTP, ftp_handle); } diff --git a/packet-gnutella.c b/packet-gnutella.c index 036a0d9e00..05f52e6516 100644 --- a/packet-gnutella.c +++ b/packet-gnutella.c @@ -2,7 +2,7 @@ * Routines for gnutella dissection * Copyright 2001, B. Johannessen <bob@havoq.com> * - * $Id: packet-gnutella.c,v 1.8 2001/11/21 02:01:06 guy Exp $ + * $Id: packet-gnutella.c,v 1.9 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -765,8 +765,9 @@ void proto_register_gnutella(void) { } void proto_reg_handoff_gnutella(void) { - dissector_add("tcp.port", - GNUTELLA_TCP_PORT, - dissect_gnutella, + dissector_handle_t gnutella_handle; + + gnutella_handle = create_dissector_handle(dissect_gnutella, proto_gnutella); + dissector_add("tcp.port", GNUTELLA_TCP_PORT, gnutella_handle); } diff --git a/packet-gre.c b/packet-gre.c index 8d3f5f3abf..5ec6dc7db2 100644 --- a/packet-gre.c +++ b/packet-gre.c @@ -2,7 +2,7 @@ * Routines for the Generic Routing Encapsulation (GRE) protocol * Brad Robel-Forrest <brad.robel-forrest@watchguard.com> * - * $Id: packet-gre.c,v 1.46 2001/11/25 22:51:13 hagbard Exp $ + * $Id: packet-gre.c,v 1.47 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -381,6 +381,9 @@ proto_register_gre(void) void proto_reg_handoff_gre(void) { - dissector_add("ip.proto", IP_PROTO_GRE, dissect_gre, proto_gre); + dissector_handle_t gre_handle; + + gre_handle = create_dissector_handle(dissect_gre, proto_gre); + dissector_add("ip.proto", IP_PROTO_GRE, gre_handle); data_handle = find_dissector("data"); } diff --git a/packet-gtp.c b/packet-gtp.c index 626b26f327..f914a93224 100644 --- a/packet-gtp.c +++ b/packet-gtp.c @@ -4,7 +4,7 @@ * Copyright 2001, Michal Melerowicz <michal.melerowicz@nokia.com> * Nicolas Balkota <balkota@mac.com> * - * $Id: packet-gtp.c,v 1.17 2001/11/21 21:37:25 guy Exp $ + * $Id: packet-gtp.c,v 1.18 2001/12/03 03:59:34 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -5144,20 +5144,26 @@ void proto_reg_handoff_gtp(void) { static int Initialized = FALSE; + static dissector_handle_t gtpv0_handle; + static dissector_handle_t gtpv1_handle; - if (Initialized) { + if (!Initialized) { - dissector_delete("udp.port", gtpv0_port, dissect_gtpv0); - dissector_delete("tcp.port", gtpv0_port, dissect_gtpv0); - - dissector_delete("udp.port", gtpv1c_port, dissect_gtpv1); - dissector_delete("tcp.port", gtpv1c_port, dissect_gtpv1); - dissector_delete("udp.port", gtpv1u_port, dissect_gtpv1); - dissector_delete("tcp.port", gtpv1u_port, dissect_gtpv1); + gtpv0_handle = find_dissector("gtpv0"); + + gtpv1_handle = find_dissector("gtpv1"); + + Initialized = TRUE; } else { - Initialized = TRUE; + dissector_delete("udp.port", gtpv0_port, gtpv0_handle); + dissector_delete("tcp.port", gtpv0_port, gtpv0_handle); + + dissector_delete("udp.port", gtpv1c_port, gtpv1_handle); + dissector_delete("tcp.port", gtpv1c_port, gtpv1_handle); + dissector_delete("udp.port", gtpv1u_port, gtpv1_handle); + dissector_delete("tcp.port", gtpv1u_port, gtpv1_handle); } gtpv0_port = g_gtpv0_port; @@ -5166,15 +5172,15 @@ proto_reg_handoff_gtp(void) /* GTP v0 */ - dissector_add("udp.port", g_gtpv0_port, dissect_gtpv0, proto_gtpv0); - dissector_add("tcp.port", g_gtpv0_port, dissect_gtpv0, proto_gtpv0); + dissector_add("udp.port", g_gtpv0_port, gtpv0_handle); + dissector_add("tcp.port", g_gtpv0_port, gtpv0_handle); /* GTP v1 */ - dissector_add("udp.port", g_gtpv1c_port, dissect_gtpv1, proto_gtpv1); - dissector_add("tcp.port", g_gtpv1c_port, dissect_gtpv1, proto_gtpv1); - dissector_add("udp.port", g_gtpv1u_port, dissect_gtpv1, proto_gtpv1); - dissector_add("tcp.port", g_gtpv1u_port, dissect_gtpv1, proto_gtpv1); + dissector_add("udp.port", g_gtpv1c_port, gtpv1_handle); + dissector_add("tcp.port", g_gtpv1c_port, gtpv1_handle); + dissector_add("udp.port", g_gtpv1u_port, gtpv1_handle); + dissector_add("tcp.port", g_gtpv1u_port, gtpv1_handle); ip_handle = find_dissector("ip"); ppp_handle = find_dissector("ppp"); diff --git a/packet-hsrp.c b/packet-hsrp.c index 786122c468..3a42d515c0 100644 --- a/packet-hsrp.c +++ b/packet-hsrp.c @@ -4,10 +4,10 @@ * * Heikki Vatiainen <hessu@cs.tut.fi> * - * $Id: packet-hsrp.c,v 1.18 2001/07/12 19:42:57 guy Exp $ + * $Id: packet-hsrp.c,v 1.19 2001/12/03 03:59:34 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-vrrp.c @@ -240,5 +240,8 @@ void proto_register_hsrp(void) void proto_reg_handoff_hsrp(void) { - dissector_add("udp.port", UDP_PORT_HSRP, dissect_hsrp, proto_hsrp); + dissector_handle_t hsrp_handle; + + hsrp_handle = create_dissector_handle(dissect_hsrp, proto_hsrp); + dissector_add("udp.port", UDP_PORT_HSRP, hsrp_handle); } diff --git a/packet-http.c b/packet-http.c index ac2d5dc388..94b4f5c150 100644 --- a/packet-http.c +++ b/packet-http.c @@ -3,12 +3,11 @@ * * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-http.c,v 1.41 2001/11/26 04:52:50 hagbard Exp $ + * $Id: packet-http.c,v 1.42 2001/12/03 03:59:35 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 @@ -23,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 @@ -59,6 +56,7 @@ static int hf_http_request = -1; static gint ett_http = -1; static dissector_handle_t data_handle; +static dissector_handle_t http_handle; #define TCP_PORT_HTTP 80 #define TCP_PORT_PROXY_HTTP 3128 @@ -405,6 +403,7 @@ proto_register_http(void) proto_register_subtree_array(ett, array_length(ett)); register_dissector("http", dissect_http, proto_http); + http_handle = find_dissector("http"); /* * Dissectors shouldn't register themselves in this table; @@ -431,35 +430,33 @@ proto_register_http(void) * Called by dissectors for protocols that run atop HTTP/TCP. */ void -http_dissector_add(guint32 port, dissector_t dissector, int proto) +http_dissector_add(guint32 port, dissector_handle_t handle) { /* * Register ourselves as the handler for that port number * over TCP. */ - dissector_add("tcp.port", port, dissect_http, proto_http); + dissector_add("tcp.port", port, http_handle); /* * And register them in *our* table for that port. */ - dissector_add("http.port", port, dissector, proto); + dissector_add("http.port", port, handle); } void proto_reg_handoff_http(void) { data_handle = find_dissector("data"); - dissector_add("tcp.port", TCP_PORT_HTTP, dissect_http, proto_http); - dissector_add("tcp.port", TCP_ALT_PORT_HTTP, dissect_http, proto_http); - dissector_add("tcp.port", TCP_PORT_PROXY_HTTP, dissect_http, - proto_http); - dissector_add("tcp.port", TCP_PORT_PROXY_ADMIN_HTTP, dissect_http, - proto_http); + dissector_add("tcp.port", TCP_PORT_HTTP, http_handle); + dissector_add("tcp.port", TCP_ALT_PORT_HTTP, http_handle); + dissector_add("tcp.port", TCP_PORT_PROXY_HTTP, http_handle); + dissector_add("tcp.port", TCP_PORT_PROXY_ADMIN_HTTP, http_handle); /* * XXX - is there anything to dissect in the body of an SSDP * request or reply? I.e., should there be an SSDP dissector? */ - dissector_add("tcp.port", TCP_PORT_SSDP, dissect_http, proto_http); - dissector_add("udp.port", UDP_PORT_SSDP, dissect_http, proto_http); + dissector_add("tcp.port", TCP_PORT_SSDP, http_handle); + dissector_add("udp.port", UDP_PORT_SSDP, http_handle); } diff --git a/packet-http.h b/packet-http.h index 372f61f1f5..e4b534cea0 100644 --- a/packet-http.h +++ b/packet-http.h @@ -1,11 +1,10 @@ /* packet-http.h * - * $Id: packet-http.h,v 1.5 2001/01/11 06:30:54 guy Exp $ + * $Id: packet-http.h,v 1.6 2001/12/03 03:59:35 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 @@ -25,6 +24,6 @@ #ifndef __PACKET_HTTP_H__ #define __PACKET_HTTP_H__ -void http_dissector_add(guint32 port, dissector_t dissector, int proto); +void http_dissector_add(guint32 port, dissector_handle_t handle); #endif diff --git a/packet-icap.c b/packet-icap.c index 225794b617..fe3b106d18 100644 --- a/packet-icap.c +++ b/packet-icap.c @@ -298,6 +298,9 @@ proto_register_icap(void) void proto_reg_handoff_icap(void) { + dissector_handle_t icap_handle; + data_handle = find_dissector("data"); - dissector_add("tcp.port", TCP_PORT_ICAP, dissect_icap, proto_icap); + icap_handle = create_dissector_handle(dissect_icap, proto_icap); + dissector_add("tcp.port", TCP_PORT_ICAP, icap_handle); } diff --git a/packet-icmpv6.c b/packet-icmpv6.c index a4689481bf..d7f50d43a6 100644 --- a/packet-icmpv6.c +++ b/packet-icmpv6.c @@ -1,7 +1,7 @@ /* packet-icmpv6.c * Routines for ICMPv6 packet disassembly * - * $Id: packet-icmpv6.c,v 1.54 2001/11/25 22:51:13 hagbard Exp $ + * $Id: packet-icmpv6.c,v 1.55 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1454,7 +1454,10 @@ proto_register_icmpv6(void) void proto_reg_handoff_icmpv6(void) { - dissector_add("ip.proto", IP_PROTO_ICMPV6, dissect_icmpv6, proto_icmpv6); + dissector_handle_t icmpv6_handle; + + icmpv6_handle = create_dissector_handle(dissect_icmpv6, proto_icmpv6); + dissector_add("ip.proto", IP_PROTO_ICMPV6, icmpv6_handle); /* * Get a handle for the IPv6 dissector. diff --git a/packet-icp.c b/packet-icp.c index 84ab7e228c..4036fe8295 100644 --- a/packet-icp.c +++ b/packet-icp.c @@ -1,13 +1,15 @@ /* packet-icp.c * Routines for ICP (internet cache protocol) packet disassembly * RFC 2186 && RFC 2187 + * By Peter Torvals + * Copyright 1999 Peter Torvals * - * $Id: packet-icp.c,v 1.18 2001/06/18 02:17:46 guy Exp $ + * $Id: packet-icp.c,v 1.19 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer - * By Peter Torvals - * Copyright 1999 Peter Torvals - + * 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 * as published by the Free Software Foundation; either version 2 @@ -253,5 +255,8 @@ proto_register_icp(void) void proto_reg_handoff_icp(void) { - dissector_add("udp.port", UDP_PORT_ICP, dissect_icp, proto_icp); + dissector_handle_t icp_handle; + + icp_handle = create_dissector_handle(dissect_icp, proto_icp); + dissector_add("udp.port", UDP_PORT_ICP, icp_handle); } diff --git a/packet-icq.c b/packet-icq.c index e26a010c57..063421b73a 100644 --- a/packet-icq.c +++ b/packet-icq.c @@ -1,7 +1,7 @@ /* packet-icq.c * Routines for ICQ packet disassembly * - * $Id: packet-icq.c,v 1.35 2001/07/03 09:08:03 guy Exp $ + * $Id: packet-icq.c,v 1.36 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2143,5 +2143,8 @@ proto_register_icq(void) void proto_reg_handoff_icq(void) { - dissector_add("udp.port", UDP_PORT_ICQ, dissect_icq, proto_icq); + dissector_handle_t icq_handle; + + icq_handle = create_dissector_handle(dissect_icq, proto_icq); + dissector_add("udp.port", UDP_PORT_ICQ, icq_handle); } diff --git a/packet-ieee80211.c b/packet-ieee80211.c index 9c06249019..435309b704 100644 --- a/packet-ieee80211.c +++ b/packet-ieee80211.c @@ -3,7 +3,7 @@ * Copyright 2000, Axis Communications AB * Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com * - * $Id: packet-ieee80211.c,v 1.44 2001/11/28 07:11:07 guy Exp $ + * $Id: packet-ieee80211.c,v 1.45 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1900,6 +1900,8 @@ proto_register_wlan (void) void proto_reg_handoff_wlan(void) { + dissector_handle_t ieee80211_handle; + /* * Get handles for the LLC and IPX dissectors. */ @@ -1907,6 +1909,6 @@ proto_reg_handoff_wlan(void) ipx_handle = find_dissector("ipx"); data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11, dissect_ieee80211, - proto_wlan); + ieee80211_handle = find_dissector("wlan"); + dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle); } diff --git a/packet-igmp.c b/packet-igmp.c index ecdd054416..914b1872bb 100644 --- a/packet-igmp.c +++ b/packet-igmp.c @@ -1,7 +1,7 @@ /* packet-igmp.c 2001 Ronnie Sahlberg <rsahlber@bigpond.net.au> * Routines for IGMP packet disassembly * - * $Id: packet-igmp.c,v 1.12 2001/07/12 07:05:33 guy Exp $ + * $Id: packet-igmp.c,v 1.13 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1085,5 +1085,8 @@ proto_register_igmp(void) void proto_reg_handoff_igmp(void) { - dissector_add("ip.proto", IP_PROTO_IGMP, dissect_igmp, proto_igmp); + dissector_handle_t igmp_handle; + + igmp_handle = create_dissector_handle(dissect_igmp, proto_igmp); + dissector_add("ip.proto", IP_PROTO_IGMP, igmp_handle); } diff --git a/packet-igrp.c b/packet-igrp.c index d7869569ec..2fbf1060e6 100644 --- a/packet-igrp.c +++ b/packet-igrp.c @@ -2,7 +2,7 @@ * Routines for IGRP dissection * Copyright 2000, Paul Ionescu <paul@acorp.ro> * - * $Id: packet-igrp.c,v 1.8 2001/06/18 02:17:47 guy Exp $ + * $Id: packet-igrp.c,v 1.9 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -205,7 +205,10 @@ void proto_register_igrp(void) void proto_reg_handoff_igrp(void) { - dissector_add("ip.proto", IP_PROTO_IGRP, dissect_igrp, proto_igrp); + dissector_handle_t igrp_handle; + + igrp_handle = create_dissector_handle(dissect_igrp, proto_igrp); + dissector_add("ip.proto", IP_PROTO_IGRP, igrp_handle); } /* IGRP Packet structure: diff --git a/packet-imap.c b/packet-imap.c index 8a1c506f42..e200caf86b 100644 --- a/packet-imap.c +++ b/packet-imap.c @@ -2,10 +2,10 @@ * Routines for imap packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-imap.c,v 1.15 2001/06/18 02:17:47 guy Exp $ + * $Id: packet-imap.c,v 1.16 2001/12/03 03:59:35 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-tftp.c @@ -182,5 +182,8 @@ proto_register_imap(void) void proto_reg_handoff_imap(void) { - dissector_add("tcp.port", TCP_PORT_IMAP, dissect_imap, proto_imap); + dissector_handle_t imap_handle; + + imap_handle = create_dissector_handle(dissect_imap, proto_imap); + dissector_add("tcp.port", TCP_PORT_IMAP, imap_handle); } diff --git a/packet-ip.c b/packet-ip.c index cec90b0678..f4184d2e13 100644 --- a/packet-ip.c +++ b/packet-ip.c @@ -1,7 +1,7 @@ /* packet-ip.c * Routines for IP and miscellaneous IP protocol packet disassembly * - * $Id: packet-ip.c,v 1.149 2001/12/02 00:07:46 guy Exp $ + * $Id: packet-ip.c,v 1.150 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1798,18 +1798,21 @@ proto_register_ip(void) void proto_reg_handoff_ip(void) { + dissector_handle_t ip_handle; + data_handle = find_dissector("data"); - dissector_add("ethertype", ETHERTYPE_IP, dissect_ip, proto_ip); - dissector_add("ppp.protocol", PPP_IP, dissect_ip, proto_ip); - dissector_add("ppp.protocol", ETHERTYPE_IP, dissect_ip, proto_ip); - dissector_add("gre.proto", ETHERTYPE_IP, dissect_ip, proto_ip); - dissector_add("gre.proto", GRE_WCCP, dissect_ip, proto_ip); - dissector_add("llc.dsap", SAP_IP, dissect_ip, proto_ip); - dissector_add("ip.proto", IP_PROTO_IPIP, dissect_ip, proto_ip); - dissector_add("null.type", BSD_AF_INET, dissect_ip, proto_ip); - dissector_add("chdlctype", ETHERTYPE_IP, dissect_ip, proto_ip); - dissector_add("fr.ietf", NLPID_IP, dissect_ip, proto_ip); - dissector_add("x.25.spi", NLPID_IP, dissect_ip, proto_ip); + ip_handle = find_dissector("ip"); + dissector_add("ethertype", ETHERTYPE_IP, ip_handle); + dissector_add("ppp.protocol", PPP_IP, ip_handle); + dissector_add("ppp.protocol", ETHERTYPE_IP, ip_handle); + dissector_add("gre.proto", ETHERTYPE_IP, ip_handle); + dissector_add("gre.proto", GRE_WCCP, ip_handle); + dissector_add("llc.dsap", SAP_IP, ip_handle); + dissector_add("ip.proto", IP_PROTO_IPIP, ip_handle); + dissector_add("null.type", BSD_AF_INET, ip_handle); + dissector_add("chdlctype", ETHERTYPE_IP, ip_handle); + dissector_add("fr.ietf", NLPID_IP, ip_handle); + dissector_add("x.25.spi", NLPID_IP, ip_handle); } void @@ -1916,10 +1919,13 @@ proto_register_icmp(void) void proto_reg_handoff_icmp(void) { + dissector_handle_t icmp_handle; + /* * Get handle for the IP dissector. */ ip_handle = find_dissector("ip"); - dissector_add("ip.proto", IP_PROTO_ICMP, dissect_icmp, proto_icmp); + icmp_handle = create_dissector_handle(dissect_icmp, proto_icmp); + dissector_add("ip.proto", IP_PROTO_ICMP, icmp_handle); } diff --git a/packet-ipp.c b/packet-ipp.c index faf7b57572..bf30d44ef0 100644 --- a/packet-ipp.c +++ b/packet-ipp.c @@ -3,7 +3,7 @@ * * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-ipp.c,v 1.25 2001/11/27 07:13:25 guy Exp $ + * $Id: packet-ipp.c,v 1.26 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -22,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 @@ -562,9 +560,12 @@ proto_register_ipp(void) void proto_reg_handoff_ipp(void) { + dissector_handle_t ipp_handle; + /* * Register ourselves as running atop HTTP and using port 631. */ + ipp_handle = create_dissector_handle(dissect_ipp, proto_ipp); + http_dissector_add(631, ipp_handle); data_handle = find_dissector("data"); - http_dissector_add(631, dissect_ipp, proto_ipp); } diff --git a/packet-ipsec.c b/packet-ipsec.c index cadf394cb8..0a74e0c15a 100644 --- a/packet-ipsec.c +++ b/packet-ipsec.c @@ -1,7 +1,7 @@ /* packet-ipsec.c * Routines for IPsec/IPComp packet disassembly * - * $Id: packet-ipsec.c,v 1.34 2001/11/26 04:52:50 hagbard Exp $ + * $Id: packet-ipsec.c,v 1.35 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -350,8 +350,13 @@ proto_register_ipsec(void) void proto_reg_handoff_ipsec(void) { + dissector_handle_t esp_handle, ah_handle, ipcomp_handle; + data_handle = find_dissector("data"); - dissector_add("ip.proto", IP_PROTO_AH, dissect_ah, proto_ah); - dissector_add("ip.proto", IP_PROTO_ESP, dissect_esp, proto_esp); - dissector_add("ip.proto", IP_PROTO_IPCOMP, dissect_ipcomp, proto_ipcomp); + ah_handle = find_dissector("ah"); + dissector_add("ip.proto", IP_PROTO_AH, ah_handle); + esp_handle = find_dissector("esp"); + dissector_add("ip.proto", IP_PROTO_ESP, esp_handle); + ipcomp_handle = create_dissector_handle(dissect_ipcomp, proto_ipcomp); + dissector_add("ip.proto", IP_PROTO_IPCOMP, ipcomp_handle); } diff --git a/packet-ipv6.c b/packet-ipv6.c index aee65bf2c2..a95f9e0839 100644 --- a/packet-ipv6.c +++ b/packet-ipv6.c @@ -1,7 +1,7 @@ /* packet-ipv6.c * Routines for IPv6 packet disassembly * - * $Id: packet-ipv6.c,v 1.69 2001/12/02 00:07:46 guy Exp $ + * $Id: packet-ipv6.c,v 1.70 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1153,16 +1153,20 @@ proto_register_ipv6(void) void proto_reg_handoff_ipv6(void) { + dissector_handle_t ipv6_handle, ipv6_none_handle; + data_handle = find_dissector("data"); - dissector_add("ethertype", ETHERTYPE_IPv6, dissect_ipv6, proto_ipv6); - dissector_add("ppp.protocol", PPP_IPV6, dissect_ipv6, proto_ipv6); - dissector_add("ppp.protocol", ETHERTYPE_IPv6, dissect_ipv6, proto_ipv6); - dissector_add("gre.proto", ETHERTYPE_IPv6, dissect_ipv6, proto_ipv6); - dissector_add("ip.proto", IP_PROTO_IPV6, dissect_ipv6, proto_ipv6); - dissector_add("ip.proto", IP_PROTO_NONE, dissect_ipv6_none, proto_ipv6); - dissector_add("null.type", BSD_AF_INET6_BSD, dissect_ipv6, proto_ipv6); - dissector_add("null.type", BSD_AF_INET6_FREEBSD, dissect_ipv6, proto_ipv6); - dissector_add("chdlctype", ETHERTYPE_IPv6, dissect_ipv6, proto_ipv6); - dissector_add("fr.ietf", NLPID_IP6, dissect_ipv6, proto_ipv6); - dissector_add("x.25.spi", NLPID_IP6, dissect_ipv6, proto_ipv6); + ipv6_handle = find_dissector("ipv6"); + dissector_add("ethertype", ETHERTYPE_IPv6, ipv6_handle); + dissector_add("ppp.protocol", PPP_IPV6, ipv6_handle); + dissector_add("ppp.protocol", ETHERTYPE_IPv6, ipv6_handle); + dissector_add("gre.proto", ETHERTYPE_IPv6, ipv6_handle); + dissector_add("ip.proto", IP_PROTO_IPV6, ipv6_handle); + ipv6_none_handle = create_dissector_handle(dissect_ipv6_none, proto_ipv6); + dissector_add("ip.proto", IP_PROTO_NONE, ipv6_none_handle); + dissector_add("null.type", BSD_AF_INET6_BSD, ipv6_handle); + dissector_add("null.type", BSD_AF_INET6_FREEBSD, ipv6_handle); + dissector_add("chdlctype", ETHERTYPE_IPv6, ipv6_handle); + dissector_add("fr.ietf", NLPID_IP6, ipv6_handle); + dissector_add("x.25.spi", NLPID_IP6, ipv6_handle); } diff --git a/packet-ipx.c b/packet-ipx.c index e697f4d88e..f7e669b3d6 100644 --- a/packet-ipx.c +++ b/packet-ipx.c @@ -2,7 +2,7 @@ * Routines for NetWare's IPX * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-ipx.c,v 1.95 2001/11/25 22:51:13 hagbard Exp $ + * $Id: packet-ipx.c,v 1.96 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -981,20 +981,25 @@ proto_register_ipx(void) void proto_reg_handoff_ipx(void) { - dissector_add("udp.port", UDP_PORT_IPX, dissect_ipx, proto_ipx); - dissector_add("ethertype", ETHERTYPE_IPX, dissect_ipx, proto_ipx); - dissector_add("chdlctype", ETHERTYPE_IPX, dissect_ipx, proto_ipx); - dissector_add("ppp.protocol", PPP_IPX, dissect_ipx, proto_ipx); - dissector_add("llc.dsap", SAP_NETWARE, dissect_ipx, proto_ipx); - dissector_add("null.type", BSD_AF_IPX, dissect_ipx, proto_ipx); - dissector_add("gre.proto", ETHERTYPE_IPX, dissect_ipx, proto_ipx); - dissector_add("ipx.packet_type", IPX_PACKET_TYPE_SPX, dissect_spx, - proto_spx); - dissector_add("ipx.socket", IPX_SOCKET_SAP, dissect_ipxsap, - proto_sap); - dissector_add("ipx.socket", IPX_SOCKET_IPXRIP, dissect_ipxrip, - proto_ipxrip); - dissector_add("ipx.socket", IPX_SOCKET_IPX_MESSAGE, dissect_ipxmsg, - proto_ipxmsg); + dissector_handle_t ipx_handle, spx_handle; + dissector_handle_t ipxsap_handle, ipxrip_handle; + dissector_handle_t ipxmsg_handle; + + ipx_handle = find_dissector("ipx"); + dissector_add("udp.port", UDP_PORT_IPX, ipx_handle); + dissector_add("ethertype", ETHERTYPE_IPX, ipx_handle); + dissector_add("chdlctype", ETHERTYPE_IPX, ipx_handle); + dissector_add("ppp.protocol", PPP_IPX, ipx_handle); + dissector_add("llc.dsap", SAP_NETWARE, ipx_handle); + dissector_add("null.type", BSD_AF_IPX, ipx_handle); + dissector_add("gre.proto", ETHERTYPE_IPX, ipx_handle); + spx_handle = create_dissector_handle(dissect_spx, proto_spx); + dissector_add("ipx.packet_type", IPX_PACKET_TYPE_SPX, spx_handle); + ipxsap_handle = find_dissector("ipxsap"); + dissector_add("ipx.socket", IPX_SOCKET_SAP, ipxsap_handle); + ipxrip_handle = create_dissector_handle(dissect_ipxrip, proto_ipxrip); + dissector_add("ipx.socket", IPX_SOCKET_IPXRIP, ipxrip_handle); + ipxmsg_handle = create_dissector_handle(dissect_ipxmsg, proto_ipxmsg); + dissector_add("ipx.socket", IPX_SOCKET_IPX_MESSAGE, ipxmsg_handle); data_handle = find_dissector("data"); } diff --git a/packet-irc.c b/packet-irc.c index 2a4b821a96..2d1f4f35ab 100644 --- a/packet-irc.c +++ b/packet-irc.c @@ -1,10 +1,10 @@ /* packet-irc.c * Routines for IRC packet dissection * - * $Id: packet-irc.c,v 1.14 2001/06/18 02:17:47 guy Exp $ + * $Id: packet-irc.c,v 1.15 2001/12/03 03:59:35 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-tftp.c @@ -164,6 +164,8 @@ proto_register_irc(void) void proto_reg_handoff_irc(void) { - dissector_add("tcp.port", TCP_PORT_IRC, dissect_irc, proto_irc); -} + dissector_handle_t irc_handle; + irc_handle = create_dissector_handle(dissect_irc, proto_irc); + dissector_add("tcp.port", TCP_PORT_IRC, irc_handle); +} diff --git a/packet-isakmp.c b/packet-isakmp.c index 41668adb0d..900f56345c 100644 --- a/packet-isakmp.c +++ b/packet-isakmp.c @@ -4,7 +4,7 @@ * for ISAKMP (RFC 2407) * Brad Robel-Forrest <brad.robel-forrest@watchguard.com> * - * $Id: packet-isakmp.c,v 1.49 2001/11/14 20:02:23 gram Exp $ + * $Id: packet-isakmp.c,v 1.50 2001/12/03 03:59:35 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1341,12 +1341,15 @@ proto_register_isakmp(void) void proto_reg_handoff_isakmp(void) { + dissector_handle_t isakmp_handle; + /* * Get handle for the AH & ESP dissectors. */ esp_handle = find_dissector("esp"); ah_handle = find_dissector("ah"); - dissector_add("udp.port", UDP_PORT_ISAKMP, dissect_isakmp, proto_isakmp); - dissector_add("tcp.port", TCP_PORT_ISAKMP, dissect_isakmp, proto_isakmp); + isakmp_handle = create_dissector_handle(dissect_isakmp, proto_isakmp); + dissector_add("udp.port", UDP_PORT_ISAKMP, isakmp_handle); + dissector_add("tcp.port", TCP_PORT_ISAKMP, isakmp_handle); } diff --git a/packet-isis.c b/packet-isis.c index 767b594920..d7f1f65f09 100644 --- a/packet-isis.c +++ b/packet-isis.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI network and transport protocol packet disassembly, core * bits. * - * $Id: packet-isis.c,v 1.25 2001/07/02 02:09:26 guy Exp $ + * $Id: packet-isis.c,v 1.26 2001/12/03 03:59:36 guy Exp $ * Stuart Stanley <stuarts@mxmail.net> * * Ethereal - Network traffic analyzer @@ -22,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 @@ -321,5 +319,8 @@ proto_register_isis(void) { void proto_reg_handoff_isis(void) { - dissector_add("osinl", NLPID_ISO10589_ISIS, dissect_isis, proto_isis); + dissector_handle_t isis_handle; + + isis_handle = create_dissector_handle(dissect_isis, proto_isis); + dissector_add("osinl", NLPID_ISO10589_ISIS, isis_handle); } diff --git a/packet-isup.c b/packet-isup.c index 79b1dcd6f9..741ecb71fc 100644 --- a/packet-isup.c +++ b/packet-isup.c @@ -2,7 +2,7 @@ * Routines for ISUP dissection * Copyright 2001, Martina Obermeier <martina.obermeier@icn.siemens.de> * - * $Id: packet-isup.c,v 1.5 2001/08/28 08:28:14 guy Exp $ + * $Id: packet-isup.c,v 1.6 2001/12/03 03:59:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -4394,5 +4394,9 @@ proto_register_isup(void) void proto_reg_handoff_isup(void) { - dissector_add("mtp3.service_indicator", MTP3_ISUP_SERVICE_INDICATOR, dissect_isup, proto_isup); + dissector_handle_t isup_handle; + + isup_handle = create_dissector_handle(dissect_isup, proto_isup); + dissector_add("mtp3.service_indicator", MTP3_ISUP_SERVICE_INDICATOR, + isup_handle); } diff --git a/packet-iua.c b/packet-iua.c index 9a3e0ad672..ba27ab637e 100644 --- a/packet-iua.c +++ b/packet-iua.c @@ -8,7 +8,7 @@ * * Copyright 2000, Michael Tüxen <Michael.Tuexen@icn.siemens.de> * - * $Id: packet-iua.c,v 1.8 2001/10/23 05:23:58 guy Exp $ + * $Id: packet-iua.c,v 1.9 2001/12/03 03:59:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1008,6 +1008,9 @@ proto_register_iua(void) void proto_reg_handoff_iua(void) { - dissector_add("sctp.port", SCTP_PORT_IUA, dissect_iua, proto_iua); - dissector_add("sctp.ppi", IUA_PAYLOAD_PROTO_ID, dissect_iua, proto_iua); + dissector_handle_t iua_handle; + + iua_handle = create_dissector_handle(dissect_iua, proto_iua); + dissector_add("sctp.port", SCTP_PORT_IUA, iua_handle); + dissector_add("sctp.ppi", IUA_PAYLOAD_PROTO_ID, iua_handle); } diff --git a/packet-kerberos.c b/packet-kerberos.c index 0e7a5349bb..b7021687be 100644 --- a/packet-kerberos.c +++ b/packet-kerberos.c @@ -3,11 +3,11 @@ * Wes Hardaker (c) 2000 * wjhardaker@ucdavis.edu * - * $Id: packet-kerberos.c,v 1.17 2001/10/26 18:28:16 gram Exp $ + * $Id: packet-kerberos.c,v 1.18 2001/12/03 03:59:36 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 * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -1354,10 +1354,11 @@ proto_register_kerberos(void) { void proto_reg_handoff_kerberos(void) { - dissector_add("udp.port", UDP_PORT_KERBEROS, dissect_kerberos, - proto_kerberos); - dissector_add("tcp.port", TCP_PORT_KERBEROS, dissect_kerberos, - proto_kerberos); + dissector_handle_t kerberos_handle; + + kerberos_handle = create_dissector_handle(dissect_kerberos, proto_kerberos); + dissector_add("udp.port", UDP_PORT_KERBEROS, kerberos_handle); + dissector_add("tcp.port", TCP_PORT_KERBEROS, kerberos_handle); } /* diff --git a/packet-l2tp.c b/packet-l2tp.c index 2ada7aa40a..9db3f74fba 100644 --- a/packet-l2tp.c +++ b/packet-l2tp.c @@ -7,7 +7,7 @@ * Laurent Cazalet <laurent.cazalet@mailclub.net> * Thomas Parvais <thomas.parvais@advalvas.be> * - * $Id: packet-l2tp.c,v 1.27 2001/10/29 21:13:07 guy Exp $ + * $Id: packet-l2tp.c,v 1.28 2001/12/03 03:59:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1066,8 +1066,10 @@ proto_register_l2tp(void) void proto_reg_handoff_l2tp(void) { - dissector_add("udp.port", UDP_PORT_L2TP, dissect_l2tp, - proto_l2tp); + dissector_handle_t l2tp_handle; + + l2tp_handle = create_dissector_handle(dissect_l2tp, proto_l2tp); + dissector_add("udp.port", UDP_PORT_L2TP, l2tp_handle); /* * Get a handle for the PPP-in-HDLC-like-framing dissector. diff --git a/packet-lapb.c b/packet-lapb.c index f9383b99d0..b0ad0e9a6e 100644 --- a/packet-lapb.c +++ b/packet-lapb.c @@ -2,12 +2,11 @@ * Routines for lapb frame disassembly * Olivier Abad <oabad@cybercable.fr> * - * $Id: packet-lapb.c,v 1.30 2001/06/18 02:17:48 guy Exp $ + * $Id: packet-lapb.c,v 1.31 2001/12/03 03:59:36 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * 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 @@ -141,10 +140,13 @@ proto_register_lapb(void) void proto_reg_handoff_lapb(void) { + dissector_handle_t lapb_handle; + /* * Get a handle for the X.25 dissector. */ x25_handle = find_dissector("x.25"); - dissector_add("wtap_encap", WTAP_ENCAP_LAPB, dissect_lapb, proto_lapb); + lapb_handle = find_dissector("lapb"); + dissector_add("wtap_encap", WTAP_ENCAP_LAPB, lapb_handle); } diff --git a/packet-lapbether.c b/packet-lapbether.c index ad1616a1b0..ab695089a7 100644 --- a/packet-lapbether.c +++ b/packet-lapbether.c @@ -3,12 +3,11 @@ * Richard Sharpe <rsharpe@ns.aus.com> based on the lapb module by * Olivier Abad <oabad@cybercable.fr> * - * $Id: packet-lapbether.c,v 1.6 2001/06/18 02:17:48 guy Exp $ + * $Id: packet-lapbether.c,v 1.7 2001/12/03 03:59:36 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * 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 @@ -100,12 +99,15 @@ proto_register_lapbether(void) void proto_reg_handoff_lapbether(void) { + dissector_handle_t lapbether_handle; /* * Get a handle for the LAPB dissector. */ lapb_handle = find_dissector("lapb"); - dissector_add("ethertype", ETHERTYPE_DEC, dissect_lapbether, proto_lapbether); + lapbether_handle = create_dissector_handle(dissect_lapbether, + proto_lapbether); + dissector_add("ethertype", ETHERTYPE_DEC, lapbether_handle); } diff --git a/packet-lapd.c b/packet-lapd.c index fea72a6be0..059c0d470a 100644 --- a/packet-lapd.c +++ b/packet-lapd.c @@ -2,12 +2,11 @@ * Routines for LAPD frame disassembly * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-lapd.c,v 1.25 2001/11/25 22:51:13 hagbard Exp $ + * $Id: packet-lapd.c,v 1.26 2001/12/03 03:59:36 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 @@ -205,11 +204,14 @@ proto_register_lapd(void) void proto_reg_handoff_lapd(void) { + dissector_handle_t lapd_handle; + /* * Get handle for the Q.931 dissector. */ q931_handle = find_dissector("q931"); data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_LAPD, dissect_lapd, proto_lapd); + lapd_handle = create_dissector_handle(dissect_lapd, proto_lapd); + dissector_add("wtap_encap", WTAP_ENCAP_LAPD, lapd_handle); } diff --git a/packet-ldap.c b/packet-ldap.c index 447f196860..60a9e20434 100644 --- a/packet-ldap.c +++ b/packet-ldap.c @@ -1,10 +1,10 @@ /* packet-ldap.c * Routines for ldap packet dissection * - * $Id: packet-ldap.c,v 1.28 2001/10/26 18:28:16 gram Exp $ + * $Id: packet-ldap.c,v 1.29 2001/12/03 03:59:36 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 @@ -1217,5 +1217,8 @@ proto_register_ldap(void) void proto_reg_handoff_ldap(void) { - dissector_add("tcp.port", TCP_PORT_LDAP, dissect_ldap, proto_ldap); + dissector_handle_t ldap_handle; + + ldap_handle = create_dissector_handle(dissect_ldap, proto_ldap); + dissector_add("tcp.port", TCP_PORT_LDAP, ldap_handle); } diff --git a/packet-ldp.c b/packet-ldp.c index 569fefd284..8a37020f45 100644 --- a/packet-ldp.c +++ b/packet-ldp.c @@ -1,13 +1,14 @@ /* packet-ldp.c * Routines for LDP (RFC 3036) packet disassembly * - * $Id: packet-ldp.c,v 1.21 2001/11/27 05:01:14 guy Exp $ + * $Id: packet-ldp.c,v 1.22 2001/12/03 03:59:36 guy Exp $ * * Copyright (c) November 2000 by Richard Sharpe <rsharpe@ns.aus.com> * * 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 @@ -883,16 +884,20 @@ void proto_reg_handoff_ldp(void) { static int ldp_prefs_initialized = FALSE; + static dissector_handle_t ldp_tcp_handle, ldp_handle; + + if (!ldp_prefs_initialized) { - if (ldp_prefs_initialized) { + ldp_tcp_handle = create_dissector_handle(dissect_ldp_tcp, proto_ldp); + ldp_handle = create_dissector_handle(dissect_ldp, proto_ldp); - dissector_delete("tcp.port", tcp_port, dissect_ldp); - dissector_delete("udp.port", udp_port, dissect_ldp); + ldp_prefs_initialized = TRUE; } else { - ldp_prefs_initialized = TRUE; + dissector_delete("tcp.port", tcp_port, ldp_tcp_handle); + dissector_delete("udp.port", udp_port, ldp_handle); } @@ -901,7 +906,7 @@ proto_reg_handoff_ldp(void) tcp_port = global_ldp_tcp_port; udp_port = global_ldp_udp_port; - dissector_add("tcp.port", global_ldp_tcp_port, dissect_ldp_tcp, proto_ldp); - dissector_add("udp.port", global_ldp_udp_port, dissect_ldp, proto_ldp); + dissector_add("tcp.port", global_ldp_tcp_port, ldp_tcp_handle); + dissector_add("udp.port", global_ldp_udp_port, ldp_handle); } diff --git a/packet-llc.c b/packet-llc.c index 0058f7ede0..27cb7630fe 100644 --- a/packet-llc.c +++ b/packet-llc.c @@ -2,7 +2,7 @@ * Routines for IEEE 802.2 LLC layer * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-llc.c,v 1.90 2001/11/25 22:51:13 hagbard Exp $ + * $Id: packet-llc.c,v 1.91 2001/12/03 03:59:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -559,6 +559,8 @@ proto_register_llc(void) void proto_reg_handoff_llc(void) { + dissector_handle_t llc_handle; + /* * Get handles for the BPDU, Ethernet, FDDI, and Token Ring * dissectors. @@ -569,6 +571,6 @@ proto_reg_handoff_llc(void) tr_handle = find_dissector("tr"); data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_ATM_RFC1483, dissect_llc, - proto_llc); + llc_handle = find_dissector("llc"); + dissector_add("wtap_encap", WTAP_ENCAP_ATM_RFC1483, llc_handle); } diff --git a/packet-lmi.c b/packet-lmi.c index 2b3055a75f..181d2de432 100644 --- a/packet-lmi.c +++ b/packet-lmi.c @@ -2,7 +2,7 @@ * Routines for Frame Relay Local Management Interface (LMI) disassembly * Copyright 2001, Jeffrey C. Foster <jfoste@woodward.com> * - * $Id: packet-lmi.c,v 1.6 2001/09/14 07:10:05 guy Exp $ + * $Id: packet-lmi.c,v 1.7 2001/12/03 03:59:36 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -246,5 +246,8 @@ proto_register_lmi(void) void proto_reg_handoff_lmi(void) { - dissector_add("fr.ietf", NLPID_LMI, dissect_lmi, proto_lmi); + dissector_handle_t lmi_handle; + + lmi_handle = create_dissector_handle(dissect_lmi, proto_lmi); + dissector_add("fr.ietf", NLPID_LMI, lmi_handle); } diff --git a/packet-lpd.c b/packet-lpd.c index f3cc388515..04002bc07f 100644 --- a/packet-lpd.c +++ b/packet-lpd.c @@ -2,12 +2,11 @@ * Routines for LPR and LPRng packet disassembly * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-lpd.c,v 1.30 2001/11/25 22:51:13 hagbard Exp $ + * $Id: packet-lpd.c,v 1.31 2001/12/03 03:59:37 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 @@ -194,6 +193,9 @@ proto_register_lpd(void) void proto_reg_handoff_lpd(void) { - dissector_add("tcp.port", TCP_PORT_PRINTER, &dissect_lpd, proto_lpd); + dissector_handle_t lpd_handle; + + lpd_handle = create_dissector_handle(dissect_lpd, proto_lpd); + dissector_add("tcp.port", TCP_PORT_PRINTER, lpd_handle); data_handle = find_dissector("data"); } diff --git a/packet-m2pa.c b/packet-m2pa.c index 3d745bc339..2c54f3a28b 100644 --- a/packet-m2pa.c +++ b/packet-m2pa.c @@ -5,7 +5,7 @@ * * Copyright 2001, Jeff Morriss <jeff.morriss[AT]ulticom.com> * - * $Id: packet-m2pa.c,v 1.1 2001/06/21 22:25:51 guy Exp $ + * $Id: packet-m2pa.c,v 1.2 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -391,12 +391,14 @@ proto_register_m2pa(void) void proto_reg_handoff_m2pa(void) { + dissector_handle_t m2pa_handle; + /* * Get a handle for the MTP3 dissector. */ mtp3_handle = find_dissector("mtp3"); - dissector_add("sctp.ppi", M2PA_PAYLOAD_PROTOCOL_ID, - dissect_m2pa, proto_m2pa); - dissector_add("sctp.port", SCTP_PORT_M2PA, dissect_m2pa, proto_m2pa); + m2pa_handle = create_dissector_handle(dissect_m2pa, proto_m2pa); + dissector_add("sctp.ppi", M2PA_PAYLOAD_PROTOCOL_ID, m2pa_handle); + dissector_add("sctp.port", SCTP_PORT_M2PA, m2pa_handle); } diff --git a/packet-m3ua.c b/packet-m3ua.c index a713480d53..fe2922789b 100644 --- a/packet-m3ua.c +++ b/packet-m3ua.c @@ -8,7 +8,7 @@ * * Copyright 2000, Michael Tüxen <Michael.Tuexen@icn.siemens.de> * - * $Id: packet-m3ua.c,v 1.8 2001/06/18 02:17:48 guy Exp $ + * $Id: packet-m3ua.c,v 1.9 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -966,11 +966,14 @@ proto_register_m3ua(void) void proto_reg_handoff_m3ua(void) { + dissector_handle_t m3ua_handle; + /* * Get a handle for the MTP3 dissector. */ mtp3_handle = find_dissector("mtp3"); - dissector_add("sctp.ppi", M3UA_PAYLOAD_PROTO_ID, dissect_m3ua, proto_m3ua); - dissector_add("sctp.port", SCTP_PORT_M3UA, dissect_m3ua, proto_m3ua); + m3ua_handle = create_dissector_handle(dissect_m3ua, proto_m3ua); + dissector_add("sctp.ppi", M3UA_PAYLOAD_PROTO_ID, m3ua_handle); + dissector_add("sctp.port", SCTP_PORT_M3UA, m3ua_handle); } diff --git a/packet-mapi.c b/packet-mapi.c index 78e104850e..e3a291eace 100644 --- a/packet-mapi.c +++ b/packet-mapi.c @@ -1,10 +1,10 @@ /* packet-mapi.c * Routines for MSX mapi packet dissection * - * $Id: packet-mapi.c,v 1.16 2001/06/18 02:17:48 guy Exp $ + * $Id: packet-mapi.c,v 1.17 2001/12/03 03:59:37 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-tftp.c @@ -131,5 +131,8 @@ proto_register_mapi(void) void proto_reg_handoff_mapi(void) { - dissector_add("tcp.port", TCP_PORT_MAPI, dissect_mapi, proto_mapi); + dissector_handle_t mapi_handle; + + mapi_handle = create_dissector_handle(dissect_mapi, proto_mapi); + dissector_add("tcp.port", TCP_PORT_MAPI, mapi_handle); } diff --git a/packet-mbtcp.c b/packet-mbtcp.c index bb110ba579..cbb79b55f2 100644 --- a/packet-mbtcp.c +++ b/packet-mbtcp.c @@ -10,7 +10,7 @@ * * for information on Modbus/TCP. * - * $Id: packet-mbtcp.c,v 1.5 2001/09/14 07:10:05 guy Exp $ + * $Id: packet-mbtcp.c,v 1.6 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -416,5 +416,8 @@ proto_register_modbus(void) void proto_reg_handoff_mbtcp(void) { - dissector_add("tcp.port", TCP_PORT_MBTCP, dissect_mbtcp, proto_mbtcp); + dissector_handle_t mbtcp_handle; + + mbtcp_handle = create_dissector_handle(dissect_mbtcp, proto_mbtcp); + dissector_add("tcp.port", TCP_PORT_MBTCP, mbtcp_handle); } diff --git a/packet-mip.c b/packet-mip.c index cae0135bc5..6d15070e25 100644 --- a/packet-mip.c +++ b/packet-mip.c @@ -2,7 +2,7 @@ * Routines for Mobile IP dissection * Copyright 2000, Stefan Raab <sraab@cisco.com> * - * $Id: packet-mip.c,v 1.22 2001/11/21 02:01:05 guy Exp $ + * $Id: packet-mip.c,v 1.23 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -552,5 +552,8 @@ void proto_register_mip(void) void proto_reg_handoff_mip(void) { - dissector_add("udp.port", UDP_PORT_MIP, dissect_mip, proto_mip); + dissector_handle_t mip_handle; + + mip_handle = find_dissector("mip"); + dissector_add("udp.port", UDP_PORT_MIP, mip_handle); } diff --git a/packet-mpls.c b/packet-mpls.c index c49ddafca3..dbb1b1d174 100644 --- a/packet-mpls.c +++ b/packet-mpls.c @@ -3,7 +3,7 @@ * * (c) Copyright Ashok Narayanan <ashokn@cisco.com> * - * $Id: packet-mpls.c,v 1.22 2001/11/07 20:26:37 guy Exp $ + * $Id: packet-mpls.c,v 1.23 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -206,12 +206,15 @@ proto_register_mpls(void) void proto_reg_handoff_mpls(void) { + dissector_handle_t mpls_handle; + /* * Get a handle for the IPv4 and IPv6 dissectors. */ ipv4_handle = find_dissector("ip"); ipv6_handle = find_dissector("ipv6"); - dissector_add("ethertype", ETHERTYPE_MPLS, dissect_mpls, proto_mpls); - dissector_add("ppp.protocol", PPP_MPLS_UNI, dissect_mpls, proto_mpls); + mpls_handle = create_dissector_handle(dissect_mpls, proto_mpls); + dissector_add("ethertype", ETHERTYPE_MPLS, mpls_handle); + dissector_add("ppp.protocol", PPP_MPLS_UNI, mpls_handle); } diff --git a/packet-msdp.c b/packet-msdp.c index 1d9182d989..3510f75dcc 100644 --- a/packet-msdp.c +++ b/packet-msdp.c @@ -4,7 +4,7 @@ * * Copyright 2001, Heikki Vatiainen <hessu@cs.tut.fi> * - * $Id: packet-msdp.c,v 1.2 2001/07/11 17:56:31 guy Exp $ + * $Id: packet-msdp.c,v 1.3 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -544,10 +544,12 @@ proto_register_msdp(void) } void -proto_reg_handoff_PROTOABBREV(void) +proto_reg_handoff_msdp(void) { - dissector_add("tcp.port", 639, dissect_msdp, - proto_msdp); + dissector_handle_t msdp_handle; + + msdp_handle = create_dissector_handle(dissect_msdp, proto_msdp); + dissector_add("tcp.port", 639, msdp_handle); ip_handle = find_dissector("ip"); diff --git a/packet-msproxy.c b/packet-msproxy.c index fa265f6844..31860bdbbe 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.23 2001/11/27 07:13:25 guy Exp $ + * $Id: packet-msproxy.c,v 1.24 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1301,6 +1301,9 @@ proto_reg_handoff_msproxy(void) { /* dissector install routine */ - dissector_add("udp.port", UDP_PORT_MSPROXY, dissect_msproxy, + dissector_handle_t msproxy_handle; + + msproxy_handle = create_dissector_handle(dissect_msproxy, proto_msproxy); + dissector_add("udp.port", UDP_PORT_MSPROXY, msproxy_handle); } diff --git a/packet-nbipx.c b/packet-nbipx.c index 04983904cf..479224ec73 100644 --- a/packet-nbipx.c +++ b/packet-nbipx.c @@ -2,7 +2,7 @@ * Routines for NetBIOS over IPX packet disassembly * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-nbipx.c,v 1.42 2001/11/13 23:55:30 gram Exp $ + * $Id: packet-nbipx.c,v 1.43 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -536,8 +536,10 @@ proto_register_nbipx(void) void proto_reg_handoff_nbipx(void) { - dissector_add("ipx.socket", IPX_SOCKET_NETBIOS, dissect_nbipx, - proto_nbipx); + dissector_handle_t nbipx_handle; + + nbipx_handle = create_dissector_handle(dissect_nbipx, proto_nbipx); + dissector_add("ipx.socket", IPX_SOCKET_NETBIOS, nbipx_handle); } /* @@ -794,8 +796,11 @@ proto_register_nmpi(void) void proto_reg_handoff_nmpi(void) { + dissector_handle_t nmpi_handle; + + nmpi_handle = create_dissector_handle(dissect_nmpi, proto_nmpi); dissector_add("ipx.socket", IPX_SOCKET_NWLINK_SMB_NAMEQUERY, - dissect_nmpi, proto_nmpi); + nmpi_handle); dissector_add("ipx.socket", IPX_SOCKET_NWLINK_SMB_MAILSLOT, - dissect_nmpi, proto_nmpi); + nmpi_handle); } diff --git a/packet-nbns.c b/packet-nbns.c index 1c7647b74a..b64d3bc3cc 100644 --- a/packet-nbns.c +++ b/packet-nbns.c @@ -3,7 +3,7 @@ * to when it had only NBNS) * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-nbns.c,v 1.65 2001/11/21 02:01:05 guy Exp $ + * $Id: packet-nbns.c,v 1.66 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1807,8 +1807,13 @@ proto_register_nbt(void) void proto_reg_handoff_nbt(void) { - dissector_add("udp.port", UDP_PORT_NBNS, dissect_nbns, proto_nbns); - dissector_add("udp.port", UDP_PORT_NBDGM, dissect_nbdgm, proto_nbdgm); - dissector_add("tcp.port", TCP_PORT_NBSS, dissect_nbss, proto_nbss); - dissector_add("tcp.port", TCP_PORT_CIFS, dissect_nbss, proto_nbss); + dissector_handle_t nbns_handle, nbdgm_handle, nbss_handle; + + nbns_handle = create_dissector_handle(dissect_nbns, proto_nbns); + dissector_add("udp.port", UDP_PORT_NBNS, nbns_handle); + nbdgm_handle = create_dissector_handle(dissect_nbdgm, proto_nbdgm); + dissector_add("udp.port", UDP_PORT_NBDGM, nbdgm_handle); + nbss_handle = create_dissector_handle(dissect_nbss, proto_nbss); + dissector_add("tcp.port", TCP_PORT_NBSS, nbss_handle); + dissector_add("tcp.port", TCP_PORT_CIFS, nbss_handle); } diff --git a/packet-ncp.c b/packet-ncp.c index c664215e27..9bae92463b 100644 --- a/packet-ncp.c +++ b/packet-ncp.c @@ -3,12 +3,11 @@ * Gilbert Ramirez <gram@alumni.rice.edu> * Modified to allow NCP over TCP/IP decodes by James Coe <jammer@cin.net> * - * $Id: packet-ncp.c,v 1.50 2001/11/13 23:55:30 gram Exp $ + * $Id: packet-ncp.c,v 1.51 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 2000 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -399,9 +398,11 @@ proto_register_ncp(void) void proto_reg_handoff_ncp(void) { - dissector_add("tcp.port", TCP_PORT_NCP, dissect_ncp, proto_ncp); - dissector_add("udp.port", UDP_PORT_NCP, dissect_ncp, proto_ncp); - dissector_add("ipx.packet_type", IPX_PACKET_TYPE_NCP, dissect_ncp, - proto_ncp); - dissector_add("ipx.socket", IPX_SOCKET_NCP, dissect_ncp, proto_ncp); + dissector_handle_t ncp_handle; + + ncp_handle = create_dissector_handle(dissect_ncp, proto_ncp); + dissector_add("tcp.port", TCP_PORT_NCP, ncp_handle); + dissector_add("udp.port", UDP_PORT_NCP, ncp_handle); + dissector_add("ipx.packet_type", IPX_PACKET_TYPE_NCP, ncp_handle); + dissector_add("ipx.socket", IPX_SOCKET_NCP, ncp_handle); } diff --git a/packet-netbios.c b/packet-netbios.c index 983e39d67d..e347207229 100644 --- a/packet-netbios.c +++ b/packet-netbios.c @@ -5,7 +5,7 @@ * * derived from the packet-nbns.c * - * $Id: packet-netbios.c,v 1.41 2001/11/26 04:52:50 hagbard Exp $ + * $Id: packet-netbios.c,v 1.42 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1141,6 +1141,10 @@ void proto_register_netbios(void) void proto_reg_handoff_netbios(void) { - dissector_add("llc.dsap", SAP_NETBIOS, dissect_netbios, proto_netbios); + dissector_handle_t netbios_handle; + + netbios_handle = create_dissector_handle(dissect_netbios, + proto_netbios); + dissector_add("llc.dsap", SAP_NETBIOS, netbios_handle); data_handle = find_dissector("data"); } diff --git a/packet-nntp.c b/packet-nntp.c index add8a14149..50284707dc 100644 --- a/packet-nntp.c +++ b/packet-nntp.c @@ -2,10 +2,10 @@ * Routines for nntp packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-nntp.c,v 1.20 2001/06/18 02:17:50 guy Exp $ + * $Id: packet-nntp.c,v 1.21 2001/12/03 03:59:37 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 @@ -147,5 +147,8 @@ proto_register_nntp(void) void proto_reg_handoff_nntp(void) { - dissector_add("tcp.port", TCP_PORT_NNTP, dissect_nntp, proto_nntp); + dissector_handle_t nntp_handle; + + nntp_handle = create_dissector_handle(dissect_nntp, proto_nntp); + dissector_add("tcp.port", TCP_PORT_NNTP, nntp_handle); } diff --git a/packet-ntp.c b/packet-ntp.c index 1e2089b0d2..6751d5a5e2 100644 --- a/packet-ntp.c +++ b/packet-ntp.c @@ -2,10 +2,10 @@ * Routines for NTP packet dissection * Copyright 1999, Nathan Neulinger <nneul@umr.edu> * - * $Id: packet-ntp.c,v 1.30 2001/07/16 20:58:23 guy Exp $ + * $Id: packet-ntp.c,v 1.31 2001/12/03 03:59:37 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-tftp.c @@ -502,6 +502,9 @@ proto_register_ntp(void) void proto_reg_handoff_ntp(void) { - dissector_add("udp.port", UDP_PORT_NTP, dissect_ntp, proto_ntp); - dissector_add("tcp.port", TCP_PORT_NTP, dissect_ntp, proto_ntp); + dissector_handle_t ntp_handle; + + ntp_handle = create_dissector_handle(dissect_ntp, proto_ntp); + dissector_add("udp.port", UDP_PORT_NTP, ntp_handle); + dissector_add("tcp.port", TCP_PORT_NTP, ntp_handle); } diff --git a/packet-null.c b/packet-null.c index 7278d20c85..a88cbbbb05 100644 --- a/packet-null.c +++ b/packet-null.c @@ -1,7 +1,7 @@ /* packet-null.c * Routines for null packet disassembly * - * $Id: packet-null.c,v 1.48 2001/11/26 04:52:50 hagbard Exp $ + * $Id: packet-null.c,v 1.49 2001/12/03 03:59:37 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -319,10 +319,13 @@ proto_register_null(void) void proto_reg_handoff_null(void) { + dissector_handle_t null_handle; + /* * Get a handle for the PPP-in-HDLC-like-framing dissector. */ ppp_hdlc_handle = find_dissector("ppp_hdlc"); data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_NULL, dissect_null, proto_null); + null_handle = create_dissector_handle(dissect_null, proto_null); + dissector_add("wtap_encap", WTAP_ENCAP_NULL, null_handle); } diff --git a/packet-osi.c b/packet-osi.c index bd6cc15eaf..de3a9462de 100644 --- a/packet-osi.c +++ b/packet-osi.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI network and transport protocol packet disassembly * Main entrance point and common functions * - * $Id: packet-osi.c,v 1.49 2001/12/02 00:07:46 guy Exp $ + * $Id: packet-osi.c,v 1.50 2001/12/03 03:59:37 guy Exp $ * Laurent Deniel <deniel@worldnet.fr> * Ralf Schneider <Ralf.Schneider@t-online.de> * @@ -23,7 +23,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 @@ -188,9 +187,12 @@ proto_register_osi(void) void proto_reg_handoff_osi(void) { - dissector_add("llc.dsap", SAP_OSINL, dissect_osi, -1); - dissector_add("ppp.protocol", PPP_OSI, dissect_osi, -1); - dissector_add("null.type", BSD_AF_ISO, dissect_osi, -1); - dissector_add("gre.proto", SAP_OSINL, dissect_osi, -1); + dissector_handle_t osi_handle; + + osi_handle = create_dissector_handle(dissect_osi, -1); + dissector_add("llc.dsap", SAP_OSINL, osi_handle); + dissector_add("ppp.protocol", PPP_OSI, osi_handle); + dissector_add("null.type", BSD_AF_ISO, osi_handle); + dissector_add("gre.proto", SAP_OSINL, osi_handle); data_handle = find_dissector("data"); } diff --git a/packet-ospf.c b/packet-ospf.c index b6fe57207c..c60e822fd8 100644 --- a/packet-ospf.c +++ b/packet-ospf.c @@ -2,7 +2,7 @@ * Routines for OSPF packet disassembly * (c) Copyright Hannes R. Boehm <hannes@boehm.org> * - * $Id: packet-ospf.c,v 1.50 2001/11/28 06:44:43 guy Exp $ + * $Id: packet-ospf.c,v 1.51 2001/12/03 03:59:37 guy Exp $ * * At this time, this module is able to analyze OSPF * packets as specified in RFC2328. MOSPF (RFC1584) and other @@ -1853,6 +1853,9 @@ proto_register_ospf(void) void proto_reg_handoff_ospf(void) { - dissector_add("ip.proto", IP_PROTO_OSPF, dissect_ospf, proto_ospf); + dissector_handle_t ospf_handle; + + ospf_handle = create_dissector_handle(dissect_ospf, proto_ospf); + dissector_add("ip.proto", IP_PROTO_OSPF, ospf_handle); data_handle = find_dissector("data"); } diff --git a/packet-pgm.c b/packet-pgm.c index b5501b0180..a3e2c0e355 100644 --- a/packet-pgm.c +++ b/packet-pgm.c @@ -1,7 +1,7 @@ /* packet-pgm.c * Routines for pgm packet disassembly * - * $Id: packet-pgm.c,v 1.9 2001/11/25 22:51:14 hagbard Exp $ + * $Id: packet-pgm.c,v 1.10 2001/12/03 03:59:37 guy Exp $ * * Copyright (c) 2000 by Talarian Corp * @@ -57,7 +57,7 @@ #include "proto.h" void proto_reg_handoff_pgm(void); -void proto_rereg_pgm(void); +static void proto_rereg_pgm(void); static int udp_encap_ucast_port = 0; static int udp_encap_mcast_port = 0; @@ -1103,33 +1103,37 @@ proto_register_pgm(void) old_encap_mcast_port = udp_encap_mcast_port; } +static dissector_handle_t pgm_handle; + /* The registration hand-off routine */ void proto_reg_handoff_pgm(void) { + pgm_handle = create_dissector_handle(dissect_pgm, proto_pgm); /* * Set up PGM Encap dissecting, which is off by default */ - dissector_add("udp.port", udp_encap_ucast_port, dissect_pgm, proto_pgm); - dissector_add("udp.port", udp_encap_mcast_port, dissect_pgm, proto_pgm); + dissector_add("udp.port", udp_encap_ucast_port, pgm_handle); + dissector_add("udp.port", udp_encap_mcast_port, pgm_handle); - dissector_add("ip.proto", IP_PROTO_PGM, dissect_pgm, proto_pgm); + dissector_add("ip.proto", IP_PROTO_PGM, pgm_handle); data_handle = find_dissector("data"); } -void + +static void proto_rereg_pgm(void) { /* * Remove the old ones */ - dissector_delete("udp.port", old_encap_ucast_port, dissect_pgm); - dissector_delete("udp.port", old_encap_mcast_port, dissect_pgm); + dissector_delete("udp.port", old_encap_ucast_port, pgm_handle); + dissector_delete("udp.port", old_encap_mcast_port, pgm_handle); /* * Set the new ones */ - dissector_add("udp.port", udp_encap_ucast_port, dissect_pgm, proto_pgm); - dissector_add("udp.port", udp_encap_mcast_port, dissect_pgm, proto_pgm); + dissector_add("udp.port", udp_encap_ucast_port, pgm_handle); + dissector_add("udp.port", udp_encap_mcast_port, pgm_handle); } diff --git a/packet-pim.c b/packet-pim.c index 7ef3c74b06..750cdeb16b 100644 --- a/packet-pim.c +++ b/packet-pim.c @@ -2,7 +2,7 @@ * Routines for PIM disassembly * (c) Copyright Jun-ichiro itojun Hagino <itojun@itojun.org> * - * $Id: packet-pim.c,v 1.34 2001/10/30 10:15:53 guy Exp $ + * $Id: packet-pim.c,v 1.35 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1130,7 +1130,10 @@ proto_register_pim(void) void proto_reg_handoff_pim(void) { - dissector_add("ip.proto", IP_PROTO_PIM, dissect_pim, proto_pim); + dissector_handle_t pim_handle; + + pim_handle = create_dissector_handle(dissect_pim, proto_pim); + dissector_add("ip.proto", IP_PROTO_PIM, pim_handle); /* * Get handles for the IPv4 and IPv6 dissectors. diff --git a/packet-pop.c b/packet-pop.c index 6ff7ef3ee0..737cf1a784 100644 --- a/packet-pop.c +++ b/packet-pop.c @@ -2,10 +2,10 @@ * Routines for pop packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-pop.c,v 1.26 2001/11/25 22:51:14 hagbard Exp $ + * $Id: packet-pop.c,v 1.27 2001/12/03 03:59:38 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-tftp.c @@ -224,6 +224,9 @@ proto_register_pop(void) void proto_reg_handoff_pop(void) { - dissector_add("tcp.port", TCP_PORT_POP, dissect_pop, proto_pop); + dissector_handle_t pop_handle; + + pop_handle = create_dissector_handle(dissect_pop, proto_pop); + dissector_add("tcp.port", TCP_PORT_POP, pop_handle); data_handle = find_dissector("data"); } diff --git a/packet-ppp.c b/packet-ppp.c index 9534f057da..4291729648 100644 --- a/packet-ppp.c +++ b/packet-ppp.c @@ -1,7 +1,7 @@ /* packet-ppp.c * Routines for ppp packet disassembly * - * $Id: packet-ppp.c,v 1.77 2001/11/25 22:51:14 hagbard Exp $ + * $Id: packet-ppp.c,v 1.78 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2103,16 +2103,20 @@ proto_register_ppp(void) void proto_reg_handoff_ppp(void) { + dissector_handle_t ppp_hdlc_handle, ppp_handle; + /* * Get a handle for the CHDLC dissector. */ chdlc_handle = find_dissector("chdlc"); data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_PPP, dissect_ppp_hdlc, proto_ppp); - dissector_add("wtap_encap", WTAP_ENCAP_PPP_WITH_PHDR, dissect_ppp_hdlc, proto_ppp); - dissector_add("fr.ietf", NLPID_PPP, dissect_ppp, proto_ppp); - dissector_add("gre.proto", ETHERTYPE_PPP, dissect_ppp_hdlc, proto_ppp); + ppp_hdlc_handle = find_dissector("ppp_hdlc"); + ppp_handle = find_dissector("ppp"); + dissector_add("wtap_encap", WTAP_ENCAP_PPP, ppp_hdlc_handle); + dissector_add("wtap_encap", WTAP_ENCAP_PPP_WITH_PHDR, ppp_hdlc_handle); + dissector_add("fr.ietf", NLPID_PPP, ppp_handle); + dissector_add("gre.proto", ETHERTYPE_PPP, ppp_hdlc_handle); } void @@ -2144,7 +2148,10 @@ proto_register_mp(void) void proto_reg_handoff_mp(void) { - dissector_add("ppp.protocol", PPP_MP, dissect_mp, proto_mp); + dissector_handle_t mp_handle; + + mp_handle = create_dissector_handle(dissect_mp, proto_mp); + dissector_add("ppp.protocol", PPP_MP, mp_handle); } void @@ -2173,7 +2180,10 @@ proto_register_lcp(void) void proto_reg_handoff_lcp(void) { - dissector_add("ppp.protocol", PPP_LCP, dissect_lcp, proto_lcp); + dissector_handle_t lcp_handle; + + lcp_handle = create_dissector_handle(dissect_lcp, proto_lcp); + dissector_add("ppp.protocol", PPP_LCP, lcp_handle); /* * NDISWAN on Windows translates Ethernet frames from higher-level @@ -2191,7 +2201,7 @@ proto_reg_handoff_lcp(void) * "ethertype" dissector table as well as the PPP protocol dissector * table. */ - dissector_add("ethertype", PPP_LCP, dissect_lcp, proto_lcp); + dissector_add("ethertype", PPP_LCP, lcp_handle); } void @@ -2212,13 +2222,16 @@ proto_register_ipcp(void) void proto_reg_handoff_ipcp(void) { - dissector_add("ppp.protocol", PPP_IPCP, dissect_ipcp, proto_ipcp); + dissector_handle_t ipcp_handle; + + ipcp_handle = create_dissector_handle(dissect_ipcp, proto_ipcp); + dissector_add("ppp.protocol", PPP_IPCP, ipcp_handle); /* * See above comment about NDISWAN for an explanation of why we're * registering with the "ethertype" dissector table. */ - dissector_add("ethertype", PPP_IPCP, dissect_ipcp, proto_ipcp); + dissector_add("ethertype", PPP_IPCP, ipcp_handle); } void @@ -2240,13 +2253,16 @@ proto_register_ccp(void) void proto_reg_handoff_ccp(void) { - dissector_add("ppp.protocol", PPP_CCP, dissect_ccp, proto_ccp); + dissector_handle_t ccp_handle; + + ccp_handle = create_dissector_handle(dissect_ccp, proto_ccp); + dissector_add("ppp.protocol", PPP_CCP, ccp_handle); /* * See above comment about NDISWAN for an explanation of why we're * registering with the "ethertype" dissector table. */ - dissector_add("ethertype", PPP_CCP, dissect_ccp, proto_ccp); + dissector_add("ethertype", PPP_CCP, ccp_handle); } void @@ -2267,13 +2283,16 @@ proto_register_cbcp(void) void proto_reg_handoff_cbcp(void) { - dissector_add("ppp.protocol", PPP_CBCP, dissect_cbcp, proto_cbcp); + dissector_handle_t cbcp_handle; + + cbcp_handle = create_dissector_handle(dissect_cbcp, proto_cbcp); + dissector_add("ppp.protocol", PPP_CBCP, cbcp_handle); /* * See above comment about NDISWAN for an explanation of why we're * registering with the "ethertype" dissector table. */ - dissector_add("ethertype", PPP_CBCP, dissect_cbcp, proto_cbcp); + dissector_add("ethertype", PPP_CBCP, cbcp_handle); } void @@ -2291,13 +2310,17 @@ proto_register_comp_data(void) void proto_reg_handoff_comp_data(void) { - dissector_add("ppp.protocol", PPP_COMP, dissect_comp_data, proto_comp_data); + dissector_handle_t comp_data_handle; + + comp_data_handle = create_dissector_handle(dissect_comp_data, + proto_comp_data); + dissector_add("ppp.protocol", PPP_COMP, comp_data_handle); /* * See above comment about NDISWAN for an explanation of why we're * registering with the "ethertype" dissector table. */ - dissector_add("ethertype", PPP_COMP, dissect_comp_data, proto_comp_data); + dissector_add("ethertype", PPP_COMP, comp_data_handle); } void @@ -2319,13 +2342,16 @@ proto_register_pap(void) void proto_reg_handoff_pap(void) { - dissector_add("ppp.protocol", PPP_PAP, dissect_pap, proto_pap); + dissector_handle_t pap_handle; + + pap_handle = create_dissector_handle(dissect_pap, proto_pap); + dissector_add("ppp.protocol", PPP_PAP, pap_handle); /* * See above comment about NDISWAN for an explanation of why we're * registering with the "ethertype" dissector table. */ - dissector_add("ethertype", PPP_PAP, dissect_pap, proto_pap); + dissector_add("ethertype", PPP_PAP, pap_handle); } void @@ -2347,11 +2373,14 @@ proto_register_chap(void) void proto_reg_handoff_chap(void) { - dissector_add("ppp.protocol", PPP_CHAP, dissect_chap, proto_chap); + dissector_handle_t chap_handle; + + chap_handle = create_dissector_handle(dissect_chap, proto_chap); + dissector_add("ppp.protocol", PPP_CHAP, chap_handle); /* * See above comment about NDISWAN for an explanation of why we're * registering with the "ethertype" dissector table. */ - dissector_add("ethertype", PPP_CHAP, dissect_chap, proto_chap); + dissector_add("ethertype", PPP_CHAP, chap_handle); } diff --git a/packet-pppoe.c b/packet-pppoe.c index 8892b16c89..f386983321 100644 --- a/packet-pppoe.c +++ b/packet-pppoe.c @@ -1,12 +1,11 @@ /* packet-pppoe.c * Routines for PPP Over Ethernet (PPPoE) packet disassembly (RFC2516) * - * $Id: packet-pppoe.c,v 1.18 2001/04/17 06:43:19 guy Exp $ + * $Id: packet-pppoe.c,v 1.19 2001/12/03 03:59:38 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 @@ -218,8 +217,10 @@ proto_register_pppoed(void) void proto_reg_handoff_pppoed(void) { - dissector_add("ethertype", ETHERTYPE_PPPOED, dissect_pppoed, - proto_pppoed); + dissector_handle_t pppoed_handle; + + pppoed_handle = create_dissector_handle(dissect_pppoed, proto_pppoed); + dissector_add("ethertype", ETHERTYPE_PPPOED, pppoed_handle); } static void @@ -289,8 +290,10 @@ proto_register_pppoes(void) void proto_reg_handoff_pppoes(void) { - dissector_add("ethertype", ETHERTYPE_PPPOES, dissect_pppoes, - proto_pppoes); + dissector_handle_t pppoes_handle; + + pppoes_handle = create_dissector_handle(dissect_pppoes, proto_pppoes); + dissector_add("ethertype", ETHERTYPE_PPPOES, pppoes_handle); /* * Get a handle for the PPP dissector. diff --git a/packet-pptp.c b/packet-pptp.c index e768bb44c7..de72d43ed5 100644 --- a/packet-pptp.c +++ b/packet-pptp.c @@ -2,12 +2,11 @@ * Routines for the Point-to-Point Tunnelling Protocol (PPTP) (RFC 2637) * Brad Robel-Forrest <brad.robel-forrest@watchguard.com> * - * $Id: packet-pptp.c,v 1.20 2001/11/26 04:52:51 hagbard Exp $ + * $Id: packet-pptp.c,v 1.21 2001/12/03 03:59:38 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 @@ -830,6 +829,9 @@ proto_register_pptp(void) void proto_reg_handoff_pptp(void) { - dissector_add("tcp.port", TCP_PORT_PPTP, dissect_pptp, proto_pptp); + dissector_handle_t pptp_handle; + + pptp_handle = create_dissector_handle(dissect_pptp, proto_pptp); + dissector_add("tcp.port", TCP_PORT_PPTP, pptp_handle); data_handle = find_dissector("data"); } diff --git a/packet-prism.c b/packet-prism.c index 3e478d0411..4fc9885f70 100644 --- a/packet-prism.c +++ b/packet-prism.c @@ -1,15 +1,15 @@ /* * packet-prism.c - * Decode packets with a prism header + * Decode packets with a Prism header * - * prism wlan devices have a monitoring mode that sticks + * Prism II-based wlan devices have a monitoring mode that sticks * a proprietary header on each packet with lots of good * information. This file is responsible for decoding that * data. * * By Tim Newsham * - * $Id: packet-prism.c,v 1.3 2001/11/30 07:14:20 guy Exp $ + * $Id: packet-prism.c,v 1.4 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -202,8 +202,11 @@ proto_register_prism(void) void proto_reg_handoff_prism(void) { + dissector_handle_t prism_handle; + /* handle for 802.11 dissector */ ieee80211_handle = find_dissector("wlan"); - dissector_add("wtap_encap", WTAP_ENCAP_PRISM_HEADER, dissect_prism, proto_prism); + prism_handle = create_dissector_handle(dissect_prism, proto_prism); + dissector_add("wtap_encap", WTAP_ENCAP_PRISM_HEADER, prism_handle); } diff --git a/packet-quake.c b/packet-quake.c index 172aa2ebe9..6ca9d82fec 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.21 2001/11/27 07:13:26 guy Exp $ + * $Id: packet-quake.c,v 1.22 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -599,7 +599,7 @@ proto_reg_handoff_quake(void) static int ServerPort=0; if (Initialized) { - dissector_delete("udp.port", ServerPort, dissect_quake); + dissector_delete("udp.port", ServerPort, quake_handle); } else { Initialized=TRUE; } @@ -607,8 +607,7 @@ proto_reg_handoff_quake(void) /* set port for future deletes */ ServerPort=gbl_quakeServerPort; - dissector_add("udp.port", gbl_quakeServerPort, - dissect_quake, proto_quake); + dissector_add("udp.port", gbl_quakeServerPort, quake_handle); data_handle = find_dissector("data"); } diff --git a/packet-quake2.c b/packet-quake2.c index 666f1d8255..2308bccf69 100644 --- a/packet-quake2.c +++ b/packet-quake2.c @@ -7,7 +7,7 @@ * http://www.dgs.monash.edu.au/~timf/bottim/ * http://www.opt-sci.Arizona.EDU/Pandora/default.asp * - * $Id: packet-quake2.c,v 1.5 2001/11/27 07:13:26 guy Exp $ + * $Id: packet-quake2.c,v 1.6 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -326,19 +326,21 @@ void proto_reg_handoff_quake2(void) { static int Initialized=FALSE; + static dissector_handle_t quake2_handle; static int ServerPort=0; - if (Initialized) { - dissector_delete("udp.port", ServerPort, dissect_quake2); - } else { + if (!Initialized) { + quake2_handle = create_dissector_handle(dissect_quake2, + proto_quake2); Initialized=TRUE; + } else { + dissector_delete("udp.port", ServerPort, quake2_handle); } /* set port for future deletes */ ServerPort=gbl_quake2ServerPort; - dissector_add("udp.port", gbl_quake2ServerPort, - dissect_quake2, proto_quake2); + dissector_add("udp.port", gbl_quake2ServerPort, quake2_handle); data_handle = find_dissector("data"); } @@ -416,4 +418,3 @@ proto_register_quake2(void) "Set the UDP port for the Quake II Server", 10, &gbl_quake2ServerPort); } - diff --git a/packet-quake3.c b/packet-quake3.c index a0080f1d17..df632b131f 100644 --- a/packet-quake3.c +++ b/packet-quake3.c @@ -3,7 +3,7 @@ * * Uwe Girlich <uwe@planetquake.com> * - * $Id: packet-quake3.c,v 1.6 2001/11/27 07:36:22 guy Exp $ + * $Id: packet-quake3.c,v 1.7 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -555,17 +555,20 @@ void proto_reg_handoff_quake3(void) { static int initialized=FALSE; + static dissector_handle_t quake3_handle; static int server_port; static int master_port; int i; - if (initialized) { + if (!initialized) { + quake3_handle = create_dissector_handle(dissect_quake3, + proto_quake3); + initialized=TRUE; + } else { for (i=0;i<4;i++) - dissector_delete("udp.port", server_port+i, dissect_quake3); + dissector_delete("udp.port", server_port+i, quake3_handle); for (i=0;i<4;i++) - dissector_delete("udp.port", master_port+i, dissect_quake3); - } else { - initialized=TRUE; + dissector_delete("udp.port", master_port+i, quake3_handle); } /* set port for future deletes */ @@ -575,10 +578,10 @@ proto_reg_handoff_quake3(void) /* add dissectors */ for (i=0;i<4;i++) dissector_add("udp.port", gbl_quake3_server_port + i, - dissect_quake3, proto_quake3); + quake3_handle); for (i=0;i<4;i++) dissector_add("udp.port", gbl_quake3_master_port + i, - dissect_quake3, proto_quake3); + quake3_handle); data_handle = find_dissector("data"); } diff --git a/packet-quakeworld.c b/packet-quakeworld.c index 68fa541c34..f5a6acfebe 100644 --- a/packet-quakeworld.c +++ b/packet-quakeworld.c @@ -4,7 +4,7 @@ * Uwe Girlich <uwe@planetquake.com> * http://www.idsoftware.com/q1source/q1source.zip * - * $Id: packet-quakeworld.c,v 1.7 2001/11/27 07:13:26 guy Exp $ + * $Id: packet-quakeworld.c,v 1.8 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -776,19 +776,21 @@ void proto_reg_handoff_quakeworld(void) { static int Initialized=FALSE; + static dissector_handle_t quakeworld_handle; static int ServerPort=0; - if (Initialized) { - dissector_delete("udp.port", ServerPort, dissect_quakeworld); - } else { + if (!Initialized) { + quakeworld_handle = create_dissector_handle(dissect_quakeworld, + proto_quakeworld); Initialized=TRUE; + } else { + dissector_delete("udp.port", ServerPort, quakeworld_handle); } /* set port for future deletes */ ServerPort=gbl_quakeworldServerPort; - dissector_add("udp.port", gbl_quakeworldServerPort, - dissect_quakeworld, proto_quakeworld); + dissector_add("udp.port", gbl_quakeworldServerPort, quakeworld_handle); data_handle = find_dissector("data"); } diff --git a/packet-radius.c b/packet-radius.c index f32080a8d5..9f1997488f 100644 --- a/packet-radius.c +++ b/packet-radius.c @@ -2,7 +2,7 @@ * Routines for RADIUS packet disassembly * Copyright 1999 Johan Feyaerts * - * $Id: packet-radius.c,v 1.38 2001/11/14 23:10:12 guy Exp $ + * $Id: packet-radius.c,v 1.39 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -980,12 +980,11 @@ proto_register_radius(void) void proto_reg_handoff_radius(void) { - dissector_add("udp.port", UDP_PORT_RADIUS, dissect_radius, - proto_radius); - dissector_add("udp.port", UDP_PORT_RADIUS_NEW, dissect_radius, - proto_radius); - dissector_add("udp.port", UDP_PORT_RADACCT, dissect_radius, - proto_radius); - dissector_add("udp.port", UDP_PORT_RADACCT_NEW, dissect_radius, - proto_radius); + dissector_handle_t radius_handle; + + radius_handle = create_dissector_handle(dissect_radius, proto_radius); + dissector_add("udp.port", UDP_PORT_RADIUS, radius_handle); + dissector_add("udp.port", UDP_PORT_RADIUS_NEW, radius_handle); + dissector_add("udp.port", UDP_PORT_RADACCT, radius_handle); + dissector_add("udp.port", UDP_PORT_RADACCT_NEW, radius_handle); } diff --git a/packet-ranap.c b/packet-ranap.c index f7a99a0b4b..1d21bc040e 100644 --- a/packet-ranap.c +++ b/packet-ranap.c @@ -3,7 +3,7 @@ * Based on 3GPP TS 25.413 V3.4.0 * Copyright 2001, Martin Held <Martin.Held@icn.siemens.de> * - * $Id: packet-ranap.c,v 1.7 2001/09/13 20:42:13 guy Exp $ + * $Id: packet-ranap.c,v 1.8 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -4805,8 +4805,10 @@ proto_register_ranap(void) void proto_reg_handoff_ranap(void) { - dissector_add("sual.subsystem_number", SCCP_SSN_RANAP, dissect_ranap, proto_ranap); - dissector_add("sual.subsystem_number", SCCP_SSN_RANAP_C, dissect_ranap, proto_ranap); - dissector_add("sual.subsystem_number", SCCP_SSN_RANAP_D, dissect_ranap, proto_ranap); -} + dissector_handle_t ranap_handle; + ranap_handle = create_dissector_handle(dissect_ranap, proto_ranap); + dissector_add("sual.subsystem_number", SCCP_SSN_RANAP, ranap_handle); + dissector_add("sual.subsystem_number", SCCP_SSN_RANAP_C, ranap_handle); + dissector_add("sual.subsystem_number", SCCP_SSN_RANAP_D, ranap_handle); +} diff --git a/packet-raw.c b/packet-raw.c index 85537b1c86..0fd4047748 100644 --- a/packet-raw.c +++ b/packet-raw.c @@ -1,7 +1,7 @@ /* packet-raw.c * Routines for raw packet disassembly * - * $Id: packet-raw.c,v 1.27 2001/11/20 21:59:13 guy Exp $ + * $Id: packet-raw.c,v 1.28 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -158,10 +158,13 @@ proto_register_raw(void) void proto_reg_handoff_raw(void) { + dissector_handle_t raw_handle; + /* * Get handles for the IP and PPP-in-HDLC-like-framing dissectors. */ ip_handle = find_dissector("ip"); ppp_hdlc_handle = find_dissector("ppp_hdlc"); - dissector_add("wtap_encap", WTAP_ENCAP_RAW_IP, dissect_raw, -1); + raw_handle = create_dissector_handle(dissect_raw, -1); + dissector_add("wtap_encap", WTAP_ENCAP_RAW_IP, raw_handle); } diff --git a/packet-rip.c b/packet-rip.c index 944634e677..42a0c24c3a 100644 --- a/packet-rip.c +++ b/packet-rip.c @@ -2,7 +2,7 @@ * Routines for RIPv1 and RIPv2 packet disassembly * (c) Copyright Hannes R. Boehm <hannes@boehm.org> * - * $Id: packet-rip.c,v 1.26 2001/09/14 06:34:36 guy Exp $ + * $Id: packet-rip.c,v 1.27 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -263,5 +263,8 @@ proto_register_rip(void) void proto_reg_handoff_rip(void) { - dissector_add("udp.port", UDP_PORT_RIP, dissect_rip, proto_rip); + dissector_handle_t rip_handle; + + rip_handle = create_dissector_handle(dissect_rip, proto_rip); + dissector_add("udp.port", UDP_PORT_RIP, rip_handle); } diff --git a/packet-ripng.c b/packet-ripng.c index 763bb82e47..51431ae469 100644 --- a/packet-ripng.c +++ b/packet-ripng.c @@ -3,13 +3,12 @@ * (c) Copyright Jun-ichiro itojun Hagino <itojun@itojun.org> * derived from packet-rip.c * - * $Id: packet-ripng.c,v 1.21 2001/06/18 02:17:51 guy Exp $ + * $Id: packet-ripng.c,v 1.22 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * 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 * as published by the Free Software Foundation; either version 2 @@ -158,5 +157,8 @@ proto_register_ripng(void) void proto_reg_handoff_ripng(void) { - dissector_add("udp.port", UDP_PORT_RIPNG, dissect_ripng, proto_ripng); + dissector_handle_t ripng_handle; + + ripng_handle = create_dissector_handle(dissect_ripng, proto_ripng); + dissector_add("udp.port", UDP_PORT_RIPNG, ripng_handle); } diff --git a/packet-rlogin.c b/packet-rlogin.c index c047504abe..7049d80fe8 100644 --- a/packet-rlogin.c +++ b/packet-rlogin.c @@ -2,7 +2,7 @@ * Routines for unix rlogin packet dissection * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com> * - * $Id: packet-rlogin.c,v 1.22 2001/11/03 00:58:49 guy Exp $ + * $Id: packet-rlogin.c,v 1.23 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -484,6 +484,8 @@ proto_reg_handoff_rlogin(void) { /* dissector install routine */ - dissector_add("tcp.port", TCP_PORT_RLOGIN, dissect_rlogin, - proto_rlogin); + dissector_handle_t rlogin_handle; + + rlogin_handle = create_dissector_handle(dissect_rlogin, proto_rlogin); + dissector_add("tcp.port", TCP_PORT_RLOGIN, rlogin_handle); } diff --git a/packet-rsh.c b/packet-rsh.c index a8d2473ea9..428793b73a 100644 --- a/packet-rsh.c +++ b/packet-rsh.c @@ -4,12 +4,11 @@ * Robert Tsai <rtsai@netapp.com> * Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu> * - * $Id: packet-rsh.c,v 1.12 2001/10/26 18:28:16 gram Exp $ + * $Id: packet-rsh.c,v 1.13 2001/12/03 03:59:38 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 @@ -24,8 +23,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 @@ -132,5 +129,8 @@ proto_register_rsh(void) void proto_reg_handoff_rsh(void) { - dissector_add("tcp.port", TCP_PORT_RSH, dissect_rsh, proto_rsh); + dissector_handle_t rsh_handle; + + rsh_handle = create_dissector_handle(dissect_rsh, proto_rsh); + dissector_add("tcp.port", TCP_PORT_RSH, rsh_handle); } diff --git a/packet-rsvp.c b/packet-rsvp.c index 660f84a240..77fb185481 100644 --- a/packet-rsvp.c +++ b/packet-rsvp.c @@ -3,13 +3,12 @@ * * (c) Copyright Ashok Narayanan <ashokn@cisco.com> * - * $Id: packet-rsvp.c,v 1.47 2001/10/26 18:28:16 gram Exp $ + * $Id: packet-rsvp.c,v 1.48 2001/12/03 03:59:38 guy Exp $ * * Ethereal - Network traffic analyzer * 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 * as published by the Free Software Foundation; either version 2 @@ -2069,5 +2068,8 @@ proto_register_rsvp(void) void proto_reg_handoff_rsvp(void) { - dissector_add("ip.proto", IP_PROTO_RSVP, dissect_rsvp, proto_rsvp); + dissector_handle_t rsvp_handle; + + rsvp_handle = create_dissector_handle(dissect_rsvp, proto_rsvp); + dissector_add("ip.proto", IP_PROTO_RSVP, rsvp_handle); } diff --git a/packet-rtcp.c b/packet-rtcp.c index 053b25e4a6..367ef9826c 100644 --- a/packet-rtcp.c +++ b/packet-rtcp.c @@ -1,6 +1,6 @@ /* packet-rtcp.c * - * $Id: packet-rtcp.c,v 1.24 2001/11/27 07:13:26 guy Exp $ + * $Id: packet-rtcp.c,v 1.25 2001/12/03 03:59:39 guy Exp $ * * Routines for RTCP dissection * RTCP = Real-time Transport Control Protocol @@ -1223,9 +1223,12 @@ proto_register_rtcp(void) void proto_reg_handoff_rtcp(void) { + dissector_handle_t rtcp_handle; + /* * Register this dissector as one that can be assigned to a * UDP conversation. */ - conv_dissector_add("udp", dissect_rtcp, proto_rtcp); + rtcp_handle = find_dissector("rtcp"); + conv_dissector_add("udp", rtcp_handle); } diff --git a/packet-rtp.c b/packet-rtp.c index 076a824b44..557f9951b5 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.28 2001/11/27 07:13:26 guy Exp $ + * $Id: packet-rtp.c,v 1.29 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -775,6 +775,8 @@ proto_register_rtp(void) void proto_reg_handoff_rtp(void) { + dissector_handle_t rtp_handle; + /* * Get handles for the H.261 and MPEG-1 dissectors. */ @@ -786,5 +788,6 @@ proto_reg_handoff_rtp(void) * Register this dissector as one that can be assigned to a * UDP conversation. */ - conv_dissector_add("udp", dissect_rtp, proto_rtp); + rtp_handle = find_dissector("rtp"); + conv_dissector_add("udp", rtp_handle); } diff --git a/packet-rtsp.c b/packet-rtsp.c index 3cd944f8de..20425bfa23 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.43 2001/11/27 07:13:26 guy Exp $ + * $Id: packet-rtsp.c,v 1.44 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -828,7 +828,10 @@ proto_register_rtsp(void) void proto_reg_handoff_rtsp(void) { - dissector_add("tcp.port", TCP_PORT_RTSP, dissect_rtsp, proto_rtsp); + dissector_handle_t rtsp_handle; + + rtsp_handle = create_dissector_handle(dissect_rtsp, proto_rtsp); + dissector_add("tcp.port", TCP_PORT_RTSP, rtsp_handle); sdp_handle = find_dissector("sdp"); rtp_handle = find_dissector("rtp"); diff --git a/packet-rx.c b/packet-rx.c index cdb332de15..9ea2e5aa94 100644 --- a/packet-rx.c +++ b/packet-rx.c @@ -4,7 +4,7 @@ * Based on routines from tcpdump patches by * Ken Hornstein <kenh@cmf.nrl.navy.mil> * - * $Id: packet-rx.c,v 1.27 2001/11/03 00:58:49 guy Exp $ + * $Id: packet-rx.c,v 1.28 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -729,6 +729,8 @@ proto_register_rx(void) void proto_reg_handoff_rx(void) { + dissector_handle_t rx_handle; + int port; /* @@ -738,8 +740,8 @@ proto_reg_handoff_rx(void) /* Ports in the range UDP_PORT_RX_LOW to UDP_PORT_RX_HIGH are all used for various AFS services. */ + rx_handle = create_dissector_handle(dissect_rx, proto_rx); for (port = UDP_PORT_RX_LOW; port <= UDP_PORT_RX_HIGH; port++) - dissector_add("udp.port", port, dissect_rx, proto_rx); - dissector_add("udp.port", UDP_PORT_RX_AFS_BACKUPS, dissect_rx, - proto_rx); + dissector_add("udp.port", port, rx_handle); + dissector_add("udp.port", UDP_PORT_RX_AFS_BACKUPS, rx_handle); } diff --git a/packet-sap.c b/packet-sap.c index 48f187c9cc..dfc3a14c46 100644 --- a/packet-sap.c +++ b/packet-sap.c @@ -4,7 +4,7 @@ * * Heikki Vatiainen <hessu@cs.tut.fi> * - * $Id: packet-sap.c,v 1.23 2001/06/18 02:17:52 guy Exp $ + * $Id: packet-sap.c,v 1.24 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -365,7 +365,10 @@ void proto_register_sap(void) void proto_reg_handoff_sap(void) { - dissector_add("udp.port", UDP_PORT_SAP, dissect_sap, proto_sap); + dissector_handle_t sap_handle; + + sap_handle = create_dissector_handle(dissect_sap, proto_sap); + dissector_add("udp.port", UDP_PORT_SAP, sap_handle); /* * Get a handle for the SDP dissector. diff --git a/packet-sctp.c b/packet-sctp.c index 4d0cbe935c..fc99a60347 100644 --- a/packet-sctp.c +++ b/packet-sctp.c @@ -2,7 +2,7 @@ * Routines for Stream Control Transmission Protocol dissection * Copyright 2000, Michael Tüxen <Michael.Tuexen@icn.siemens.de> * - * $Id: packet-sctp.c,v 1.21 2001/10/23 20:14:20 guy Exp $ + * $Id: packet-sctp.c,v 1.22 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1940,5 +1940,8 @@ proto_register_sctp(void) void proto_reg_handoff_sctp(void) { - dissector_add("ip.proto", IP_PROTO_SCTP, dissect_sctp, proto_sctp); + dissector_handle_t sctp_handle; + + sctp_handle = create_dissector_handle(dissect_sctp, proto_sctp); + dissector_add("ip.proto", IP_PROTO_SCTP, sctp_handle); } diff --git a/packet-sip.c b/packet-sip.c index 25b3216c17..9a71a1a0b0 100644 --- a/packet-sip.c +++ b/packet-sip.c @@ -15,7 +15,7 @@ * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi> * Copyright 2001, Jean-Francois Mule <jfm@clarent.com> * - * $Id: packet-sip.c,v 1.18 2001/11/25 22:19:24 hagbard Exp $ + * $Id: packet-sip.c,v 1.19 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -221,8 +221,11 @@ void proto_register_sip(void) void proto_reg_handoff_sip(void) { - dissector_add("tcp.port", TCP_PORT_SIP, dissect_sip, proto_sip); - dissector_add("udp.port", UDP_PORT_SIP, dissect_sip, proto_sip); + dissector_handle_t sip_handle; + + sip_handle = create_dissector_handle(dissect_sip, proto_sip); + dissector_add("tcp.port", TCP_PORT_SIP, sip_handle); + dissector_add("udp.port", UDP_PORT_SIP, sip_handle); /* * Get a handle for the SDP dissector. diff --git a/packet-skinny.c b/packet-skinny.c index 042ccb060f..7665196860 100644 --- a/packet-skinny.c +++ b/packet-skinny.c @@ -7,7 +7,7 @@ * This file is based on packet-aim.c, which is * Copyright 2000, Ralf Hoelzer <ralf@well.com> * - * $Id: packet-skinny.c,v 1.5 2001/11/25 22:19:25 hagbard Exp $ + * $Id: packet-skinny.c,v 1.6 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -291,6 +291,9 @@ proto_register_skinny(void) void proto_reg_handoff_skinny(void) { + dissector_handle_t skinny_handle; + data_handle = find_dissector("data"); - dissector_add("tcp.port", TCP_PORT_SKINNY, &dissect_skinny, proto_skinny); + skinny_handle = create_dissector_handle(dissect_skinny, proto_skinny); + dissector_add("tcp.port", TCP_PORT_SKINNY, skinny_handle); } diff --git a/packet-sll.c b/packet-sll.c index eabcd0b7bd..abb558404c 100644 --- a/packet-sll.c +++ b/packet-sll.c @@ -1,7 +1,7 @@ /* packet-sll.c * Routines for disassembly of packets from Linux "cooked mode" captures * - * $Id: packet-sll.c,v 1.13 2001/11/25 22:19:25 hagbard Exp $ + * $Id: packet-sll.c,v 1.14 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -280,6 +280,8 @@ proto_register_sll(void) void proto_reg_handoff_sll(void) { + dissector_handle_t sll_handle; + /* * Get handles for the IPX and LLC dissectors. */ @@ -287,5 +289,6 @@ proto_reg_handoff_sll(void) ipx_handle = find_dissector("ipx"); data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_SLL, dissect_sll, proto_sll); + sll_handle = create_dissector_handle(dissect_sll, proto_sll); + dissector_add("wtap_encap", WTAP_ENCAP_SLL, sll_handle); } diff --git a/packet-smtp.c b/packet-smtp.c index cb0d26dbd3..a242785258 100644 --- a/packet-smtp.c +++ b/packet-smtp.c @@ -1,13 +1,14 @@ /* packet-smtp.c * Routines for SMTP packet disassembly * - * $Id: packet-smtp.c,v 1.21 2001/11/13 04:34:38 guy Exp $ + * $Id: packet-smtp.c,v 1.22 2001/12/03 03:59:39 guy Exp $ * * Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com> * * 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 @@ -521,21 +522,24 @@ void proto_reg_handoff_smtp(void) { static int smtp_prefs_initialized = FALSE; + static dissector_handle_t smtp_handle; static int tcp_port = 0; - if (smtp_prefs_initialized) { + if (!smtp_prefs_initialized) { + + smtp_handle = create_dissector_handle(dissect_smtp, proto_smtp); - dissector_delete("tcp.port", tcp_port, dissect_smtp); + smtp_prefs_initialized = TRUE; } else { - smtp_prefs_initialized = TRUE; + dissector_delete("tcp.port", tcp_port, smtp_handle); } tcp_port = global_smtp_tcp_port; - dissector_add("tcp.port", global_smtp_tcp_port, dissect_smtp, proto_smtp); + dissector_add("tcp.port", global_smtp_tcp_port, smtp_handle); } diff --git a/packet-sna.c b/packet-sna.c index a3eee6b65a..2535da4a23 100644 --- a/packet-sna.c +++ b/packet-sna.c @@ -2,7 +2,7 @@ * Routines for SNA * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-sna.c,v 1.34 2001/11/26 04:52:51 hagbard Exp $ + * $Id: packet-sna.c,v 1.35 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1199,7 +1199,9 @@ proto_register_sna(void) void proto_reg_handoff_sna(void) { - dissector_add("llc.dsap", SAP_SNA_PATHCTRL, dissect_sna, - proto_sna); + dissector_handle_t sna_handle; + + sna_handle = find_dissector("sna"); + dissector_add("llc.dsap", SAP_SNA_PATHCTRL, sna_handle); data_handle = find_dissector("data"); } diff --git a/packet-snmp.c b/packet-snmp.c index 63082af4a7..d0b5b7ea46 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.74 2001/11/27 07:13:26 guy Exp $ + * $Id: packet-snmp.c,v 1.75 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2296,13 +2296,14 @@ proto_register_snmp(void) void proto_reg_handoff_snmp(void) { - dissector_add("udp.port", UDP_PORT_SNMP, dissect_snmp, proto_snmp); - dissector_add("udp.port", UDP_PORT_SNMP_TRAP, dissect_snmp, proto_snmp); - dissector_add("tcp.port", TCP_PORT_SMUX, dissect_smux, proto_smux); - dissector_add("ethertype", ETHERTYPE_SNMP, dissect_snmp, proto_snmp); - dissector_add("ipx.socket", IPX_SOCKET_SNMP_AGENT, dissect_snmp, - proto_snmp); - dissector_add("ipx.socket", IPX_SOCKET_SNMP_SINK, dissect_snmp, - proto_snmp); + dissector_handle_t smux_handle; + + dissector_add("udp.port", UDP_PORT_SNMP, snmp_handle); + dissector_add("udp.port", UDP_PORT_SNMP_TRAP, snmp_handle); + smux_handle = create_dissector_handle(dissect_smux, proto_smux); + dissector_add("tcp.port", TCP_PORT_SMUX, smux_handle); + dissector_add("ethertype", ETHERTYPE_SNMP, snmp_handle); + dissector_add("ipx.socket", IPX_SOCKET_SNMP_AGENT, snmp_handle); + dissector_add("ipx.socket", IPX_SOCKET_SNMP_SINK, snmp_handle); data_handle = find_dissector("data"); } diff --git a/packet-socks.c b/packet-socks.c index a4578c1a92..60f2670040 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.30 2001/11/27 07:41:39 guy Exp $ + * $Id: packet-socks.c,v 1.31 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1132,6 +1132,5 @@ proto_reg_handoff_socks(void) { /* dissector install routine */ - dissector_add("tcp.port", TCP_PORT_SOCKS, dissect_socks, - proto_socks); + dissector_add("tcp.port", TCP_PORT_SOCKS, socks_handle); } diff --git a/packet-srvloc.c b/packet-srvloc.c index b4494eec87..29ed88833f 100644 --- a/packet-srvloc.c +++ b/packet-srvloc.c @@ -6,7 +6,7 @@ * In particular I have not had an opportunity to see how it * responds to SRVLOC over TCP. * - * $Id: packet-srvloc.c,v 1.25 2001/07/15 19:14:00 guy Exp $ + * $Id: packet-srvloc.c,v 1.26 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -536,7 +536,9 @@ proto_register_srvloc(void) void proto_reg_handoff_srvloc(void) { - dissector_add("tcp.port", TCP_PORT_SRVLOC, dissect_srvloc, proto_srvloc); - dissector_add("udp.port", UDP_PORT_SRVLOC, dissect_srvloc, proto_srvloc); -} + dissector_handle_t srvloc_handle; + srvloc_handle = create_dissector_handle(dissect_srvloc, proto_srvloc); + dissector_add("tcp.port", TCP_PORT_SRVLOC, srvloc_handle); + dissector_add("udp.port", UDP_PORT_SRVLOC, srvloc_handle); +} diff --git a/packet-ssl.c b/packet-ssl.c index 23f95ff677..f8d6b61ab8 100644 --- a/packet-ssl.c +++ b/packet-ssl.c @@ -2,7 +2,7 @@ * Routines for ssl dissection * Copyright (c) 2000-2001, Scott Renfro <scott@renfro.org> * - * $Id: packet-ssl.c,v 1.9 2001/11/21 01:21:08 guy Exp $ + * $Id: packet-ssl.c,v 1.10 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2538,5 +2538,8 @@ proto_register_ssl(void) void proto_reg_handoff_ssl(void) { - dissector_add("tcp.port", TCP_PORT_SSL, dissect_ssl, proto_ssl); + dissector_handle_t ssl_handle; + + ssl_handle = create_dissector_handle(dissect_ssl, proto_ssl); + dissector_add("tcp.port", TCP_PORT_SSL, ssl_handle); } diff --git a/packet-sua.c b/packet-sua.c index 392a458088..a1ba464030 100644 --- a/packet-sua.c +++ b/packet-sua.c @@ -4,9 +4,9 @@ * http://www.ietf.org/internet-drafts/draft-ietf-sigtran-sua-08.txt * and also supports SUA light, a trivial Siemens proprietary version. * - * Copyright 2001, Michael TŸxen <Michael.Tuexen@icn.siemens.de> + * Copyright 2000, Michael Tüxen <Michael.Tuexen@icn.siemens.de> * - * $Id: packet-sua.c,v 1.1 2001/11/04 22:19:23 guy Exp $ + * $Id: packet-sua.c,v 1.2 2001/12/03 03:59:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2757,6 +2757,9 @@ proto_register_sua(void) void proto_reg_handoff_sua(void) { - dissector_add("sctp.ppi", SUA_PAYLOAD_PROTO_ID, dissect_sua, proto_sua); - dissector_add("sctp.port", SCTP_PORT_SUA, dissect_sua, proto_sua); + dissector_handle_t sua_handle; + + sua_handle = create_dissector_handle(dissect_sua, proto_sua); + dissector_add("sctp.ppi", SUA_PAYLOAD_PROTO_ID, sua_handle); + dissector_add("sctp.port", SCTP_PORT_SUA, sua_handle); } diff --git a/packet-syslog.c b/packet-syslog.c index c6767078b7..223c28a3f6 100644 --- a/packet-syslog.c +++ b/packet-syslog.c @@ -1,14 +1,13 @@ /* packet-syslog.c * Routines for syslog message dissection * - * Copyright 2000, Gerald Combs <gerald@zing.org> + * Copyright 2000, Gerald Combs <gerald@ethereal.com> * - * $Id: packet-syslog.c,v 1.11 2001/06/18 02:17:53 guy Exp $ + * $Id: packet-syslog.c,v 1.12 2001/12/03 03:59:40 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 @@ -248,5 +247,8 @@ void proto_register_syslog(void) void proto_reg_handoff_syslog(void) { - dissector_add("udp.port", UDP_PORT_SYSLOG, dissect_syslog, proto_syslog); + dissector_handle_t syslog_handle; + + syslog_handle = create_dissector_handle(dissect_syslog, proto_syslog); + dissector_add("udp.port", UDP_PORT_SYSLOG, syslog_handle); } diff --git a/packet-tacacs.c b/packet-tacacs.c index a4d1103c18..22ea4370de 100644 --- a/packet-tacacs.c +++ b/packet-tacacs.c @@ -2,7 +2,7 @@ * Routines for cisco tacacs/xtacacs/tacacs+ packet dissection * Copyright 2001, Paul Ionescu <paul@acorp.ro> * - * $Id: packet-tacacs.c,v 1.16 2001/11/27 22:37:20 guy Exp $ + * $Id: packet-tacacs.c,v 1.17 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -288,8 +288,10 @@ proto_register_tacacs(void) void proto_reg_handoff_tacacs(void) { - dissector_add("udp.port", UDP_PORT_TACACS, dissect_tacacs, - proto_tacacs); + dissector_handle_t tacacs_handle; + + tacacs_handle = create_dissector_handle(dissect_tacacs, proto_tacacs); + dissector_add("udp.port", UDP_PORT_TACACS, tacacs_handle); } static int proto_tacplus = -1; @@ -464,6 +466,9 @@ proto_register_tacplus(void) void proto_reg_handoff_tacplus(void) { - dissector_add("tcp.port", TCP_PORT_TACACS, dissect_tacplus, + dissector_handle_t tacplus_handle; + + tacplus_handle = create_dissector_handle(dissect_tacplus, proto_tacplus); + dissector_add("tcp.port", TCP_PORT_TACACS, tacplus_handle); } diff --git a/packet-tcp.c b/packet-tcp.c index 3db4d2888f..06e98f1940 100644 --- a/packet-tcp.c +++ b/packet-tcp.c @@ -1,7 +1,7 @@ /* packet-tcp.c * Routines for TCP packet disassembly * - * $Id: packet-tcp.c,v 1.118 2001/11/29 09:05:23 guy Exp $ + * $Id: packet-tcp.c,v 1.119 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1230,6 +1230,9 @@ proto_register_tcp(void) void proto_reg_handoff_tcp(void) { - dissector_add("ip.proto", IP_PROTO_TCP, dissect_tcp, proto_tcp); + dissector_handle_t tcp_handle; + + tcp_handle = create_dissector_handle(dissect_tcp, proto_tcp); + dissector_add("ip.proto", IP_PROTO_TCP, tcp_handle); data_handle = find_dissector("data"); } diff --git a/packet-telnet.c b/packet-telnet.c index a1c9b28a0a..81d58840d0 100644 --- a/packet-telnet.c +++ b/packet-telnet.c @@ -2,10 +2,10 @@ * Routines for telnet packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-telnet.c,v 1.25 2001/10/26 02:55:20 gram Exp $ + * $Id: packet-telnet.c,v 1.26 2001/12/03 03:59:40 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-pop.c @@ -434,6 +434,8 @@ proto_register_telnet(void) void proto_reg_handoff_telnet(void) { - dissector_add("tcp.port", TCP_PORT_TELNET, dissect_telnet, - proto_telnet); + dissector_handle_t telnet_handle; + + telnet_handle = create_dissector_handle(dissect_telnet, proto_telnet); + dissector_add("tcp.port", TCP_PORT_TELNET, telnet_handle); } diff --git a/packet-tftp.c b/packet-tftp.c index 7bd1ffa5ad..5aec3d5bdf 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.32 2001/11/27 07:13:26 guy Exp $ + * $Id: packet-tftp.c,v 1.33 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -346,5 +346,5 @@ proto_register_tftp(void) void proto_reg_handoff_tftp(void) { - dissector_add("udp.port", UDP_PORT_TFTP, dissect_tftp, proto_tftp); + dissector_add("udp.port", UDP_PORT_TFTP, tftp_handle); } diff --git a/packet-time.c b/packet-time.c index bd18cd28f5..29e1f6bb92 100644 --- a/packet-time.c +++ b/packet-time.c @@ -3,10 +3,10 @@ * * Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-time.c,v 1.14 2001/06/18 02:17:53 guy Exp $ + * $Id: packet-time.c,v 1.15 2001/12/03 03:59:40 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-tftp.c @@ -92,5 +92,8 @@ proto_register_time(void) void proto_reg_handoff_time(void) { - dissector_add("udp.port", UDP_PORT_TIME, dissect_time, proto_time); + dissector_handle_t time_handle; + + time_handle = create_dissector_handle(dissect_time, proto_time); + dissector_add("udp.port", UDP_PORT_TIME, time_handle); } diff --git a/packet-tns.c b/packet-tns.c index de49fe861c..6d5e669a2f 100644 --- a/packet-tns.c +++ b/packet-tns.c @@ -1,10 +1,10 @@ /* packet-tns.c * Routines for Oracle TNS packet dissection * - * $Id: packet-tns.c,v 1.22 2001/11/26 04:52:51 hagbard Exp $ + * $Id: packet-tns.c,v 1.23 2001/12/03 03:59:40 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-tftp.c @@ -1035,6 +1035,9 @@ void proto_register_tns(void) void proto_reg_handoff_tns(void) { - dissector_add("tcp.port", TCP_PORT_TNS, dissect_tns, proto_tns); + dissector_handle_t tns_handle; + + tns_handle = create_dissector_handle(dissect_tns, proto_tns); + dissector_add("tcp.port", TCP_PORT_TNS, tns_handle); data_handle = find_dissector("data"); } diff --git a/packet-tpkt.c b/packet-tpkt.c index ce7ffaefa9..35a4ca0faa 100644 --- a/packet-tpkt.c +++ b/packet-tpkt.c @@ -7,7 +7,7 @@ * Routine to dissect RFC 1006 TPKT packet containing OSI TP PDU * Copyright 2001, Martin Thomas <Martin_A_Thomas@yahoo.com> * - * $Id: packet-tpkt.c,v 1.7 2001/06/18 02:17:53 guy Exp $ + * $Id: packet-tpkt.c,v 1.8 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -231,6 +231,9 @@ proto_register_tpkt(void) void proto_reg_handoff_tpkt(void) { + dissector_handle_t tpkt_handle; + osi_tp_handle = find_dissector("ositp"); - dissector_add("tcp.port", TCP_PORT_TPKT, dissect_tpkt, proto_tpkt); + tpkt_handle = create_dissector_handle(dissect_tpkt, proto_tpkt); + dissector_add("tcp.port", TCP_PORT_TPKT, tpkt_handle); } diff --git a/packet-tr.c b/packet-tr.c index aba6276926..6415ad7ab1 100644 --- a/packet-tr.c +++ b/packet-tr.c @@ -2,7 +2,7 @@ * Routines for Token-Ring packet disassembly * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-tr.c,v 1.66 2001/11/26 04:52:51 hagbard Exp $ + * $Id: packet-tr.c,v 1.67 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -674,6 +674,8 @@ proto_register_tr(void) void proto_reg_handoff_tr(void) { + dissector_handle_t tr_handle; + /* * Get handles for the TR MAC and LLC dissectors. */ @@ -681,6 +683,6 @@ proto_reg_handoff_tr(void) llc_handle = find_dissector("llc"); data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_TOKEN_RING, dissect_tr, - proto_tr); + tr_handle = find_dissector("tr"); + dissector_add("wtap_encap", WTAP_ENCAP_TOKEN_RING, tr_handle); } diff --git a/packet-ucp.c b/packet-ucp.c index b552c7e1f8..17018cd37a 100644 --- a/packet-ucp.c +++ b/packet-ucp.c @@ -2,7 +2,7 @@ * Routines for Universal Computer Protocol dissection * Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl> * - * $Id: packet-ucp.c,v 1.5 2001/11/05 21:41:33 guy Exp $ + * $Id: packet-ucp.c,v 1.6 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2503,6 +2503,8 @@ proto_register_ucp(void) void proto_reg_handoff_ucp(void) { + dissector_handle_t ucp_handle; + /* * UCP can be spoken on any port so, when not on a specific port, try this * one whenever TCP is spoken. @@ -2511,5 +2513,6 @@ proto_reg_handoff_ucp(void) /* * Also register as one that can be assigned to a TCP conversation. */ - conv_dissector_add("tcp", dissect_ucp, proto_ucp); + ucp_handle = create_dissector_handle(dissect_ucp, proto_ucp); + conv_dissector_add("tcp", ucp_handle); } diff --git a/packet-udp.c b/packet-udp.c index bde090f679..2b941a7c55 100644 --- a/packet-udp.c +++ b/packet-udp.c @@ -1,7 +1,7 @@ /* packet-udp.c * Routines for UDP packet disassembly * - * $Id: packet-udp.c,v 1.96 2001/11/26 04:52:51 hagbard Exp $ + * $Id: packet-udp.c,v 1.97 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -283,6 +283,9 @@ proto_register_udp(void) void proto_reg_handoff_udp(void) { - dissector_add("ip.proto", IP_PROTO_UDP, dissect_udp, proto_udp); + dissector_handle_t udp_handle; + + udp_handle = create_dissector_handle(dissect_udp, proto_udp); + dissector_add("ip.proto", IP_PROTO_UDP, udp_handle); data_handle = find_dissector("data"); } diff --git a/packet-v120.c b/packet-v120.c index 863a0f637e..10d3e11393 100644 --- a/packet-v120.c +++ b/packet-v120.c @@ -2,12 +2,11 @@ * Routines for v120 frame disassembly * Bert Driehuis <driehuis@playbeing.org> * - * $Id: packet-v120.c,v 1.20 2001/11/25 22:19:25 hagbard Exp $ + * $Id: packet-v120.c,v 1.21 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * 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 @@ -235,7 +234,9 @@ proto_register_v120(void) void proto_reg_handoff_v120(void) { - data_handle = find_dissector("data"); - dissector_add("wtap_encap", WTAP_ENCAP_V120, dissect_v120, - proto_v120); + dissector_handle_t v120_handle; + + data_handle = find_dissector("data"); + v120_handle = create_dissector_handle(dissect_v120, proto_v120); + dissector_add("wtap_encap", WTAP_ENCAP_V120, v120_handle); } diff --git a/packet-vines.c b/packet-vines.c index 0bb3f0210d..76c905c4b7 100644 --- a/packet-vines.c +++ b/packet-vines.c @@ -1,7 +1,7 @@ /* packet-vines.c * Routines for Banyan VINES protocol packet disassembly * - * $Id: packet-vines.c,v 1.35 2001/11/26 04:52:51 hagbard Exp $ + * $Id: packet-vines.c,v 1.36 2001/12/03 03:59:40 guy Exp $ * * Don Lafontaine <lafont02@cn.ca> * @@ -162,18 +162,15 @@ proto_register_vines_frp(void) void proto_reg_handoff_vines_frp(void) { - /* - * Get handle for the Vines dissector. - */ - vines_handle = find_dissector("vines"); + dissector_handle_t vines_frp_handle; - dissector_add("ip.proto", IP_PROTO_VINES, dissect_vines_frp, + vines_frp_handle = create_dissector_handle(dissect_vines_frp, proto_vines_frp); + dissector_add("ip.proto", IP_PROTO_VINES, vines_frp_handle); /* XXX: AFAIK, src and dst port must be the same; should the dissector check for that? */ - dissector_add("udp.port", UDP_PORT_VINES, dissect_vines_frp, - proto_vines_frp); + dissector_add("udp.port", UDP_PORT_VINES, vines_frp_handle); } static dissector_table_t vines_dissector_table; @@ -342,13 +339,14 @@ proto_register_vines(void) vines_dissector_table = register_dissector_table("vines.proto"); register_dissector("vines", dissect_vines, proto_vines); + vines_handle = find_dissector("vines"); } void proto_reg_handoff_vines(void) { - dissector_add("ethertype", ETHERTYPE_VINES, dissect_vines, proto_vines); - dissector_add("ppp.protocol", PPP_VINES, dissect_vines, proto_vines); + dissector_add("ethertype", ETHERTYPE_VINES, vines_handle); + dissector_add("ppp.protocol", PPP_VINES, vines_handle); data_handle = find_dissector("data"); } @@ -474,6 +472,9 @@ proto_register_vines_spp(void) void proto_reg_handoff_vines_spp(void) { - dissector_add("vines.proto", VIP_PROTO_SPP, dissect_vines_spp, + dissector_handle_t vines_spp_handle; + + vines_spp_handle = create_dissector_handle(dissect_vines_spp, proto_vines_spp); + dissector_add("vines.proto", VIP_PROTO_SPP, vines_spp_handle); } diff --git a/packet-vlan.c b/packet-vlan.c index 10723fb9e7..b4521f6194 100644 --- a/packet-vlan.c +++ b/packet-vlan.c @@ -1,7 +1,7 @@ /* packet-vlan.c * Routines for VLAN 802.1Q ethernet header disassembly * - * $Id: packet-vlan.c,v 1.35 2001/11/20 21:59:13 guy Exp $ + * $Id: packet-vlan.c,v 1.36 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -166,5 +166,8 @@ proto_register_vlan(void) void proto_reg_handoff_vlan(void) { - dissector_add("ethertype", ETHERTYPE_VLAN, dissect_vlan, proto_vlan); + dissector_handle_t vlan_handle; + + vlan_handle = create_dissector_handle(dissect_vlan, proto_vlan); + dissector_add("ethertype", ETHERTYPE_VLAN, vlan_handle); } diff --git a/packet-vrrp.c b/packet-vrrp.c index 63d63237f6..225ba50694 100644 --- a/packet-vrrp.c +++ b/packet-vrrp.c @@ -4,12 +4,11 @@ * * Heikki Vatiainen <hessu@cs.tut.fi> * - * $Id: packet-vrrp.c,v 1.17 2001/07/12 19:43:59 guy Exp $ + * $Id: packet-vrrp.c,v 1.18 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * 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 @@ -261,5 +260,8 @@ void proto_register_vrrp(void) void proto_reg_handoff_vrrp(void) { - dissector_add("ip.proto", IP_PROTO_VRRP, dissect_vrrp, proto_vrrp); + dissector_handle_t vrrp_handle; + + vrrp_handle = create_dissector_handle(dissect_vrrp, proto_vrrp); + dissector_add("ip.proto", IP_PROTO_VRRP, vrrp_handle); } diff --git a/packet-vtp.c b/packet-vtp.c index c04fbf973f..dd6e12a6ae 100644 --- a/packet-vtp.c +++ b/packet-vtp.c @@ -1,7 +1,7 @@ /* packet-vtp.c * Routines for the disassembly of Cisco's Virtual Trunking Protocol * - * $Id: packet-vtp.c,v 1.15 2001/08/28 08:28:14 guy Exp $ + * $Id: packet-vtp.c,v 1.16 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -695,5 +695,8 @@ proto_register_vtp(void) void proto_reg_handoff_vtp(void) { - dissector_add("llc.cisco_pid", 0x2003, dissect_vtp, proto_vtp); + dissector_handle_t vtp_handle; + + vtp_handle = create_dissector_handle(dissect_vtp, proto_vtp); + dissector_add("llc.cisco_pid", 0x2003, vtp_handle); } diff --git a/packet-wccp.c b/packet-wccp.c index f080ae23be..43a534c642 100644 --- a/packet-wccp.c +++ b/packet-wccp.c @@ -2,7 +2,7 @@ * Routines for Web Cache Coordination Protocol dissection * Jerry Talkington <jerryt@netapp.com> * - * $Id: packet-wccp.c,v 1.23 2001/11/27 00:50:45 guy Exp $ + * $Id: packet-wccp.c,v 1.24 2001/12/03 03:59:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1314,5 +1314,8 @@ proto_register_wccp(void) void proto_reg_handoff_wccp(void) { - dissector_add("udp.port", UDP_PORT_WCCP, dissect_wccp, proto_wccp); + dissector_handle_t wccp_handle; + + wccp_handle = create_dissector_handle(dissect_wccp, proto_wccp); + dissector_add("udp.port", UDP_PORT_WCCP, wccp_handle); } diff --git a/packet-wcp.c b/packet-wcp.c index 505682aa01..781884463a 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.17 2001/11/30 04:39:45 guy Exp $ + * $Id: packet-wcp.c,v 1.18 2001/12/03 03:59:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -727,12 +727,14 @@ proto_register_wcp(void) void proto_reg_handoff_wcp(void) { + dissector_handle_t wcp_handle; /* * 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); + wcp_handle = create_dissector_handle(dissect_wcp, proto_wcp); + dissector_add("fr.ietf", NLPID_COMPRESSED, wcp_handle); + dissector_add("ethertype", ETHERTYPE_WCP, wcp_handle); } diff --git a/packet-who.c b/packet-who.c index 8e26405a5c..fec42e52e2 100644 --- a/packet-who.c +++ b/packet-who.c @@ -2,12 +2,11 @@ * Routines for who protocol (see man rwhod) * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-who.c,v 1.19 2001/11/13 23:55:30 gram Exp $ + * $Id: packet-who.c,v 1.20 2001/12/03 03:59:42 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 @@ -306,5 +305,8 @@ proto_register_who(void) void proto_reg_handoff_who(void) { - dissector_add("udp.port", UDP_PORT_WHO, dissect_who, proto_who); + dissector_handle_t who_handle; + + who_handle = create_dissector_handle(dissect_who, proto_who); + dissector_add("udp.port", UDP_PORT_WHO, who_handle); } diff --git a/packet-wsp.c b/packet-wsp.c index 672bd776fa..96f77ea5ce 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.46 2001/12/03 02:10:31 guy Exp $ + * $Id: packet-wsp.c,v 1.47 2001/12/03 03:59:43 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -4077,8 +4077,8 @@ proto_reg_handoff_wsp(void) 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); + dissector_add("udp.port", UDP_PORT_WSP, wsp_fromudp_handle); + dissector_add("udp.port", UDP_PORT_WSP_PUSH, wsp_fromudp_handle); /* This dissector is also called from the WTP and WTLS dissectors */ } diff --git a/packet-wtls.c b/packet-wtls.c index 86f1ce21df..393956d725 100644 --- a/packet-wtls.c +++ b/packet-wtls.c @@ -2,7 +2,7 @@ * * Routines to dissect WTLS component of WAP traffic. * - * $Id: packet-wtls.c,v 1.14 2001/12/03 02:10:31 guy Exp $ + * $Id: packet-wtls.c,v 1.15 2001/12/03 03:59:43 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1636,13 +1636,16 @@ proto_register_wtls(void) void proto_reg_handoff_wtls(void) { + dissector_handle_t wtls_handle; + /* * Get handles for the WTP and connectionless WSP dissectors. */ wtp_handle = find_dissector("wtp"); wsp_handle = find_dissector("wsp-cl"); - dissector_add("udp.port", UDP_PORT_WTLS_WSP, dissect_wtls, proto_wtls); - dissector_add("udp.port", UDP_PORT_WTLS_WTP_WSP, dissect_wtls, proto_wtls); - dissector_add("udp.port", UDP_PORT_WTLS_WSP_PUSH,dissect_wtls, proto_wtls); + wtls_handle = create_dissector_handle(dissect_wtls, proto_wtls); + dissector_add("udp.port", UDP_PORT_WTLS_WSP, wtls_handle); + dissector_add("udp.port", UDP_PORT_WTLS_WTP_WSP, wtls_handle); + dissector_add("udp.port", UDP_PORT_WTLS_WSP_PUSH,wtls_handle); } diff --git a/packet-wtp.c b/packet-wtp.c index 39efdd3090..c7fd282289 100644 --- a/packet-wtp.c +++ b/packet-wtp.c @@ -2,7 +2,7 @@ * * Routines to dissect WTP component of WAP traffic. * - * $Id: packet-wtp.c,v 1.21 2001/12/03 02:10:31 guy Exp $ + * $Id: packet-wtp.c,v 1.22 2001/12/03 03:59:43 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -725,12 +725,14 @@ proto_register_wtp(void) void proto_reg_handoff_wtp(void) { + dissector_handle_t wtp_fromudp_handle; + /* * Get a handle for the connection-oriented WSP dissector - if WTP * PDUs have data, it is WSP. */ wsp_handle = find_dissector("wsp-co"); - dissector_add("udp.port", UDP_PORT_WTP_WSP, dissect_wtp_fromudp, - proto_wtp); + wtp_fromudp_handle = find_dissector("wtp-udp"); + dissector_add("udp.port", UDP_PORT_WTP_WSP, wtp_fromudp_handle); } diff --git a/packet-x11.c b/packet-x11.c index 46013eb8c4..d338abe66a 100644 --- a/packet-x11.c +++ b/packet-x11.c @@ -2,7 +2,7 @@ * Routines for X11 dissection * Copyright 2000, Christophe Tronche <ch.tronche@computer.org> * - * $Id: packet-x11.c,v 1.25 2001/11/26 04:52:51 hagbard Exp $ + * $Id: packet-x11.c,v 1.26 2001/12/03 03:59:43 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2942,8 +2942,11 @@ void proto_register_x11(void) void proto_reg_handoff_x11(void) { - dissector_add("tcp.port", TCP_PORT_X11, dissect_x11, proto_x11); - dissector_add("tcp.port", TCP_PORT_X11_2, dissect_x11, proto_x11); - dissector_add("tcp.port", TCP_PORT_X11_3, dissect_x11, proto_x11); + dissector_handle_t x11_handle; + + x11_handle = create_dissector_handle(dissect_x11, proto_x11); + dissector_add("tcp.port", TCP_PORT_X11, x11_handle); + dissector_add("tcp.port", TCP_PORT_X11_2, x11_handle); + dissector_add("tcp.port", TCP_PORT_X11_3, x11_handle); data_handle = find_dissector("data"); } diff --git a/packet-x25.c b/packet-x25.c index 9dbc744502..f7f4fcce54 100644 --- a/packet-x25.c +++ b/packet-x25.c @@ -2,7 +2,7 @@ * Routines for x25 packet disassembly * Olivier Abad <oabad@cybercable.fr> * - * $Id: packet-x25.c,v 1.57 2001/12/02 00:38:53 guy Exp $ + * $Id: packet-x25.c,v 1.58 2001/12/03 03:59:43 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2279,6 +2279,8 @@ proto_register_x25(void) void proto_reg_handoff_x25(void) { + dissector_handle_t x25_handle; + /* * Get handles for various dissectors. */ @@ -2287,5 +2289,6 @@ proto_reg_handoff_x25(void) qllc_handle = find_dissector("qllc"); data_handle = find_dissector("data"); - dissector_add("llc.dsap", SAP_X25, dissect_x25, proto_x25); + x25_handle = find_dissector("x.25"); + dissector_add("llc.dsap", SAP_X25, x25_handle); } diff --git a/packet-xot.c b/packet-xot.c index b49ab3fbba..3cdb4af628 100644 --- a/packet-xot.c +++ b/packet-xot.c @@ -3,12 +3,11 @@ * * Copyright 2000, Paul Ionescu <paul@acorp.ro> * - * $Id: packet-xot.c,v 1.6 2001/09/13 08:05:26 guy Exp $ + * $Id: packet-xot.c,v 1.7 2001/12/03 03:59:43 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 @@ -105,10 +104,13 @@ proto_register_xot(void) void proto_reg_handoff_xot(void) { + dissector_handle_t xot_handle; + /* * Get a handle for the X.25 dissector. */ x25_handle = find_dissector("x.25"); - dissector_add("tcp.port", TCP_PORT_XOT, dissect_xot, proto_xot); + xot_handle = create_dissector_handle(dissect_xot, proto_xot); + dissector_add("tcp.port", TCP_PORT_XOT, xot_handle); } diff --git a/packet-zebra.c b/packet-zebra.c index cba1f2f846..0dae661953 100644 --- a/packet-zebra.c +++ b/packet-zebra.c @@ -3,7 +3,7 @@ * * Jochen Friedrich <jochen@scram.de> * - * $Id: packet-zebra.c,v 1.15 2001/10/26 18:28:16 gram Exp $ + * $Id: packet-zebra.c,v 1.16 2001/12/03 03:59:43 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -645,5 +645,8 @@ proto_register_zebra(void) void proto_reg_handoff_zebra(void) { - dissector_add("tcp.port", TCP_PORT_ZEBRA, dissect_zebra, proto_zebra); + dissector_handle_t zebra_handle; + + zebra_handle = create_dissector_handle(dissect_zebra, proto_zebra); + dissector_add("tcp.port", TCP_PORT_ZEBRA, zebra_handle); } 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 *); |