diff --git a/AUTHORS b/AUTHORS index d1857ebb99..7eb98f5bfe 100644 --- a/AUTHORS +++ b/AUTHORS @@ -42,6 +42,7 @@ Laurent Deniel { Many display filters added GUI enhancements (about & help windows) Follow TCP stream for IPv6 + Protocol activation/deactivation (Edit:protocols) Miscellaneous enhancements and fixes } diff --git a/gtk/Makefile.am b/gtk/Makefile.am index bda475a3d4..9a2b245828 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -1,7 +1,7 @@ # Makefile.am # Automake file for the GTK interface routines for Ethereal # -# $Id: Makefile.am,v 1.29 2000/08/08 12:24:31 deniel Exp $ +# $Id: Makefile.am,v 1.30 2000/08/13 14:03:49 deniel Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs @@ -72,6 +72,8 @@ libui_a_SOURCES = \ print_prefs.c \ print_prefs.h \ progress_dlg.c \ + proto_dlg.c \ + proto_dlg.h \ proto_draw.c \ proto_draw.h \ simple_dialog.c \ diff --git a/gtk/Makefile.nmake b/gtk/Makefile.nmake index b5eca047bb..9e6617e2e1 100644 --- a/gtk/Makefile.nmake +++ b/gtk/Makefile.nmake @@ -35,6 +35,7 @@ OBJECTS=capture_dlg.obj \ print_dlg.obj \ print_prefs.obj \ progress_dlg.obj \ + proto_dlg.obj \ proto_draw.obj \ simple_dialog.obj \ stream_prefs.obj \ diff --git a/gtk/menu.c b/gtk/menu.c index 2b1641431d..b6ea7eddb8 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -1,7 +1,7 @@ /* menu.c * Menu routines * - * $Id: menu.c,v 1.34 2000/08/09 06:43:22 guy Exp $ + * $Id: menu.c,v 1.35 2000/08/13 14:03:50 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -55,6 +55,7 @@ #include "print.h" #include "follow_dlg.h" #include "help_dlg.h" +#include "proto_dlg.h" #include "keys.h" #include "plugins.h" @@ -112,6 +113,7 @@ static GtkItemFactoryEntry menu_items[] = {"/Edit/", NULL, NULL, 0, ""}, {"/Edit/_Preferences...", NULL, GTK_MENU_FUNC(prefs_cb), 0, NULL}, {"/Edit/_Filters...", NULL, GTK_MENU_FUNC(filter_dialog_cb), 0, NULL}, + {"/Edit/P_rotocols...", NULL, GTK_MENU_FUNC(proto_cb), 0, NULL}, #ifdef HAVE_LIBPCAP {"/_Capture", NULL, NULL, 0, "" }, {"/Capture/_Start...", "K", GTK_MENU_FUNC(capture_prep_cb), 0, NULL}, diff --git a/gtk/proto_dlg.c b/gtk/proto_dlg.c new file mode 100644 index 0000000000..2e38043bf5 --- /dev/null +++ b/gtk/proto_dlg.c @@ -0,0 +1,287 @@ +/* proto_dlg.c + * + * $Id: proto_dlg.c,v 1.1 2000/08/13 14:03:49 deniel Exp $ + * + * Laurent Deniel + * + * Ethereal - Network traffic analyzer + * By Gerald Combs + * 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +/* + * TODO : + * + * Modify proto.c to have a better protocol characteristics database + * such as ordered list or hash table. This would allow a quick search + * knowing the protocol abbreviation and to enhance this stuff by adding + * other fields (hfinfo is currently limited since protocols and fields + * share the same structure type). + * + * The protocol display should be sorted (by abbreviation). + * + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#include "prefs.h" +#include "globals.h" +#include "gtkglobals.h" +#include "main.h" +#include "util.h" +#include "ui_util.h" +#include "dlg_utils.h" +#include "proto_dlg.h" + +static void proto_ok_cb(GtkWidget *, gpointer); +static void proto_apply_cb(GtkWidget *, gpointer); +static void proto_close_cb(GtkWidget *, gpointer); + +static void show_proto_selection(GtkWidget *main, GtkWidget *container); +static gboolean set_proto_selection(GtkWidget *); + +static GtkWidget *proto_w = NULL; + +void proto_cb(GtkWidget *w, gpointer data) +{ + + GtkWidget *main_vb, *bbox, *proto_nb, *apply_bt, *cancel_bt, *ok_bt, + *label, *scrolled_w, *selection_vb; + + if (proto_w != NULL) { + reactivate_window(proto_w); + return; + } + + proto_w = dlg_window_new(); + gtk_window_set_title(GTK_WINDOW(proto_w), "Ethereal: Protocol"); + gtk_signal_connect(GTK_OBJECT(proto_w), "destroy", + GTK_SIGNAL_FUNC(proto_close_cb), NULL); + gtk_widget_set_usize(GTK_WIDGET(proto_w), DEF_WIDTH * 2/3, DEF_HEIGHT * 2/3); + + /* Container for each row of widgets */ + + main_vb = gtk_vbox_new(FALSE, 0); + gtk_container_border_width(GTK_CONTAINER(main_vb), 1); + gtk_container_add(GTK_CONTAINER(proto_w), main_vb); + gtk_widget_show(main_vb); + + /* Protocol topics container */ + + proto_nb = gtk_notebook_new(); + gtk_container_add(GTK_CONTAINER(main_vb), proto_nb); + /* XXX do not know why I need this to fill all space around buttons */ + gtk_widget_set_usize(GTK_WIDGET(proto_nb), DEF_WIDTH * 2/3 - 50, + DEF_HEIGHT * 2/3 - 50); + + /* Protocol selection panel ("enable/disable" protocols) */ + + selection_vb = gtk_vbox_new(FALSE, 0); + gtk_container_border_width(GTK_CONTAINER(selection_vb), 1); + label = gtk_label_new("Button pressed: protocol decoding is enabled"); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(selection_vb), label, FALSE, FALSE, 0); + scrolled_w = gtk_scrolled_window_new(NULL, NULL); + gtk_container_set_border_width(GTK_CONTAINER(scrolled_w), 1); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_w), + GTK_POLICY_AUTOMATIC, + GTK_POLICY_ALWAYS); + set_scrollbar_placement_scrollw(scrolled_w, prefs.gui_scrollbar_on_right); + remember_scrolled_window(scrolled_w); + gtk_box_pack_start(GTK_BOX(selection_vb), scrolled_w, TRUE, TRUE, 0); + show_proto_selection(proto_w, scrolled_w); + gtk_widget_show(scrolled_w); + gtk_widget_show(selection_vb); + label = gtk_label_new("Decoding"); + gtk_notebook_append_page(GTK_NOTEBOOK(proto_nb), selection_vb, label); + label = gtk_label_new("Note that when a protocol is disabled, " + "all linked sub-protocols are as well"); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(selection_vb), label, FALSE, FALSE, 0); + + /* XXX add other protocol-related panels here ... */ + + gtk_widget_show(proto_nb); + + /* Ok, Apply, Cancel Buttons */ + + bbox = gtk_hbutton_box_new(); + gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); + gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); + gtk_container_add(GTK_CONTAINER(main_vb), bbox); + gtk_widget_show(bbox); + + ok_bt = gtk_button_new_with_label ("OK"); + gtk_signal_connect(GTK_OBJECT(ok_bt), "clicked", + GTK_SIGNAL_FUNC(proto_ok_cb), GTK_OBJECT(proto_w)); + GTK_WIDGET_SET_FLAGS(ok_bt, GTK_CAN_DEFAULT); + gtk_box_pack_start(GTK_BOX (bbox), ok_bt, TRUE, TRUE, 0); + gtk_widget_grab_default(ok_bt); + gtk_widget_show(ok_bt); + + apply_bt = gtk_button_new_with_label ("Apply"); + gtk_signal_connect(GTK_OBJECT(apply_bt), "clicked", + GTK_SIGNAL_FUNC(proto_apply_cb), GTK_OBJECT(proto_w)); + GTK_WIDGET_SET_FLAGS(apply_bt, GTK_CAN_DEFAULT); + gtk_box_pack_start(GTK_BOX (bbox), apply_bt, TRUE, TRUE, 0); + gtk_widget_show(apply_bt); + + cancel_bt = gtk_button_new_with_label ("Cancel"); + gtk_signal_connect(GTK_OBJECT(cancel_bt), "clicked", + GTK_SIGNAL_FUNC(proto_close_cb), GTK_OBJECT(proto_w)); + GTK_WIDGET_SET_FLAGS(cancel_bt, GTK_CAN_DEFAULT); + gtk_box_pack_start(GTK_BOX (bbox), cancel_bt, TRUE, TRUE, 0); + gtk_widget_show(cancel_bt); + + dlg_set_cancel(proto_w, cancel_bt); + + gtk_quit_add_destroy(gtk_main_level(), GTK_OBJECT(proto_w)); + gtk_widget_show(proto_w); + +} /* proto_cb */ + +static void proto_close_cb(GtkWidget *w, gpointer data) +{ + if (proto_w) + gtk_widget_destroy(proto_w); + proto_w = NULL; +} + +static void proto_ok_cb(GtkWidget *ok_bt, gpointer parent_w) +{ + gboolean redissect; + redissect = set_proto_selection(GTK_WIDGET(parent_w)); + gtk_widget_destroy(GTK_WIDGET(parent_w)); + if (redissect) + redissect_packets(&cfile); +} + +static void proto_apply_cb(GtkWidget *ok_bt, gpointer parent_w) +{ + if (set_proto_selection(GTK_WIDGET(parent_w))) + redissect_packets(&cfile); +} + +static gboolean set_proto_selection(GtkWidget *parent_w) +{ + int i; + gboolean need_redissect = FALSE; + + for (i = 0; i < proto_registrar_n() ; i++) { + if (proto_registrar_is_protocol(i)) { + GtkWidget *button; + header_field_info *hfinfo; + hfinfo = proto_registrar_get_nth(i); + + if (strcmp(hfinfo->abbrev, "data") == 0 || + strcmp(hfinfo->abbrev, "text") == 0 || + strcmp(hfinfo->abbrev, "malformed") == 0 || + strcmp(hfinfo->abbrev, "short") == 0 || + strcmp(hfinfo->abbrev, "frame") == 0) continue; + + button = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w), + hfinfo->abbrev); + /* XXX optimization but should not use display field */ + if (hfinfo->display != GTK_TOGGLE_BUTTON (button)->active) { + proto_set_decoding(i, GTK_TOGGLE_BUTTON (button)->active); + need_redissect = TRUE; + } + } + } + + return need_redissect; + +} /* set_proto_selection */ + +static void show_proto_selection(GtkWidget *main, GtkWidget *container) +{ + + /* XXX : we should sort the protocol abbrev */ + +#define NB_COL 7 + + GtkTooltips *tooltips; + GtkWidget *table; + int i, t = 0, l = 0, nb_line, nb_proto = 0; + + /* Obtain the number of "true" protocols */ + + for (i = 0; i < proto_registrar_n() ; i++) { + if (proto_registrar_is_protocol(i)) { + nb_proto ++; + } + } + + /* XXX ignore "data", "malformed", "short", "frame", "text" */ + nb_proto -= 5; + + /* create a table (n x NB_COL) of buttons */ + + nb_line = (nb_proto % NB_COL) ? nb_proto / NB_COL + 1 : nb_proto / NB_COL; + table = gtk_table_new (nb_line, NB_COL, FALSE); + gtk_table_set_row_spacings(GTK_TABLE (table), 1); + gtk_table_set_col_spacings(GTK_TABLE (table), 1); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(container), table); + gtk_widget_show(table); + + tooltips = gtk_tooltips_new(); + + nb_proto = 0; + + for (i = 0; i < proto_registrar_n() ; i++) { + if (proto_registrar_is_protocol(i)) { + GtkWidget *button; + header_field_info *hfinfo; + hfinfo = proto_registrar_get_nth(i); + + if (strcmp(hfinfo->abbrev, "data") == 0 || + strcmp(hfinfo->abbrev, "text") == 0 || + strcmp(hfinfo->abbrev, "malformed") == 0 || + strcmp(hfinfo->abbrev, "short") == 0 || + strcmp(hfinfo->abbrev, "frame") == 0) continue; + + /* button label is the protocol abbrev */ + button = gtk_toggle_button_new_with_label (hfinfo->abbrev); + /* tip is the complete protocol name */ + gtk_tooltips_set_tip(tooltips, button, hfinfo->name, NULL); + gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), hfinfo->display); + gtk_object_set_data(GTK_OBJECT(main), hfinfo->abbrev, button); + gtk_table_attach_defaults (GTK_TABLE (table), button, l, l+1, t, t+1); + gtk_widget_show (button); + if (++nb_proto % NB_COL) { + l++; + } + else { + l = 0; + t++; + } + } + } + +} /* show_proto_selection */ diff --git a/gtk/proto_dlg.h b/gtk/proto_dlg.h new file mode 100644 index 0000000000..187c8c311e --- /dev/null +++ b/gtk/proto_dlg.h @@ -0,0 +1,32 @@ +/* proto_dlg.h + * + * $Id: proto_dlg.h,v 1.1 2000/08/13 14:03:49 deniel Exp $ + * + * Laurent Deniel + * + * Ethereal - Network traffic analyzer + * By Gerald Combs + * 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef __PROTO_DLG_H__ +#define __PROTO_DLG_H__ + +void proto_cb(GtkWidget *, gpointer); + +#endif diff --git a/packet-aarp.c b/packet-aarp.c index dcb2736c6a..4c49366ec5 100644 --- a/packet-aarp.c +++ b/packet-aarp.c @@ -1,7 +1,7 @@ /* packet-aarp.c * Routines for Appletalk ARP packet disassembly * - * $Id: packet-aarp.c,v 1.21 2000/08/07 03:20:20 guy Exp $ + * $Id: packet-aarp.c,v 1.22 2000/08/13 14:07:55 deniel Exp $ * * Simon Wilkinson * @@ -139,6 +139,8 @@ dissect_aarp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { int sha_offset, spa_offset, tha_offset, tpa_offset; gchar *sha_str, *spa_str, *tha_str, *tpa_str; + OLD_CHECK_DISPLAY_AS_DATA(proto_aarp, pd, offset, fd, tree); + if (!BYTES_ARE_IN_FRAME(offset, MIN_AARP_HEADER_SIZE)) { old_dissect_data(pd, offset, fd, tree); return; diff --git a/packet-afs.c b/packet-afs.c index b66cd5c29b..0c616e0e8c 100644 --- a/packet-afs.c +++ b/packet-afs.c @@ -6,7 +6,7 @@ * Portions based on information retrieved from the RX definitions * in Arla, the free AFS client at http://www.stacken.kth.se/project/arla/ * - * $Id: packet-afs.c,v 1.12 2000/06/21 04:41:30 guy Exp $ + * $Id: packet-afs.c,v 1.13 2000/08/13 14:07:56 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -728,6 +728,8 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) void (*dissector)(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int opcode); + OLD_CHECK_DISPLAY_AS_DATA(proto_afs, pd, offset, fd, tree); + rxh = (struct rx_header *) &pd[offset]; doffset = offset + sizeof(struct rx_header); afsh = (struct afs_header *) &pd[doffset]; diff --git a/packet-arp.c b/packet-arp.c index b043eb9c32..85edad04e6 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.32 2000/08/10 20:09:29 deniel Exp $ + * $Id: packet-arp.c,v 1.33 2000/08/13 14:07:58 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -564,6 +564,8 @@ dissect_arp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int sha_offset, spa_offset, tha_offset, tpa_offset; gchar *sha_str, *spa_str, *tha_str, *tpa_str; + OLD_CHECK_DISPLAY_AS_DATA(proto_arp, pd, offset, fd, tree); + if (!BYTES_ARE_IN_FRAME(offset, MIN_ARP_HEADER_SIZE)) { old_dissect_data(pd, offset, fd, tree); return; diff --git a/packet-ascend.c b/packet-ascend.c index c2e6de836f..7210db45b3 100644 --- a/packet-ascend.c +++ b/packet-ascend.c @@ -1,7 +1,7 @@ /* packet-ascend.c * Routines for decoding Lucent/Ascend packet traces * - * $Id: packet-ascend.c,v 1.16 2000/05/31 05:06:51 guy Exp $ + * $Id: packet-ascend.c,v 1.17 2000/08/13 14:08:00 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -59,6 +59,8 @@ dissect_ascend(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *ti; union wtap_pseudo_header *pseudo_header = pinfo->pseudo_header; + CHECK_DISPLAY_AS_DATA(proto_ascend, tvb, pinfo, tree); + pinfo->current_proto = "Lucent/Ascend"; /* load the top pane info. This should be overwritten by diff --git a/packet-atalk.c b/packet-atalk.c index a9f85b3572..9ec3359b07 100644 --- a/packet-atalk.c +++ b/packet-atalk.c @@ -1,7 +1,7 @@ /* packet-atalk.c * Routines for Appletalk packet disassembly (DDP, currently). * - * $Id: packet-atalk.c,v 1.39 2000/08/07 03:20:22 guy Exp $ + * $Id: packet-atalk.c,v 1.40 2000/08/13 14:08:00 deniel Exp $ * * Simon Wilkinson * @@ -196,6 +196,8 @@ dissect_rtmp_data(const u_char *pd, int offset, frame_data *fd, proto_tree *tree guint16 node; /* might be more than 8 bits */ int i; + OLD_CHECK_DISPLAY_AS_DATA(proto_rtmp, pd, offset, fd, tree); + if (!BYTES_ARE_IN_FRAME(offset, 3)) { old_dissect_data(pd, offset, fd, tree); return; @@ -292,6 +294,8 @@ dissect_nbp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { guint op, count; int i; + OLD_CHECK_DISPLAY_AS_DATA(proto_nbp, pd, offset, fd, tree); + if (!BYTES_ARE_IN_FRAME(offset, 2)) { old_dissect_data(pd, offset, fd, tree); return; @@ -370,6 +374,8 @@ dissect_ddp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_item *ti; static struct atalk_ddp_addr src, dst; + OLD_CHECK_DISPLAY_AS_DATA(proto_ddp, pd, offset, fd, tree); + if (!BYTES_ARE_IN_FRAME(offset, DDP_HEADER_SIZE)) { old_dissect_data(pd, offset, fd, tree); return; diff --git a/packet-atm.c b/packet-atm.c index c213327f01..24b733172e 100644 --- a/packet-atm.c +++ b/packet-atm.c @@ -1,7 +1,7 @@ /* packet-atm.c * Routines for ATM packet disassembly * - * $Id: packet-atm.c,v 1.23 2000/08/07 03:20:22 guy Exp $ + * $Id: packet-atm.c,v 1.24 2000/08/13 14:08:02 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -378,6 +378,8 @@ dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvbuff_t *next_tvb; tvbuff_t *next_tvb_le_client; + CHECK_DISPLAY_AS_DATA(proto_atm_lane, tvb, pinfo, tree); + pinfo->current_proto = "ATM LANE"; if (check_col(pinfo->fd, COL_PROTOCOL)) @@ -564,6 +566,8 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) const guint8 *pd; int offset; + CHECK_DISPLAY_AS_DATA(proto_atm, tvb, pinfo, tree); + pinfo->current_proto = "ATM"; aal_type = pinfo->pseudo_header->ngsniffer_atm.AppTrafType & ATT_AALTYPE; @@ -736,6 +740,7 @@ dissect_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; case ATT_HL_ILMI: + CHECK_DISPLAY_AS_DATA(proto_ilmi, tvb, pinfo, tree); tvb_compat(tvb, &pd, &offset); dissect_snmp_pdu(pd, offset, pinfo->fd, tree, "ILMI", proto_ilmi, ett_ilmi); break; diff --git a/packet-auto_rp.c b/packet-auto_rp.c index dfc069b2b3..46a1c519f4 100644 --- a/packet-auto_rp.c +++ b/packet-auto_rp.c @@ -4,7 +4,7 @@ * * Heikki Vatiainen * - * $Id: packet-auto_rp.c,v 1.7 2000/08/07 03:20:23 guy Exp $ + * $Id: packet-auto_rp.c,v 1.8 2000/08/13 14:08:02 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -123,6 +123,8 @@ static void dissect_auto_rp(const u_char *pd, int offset, frame_data *fd, proto_ struct auto_rp_fixed_hdr arh; gboolean short_hdr = FALSE; + OLD_CHECK_DISPLAY_AS_DATA(proto_auto_rp, pd, offset, fd, tree); + if (sizeof(struct auto_rp_fixed_hdr) > END_OF_FRAME) short_hdr = TRUE; else diff --git a/packet-bgp.c b/packet-bgp.c index 87290fe049..6e36073aea 100644 --- a/packet-bgp.c +++ b/packet-bgp.c @@ -2,7 +2,7 @@ * Routines for BGP packet dissection. * Copyright 1999, Jun-ichiro itojun Hagino * - * $Id: packet-bgp.c,v 1.25 2000/08/11 13:35:29 deniel Exp $ + * $Id: packet-bgp.c,v 1.26 2000/08/13 14:08:02 deniel Exp $ * * Supports: * RFC1771 A Border Gateway Protocol 4 (BGP-4) @@ -1137,6 +1137,8 @@ dissect_bgp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int hlen; /* BGP header length */ char *typ; /* BGP message type */ + OLD_CHECK_DISPLAY_AS_DATA(proto_bgp, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "BGP"); diff --git a/packet-bootp.c b/packet-bootp.c index 4aca8ff8ba..72d4f8f7cf 100644 --- a/packet-bootp.c +++ b/packet-bootp.c @@ -2,7 +2,7 @@ * Routines for BOOTP/DHCP packet disassembly * Gilbert Ramirez * - * $Id: packet-bootp.c,v 1.39 2000/08/09 06:14:57 guy Exp $ + * $Id: packet-bootp.c,v 1.40 2000/08/13 14:08:03 deniel Exp $ * * The information used comes from: * RFC 951: Bootstrap Protocol @@ -622,6 +622,8 @@ dissect_bootp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guint32 ip_addr; const char *dhcp_type; + OLD_CHECK_DISPLAY_AS_DATA(proto_bootp, pd, offset, fd, tree); + dhcp_type = NULL; if (check_col(fd, COL_PROTOCOL)) diff --git a/packet-bootparams.c b/packet-bootparams.c index 7ae6c8f33b..93b687a94d 100644 --- a/packet-bootparams.c +++ b/packet-bootparams.c @@ -1,7 +1,7 @@ /* packet-bootparams.c * Routines for bootparams dissection * - * $Id: packet-bootparams.c,v 1.11 2000/05/31 05:06:55 guy Exp $ + * $Id: packet-bootparams.c,v 1.12 2000/08/13 14:08:04 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -58,6 +58,9 @@ int dissect_bp_address(const u_char *pd, int offset, frame_data *fd, guint32 type; guint32 ipaddr; + if (!proto_is_protocol_enabled(proto_bootparams)) + return offset; + /* get the address type */ if ( !BYTES_ARE_IN_FRAME(offset, 1)) return offset; type = pntohl(&pd[offset]); /* type of address */ @@ -89,6 +92,9 @@ ZZZZZZZZZZZZZZZZZZZ Check type: int dissect_getfile_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_bootparams)) + return offset; + if ( tree ) { offset = dissect_rpc_string(pd,offset,fd,tree,hf_bootparams_host,NULL); @@ -102,6 +108,9 @@ int dissect_getfile_call(const u_char *pd, int offset, frame_data *fd, int dissect_getfile_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_bootparams)) + return offset; + if ( tree ) { offset = dissect_rpc_string(pd,offset,fd,tree,hf_bootparams_host,NULL); @@ -116,6 +125,9 @@ int dissect_getfile_reply(const u_char *pd, int offset, frame_data *fd, int dissect_whoami_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_bootparams)) + return offset; + if ( tree ) { offset = dissect_bp_address(pd,offset,fd,tree,hf_bootparams_hostaddr); @@ -128,6 +140,9 @@ int dissect_whoami_call(const u_char *pd, int offset, frame_data *fd, int dissect_whoami_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_bootparams)) + return offset; + if ( tree ) { offset = dissect_rpc_string(pd,offset,fd,tree,hf_bootparams_host,NULL); diff --git a/packet-bpdu.c b/packet-bpdu.c index 8256ba737a..c7c75ef681 100644 --- a/packet-bpdu.c +++ b/packet-bpdu.c @@ -1,7 +1,7 @@ /* packet-bpdu.c * Routines for BPDU (Spanning Tree Protocol) disassembly * - * $Id: packet-bpdu.c,v 1.12 2000/08/07 03:20:25 guy Exp $ + * $Id: packet-bpdu.c,v 1.13 2000/08/13 14:08:04 deniel Exp $ * * Copyright 1999 Christophe Tronche * @@ -95,6 +95,8 @@ void dissect_bpdu(const u_char *pd, int offset, frame_data *fd, proto_tree *tree proto_item *ti; const u_char *bpdu; + OLD_CHECK_DISPLAY_AS_DATA(proto_bpdu, pd, offset, fd, tree); + bpdu = pd + offset; bpdu_type = (guint8) bpdu[BPDU_TYPE]; flags = (guint8) bpdu[BPDU_FLAGS]; diff --git a/packet-cdp.c b/packet-cdp.c index 1fd7bc59b0..70a02f22c2 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 * - * $Id: packet-cdp.c,v 1.24 2000/08/07 03:20:25 guy Exp $ + * $Id: packet-cdp.c,v 1.25 2000/08/13 14:08:04 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -101,6 +101,8 @@ dissect_cdp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guint32 naddresses; int addr_length; + OLD_CHECK_DISPLAY_AS_DATA(proto_cdp, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "CDP"); if (check_col(fd, COL_INFO)) diff --git a/packet-cgmp.c b/packet-cgmp.c index 65333f055b..1a2b4ebc62 100644 --- a/packet-cgmp.c +++ b/packet-cgmp.c @@ -1,7 +1,7 @@ /* packet-cgmp.c * Routines for the disassembly of the Cisco Group Management Protocol * - * $Id: packet-cgmp.c,v 1.3 2000/05/31 05:06:58 guy Exp $ + * $Id: packet-cgmp.c,v 1.4 2000/08/13 14:08:05 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -65,6 +65,8 @@ dissect_cgmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree *cgmp_tree = NULL; guint8 count; + OLD_CHECK_DISPLAY_AS_DATA(proto_cgmp, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "CGMP"); if (check_col(fd, COL_INFO)) diff --git a/packet-clnp.c b/packet-clnp.c index c302241269..27e452ef81 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.12 2000/08/07 03:20:26 guy Exp $ + * $Id: packet-clnp.c,v 1.13 2000/08/13 14:08:05 deniel Exp $ * Laurent Deniel * Ralf Schneider * @@ -1510,6 +1510,7 @@ static gboolean dissect_ositp_internal(const u_char *pd, int offset, void dissect_ositp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + OLD_CHECK_DISPLAY_AS_DATA(proto_cotp, pd, offset, fd, tree); if (!dissect_ositp_internal(pd, offset, fd, tree, FALSE)) old_dissect_data(pd, offset, fd, tree); } @@ -1534,6 +1535,8 @@ static void dissect_clnp(const u_char *pd, int offset, frame_data *fd, guint16 segment_offset = 0; guint len; + OLD_CHECK_DISPLAY_AS_DATA(proto_clnp, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "CLNP"); diff --git a/packet-cops.c b/packet-cops.c index e10d5dc337..09feb44f46 100644 --- a/packet-cops.c +++ b/packet-cops.c @@ -4,7 +4,7 @@ * * Copyright 2000, Heikki Vatiainen * - * $Id: packet-cops.c,v 1.3 2000/08/07 03:20:27 guy Exp $ + * $Id: packet-cops.c,v 1.4 2000/08/13 14:08:07 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -151,6 +151,8 @@ static void dissect_cops(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint8 op_code; + CHECK_DISPLAY_AS_DATA(proto_cops, tvb, pinfo, tree); + pinfo->current_proto = "COPS"; if (check_col(pinfo->fd, COL_PROTOCOL)) col_add_str(pinfo->fd, COL_PROTOCOL, "COPS"); diff --git a/packet-ddtp.c b/packet-ddtp.c index 5f8c3efd54..057c8ccfc9 100644 --- a/packet-ddtp.c +++ b/packet-ddtp.c @@ -3,7 +3,7 @@ * see http://ddt.sourceforge.net/ * Olivier Abad * - * $Id: packet-ddtp.c,v 1.9 2000/08/07 03:20:27 guy Exp $ + * $Id: packet-ddtp.c,v 1.10 2000/08/13 14:08:08 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -103,6 +103,8 @@ dissect_ddtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *ddtp_tree; proto_item *ti; + CHECK_DISPLAY_AS_DATA(proto_ddtp, tvb, pinfo, tree); + pinfo->current_proto = "DDTP"; if (check_col(pinfo->fd, COL_PROTOCOL)) { /* Indicate what kind of message this is. */ diff --git a/packet-diameter.c b/packet-diameter.c index 49937fa026..bcf2c2b3bc 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.4 2000/08/07 03:20:28 guy Exp $ + * $Id: packet-diameter.c,v 1.5 2000/08/13 14:08:08 deniel Exp $ * * Copyright (c) 2000 by David Frascone * @@ -500,6 +500,7 @@ void dissect_diameter(const u_char *pd, int offset, frame_data *fd, gchar *codestrval; + OLD_CHECK_DISPLAY_AS_DATA(proto_diameter, pd, offset, fd, tree); if (gbl_commandCodeInHeader) hdrlength=sizeof(e_diameterhdr); diff --git a/packet-dns.c b/packet-dns.c index 5bc44802d7..3736943256 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.51 2000/08/09 07:15:19 guy Exp $ + * $Id: packet-dns.c,v 1.52 2000/08/13 14:08:08 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1728,6 +1728,8 @@ dissect_dns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { RCODE_REFUSED, "Refused" }, { 0, NULL } }; + OLD_CHECK_DISPLAY_AS_DATA(proto_dns, pd, offset, fd, tree); + dns_data_offset = offset; if (check_col(fd, COL_PROTOCOL)) diff --git a/packet-eigrp.c b/packet-eigrp.c index aa460534a3..1309783da3 100644 --- a/packet-eigrp.c +++ b/packet-eigrp.c @@ -1,6 +1,6 @@ /* packet-eigrp.c * - * $Id: packet-eigrp.c,v 1.5 2000/08/07 03:20:29 guy Exp $ + * $Id: packet-eigrp.c,v 1.6 2000/08/13 14:08:09 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -92,6 +92,8 @@ dissect_eigrp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_item *ti; guint16 cksum; + OLD_CHECK_DISPLAY_AS_DATA(proto_eigrp, pd, offset, fd, tree); + /* Avoids alignment problems on many architectures. */ memcpy(&ih, &pd[offset], sizeof(e_eigrp)); /* To do: check for runts, errs, etc. */ diff --git a/packet-esis.c b/packet-esis.c index 057188b78c..b38450313c 100644 --- a/packet-esis.c +++ b/packet-esis.c @@ -2,7 +2,7 @@ * Routines for ISO/OSI End System to Intermediate System * Routeing Exchange Protocol ISO 9542. * - * $Id: packet-esis.c,v 1.6 2000/08/10 16:04:33 deniel Exp $ + * $Id: packet-esis.c,v 1.7 2000/08/13 14:08:09 deniel Exp $ * Ralf Schneider * * Ethereal - Network traffic analyzer @@ -299,6 +299,8 @@ dissect_esis(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { int variable_len = 0; u_int tmp_uint = 0; + OLD_CHECK_DISPLAY_AS_DATA(proto_esis, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "ESIS"); diff --git a/packet-eth.c b/packet-eth.c index 4f5ff0995a..600612a1ba 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.43 2000/08/07 03:20:32 guy Exp $ + * $Id: packet-eth.c,v 1.44 2000/08/13 14:08:10 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -157,6 +157,8 @@ dissect_eth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static tvbuff_t *trailer_tvb; static proto_tree *fh_tree; + CHECK_DISPLAY_AS_DATA(proto_eth, tvb, pinfo, tree); + tvb_compat(tvb, &pd, (int*)ð_offset); /* Reset this static variable to NULL since I test it's value later */ diff --git a/packet-fddi.c b/packet-fddi.c index 90828623e5..f96dbe3acb 100644 --- a/packet-fddi.c +++ b/packet-fddi.c @@ -3,7 +3,7 @@ * * Laurent Deniel * - * $Id: packet-fddi.c,v 1.37 2000/08/07 03:20:33 guy Exp $ + * $Id: packet-fddi.c,v 1.38 2000/08/13 14:08:10 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -265,6 +265,8 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, u_char src_swapped[6], dst_swapped[6]; tvbuff_t *next_tvb; + CHECK_DISPLAY_AS_DATA(proto_fddi, tvb, pinfo, tree); + pinfo->current_proto = "FDDI"; if (check_col(pinfo->fd, COL_PROTOCOL)) col_add_str(pinfo->fd, COL_PROTOCOL, "FDDI"); diff --git a/packet-ftp.c b/packet-ftp.c index aff4f1dbd1..ceec43993d 100644 --- a/packet-ftp.c +++ b/packet-ftp.c @@ -2,7 +2,7 @@ * Routines for ftp packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-ftp.c,v 1.17 2000/08/07 03:20:34 guy Exp $ + * $Id: packet-ftp.c,v 1.18 2000/08/13 14:08:11 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -66,6 +66,8 @@ dissect_ftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int i2; int max_data = pi.captured_len - offset; + OLD_CHECK_DISPLAY_AS_DATA(proto_ftp, pd, offset, fd, tree); + memset(rr, '\0', sizeof(rr)); memset(rd, '\0', sizeof(rd)); diff --git a/packet-giop.c b/packet-giop.c index d56f4b4bfe..b134d3198f 100644 --- a/packet-giop.c +++ b/packet-giop.c @@ -3,7 +3,7 @@ * * Laurent Deniel * - * $Id: packet-giop.c,v 1.16 2000/08/07 03:20:34 guy Exp $ + * $Id: packet-giop.c,v 1.17 2000/08/13 14:08:11 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -214,6 +214,9 @@ dissect_giop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) LocateRequestHeader locate_req; int i; + if (!proto_is_protocol_enabled(proto_giop)) + return FALSE; + #define END_OF_GIOP_MESSAGE (offset - first_offset - GIOP_HEADER_SIZE) if (!BYTES_ARE_IN_FRAME(offset, GIOP_HEADER_SIZE)) { diff --git a/packet-gre.c b/packet-gre.c index e30bd9a65f..1d503ecf06 100644 --- a/packet-gre.c +++ b/packet-gre.c @@ -2,7 +2,7 @@ * Routines for the Generic Routing Encapsulation (GRE) protocol * Brad Robel-Forrest * - * $Id: packet-gre.c,v 1.24 2000/08/07 03:20:35 guy Exp $ + * $Id: packet-gre.c,v 1.25 2000/08/13 14:08:11 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -83,6 +83,8 @@ dissect_gre(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { guint8 sre_length; tvbuff_t *next_tvb; + OLD_CHECK_DISPLAY_AS_DATA(proto_gre, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "GRE"); diff --git a/packet-h1.c b/packet-h1.c index 42534268a4..981c6063ff 100644 --- a/packet-h1.c +++ b/packet-h1.c @@ -2,7 +2,7 @@ * Routines for Sinec H1 packet disassembly * Gerrit Gehnen * - * $Id: packet-h1.c,v 1.11 2000/08/07 03:20:35 guy Exp $ + * $Id: packet-h1.c,v 1.12 2000/08/13 14:08:11 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -114,6 +114,9 @@ static gboolean dissect_h1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) unsigned int position = 3; unsigned int offset=0; + if (!proto_is_protocol_enabled(proto_h1)) + return FALSE; + if (!(tvb_get_guint8(tvb,offset) == 'S' && tvb_get_guint8(tvb,offset+1) == '5')) { return FALSE; } diff --git a/packet-hsrp.c b/packet-hsrp.c index b9cbd0c504..a781ba7451 100644 --- a/packet-hsrp.c +++ b/packet-hsrp.c @@ -4,7 +4,7 @@ * * Heikki Vatiainen * - * $Id: packet-hsrp.c,v 1.6 2000/08/07 03:20:36 guy Exp $ + * $Id: packet-hsrp.c,v 1.7 2000/08/13 14:08:12 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -93,6 +93,8 @@ dissect_hsrp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) struct hsrp_packet hsrp; gboolean short_packet = FALSE; + OLD_CHECK_DISPLAY_AS_DATA(proto_hsrp, pd, offset, fd, tree); + if (sizeof(struct hsrp_packet) > END_OF_FRAME) short_packet = TRUE; else diff --git a/packet-http.c b/packet-http.c index 5f487973ac..5b1e88366c 100644 --- a/packet-http.c +++ b/packet-http.c @@ -3,7 +3,7 @@ * * Guy Harris * - * $Id: packet-http.c,v 1.20 2000/08/07 03:20:36 guy Exp $ + * $Id: packet-http.c,v 1.21 2000/08/13 14:08:12 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -72,6 +72,8 @@ void dissect_http(const u_char *pd, int offset, frame_data *fd, proto_tree *tree u_char c; http_type_t http_type = HTTP_OTHERS; + OLD_CHECK_DISPLAY_AS_DATA(proto_http, pd, offset, fd, tree); + data = &pd[offset]; dataend = data + END_OF_FRAME; diff --git a/packet-icmpv6.c b/packet-icmpv6.c index 22edc16bbe..827d12ff14 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.19 2000/08/11 13:35:27 deniel Exp $ + * $Id: packet-icmpv6.c,v 1.20 2000/08/13 14:08:13 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -204,6 +204,8 @@ dissect_icmpv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) char *codename, *typename; int len; + OLD_CHECK_DISPLAY_AS_DATA(proto_icmpv6, pd, offset, fd, tree); + dp = (struct icmp6_hdr *)&pd[offset]; codename = typename = "Unknown"; len = sizeof(*dp); diff --git a/packet-icp.c b/packet-icp.c index 7041308d06..015035b599 100644 --- a/packet-icp.c +++ b/packet-icp.c @@ -2,7 +2,7 @@ * Routines for ICP (internet cache protocol) packet disassembly * RFC 2186 && RFC 2187 * - * $Id: packet-icp.c,v 1.10 2000/08/07 03:20:38 guy Exp $ + * $Id: packet-icp.c,v 1.11 2000/08/13 14:08:14 deniel Exp $ * * Ethereal - Network traffic analyzer * By Peter Torvals @@ -181,6 +181,8 @@ static void dissect_icp(const u_char *pd, int offset, frame_data *fd, gchar *opcodestrval; + OLD_CHECK_DISPLAY_AS_DATA(proto_icp, pd, offset, fd, tree); + /* TBD: check if this is a fragment or first part of udp packet */ icph.opcode=pd[offset]; icph.version=pd[offset+1]; diff --git a/packet-icq.c b/packet-icq.c index 0241af4b75..2722ae4c5c 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.20 2000/08/11 13:35:24 deniel Exp $ + * $Id: packet-icq.c,v 1.21 2000/08/13 14:08:15 deniel Exp $ * * Ethereal - Network traffic analyzer * By Johan Feyaerts @@ -2427,6 +2427,8 @@ static void dissect_icq(const u_char *pd, { int version = 0; + OLD_CHECK_DISPLAY_AS_DATA(proto_icq, pd, offset, fd, tree); + version = pletohs(&pd[offset + ICQ_VERSION]); switch (version) { case 0x0005: diff --git a/packet-imap.c b/packet-imap.c index 2dc6a51b38..eef04d6875 100644 --- a/packet-imap.c +++ b/packet-imap.c @@ -2,7 +2,7 @@ * Routines for imap packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-imap.c,v 1.8 2000/08/07 03:20:39 guy Exp $ + * $Id: packet-imap.c,v 1.9 2000/08/13 14:08:16 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -60,6 +60,8 @@ dissect_imap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int i2; int max_data = pi.captured_len - offset; + OLD_CHECK_DISPLAY_AS_DATA(proto_imap, pd, offset, fd, tree); + memset(rr, '\0', sizeof(rr)); memset(rd, '\0', sizeof(rd)); diff --git a/packet-ip.c b/packet-ip.c index bd6ebe3c37..88442d7c94 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.101 2000/08/11 13:35:20 deniel Exp $ + * $Id: packet-ip.c,v 1.102 2000/08/13 14:08:16 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -827,6 +827,8 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { guint8 nxt; guint16 ipsum; + OLD_CHECK_DISPLAY_AS_DATA(proto_ip, pd, offset, fd, tree); + /* To do: check for errs, etc. */ if (!BYTES_ARE_IN_FRAME(offset, IPH_MIN_LEN)) { old_dissect_data(pd, offset, fd, tree); @@ -1007,6 +1009,8 @@ dissect_icmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { guint8 addr_entry_size = 0; int i; + OLD_CHECK_DISPLAY_AS_DATA(proto_icmp, pd, offset, fd, tree); + /* Avoids alignment problems on many architectures. */ memcpy(&ih, &pd[offset], sizeof(e_icmp)); /* To do: check for runts, errs, etc. */ @@ -1208,6 +1212,8 @@ dissect_igmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *ti; gchar *type_str; + CHECK_DISPLAY_AS_DATA(proto_igmp, tvb, pinfo, tree); + pinfo->current_proto = "IGMP"; if (check_col(pinfo->fd, COL_PROTOCOL)) col_add_str(pinfo->fd, COL_PROTOCOL, "IGMP"); diff --git a/packet-ipp.c b/packet-ipp.c index 7cfd73e90b..b5b1e49fa2 100644 --- a/packet-ipp.c +++ b/packet-ipp.c @@ -3,7 +3,7 @@ * * Guy Harris * - * $Id: packet-ipp.c,v 1.11 2000/08/07 03:20:41 guy Exp $ + * $Id: packet-ipp.c,v 1.12 2000/08/13 14:08:17 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -167,6 +167,8 @@ void dissect_ipp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guint16 status_code; gchar *status_fmt; + OLD_CHECK_DISPLAY_AS_DATA(proto_ipp, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "IPP"); if (check_col(fd, COL_INFO)) { diff --git a/packet-ipsec.c b/packet-ipsec.c index 5cb757c101..f63b2411e5 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.19 2000/08/07 03:20:41 guy Exp $ + * $Id: packet-ipsec.c,v 1.20 2000/08/13 14:08:17 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -153,6 +153,8 @@ dissect_ah(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) struct newah ah; int advance; + OLD_CHECK_DISPLAY_AS_DATA(proto_ah, pd, offset, fd, tree); + memcpy(&ah, (void *) &pd[offset], sizeof(ah)); advance = sizeof(ah) + ((ah.ah_len - 1) << 2); @@ -210,6 +212,8 @@ dissect_esp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_item *ti; struct newesp esp; + OLD_CHECK_DISPLAY_AS_DATA(proto_esp, pd, offset, fd, tree); + memcpy(&esp, (void *) &pd[offset], sizeof(esp)); /* @@ -248,6 +252,8 @@ dissect_ipcomp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) struct ipcomp ipcomp; char *p; + OLD_CHECK_DISPLAY_AS_DATA(proto_ipcomp, pd, offset, fd, tree); + memcpy(&ipcomp, (void *) &pd[offset], sizeof(ipcomp)); /* diff --git a/packet-ipv6.c b/packet-ipv6.c index 27b20eb2dc..76198a202a 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.42 2000/08/11 22:18:13 deniel Exp $ + * $Id: packet-ipv6.c,v 1.43 2000/08/13 14:08:06 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -295,6 +295,8 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { struct ip6_hdr ipv6; + OLD_CHECK_DISPLAY_AS_DATA(proto_ipv6, pd, offset, fd, tree); + memcpy(&ipv6, (void *) &pd[offset], sizeof(ipv6)); pi.ipproto = ipv6.ip6_nxt; /* XXX make work TCP follow (ipproto = 6) */ diff --git a/packet-ipx.c b/packet-ipx.c index f28ce4aeb8..e644b83b2e 100644 --- a/packet-ipx.c +++ b/packet-ipx.c @@ -2,7 +2,7 @@ * Routines for NetWare's IPX * Gilbert Ramirez * - * $Id: packet-ipx.c,v 1.63 2000/08/07 03:20:42 guy Exp $ + * $Id: packet-ipx.c,v 1.64 2000/08/13 14:08:18 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -290,6 +290,7 @@ dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint16 ipx_dsocket, ipx_ssocket; + CHECK_DISPLAY_AS_DATA(proto_ipx, tvb, pinfo, tree); pinfo->current_proto = "IPX"; @@ -440,6 +441,8 @@ dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 conn_ctrl; guint8 datastream_type; + CHECK_DISPLAY_AS_DATA(proto_spx, tvb, pinfo, tree); + pinfo->current_proto = "SPX"; if (check_col(pinfo->fd, COL_PROTOCOL)) col_add_str(pinfo->fd, COL_PROTOCOL, "SPX"); @@ -483,6 +486,8 @@ dissect_ipxmsg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *ti; guint8 conn_number, sig_char; + CHECK_DISPLAY_AS_DATA(proto_ipxmsg, tvb, pinfo, tree); + pinfo->current_proto = "IPX MSG"; if (check_col(pinfo->fd, COL_PROTOCOL)) @@ -522,6 +527,8 @@ dissect_ipxrip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) char *rip_type[3] = { "Request", "Response", "Unknown" }; + CHECK_DISPLAY_AS_DATA(proto_ipxrip, tvb, pinfo, tree); + pinfo->current_proto = "IPX RIP"; if (check_col(pinfo->fd, COL_PROTOCOL)) col_add_str(pinfo->fd, COL_PROTOCOL, "IPX RIP"); @@ -668,6 +675,8 @@ dissect_ipxsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) char *sap_type[4] = { "General Query", "General Response", "Nearest Query", "Nearest Response" }; + CHECK_DISPLAY_AS_DATA(proto_sap, tvb, pinfo, tree); + pinfo->current_proto = "IPX SAP"; if (check_col(pinfo->fd, COL_PROTOCOL)) col_add_str(pinfo->fd, COL_PROTOCOL, "IPX SAP"); diff --git a/packet-irc.c b/packet-irc.c index 765acc4327..ac62239922 100644 --- a/packet-irc.c +++ b/packet-irc.c @@ -1,7 +1,7 @@ /* packet-irc.c * Routines for MSX irc packet dissection * - * $Id: packet-irc.c,v 1.7 2000/08/07 03:20:45 guy Exp $ + * $Id: packet-irc.c,v 1.8 2000/08/13 14:08:18 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -78,6 +78,8 @@ dissect_irc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int start, cur, len; const u_char *i; + OLD_CHECK_DISPLAY_AS_DATA(proto_irc, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "IRC"); diff --git a/packet-isakmp.c b/packet-isakmp.c index b63d93562e..a945adcc4d 100644 --- a/packet-isakmp.c +++ b/packet-isakmp.c @@ -3,7 +3,7 @@ * (ISAKMP) (RFC 2408) * Brad Robel-Forrest * - * $Id: packet-isakmp.c,v 1.25 2000/08/11 13:35:18 deniel Exp $ + * $Id: packet-isakmp.c,v 1.26 2000/08/13 14:08:18 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -350,6 +350,8 @@ dissect_isakmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { struct isakmp_hdr * hdr = (struct isakmp_hdr *)(pd + offset); guint32 len; + + OLD_CHECK_DISPLAY_AS_DATA(proto_isakmp, pd, offset, fd, tree); if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "ISAKMP"); diff --git a/packet-isis-hello.c b/packet-isis-hello.c index a268f2db2c..25ad8d4107 100644 --- a/packet-isis-hello.c +++ b/packet-isis-hello.c @@ -1,7 +1,7 @@ /* packet-isis-hello.c * Routines for decoding isis hello packets and their CLVs * - * $Id: packet-isis-hello.c,v 1.9 2000/06/19 08:33:48 guy Exp $ + * $Id: packet-isis-hello.c,v 1.10 2000/08/13 14:08:19 deniel Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -427,6 +427,8 @@ isis_dissect_isis_hello(int hello_type, int header_length, int id_length, int hlen; guint16 pdu_length; + OLD_CHECK_DISPLAY_AS_DATA(proto_isis_hello, pd, offset, fd, tree); + if (hello_type == ISIS_TYPE_PTP_HELLO) { hlen = 1+id_length+2+2+1; } else { diff --git a/packet-isis-lsp.c b/packet-isis-lsp.c index 2d14613276..fdefde0402 100644 --- a/packet-isis-lsp.c +++ b/packet-isis-lsp.c @@ -1,7 +1,7 @@ /* packet-isis-lsp.c * Routines for decoding isis lsp packets and their CLVs * - * $Id: packet-isis-lsp.c,v 1.8 2000/06/19 08:33:48 guy Exp $ + * $Id: packet-isis-lsp.c,v 1.9 2000/08/13 14:08:22 deniel Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -795,6 +795,8 @@ isis_dissect_isis_lsp(int lsp_type, int header_length, int id_length, char sbuf[128]; int inx, q, some, value, len; + OLD_CHECK_DISPLAY_AS_DATA(proto_isis_lsp, pd, offset, fd, tree); + hlen = 2+2+id_length+2+4+2+1; if (!BYTES_ARE_IN_FRAME(offset, hlen)) { diff --git a/packet-isis-snp.c b/packet-isis-snp.c index fb105d562f..e0001f1eae 100644 --- a/packet-isis-snp.c +++ b/packet-isis-snp.c @@ -1,7 +1,7 @@ /* packet-isis-snp.c * Routines for decoding isis complete & partial SNP and their payload * - * $Id: packet-isis-snp.c,v 1.6 2000/06/19 08:33:49 guy Exp $ + * $Id: packet-isis-snp.c,v 1.7 2000/08/13 14:08:22 deniel Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -248,6 +248,8 @@ isis_dissect_isis_csnp(int type, int header_length, int id_length, guint16 pdu_length; int len; + OLD_CHECK_DISPLAY_AS_DATA(proto_isis_csnp, pd, offset, fd, tree); + hlen = 2+id_length+1+id_length+2+id_length+2; if (!BYTES_ARE_IN_FRAME(offset, hlen)) { @@ -331,6 +333,8 @@ isis_dissect_isis_psnp(int type, int header_length, int id_length, guint16 pdu_length; int len; + OLD_CHECK_DISPLAY_AS_DATA(proto_isis_psnp, pd, offset, fd, tree); + hlen = 2+id_length+1; if (!BYTES_ARE_IN_FRAME(offset, hlen)) { diff --git a/packet-isis.c b/packet-isis.c index 6f6c455827..b91369fe16 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.13 2000/08/10 16:04:33 deniel Exp $ + * $Id: packet-isis.c,v 1.14 2000/08/13 14:08:23 deniel Exp $ * Stuart Stanley * * Ethereal - Network traffic analyzer @@ -139,6 +139,8 @@ dissect_isis(const u_char *pd, int offset, frame_data *fd, proto_tree *isis_tree = NULL; int id_length; + OLD_CHECK_DISPLAY_AS_DATA(proto_isis, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "ISIS"); diff --git a/packet-isl.c b/packet-isl.c index 3d4dc51498..9d312ec054 100644 --- a/packet-isl.c +++ b/packet-isl.c @@ -1,7 +1,7 @@ /* packet-isl.c * Routines for Cisco ISL Ethernet header disassembly * - * $Id: packet-isl.c,v 1.14 2000/08/07 03:20:46 guy Exp $ + * $Id: packet-isl.c,v 1.15 2000/08/13 14:08:23 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -145,6 +145,8 @@ dissect_isl(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guint8 type; guint16 length; tvbuff_t *next_tvb; + + OLD_CHECK_DISPLAY_AS_DATA(proto_isl, pd, offset, fd, tree); if (!BYTES_ARE_IN_FRAME(offset, ISL_HEADER_SIZE)) { old_dissect_data(pd, offset, fd, tree); diff --git a/packet-kerberos.c b/packet-kerberos.c index 5f40ee404c..79de746daa 100644 --- a/packet-kerberos.c +++ b/packet-kerberos.c @@ -3,7 +3,7 @@ * Wes Hardaker (c) 2000 * wjhardaker@ucdavis.edu * - * $Id: packet-kerberos.c,v 1.2 2000/08/11 08:21:07 guy Exp $ + * $Id: packet-kerberos.c,v 1.3 2000/08/13 14:08:23 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -289,6 +289,8 @@ dissect_kerberos(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guchar *str; int tmp_pos1, tmp_pos2; + OLD_CHECK_DISPLAY_AS_DATA(proto_kerberos, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "KRB5"); diff --git a/packet-l2tp.c b/packet-l2tp.c index c912bfddd4..b047d5c39e 100644 --- a/packet-l2tp.c +++ b/packet-l2tp.c @@ -7,7 +7,7 @@ * Laurent Cazalet * Thomas Parvais * - * $Id: packet-l2tp.c,v 1.14 2000/08/07 03:20:47 guy Exp $ + * $Id: packet-l2tp.c,v 1.15 2000/08/13 14:08:24 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -294,6 +294,8 @@ dissect_l2tp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) tvbuff_t *tvb; tvbuff_t *next_tvb; + OLD_CHECK_DISPLAY_AS_DATA(proto_l2tp, pd, offset, fd, tree); + pi.current_proto = "L2TP"; if (check_col(fd, COL_PROTOCOL)) /* build output for closed L2tp frame displayed */ col_add_str(fd, COL_PROTOCOL, "L2TP"); diff --git a/packet-lapb.c b/packet-lapb.c index 225f785794..7396f6d054 100644 --- a/packet-lapb.c +++ b/packet-lapb.c @@ -2,7 +2,7 @@ * Routines for lapb frame disassembly * Olivier Abad * - * $Id: packet-lapb.c,v 1.21 2000/05/31 03:58:53 gram Exp $ + * $Id: packet-lapb.c,v 1.22 2000/08/13 14:08:24 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -57,6 +57,8 @@ dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 byte0; tvbuff_t *next_tvb; + CHECK_DISPLAY_AS_DATA(proto_lapb, tvb, pinfo, tree); + pinfo->current_proto = "LAPB"; if (check_col(pinfo->fd, COL_PROTOCOL)) diff --git a/packet-lapd.c b/packet-lapd.c index 021394dc8b..6566bd4b2b 100644 --- a/packet-lapd.c +++ b/packet-lapd.c @@ -2,7 +2,7 @@ * Routines for LAPD frame disassembly * Gilbert Ramirez * - * $Id: packet-lapd.c,v 1.12 2000/08/07 03:20:48 guy Exp $ + * $Id: packet-lapd.c,v 1.13 2000/08/13 14:08:24 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -94,6 +94,8 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) gboolean is_response; tvbuff_t *next_tvb; + CHECK_DISPLAY_AS_DATA(proto_lapd, tvb, pinfo, tree); + pinfo->current_proto = "LAPD"; if (check_col(pinfo->fd, COL_PROTOCOL)) diff --git a/packet-ldap.c b/packet-ldap.c index e1764ddba8..8578ce4242 100644 --- a/packet-ldap.c +++ b/packet-ldap.c @@ -1,7 +1,7 @@ /* packet-ldap.c * Routines for ldap packet dissection * - * $Id: packet-ldap.c,v 1.14 2000/08/11 13:35:15 deniel Exp $ + * $Id: packet-ldap.c,v 1.15 2000/08/13 14:08:24 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -837,6 +837,8 @@ dissect_ldap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int first_time = 1; int ret; + OLD_CHECK_DISPLAY_AS_DATA(proto_ldap, pd, offset, fd, tree); + if (tree) { ti = proto_tree_add_item(tree, proto_ldap, NullTVB, offset, END_OF_FRAME, FALSE); diff --git a/packet-llc.c b/packet-llc.c index e43b8fd664..167028fed0 100644 --- a/packet-llc.c +++ b/packet-llc.c @@ -2,7 +2,7 @@ * Routines for IEEE 802.2 LLC layer * Gilbert Ramirez * - * $Id: packet-llc.c,v 1.67 2000/08/11 08:19:32 guy Exp $ + * $Id: packet-llc.c,v 1.68 2000/08/13 14:08:26 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -278,6 +278,8 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) const guint8 *pd; int offset; + CHECK_DISPLAY_AS_DATA(proto_llc, tvb, pinfo, tree); + pinfo->current_proto = "LLC"; if (check_col(pinfo->fd, COL_PROTOCOL)) { diff --git a/packet-lpd.c b/packet-lpd.c index aad54d273e..6b48224204 100644 --- a/packet-lpd.c +++ b/packet-lpd.c @@ -2,7 +2,7 @@ * Routines for LPR and LPRng packet disassembly * Gilbert Ramirez * - * $Id: packet-lpd.c,v 1.21 2000/08/07 03:20:51 guy Exp $ + * $Id: packet-lpd.c,v 1.22 2000/08/13 14:08:27 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -78,6 +78,8 @@ dissect_lpd(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) "Bad job format, do not retry" }; + OLD_CHECK_DISPLAY_AS_DATA(proto_lpd, pd, offset, fd, tree); + /* rfc1179 states that all responses are 1 byte long */ if (END_OF_FRAME == 1) { lpr_packet_type = response; diff --git a/packet-mapi.c b/packet-mapi.c index 5a75090276..191a9e19d3 100644 --- a/packet-mapi.c +++ b/packet-mapi.c @@ -1,7 +1,7 @@ /* packet-mapi.c * Routines for MSX mapi packet dissection * - * $Id: packet-mapi.c,v 1.8 2000/08/07 03:20:51 guy Exp $ + * $Id: packet-mapi.c,v 1.9 2000/08/13 14:08:27 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -55,6 +55,8 @@ dissect_mapi(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree *mapi_tree, *ti; + OLD_CHECK_DISPLAY_AS_DATA(proto_mapi, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "MAPI"); diff --git a/packet-mip.c b/packet-mip.c index f804ef8da8..c6913b8d53 100644 --- a/packet-mip.c +++ b/packet-mip.c @@ -2,7 +2,7 @@ * Routines for Mobile IP dissection * Copyright 2000, Stefan Raab * - * $Id: packet-mip.c,v 1.7 2000/08/11 13:35:14 deniel Exp $ + * $Id: packet-mip.c,v 1.8 2000/08/13 14:08:28 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -147,6 +147,8 @@ dissect_mip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) packet_info *pinfo = π tvb = tvb_create_from_top(offset); + CHECK_DISPLAY_AS_DATA(proto_mip, tvb, pinfo, tree); + /* Make entries in Protocol column and Info column on summary display */ pinfo->current_proto = "Mobile IP"; diff --git a/packet-mount.c b/packet-mount.c index 97d05ce9c4..7a5596ab17 100644 --- a/packet-mount.c +++ b/packet-mount.c @@ -1,7 +1,7 @@ /* packet-mount.c * Routines for mount dissection * - * $Id: packet-mount.c,v 1.15 2000/05/31 05:07:18 guy Exp $ + * $Id: packet-mount.c,v 1.16 2000/08/13 14:08:29 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -83,6 +83,9 @@ dissect_fhstatus(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { guint32 status; + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; status = EXTRACT_UINT(pd, offset+0); if (tree) { @@ -107,6 +110,10 @@ static int dissect_mount_dirpath_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + if ( tree ) { offset = dissect_rpc_string(pd,offset,fd,tree,hf_mount_path,NULL); @@ -121,6 +128,10 @@ static int dissect_mount_mnt_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + offset = dissect_fhstatus(pd, offset, fd, tree); return offset; @@ -138,6 +149,9 @@ dissect_mountlist(const u_char *pd, int offset, frame_data *fd, proto_tree *tree char* hostname; char* directory; + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + if (tree) { mountlist_item = proto_tree_add_item(tree, hf_mount_mountlist, NullTVB, offset+0, END_OF_FRAME, FALSE); @@ -167,6 +181,10 @@ static int dissect_mount_dump_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + offset = dissect_rpc_list(pd,offset,fd,tree,dissect_mountlist); return offset; @@ -178,6 +196,10 @@ dissect_mount_dump_reply(const u_char *pd, int offset, frame_data *fd, static int dissect_group(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + offset = dissect_rpc_string(pd, offset, fd, tree, hf_mount_groups_group,NULL); return offset; @@ -197,6 +219,9 @@ dissect_exportlist(const u_char *pd, int offset, frame_data *fd, proto_tree *tre proto_item* groups_tree = NULL; char* directory; + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + if (tree) { exportlist_item = proto_tree_add_item(tree, hf_mount_exportlist, NullTVB, offset+0, END_OF_FRAME, FALSE); @@ -241,6 +266,10 @@ static int dissect_mount_export_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + offset = dissect_rpc_list(pd,offset,fd,tree,dissect_exportlist); return offset; @@ -318,6 +347,9 @@ dissect_mount_pathconf_reply(const u_char *pd, int offset, frame_data *fd, proto_item *ti; proto_tree *mask_tree; + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + /* * Extract the mask first, so we know which other fields the * server was able to return to us. @@ -506,6 +538,9 @@ dissect_mountstat3(const u_char *pd, int offset, frame_data *fd, proto_tree *tre { guint32 mountstat3; + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + if (!BYTES_ARE_IN_FRAME(offset,4)) return offset; mountstat3 = EXTRACT_UINT(pd, offset+0); @@ -528,7 +563,10 @@ dissect_mount3_mnt_reply(const u_char *pd, int offset, frame_data *fd, guint32 auth_flavors; guint32 auth_flavor; guint32 auth_flavor_i; - + + if (!proto_is_protocol_enabled(proto_mount)) + return offset; + offset = dissect_mountstat3(pd, offset, fd, tree, hf_mount_status, &status); switch (status) { case 0: diff --git a/packet-mpls.c b/packet-mpls.c index a895b6bc42..b1e1ca3d70 100644 --- a/packet-mpls.c +++ b/packet-mpls.c @@ -3,7 +3,7 @@ * * (c) Copyright Ashok Narayanan * - * $Id: packet-mpls.c,v 1.8 2000/08/07 03:20:51 guy Exp $ + * $Id: packet-mpls.c,v 1.9 2000/08/13 14:08:29 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -134,6 +134,8 @@ dissect_mpls(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree *mpls_tree; proto_item *ti; + OLD_CHECK_DISPLAY_AS_DATA(proto_mpls, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) { col_add_str(fd,COL_PROTOCOL, "MPLS"); } diff --git a/packet-msproxy.c b/packet-msproxy.c index 090afcdaef..9a7affe23c 100644 --- a/packet-msproxy.c +++ b/packet-msproxy.c @@ -2,7 +2,7 @@ * Routines for Microsoft Proxy packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-msproxy.c,v 1.8 2000/08/11 13:35:11 deniel Exp $ + * $Id: packet-msproxy.c,v 1.9 2000/08/13 14:08:29 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1164,6 +1164,7 @@ static void dissect_msproxy(const u_char *pd, int offset, frame_data *fd, proto_ hash_entry_t *hash_info; conversation_t *conversation; + OLD_CHECK_DISPLAY_AS_DATA(proto_msproxy, pd, offset, fd, tree); conversation = find_conversation( &pi.src, &pi.dst, pi.ptype, pi.srcport, pi.destport); diff --git a/packet-nbipx.c b/packet-nbipx.c index 81a2204652..8bb437cdda 100644 --- a/packet-nbipx.c +++ b/packet-nbipx.c @@ -2,7 +2,7 @@ * Routines for NetBIOS over IPX packet disassembly * Gilbert Ramirez * - * $Id: packet-nbipx.c,v 1.22 2000/08/07 03:20:52 guy Exp $ + * $Id: packet-nbipx.c,v 1.23 2000/08/13 14:08:30 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -117,6 +117,8 @@ dissect_nbipx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { int max_data = pi.captured_len - offset; + OLD_CHECK_DISPLAY_AS_DATA(proto_nbipx, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "NBIPX"); diff --git a/packet-nbns.c b/packet-nbns.c index d342502d5d..1c593fdb6c 100644 --- a/packet-nbns.c +++ b/packet-nbns.c @@ -4,7 +4,7 @@ * Gilbert Ramirez * Much stuff added by Guy Harris * - * $Id: packet-nbns.c,v 1.44 2000/08/07 03:20:53 guy Exp $ + * $Id: packet-nbns.c,v 1.45 2000/08/13 14:08:30 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1133,6 +1133,8 @@ dissect_nbns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guint16 id, flags, quest, ans, auth, add; int cur_off; + OLD_CHECK_DISPLAY_AS_DATA(proto_nbns, pd, offset, fd, tree); + nbns_data_offset = offset; if (check_col(fd, COL_PROTOCOL)) @@ -1293,6 +1295,8 @@ dissect_nbdgm(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int name_type; int len; + OLD_CHECK_DISPLAY_AS_DATA(proto_nbdgm, pd, offset, fd, tree); + header.msg_type = pd[offset]; flags = pd[offset+1]; @@ -1586,6 +1590,8 @@ dissect_nbss(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int max_data; int is_cifs; + OLD_CHECK_DISPLAY_AS_DATA(proto_nbss, pd, offset, fd, tree); + msg_type = pd[offset]; if (pi.match_port == TCP_PORT_CIFS) { diff --git a/packet-ncp.c b/packet-ncp.c index 15ce9c670b..830d9213bd 100644 --- a/packet-ncp.c +++ b/packet-ncp.c @@ -3,7 +3,7 @@ * Gilbert Ramirez * Modified to allow NCP over TCP/IP decodes by James Coe * - * $Id: packet-ncp.c,v 1.39 2000/08/07 03:20:54 guy Exp $ + * $Id: packet-ncp.c,v 1.40 2000/08/13 14:08:31 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -259,6 +259,8 @@ dissect_ncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int hdr_offset = 0; int commhdr; + CHECK_DISPLAY_AS_DATA(proto_ncp, tvb, pinfo, tree); + pinfo->current_proto = "NCP"; if (check_col(pinfo->fd, COL_PROTOCOL)) col_add_str(pinfo->fd, COL_PROTOCOL, "NCP"); diff --git a/packet-netbios.c b/packet-netbios.c index 56cf58491f..96a2c6d413 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.21 2000/08/07 03:20:55 guy Exp $ + * $Id: packet-netbios.c,v 1.22 2000/08/13 14:08:32 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -974,6 +974,8 @@ static void dissect_netbios(const u_char *pd, int offset, frame_data *fd, /* Find NetBIOS marker EFFF, this is done because I have seen an extra LLC */ /* byte on our network. This only checks for one extra LLC byte. */ + OLD_CHECK_DISPLAY_AS_DATA(proto_netbios, pd, offset, fd, tree); + if (( pd[offset + 2] != 0xff) || ( pd[offset + 3] != 0xef)){ ++offset; if (( pd[offset + 2] != 0xff) diff --git a/packet-nlm.c b/packet-nlm.c index a52a3112bd..6eb3c43e69 100644 --- a/packet-nlm.c +++ b/packet-nlm.c @@ -1,7 +1,7 @@ /* packet-nlm.c * Routines for nlm dissection * - * $Id: packet-nlm.c,v 1.7 2000/08/08 06:22:08 girlich Exp $ + * $Id: packet-nlm.c,v 1.8 2000/08/13 14:08:33 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -105,6 +105,9 @@ dissect_nlm_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int versio tvb_compat(tvb, &pd, &compat_offset); + if (!proto_is_protocol_enabled(proto_nlm)) + return offset; + if (tree) { lock_item = proto_tree_add_item(tree, hf_nlm_lock, tvb, offset, tvb_length_remaining(tvb, offset), FALSE); @@ -148,6 +151,9 @@ dissect_nlm1_lock_call(const u_char* pd, int offset, frame_data* fd, proto_tree* #endif int noffset; + if (!proto_is_protocol_enabled(proto_nlm)) + return tvb_raw_offset(tvb); + noffset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, 0); noffset = dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_block, noffset); noffset = dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_exclusive, noffset); @@ -171,6 +177,9 @@ dissect_nlm1_unlock_call(const u_char* pd, int offset, frame_data* fd, proto_tre #endif int noffset; + if (!proto_is_protocol_enabled(proto_nlm)) + return tvb_raw_offset(tvb); + noffset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, 0); noffset = dissect_nlm_lock(tvb, pinfo, tree, 1, noffset); return tvb_raw_offset(tvb) + noffset; @@ -190,6 +199,9 @@ dissect_nlm1_gen_reply(const u_char* pd, int offset, frame_data* fd, proto_tree* #endif int noffset; + if (!proto_is_protocol_enabled(proto_nlm)) + return tvb_raw_offset(tvb); + noffset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, 0); noffset = dissect_rpc_uint32_tvb(tvb, pinfo, tree, hf_nlm_state, noffset); return tvb_raw_offset(tvb) + noffset; @@ -298,6 +310,9 @@ dissect_nlm4_test_call(const u_char* pd, int offset, frame_data* fd, proto_tree* #endif int noffset; + if (!proto_is_protocol_enabled(proto_nlm)) + return tvb_raw_offset(tvb); + noffset = dissect_rpc_data_tvb(tvb, pinfo, tree, hf_nlm_cookie, 0); dissect_rpc_bool_tvb(tvb, pinfo, tree, hf_nlm_exclusive, noffset); noffset += 4; diff --git a/packet-nntp.c b/packet-nntp.c index 723904a3a0..0a27f21f33 100644 --- a/packet-nntp.c +++ b/packet-nntp.c @@ -2,7 +2,7 @@ * Routines for nntp packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-nntp.c,v 1.11 2000/08/07 03:20:56 guy Exp $ + * $Id: packet-nntp.c,v 1.12 2000/08/13 14:08:31 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -59,6 +59,8 @@ dissect_nntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int linelen; int max_data = pi.captured_len - offset; + OLD_CHECK_DISPLAY_AS_DATA(proto_nntp, pd, offset, fd, tree); + data = &pd[offset]; dataend = data + END_OF_FRAME; if (dataend > data + max_data) diff --git a/packet-ntp.c b/packet-ntp.c index 265315de72..eeb7cb303a 100644 --- a/packet-ntp.c +++ b/packet-ntp.c @@ -2,7 +2,7 @@ * Routines for NTP packet dissection * Copyright 1999, Nathan Neulinger * - * $Id: packet-ntp.c,v 1.15 2000/08/11 13:35:09 deniel Exp $ + * $Id: packet-ntp.c,v 1.16 2000/08/13 14:08:25 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -236,6 +236,8 @@ dissect_ntp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) gchar buff[NTP_TS_SIZE]; int i; + OLD_CHECK_DISPLAY_AS_DATA(proto_ntp, pd, offset, fd, tree); + /* get at least a full packet structure */ if ( !BYTES_ARE_IN_FRAME(offset, 48) ) /* 48 without keyid or mac */ return; diff --git a/packet-null.c b/packet-null.c index a8b1f3c808..9b23a930b7 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.26 2000/08/07 03:20:57 guy Exp $ + * $Id: packet-null.c,v 1.27 2000/08/13 14:08:36 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -228,6 +228,8 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) const guint8 *next_pd; int next_offset; + CHECK_DISPLAY_AS_DATA(proto_null, tvb, pinfo, tree); + /* * See comment in "capture_null()" for an explanation of what we're * doing. diff --git a/packet-ospf.c b/packet-ospf.c index 9c18ed5f2a..a770ef4f6a 100644 --- a/packet-ospf.c +++ b/packet-ospf.c @@ -2,7 +2,7 @@ * Routines for OSPF packet disassembly * (c) Copyright Hannes R. Boehm * - * $Id: packet-ospf.c,v 1.26 2000/08/07 03:20:58 guy Exp $ + * $Id: packet-ospf.c,v 1.27 2000/08/13 14:08:36 deniel Exp $ * * At this time, this module is able to analyze OSPF * packets as specified in RFC2328. MOSPF (RFC1584) and other @@ -98,6 +98,8 @@ dissect_ospf(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { {OSPF_LS_ACK, "LS Acknowledge" }, {0, NULL } }; + OLD_CHECK_DISPLAY_AS_DATA(proto_ospf, pd, offset, fd, tree); + memcpy(&ospfh, &pd[offset], sizeof(e_ospfhdr)); packet_type = match_strval(ospfh.packet_type, pt_vals); diff --git a/packet-pim.c b/packet-pim.c index 35c50b9cb9..d24767eb77 100644 --- a/packet-pim.c +++ b/packet-pim.c @@ -2,7 +2,7 @@ * Routines for PIM disassembly * (c) Copyright Jun-ichiro itojun Hagino * - * $Id: packet-pim.c,v 1.16 2000/08/11 13:35:08 deniel Exp $ + * $Id: packet-pim.c,v 1.17 2000/08/13 14:08:37 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -193,6 +193,8 @@ dissect_pim(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree *pimopt_tree = NULL; proto_item *tiopt; + OLD_CHECK_DISPLAY_AS_DATA(proto_pim, pd, offset, fd, tree); + /* avoid alignment problem */ memcpy(&pim, &pd[offset], sizeof(pim)); diff --git a/packet-pop.c b/packet-pop.c index d152212b8b..66605a13c0 100644 --- a/packet-pop.c +++ b/packet-pop.c @@ -2,7 +2,7 @@ * Routines for pop packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-pop.c,v 1.16 2000/08/07 03:20:59 guy Exp $ + * $Id: packet-pop.c,v 1.17 2000/08/13 14:08:37 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -62,6 +62,8 @@ dissect_pop(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int i2; int max_data = pi.captured_len - offset; + OLD_CHECK_DISPLAY_AS_DATA(proto_pop, pd, offset, fd, tree); + memset(rr, '\0', sizeof(rr)); memset(rd, '\0', sizeof(rd)); diff --git a/packet-portmap.c b/packet-portmap.c index 84c4dfcc54..d256bd9124 100644 --- a/packet-portmap.c +++ b/packet-portmap.c @@ -1,7 +1,7 @@ /* packet-portmap.c * Routines for portmap dissection * - * $Id: packet-portmap.c,v 1.17 2000/06/12 08:47:34 guy Exp $ + * $Id: packet-portmap.c,v 1.18 2000/08/13 14:07:55 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -65,6 +65,10 @@ int dissect_getport_call(const u_char *pd, int offset, frame_data *fd, { guint32 proto; guint32 prog; + + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + if ( !BYTES_ARE_IN_FRAME(offset, 16)) return offset; if ( tree ) @@ -90,6 +94,9 @@ int dissect_getport_call(const u_char *pd, int offset, frame_data *fd, int dissect_getport_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + if ( !BYTES_ARE_IN_FRAME(offset, 4)) return offset; if ( tree ) { @@ -105,6 +112,10 @@ int dissect_set_call(const u_char *pd, int offset, frame_data *fd, { guint32 proto; guint32 prog; + + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + if ( !BYTES_ARE_IN_FRAME(offset, 16)) return offset; if ( tree ) @@ -133,6 +144,10 @@ int dissect_unset_call(const u_char *pd, int offset, frame_data *fd, { guint32 proto; guint32 prog; + + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + if ( !BYTES_ARE_IN_FRAME(offset, 16)) return offset; if ( tree ) @@ -158,6 +173,9 @@ int dissect_unset_call(const u_char *pd, int offset, frame_data *fd, int dissect_set_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + if ( tree ) { if ( !BYTES_ARE_IN_FRAME(offset, 4)) return offset; @@ -175,6 +193,9 @@ dissect_dump_entry(const u_char* pd, int offset, frame_data* fd, proto_tree* tre int prog, version, proto, port; proto_item *ti, *subtree; + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + if ( ! BYTES_ARE_IN_FRAME(offset, 16) ) { if ( tree ) @@ -211,6 +232,9 @@ dissect_dump_entry(const u_char* pd, int offset, frame_data* fd, proto_tree* tre int dissect_dump_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + offset = dissect_rpc_list(pd, offset, fd, tree, dissect_dump_entry); return offset; } @@ -296,6 +320,9 @@ dissect_rpcb(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int dissect_rpcb3_getaddr_call(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + offset = dissect_rpcb(pd, offset, fd, tree); return offset; @@ -306,6 +333,9 @@ int dissect_rpcb3_getaddr_call(const u_char *pd, int offset, frame_data *fd, int dissect_rpcb3_getaddr_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + offset = dissect_rpc_string(pd, offset, fd, tree, hf_portmap_uaddr,NULL); return offset; @@ -316,6 +346,9 @@ int dissect_rpcb3_getaddr_reply(const u_char *pd, int offset, frame_data *fd, int dissect_rpcb3_dump_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + if (!proto_is_protocol_enabled(proto_portmap)) + return offset; + offset = dissect_rpc_list(pd, offset, fd, tree, dissect_rpcb); return offset; } diff --git a/packet-ppp.c b/packet-ppp.c index 38a459b66b..6ec222100d 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.38 2000/08/07 03:21:00 guy Exp $ + * $Id: packet-ppp.c,v 1.39 2000/08/13 14:08:38 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1046,6 +1046,8 @@ dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int first, last; tvbuff_t *next_tvb; + CHECK_DISPLAY_AS_DATA(proto_mp, tvb, pinfo, tree); + flags = tvb_get_guint8(tvb, 0); first = flags && MP_FRAG_FIRST; last = flags && MP_FRAG_LAST; @@ -1123,6 +1125,8 @@ dissect_ppp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { tvbuff_t *next_tvb; guint8 byte0; + CHECK_DISPLAY_AS_DATA(proto_ppp, tvb, pinfo, tree); + pinfo->current_proto = "PPP"; byte0 = tvb_get_guint8(tvb, 0); diff --git a/packet-q2931.c b/packet-q2931.c index 03c075cba6..ead13c81db 100644 --- a/packet-q2931.c +++ b/packet-q2931.c @@ -2,7 +2,7 @@ * Routines for Q.2931 frame disassembly * Guy Harris * - * $Id: packet-q2931.c,v 1.10 2000/05/31 05:07:30 guy Exp $ + * $Id: packet-q2931.c,v 1.11 2000/08/13 14:08:42 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1988,6 +1988,8 @@ dissect_q2931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int codeset; gboolean non_locking_shift; + CHECK_DISPLAY_AS_DATA(proto_q2931, tvb, pinfo, tree); + pinfo->current_proto = "Q.2931"; if (check_col(pinfo->fd, COL_PROTOCOL)) diff --git a/packet-q931.c b/packet-q931.c index f0ce81fe2a..1317b85d03 100644 --- a/packet-q931.c +++ b/packet-q931.c @@ -2,7 +2,7 @@ * Routines for Q.931 frame disassembly * Guy Harris * - * $Id: packet-q931.c,v 1.16 2000/05/31 05:07:31 guy Exp $ + * $Id: packet-q931.c,v 1.17 2000/08/13 14:08:38 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -2067,6 +2067,8 @@ dissect_q931(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int codeset; gboolean non_locking_shift; + CHECK_DISPLAY_AS_DATA(proto_q931, tvb, pinfo, tree); + pinfo->current_proto = "Q.931"; if (check_col(pinfo->fd, COL_PROTOCOL)) diff --git a/packet-quake.c b/packet-quake.c index ceec72b180..e337f4d77c 100644 --- a/packet-quake.c +++ b/packet-quake.c @@ -4,7 +4,7 @@ * Uwe Girlich * http://www.idsoftware.com/q1source/q1source.zip * - * $Id: packet-quake.c,v 1.3 2000/08/07 03:21:02 guy Exp $ + * $Id: packet-quake.c,v 1.4 2000/08/13 14:08:36 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -543,6 +543,8 @@ dissect_quake(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint rest_length; tvbuff_t *next_tvb; + CHECK_DISPLAY_AS_DATA(proto_quake, tvb, pinfo, tree); + if (!tvb_bytes_exist(tvb, 0, 4)) return; length = tvb_get_ntohl(tvb, 0); diff --git a/packet-radius.c b/packet-radius.c index 6ef47248d2..10f75ac718 100644 --- a/packet-radius.c +++ b/packet-radius.c @@ -1,7 +1,7 @@ /* packet-radius.c * Routines for RADIUS packet disassembly * - * $Id: packet-radius.c,v 1.16 2000/08/07 03:21:03 guy Exp $ + * $Id: packet-radius.c,v 1.17 2000/08/13 14:08:35 deniel Exp $ * * Ethereal - Network traffic analyzer * By Johan Feyaerts @@ -680,6 +680,8 @@ proto_tree return; } + OLD_CHECK_DISPLAY_AS_DATA(proto_radius, pd, offset, fd, tree); + memcpy(&rh,&pd[offset],sizeof(e_radiushdr)); diff --git a/packet-rip.c b/packet-rip.c index 24fb0c1d43..d0bd456ac1 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 * - * $Id: packet-rip.c,v 1.17 2000/08/07 03:21:04 guy Exp $ + * $Id: packet-rip.c,v 1.18 2000/08/13 14:08:42 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -63,6 +63,8 @@ dissect_rip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { "Traceon", "Traceoff", "Vendor specific (Sun)" }; static char *version[3] = { "RIP", "RIPv1", "RIPv2" }; + OLD_CHECK_DISPLAY_AS_DATA(proto_rip, pd, offset, fd, tree); + /* avoid alignment problem */ memcpy(&rip_header, &pd[offset], sizeof(rip_header)); diff --git a/packet-ripng.c b/packet-ripng.c index d32022832d..f41f1e8219 100644 --- a/packet-ripng.c +++ b/packet-ripng.c @@ -3,7 +3,7 @@ * (c) Copyright Jun-ichiro itojun Hagino * derived from packet-rip.c * - * $Id: packet-ripng.c,v 1.13 2000/08/07 03:21:04 guy Exp $ + * $Id: packet-ripng.c,v 1.14 2000/08/13 14:08:43 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -67,6 +67,8 @@ dissect_ripng(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { }; const char *cmd; + OLD_CHECK_DISPLAY_AS_DATA(proto_ripng, pd, offset, fd, tree); + /* avoid alignment problem */ memcpy(&rip6, &pd[offset], sizeof(rip6)); diff --git a/packet-rlogin.c b/packet-rlogin.c index 00633b7cbc..99878045d2 100644 --- a/packet-rlogin.c +++ b/packet-rlogin.c @@ -2,7 +2,7 @@ * Routines for unix rlogin packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-rlogin.c,v 1.8 2000/08/11 13:35:07 deniel Exp $ + * $Id: packet-rlogin.c,v 1.9 2000/08/13 14:08:37 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -365,6 +365,8 @@ dissect_rlogin(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { rlogin_hash_entry_t *hash_info = 0; conversation_t *conversation; + OLD_CHECK_DISPLAY_AS_DATA(proto_rlogin, pd, offset, fd, tree); + /* Lookup this connection*/ conversation = find_conversation( &pi.src, &pi.dst, pi.ptype, pi.srcport, pi.destport); diff --git a/packet-rpc.c b/packet-rpc.c index d9988a8626..411e930f2c 100644 --- a/packet-rpc.c +++ b/packet-rpc.c @@ -2,7 +2,7 @@ * Routines for rpc dissection * Copyright 1999, Uwe Girlich * - * $Id: packet-rpc.c,v 1.35 2000/08/08 06:19:51 girlich Exp $ + * $Id: packet-rpc.c,v 1.36 2000/08/13 14:07:54 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1042,6 +1042,9 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) dissect_function_t *dissect_function = NULL; + if (!proto_is_protocol_enabled(proto_rpc)) + return FALSE; + /* TCP uses record marking */ use_rm = (pi.ptype == PT_TCP); diff --git a/packet-rsh.c b/packet-rsh.c index 9491001385..298412ae8f 100644 --- a/packet-rsh.c +++ b/packet-rsh.c @@ -4,7 +4,7 @@ * Robert Tsai * Liberally copied from packet-http.c, by Guy Harris * - * $Id: packet-rsh.c,v 1.2 2000/08/12 12:56:23 deniel Exp $ + * $Id: packet-rsh.c,v 1.3 2000/08/13 14:08:43 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -55,6 +55,8 @@ dissect_rsh(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) const u_char *lineend, *eol; int linelen; + OLD_CHECK_DISPLAY_AS_DATA(proto_rsh, pd, offset, fd, tree); + data = &pd[offset]; dataend = data + END_OF_FRAME; diff --git a/packet-rsvp.c b/packet-rsvp.c index 3689bc8b89..4203ac0f03 100644 --- a/packet-rsvp.c +++ b/packet-rsvp.c @@ -3,7 +3,7 @@ * * (c) Copyright Ashok Narayanan * - * $Id: packet-rsvp.c,v 1.26 2000/08/11 13:35:04 deniel Exp $ + * $Id: packet-rsvp.c,v 1.27 2000/08/13 14:07:58 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -847,6 +847,8 @@ dissect_rsvp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) struct e_in6_addr *ip6a; guint32 ip_addr; + OLD_CHECK_DISPLAY_AS_DATA(proto_rsvp, pd, offset, fd, tree); + hdr = (rsvp_header *)&pd[offset]; packet_type = match_strval(hdr->message_type, message_type_vals); if (check_col(fd, COL_PROTOCOL)) diff --git a/packet-rtcp.c b/packet-rtcp.c index a2928d4d7d..c0f7b56088 100644 --- a/packet-rtcp.c +++ b/packet-rtcp.c @@ -3,7 +3,7 @@ * * Jason Lango * - * $Id: packet-rtcp.c,v 1.3 2000/05/31 05:07:37 guy Exp $ + * $Id: packet-rtcp.c,v 1.4 2000/08/13 14:08:43 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -422,6 +422,8 @@ dissect_rtcp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { int end_offset; + OLD_CHECK_DISPLAY_AS_DATA(proto_rtcp, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "RTCP"); diff --git a/packet-rtp.c b/packet-rtp.c index 92763c8c80..88ee2a15bc 100644 --- a/packet-rtp.c +++ b/packet-rtp.c @@ -3,7 +3,7 @@ * * Jason Lango * - * $Id: packet-rtp.c,v 1.4 2000/05/31 05:07:37 guy Exp $ + * $Id: packet-rtp.c,v 1.5 2000/08/13 14:08:43 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -84,6 +84,8 @@ dissect_rtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guint32 *csrc_ptr; rtp_hdr_ext_t ext; + OLD_CHECK_DISPLAY_AS_DATA(proto_rtp, pd, offset, fd, tree); + data = &pd[offset]; dataend = data + END_OF_FRAME; end_offset = offset + END_OF_FRAME; diff --git a/packet-rtsp.c b/packet-rtsp.c index 398f1a0a13..d72c02c822 100644 --- a/packet-rtsp.c +++ b/packet-rtsp.c @@ -4,7 +4,7 @@ * Jason Lango * Liberally copied from packet-http.c, by Guy Harris * - * $Id: packet-rtsp.c,v 1.15 2000/08/07 03:21:07 guy Exp $ + * $Id: packet-rtsp.c,v 1.16 2000/08/13 14:08:43 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -149,6 +149,8 @@ static void dissect_rtsp(const u_char *pd, int offset, frame_data *fd, int is_sdp = 0; int end_offset; + OLD_CHECK_DISPLAY_AS_DATA(proto_rtsp, pd, offset, fd, tree); + data = &pd[offset]; dataend = data + END_OF_FRAME; end_offset = offset + END_OF_FRAME; diff --git a/packet-rx.c b/packet-rx.c index 2b67c25ddb..d36715b504 100644 --- a/packet-rx.c +++ b/packet-rx.c @@ -4,7 +4,7 @@ * Based on routines from tcpdump patches by * Ken Hornstein * - * $Id: packet-rx.c,v 1.13 2000/08/07 03:21:07 guy Exp $ + * $Id: packet-rx.c,v 1.14 2000/08/13 14:08:44 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -103,6 +103,8 @@ dissect_rx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) struct rx_header *rxh; int reply; + OLD_CHECK_DISPLAY_AS_DATA(proto_rx, pd, offset, fd, tree); + rxh = (struct rx_header *) &pd[offset]; /* get at least a full packet structure */ diff --git a/packet-sap.c b/packet-sap.c index 56ed067ede..d905a586c7 100644 --- a/packet-sap.c +++ b/packet-sap.c @@ -4,7 +4,7 @@ * * Heikki Vatiainen * - * $Id: packet-sap.c,v 1.9 2000/08/07 03:21:08 guy Exp $ + * $Id: packet-sap.c,v 1.10 2000/08/13 14:08:44 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -137,6 +137,8 @@ dissect_sap(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_item *si, *sif; proto_tree *sap_tree, *sap_flags_tree; + OLD_CHECK_DISPLAY_AS_DATA(proto_sap, pd, offset, fd, tree); + is_ipv6 = pd[offset]&MCAST_SAP_BIT_A; is_del = pd[offset]&MCAST_SAP_BIT_T; is_enc = pd[offset]&MCAST_SAP_BIT_E; diff --git a/packet-sctp.c b/packet-sctp.c index 8a8918d8d3..c885d81d9e 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 * - * $Id: packet-sctp.c,v 1.4 2000/08/11 13:35:00 deniel Exp $ + * $Id: packet-sctp.c,v 1.5 2000/08/13 14:08:45 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1482,6 +1482,8 @@ dissect_sctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *ti; proto_tree *sctp_tree; + CHECK_DISPLAY_AS_DATA(proto_sctp, tvb, pinfo, tree); + pinfo->current_proto = "SCTP"; /* Extract the common header */ diff --git a/packet-sdp.c b/packet-sdp.c index 677581f272..5b57df7e8f 100644 --- a/packet-sdp.c +++ b/packet-sdp.c @@ -4,7 +4,7 @@ * Jason Lango * Liberally copied from packet-http.c, by Guy Harris * - * $Id: packet-sdp.c,v 1.8 2000/05/31 05:07:40 guy Exp $ + * $Id: packet-sdp.c,v 1.9 2000/08/13 14:08:46 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -58,6 +58,8 @@ void dissect_sdp(const u_char *pd, int offset, frame_data *fd, int valuelen; const char *typename; + OLD_CHECK_DISPLAY_AS_DATA(proto_sdp, pd, offset, fd, tree); + data = &pd[offset]; dataend = data + END_OF_FRAME; diff --git a/packet-smb-browse.c b/packet-smb-browse.c index 4770eb8e3d..ce0e7ecf96 100644 --- a/packet-smb-browse.c +++ b/packet-smb-browse.c @@ -2,7 +2,7 @@ * Routines for smb packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-smb-browse.c,v 1.4 2000/05/31 05:07:40 guy Exp $ + * $Id: packet-smb-browse.c,v 1.5 2000/08/13 14:08:48 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -150,6 +150,9 @@ dissect_mailslot_browse(const u_char *pd, int offset, frame_data *fd, proto_tree guint32 loc_offset = DataOffset, count = 0; int i; + if (!proto_is_protocol_enabled(proto_smb_browse)) + return 0; + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "BROWSER"); diff --git a/packet-smb-logon.c b/packet-smb-logon.c index 2ae6667573..80d46a80c3 100644 --- a/packet-smb-logon.c +++ b/packet-smb-logon.c @@ -2,7 +2,7 @@ * Routines for smb net logon packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-smb-logon.c,v 1.7 2000/08/06 10:04:14 guy Exp $ + * $Id: packet-smb-logon.c,v 1.8 2000/08/13 14:08:49 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -524,6 +524,9 @@ static void (*dissect_smb_logon_cmds[])(const u_char *, int, frame_data *, proto_tree *smb_logon_tree; proto_item *ti; + + if (!proto_is_protocol_enabled(proto_smb_logon)) + return 0; /* get the Command field */ cmd = MIN( GBYTE(pd, offset), array_length(dissect_smb_logon_cmds)-1); diff --git a/packet-smb-mailslot.c b/packet-smb-mailslot.c index ae0ccb3749..fa966e86d3 100644 --- a/packet-smb-mailslot.c +++ b/packet-smb-mailslot.c @@ -2,7 +2,7 @@ * Routines for smb mailslot packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-smb-mailslot.c,v 1.5 2000/05/31 05:07:41 guy Exp $ + * $Id: packet-smb-mailslot.c,v 1.6 2000/08/13 14:08:49 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -71,12 +71,14 @@ dissect_mailslot_smb(const u_char *pd, int offset, frame_data *fd, /* decode the SMB mail slot protocol */ - proto_tree *smb_msp_tree = 0; proto_item *ti; guint16 Temp16; const char *StrPtr; + + if (!proto_is_protocol_enabled(proto_smb_msp)) + return 0; /* do the Op code field */ diff --git a/packet-smb-pipe.c b/packet-smb-pipe.c index bc1ea076b5..3a497e3a08 100644 --- a/packet-smb-pipe.c +++ b/packet-smb-pipe.c @@ -2,7 +2,7 @@ * Routines for smb packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-smb-pipe.c,v 1.9 2000/05/31 05:07:41 guy Exp $ + * $Id: packet-smb-pipe.c,v 1.10 2000/08/13 14:08:49 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1227,6 +1227,9 @@ guint32 dissect_pipe_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn, const u_char *command, int DataOffset, int DataCount, int ParameterOffset, int ParameterCount) { + if (!proto_is_protocol_enabled(proto_smb_lanman)) + return 0; + if (strcmp(command, "LANMAN") == 0) { /* Try to decode a LANMAN */ return dissect_pipe_lanman(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, command, DataOffset, DataCount, ParameterOffset, ParameterCount); diff --git a/packet-smb.c b/packet-smb.c index a326b7a9d2..4ad21712b5 100644 --- a/packet-smb.c +++ b/packet-smb.c @@ -2,7 +2,7 @@ * Routines for smb packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-smb.c,v 1.70 2000/08/07 14:49:03 sharpe Exp $ + * $Id: packet-smb.c,v 1.71 2000/08/13 14:08:50 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -10595,6 +10595,8 @@ dissect_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *tree, int int SMB_offset = offset; struct smb_info si; + OLD_CHECK_DISPLAY_AS_DATA(proto_smb, pd, offset, fd, tree); + si.unicode = 0; cmd = pd[offset + SMB_hdr_com_offset]; diff --git a/packet-sna.c b/packet-sna.c index dd3a35f326..39db5d82e8 100644 --- a/packet-sna.c +++ b/packet-sna.c @@ -2,7 +2,7 @@ * Routines for SNA * Gilbert Ramirez * - * $Id: packet-sna.c,v 1.17 2000/08/07 03:21:10 guy Exp $ + * $Id: packet-sna.c,v 1.18 2000/08/13 14:08:58 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -310,6 +310,8 @@ dissect_sna(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { guint8 th_fid; int sna_header_len = 0, th_header_len = 0; + OLD_CHECK_DISPLAY_AS_DATA(proto_sna, pd, offset, fd, tree); + /* SNA data should be printed in EBCDIC, not ASCII */ fd->flags.encoding = CHAR_EBCDIC; diff --git a/packet-snmp.c b/packet-snmp.c index 502cf649ba..8cf23aebe8 100644 --- a/packet-snmp.c +++ b/packet-snmp.c @@ -2,7 +2,7 @@ * Routines for SNMP (simple network management protocol) * D.Jorand (c) 1998 * - * $Id: packet-snmp.c,v 1.46 2000/08/07 03:21:11 guy Exp $ + * $Id: packet-snmp.c,v 1.47 2000/08/13 14:09:00 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1893,12 +1893,14 @@ dissect_smux_pdu(const u_char *pd, int offset, frame_data *fd, static void dissect_snmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + OLD_CHECK_DISPLAY_AS_DATA(proto_snmp, pd, offset, fd, tree); dissect_snmp_pdu(pd, offset, fd, tree, "SNMP", proto_snmp, ett_snmp); } static void dissect_smux(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + OLD_CHECK_DISPLAY_AS_DATA(proto_smux, pd, offset, fd, tree); dissect_smux_pdu(pd, offset, fd, tree, proto_smux, ett_smux); } diff --git a/packet-socks.c b/packet-socks.c index 4f5a2bf8d8..7e87de7af7 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 * - * $Id: packet-socks.c,v 1.9 2000/08/11 13:34:59 deniel Exp $ + * $Id: packet-socks.c,v 1.10 2000/08/13 14:09:01 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -954,6 +954,7 @@ dissect_socks(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { socks_hash_entry_t *hash_info; conversation_t *conversation; + OLD_CHECK_DISPLAY_AS_DATA(proto_socks, pd, offset, fd, tree); conversation = find_conversation( &pi.src, &pi.dst, pi.ptype, pi.srcport, pi.destport); diff --git a/packet-srvloc.c b/packet-srvloc.c index 8aa75e8d82..3525e86bba 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.13 2000/08/11 13:34:57 deniel Exp $ + * $Id: packet-srvloc.c,v 1.14 2000/08/13 14:09:02 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -181,6 +181,8 @@ dissect_srvloc(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) struct srvloc_hdr srvloc_hdr; guint32 count; guint32 length; + + OLD_CHECK_DISPLAY_AS_DATA(proto_srvloc, pd, offset, fd, tree); if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "SRVLOC"); diff --git a/packet-sscop.c b/packet-sscop.c index 6d39b6b4e6..72c9eeb97d 100644 --- a/packet-sscop.c +++ b/packet-sscop.c @@ -2,7 +2,7 @@ * Routines for SSCOP (Q.2110, Q.SAAL) frame disassembly * Guy Harris * - * $Id: packet-sscop.c,v 1.9 2000/08/07 03:21:13 guy Exp $ + * $Id: packet-sscop.c,v 1.10 2000/08/13 14:09:03 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -144,6 +144,8 @@ dissect_sscop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int pad_len; tvbuff_t *next_tvb; + CHECK_DISPLAY_AS_DATA(proto_sscop, tvb, pinfo, tree); + pinfo->current_proto = "SSCOP"; reported_length = tvb_reported_length(tvb); /* frame length */ diff --git a/packet-syslog.c b/packet-syslog.c index 1935d2a997..5cd5f334b8 100644 --- a/packet-syslog.c +++ b/packet-syslog.c @@ -3,7 +3,7 @@ * * Copyright 2000, Gerald Combs * - * $Id: packet-syslog.c,v 1.5 2000/08/07 03:21:14 guy Exp $ + * $Id: packet-syslog.c,v 1.6 2000/08/13 14:07:53 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -145,6 +145,8 @@ static void dissect_syslog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *syslog_tree; gchar msg_str[COL_INFO_LEN]; + CHECK_DISPLAY_AS_DATA(proto_syslog, tvb, pinfo, tree); + pinfo->current_proto = "Syslog"; msg_len = tvb_length(tvb); diff --git a/packet-tacacs.c b/packet-tacacs.c index 0b13adecaf..00eb58f92f 100644 --- a/packet-tacacs.c +++ b/packet-tacacs.c @@ -1,7 +1,7 @@ /* packet-tacacs.c * Routines for cisco tacacs/tacplus/AAA packet dissection * - * $Id: packet-tacacs.c,v 1.6 2000/08/07 03:21:15 guy Exp $ + * $Id: packet-tacacs.c,v 1.7 2000/08/13 14:09:05 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -57,6 +57,8 @@ dissect_tacacs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree *tacacs_tree, *ti; + OLD_CHECK_DISPLAY_AS_DATA(proto_tacacs, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "TACACS"); diff --git a/packet-tcp.c b/packet-tcp.c index 3b4764c5de..cd5cb266d8 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.80 2000/08/11 13:34:55 deniel Exp $ + * $Id: packet-tcp.c,v 1.81 2000/08/13 14:08:47 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -411,6 +411,8 @@ dissect_tcp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { guint optlen; guint packet_max = pi.len; + OLD_CHECK_DISPLAY_AS_DATA(proto_tcp, pd, offset, fd, tree); + /* To do: Check for {cap len,pkt len} < struct len */ /* Avoids alignment problems on many architectures. */ memcpy(&th, &pd[offset], sizeof(e_tcphdr)); diff --git a/packet-telnet.c b/packet-telnet.c index 7f07e45a95..3d2826c126 100644 --- a/packet-telnet.c +++ b/packet-telnet.c @@ -2,7 +2,7 @@ * Routines for telnet packet dissection * Copyright 1999, Richard Sharpe * - * $Id: packet-telnet.c,v 1.14 2000/08/07 03:21:16 guy Exp $ + * $Id: packet-telnet.c,v 1.15 2000/08/13 14:08:44 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -297,6 +297,8 @@ dissect_telnet(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree *telnet_tree, *ti; + OLD_CHECK_DISPLAY_AS_DATA(proto_telnet, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "TELNET"); diff --git a/packet-tftp.c b/packet-tftp.c index e7d368ae1c..8c62d50183 100644 --- a/packet-tftp.c +++ b/packet-tftp.c @@ -5,7 +5,7 @@ * Craig Newell * RFC2347 TFTP Option Extension * - * $Id: packet-tftp.c,v 1.12 2000/05/31 05:07:50 guy Exp $ + * $Id: packet-tftp.c,v 1.13 2000/08/13 14:09:05 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -85,6 +85,8 @@ dissect_tftp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_item *ti; u_int i1; + OLD_CHECK_DISPLAY_AS_DATA(proto_tftp, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "TFTP"); diff --git a/packet-time.c b/packet-time.c index f8e1c3348a..a38750564f 100644 --- a/packet-time.c +++ b/packet-time.c @@ -5,7 +5,7 @@ * Craig Newell * RFC2347 TIME Option Extension * - * $Id: packet-time.c,v 1.7 2000/08/07 03:21:17 guy Exp $ + * $Id: packet-time.c,v 1.8 2000/08/13 14:09:06 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -46,6 +46,8 @@ dissect_time(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree *time_tree; proto_item *ti; + + OLD_CHECK_DISPLAY_AS_DATA(proto_time, pd, offset, fd, tree); if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "TIME"); diff --git a/packet-tns.c b/packet-tns.c index e90b8f3c69..dd4fb8e14d 100644 --- a/packet-tns.c +++ b/packet-tns.c @@ -1,7 +1,7 @@ /* packet-tns.c * Routines for MSX tns packet dissection * - * $Id: packet-tns.c,v 1.8 2000/08/07 03:21:17 guy Exp $ + * $Id: packet-tns.c,v 1.9 2000/08/13 14:09:06 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -193,6 +193,8 @@ dissect_tns(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guint16 length; guint16 type; + OLD_CHECK_DISPLAY_AS_DATA(proto_tns, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "TNS"); diff --git a/packet-tr.c b/packet-tr.c index 2dc54bd2e7..cfee9cffd8 100644 --- a/packet-tr.c +++ b/packet-tr.c @@ -2,7 +2,7 @@ * Routines for Token-Ring packet disassembly * Gilbert Ramirez * - * $Id: packet-tr.c,v 1.45 2000/08/07 03:21:17 guy Exp $ + * $Id: packet-tr.c,v 1.46 2000/08/13 14:09:03 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -327,6 +327,8 @@ dissect_tr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Token-Ring Strings */ char *fc[] = { "MAC", "LLC", "Reserved", "Unknown" }; + CHECK_DISPLAY_AS_DATA(proto_tr, tvb, pinfo, tree); + pinfo->current_proto = "Token-Ring"; if (check_col(pinfo->fd, COL_PROTOCOL)) diff --git a/packet-trmac.c b/packet-trmac.c index 01b2234ea0..1faca0c369 100644 --- a/packet-trmac.c +++ b/packet-trmac.c @@ -2,7 +2,7 @@ * Routines for Token-Ring Media Access Control * Gilbert Ramirez * - * $Id: packet-trmac.c,v 1.23 2000/06/20 03:05:36 gram Exp $ + * $Id: packet-trmac.c,v 1.24 2000/08/13 14:09:07 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -279,6 +279,8 @@ dissect_trmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 mv_val; char *mv_text; + CHECK_DISPLAY_AS_DATA(proto_trmac, tvb, pinfo, tree); + pinfo->current_proto = "TR MAC"; if (check_col(pinfo->fd, COL_PROTOCOL)) col_add_str(pinfo->fd, COL_PROTOCOL, "TR MAC"); diff --git a/packet-udp.c b/packet-udp.c index 2ddbe16155..788d18beee 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.74 2000/08/07 03:21:18 guy Exp $ + * $Id: packet-udp.c,v 1.75 2000/08/13 14:09:07 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -141,6 +141,8 @@ dissect_udp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { proto_tree *udp_tree; proto_item *ti; + OLD_CHECK_DISPLAY_AS_DATA(proto_udp, pd, offset, fd, tree); + if (!BYTES_ARE_IN_FRAME(offset, sizeof(e_udphdr))) { old_dissect_data(pd, offset, fd, tree); return; diff --git a/packet-v120.c b/packet-v120.c index 5953324766..6d38647502 100644 --- a/packet-v120.c +++ b/packet-v120.c @@ -2,7 +2,7 @@ * Routines for v120 frame disassembly * Bert Driehuis * - * $Id: packet-v120.c,v 1.11 2000/08/07 03:21:18 guy Exp $ + * $Id: packet-v120.c,v 1.12 2000/08/13 14:07:53 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -66,6 +66,8 @@ dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint16 control; tvbuff_t *next_tvb; + CHECK_DISPLAY_AS_DATA(proto_v120, tvb, pinfo, tree); + pinfo->current_proto = "V.120"; if (check_col(pinfo->fd, COL_PROTOCOL)) diff --git a/packet-vlan.c b/packet-vlan.c index 2f47436b5b..9965e1b9d3 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.18 2000/08/07 03:21:19 guy Exp $ + * $Id: packet-vlan.c,v 1.19 2000/08/13 14:09:06 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -74,6 +74,8 @@ dissect_vlan(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { guint16 tci,encap_proto; tvbuff_t *next_tvb; + OLD_CHECK_DISPLAY_AS_DATA(proto_vlan, pd, offset, fd, tree); + if (!BYTES_ARE_IN_FRAME(offset, 2*sizeof(guint16))) { return; } diff --git a/packet-vrrp.c b/packet-vrrp.c index 3d23add2b5..65c41684f4 100644 --- a/packet-vrrp.c +++ b/packet-vrrp.c @@ -4,7 +4,7 @@ * * Heikki Vatiainen * - * $Id: packet-vrrp.c,v 1.7 2000/08/07 03:21:19 guy Exp $ + * $Id: packet-vrrp.c,v 1.8 2000/08/13 14:09:08 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -100,6 +100,8 @@ dissect_vrrp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) gboolean short_packet = FALSE; guint calculated_len = -1; /* initialize to silence false warning from gcc */ + OLD_CHECK_DISPLAY_AS_DATA(proto_vrrp, pd, offset, fd, tree); + if (sizeof(struct vrrp_header) > END_OF_FRAME) short_hdr = short_packet = TRUE; else { diff --git a/packet-vtp.c b/packet-vtp.c index d76f169df4..ba59d31977 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.5 2000/05/31 05:07:53 guy Exp $ + * $Id: packet-vtp.c,v 1.6 2000/08/13 14:09:08 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -101,6 +101,8 @@ dissect_vtp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) int vlan_info_len; guint32 upd_id; + OLD_CHECK_DISPLAY_AS_DATA(proto_vtp, pd, offset, fd, tree); + if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "VTP"); if (check_col(fd, COL_INFO)) diff --git a/packet-wccp.c b/packet-wccp.c index 8c173d209a..7228c4af24 100644 --- a/packet-wccp.c +++ b/packet-wccp.c @@ -2,7 +2,7 @@ * Routines for Web Cache Coordination Protocol dissection * Jerry Talkington * - * $Id: packet-wccp.c,v 1.9 2000/08/07 03:21:19 guy Exp $ + * $Id: packet-wccp.c,v 1.10 2000/08/13 14:09:09 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -102,6 +102,8 @@ dissect_wccp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guint32 cache_count; int i; + OLD_CHECK_DISPLAY_AS_DATA(proto_wccp, pd, offset, fd, tree); + if(check_col(fd, COL_PROTOCOL)) { col_add_str(fd, COL_PROTOCOL, "WCCP"); } diff --git a/packet-who.c b/packet-who.c index 06b1438878..f9c12ce991 100644 --- a/packet-who.c +++ b/packet-who.c @@ -2,7 +2,7 @@ * Routines for who protocol (see man rwhod) * Gilbert Ramirez * - * $Id: packet-who.c,v 1.8 2000/08/07 03:21:20 guy Exp $ + * $Id: packet-who.c,v 1.9 2000/08/13 14:09:09 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -102,6 +102,8 @@ dissect_who(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) gchar server_name[33]; double loadav_5 = 0.0, loadav_10 = 0.0, loadav_15 = 0.0; + OLD_CHECK_DISPLAY_AS_DATA(proto_who, pd, offset, fd, tree); + /* Summary information */ if (check_col(fd, COL_PROTOCOL)) col_add_str(fd, COL_PROTOCOL, "WHO"); diff --git a/packet-x11.c b/packet-x11.c index 0d05a8c478..3680565637 100644 --- a/packet-x11.c +++ b/packet-x11.c @@ -2,7 +2,7 @@ * Routines for X11 dissection * Copyright 2000, Christophe Tronche * - * $Id: packet-x11.c,v 1.10 2000/08/07 03:21:20 guy Exp $ + * $Id: packet-x11.c,v 1.11 2000/08/13 14:09:11 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -2919,6 +2919,9 @@ dissect_x11_event(const u_char *pd, int offset, frame_data *fd, proto_tree *tree static void dissect_x11(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { + + OLD_CHECK_DISPLAY_AS_DATA(proto_x11, pd, offset, fd, tree); + pi.current_proto = "X11"; if (pi.destport == TCP_PORT_X11 || pi.destport == TCP_PORT_X11_2 || pi.destport == TCP_PORT_X11_3) dissect_x11_request(pd, offset, fd, tree); diff --git a/packet-x25.c b/packet-x25.c index eb94c96f81..d1e78263d8 100644 --- a/packet-x25.c +++ b/packet-x25.c @@ -2,7 +2,7 @@ * Routines for x25 packet disassembly * Olivier Abad * - * $Id: packet-x25.c,v 1.34 2000/08/07 03:21:23 guy Exp $ + * $Id: packet-x25.c,v 1.35 2000/08/13 14:09:13 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1412,6 +1412,12 @@ dissect_x25(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) modulo = ((bytes0_1 & 0x2000) ? 128 : 8); vc = (int)(bytes0_1 & 0x0FFF); + if (modulo == 8) { + CHECK_DISPLAY_AS_DATA(proto_x25, tvb, pinfo, tree); + } else { + CHECK_DISPLAY_AS_DATA(proto_ex25, tvb, pinfo, tree); + } + if (bytes0_1 & 0x8000) toa = TRUE; else toa = FALSE; diff --git a/packet-yhoo.c b/packet-yhoo.c index 30fe4a279e..d66432c83c 100644 --- a/packet-yhoo.c +++ b/packet-yhoo.c @@ -2,7 +2,7 @@ * Routines for yahoo messenger packet dissection * Copyright 1999, Nathan Neulinger * - * $Id: packet-yhoo.c,v 1.9 2000/08/07 03:21:24 guy Exp $ + * $Id: packet-yhoo.c,v 1.10 2000/08/13 14:09:15 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -110,6 +110,10 @@ dissect_yhoo(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) proto_tree *yhoo_tree, *ti; struct yahoo_rawpacket *pkt; + if (!proto_is_protocol_enabled(proto_yhoo)) { + return FALSE; + } + if (pi.srcport != TCP_PORT_YHOO && pi.destport != TCP_PORT_YHOO) { /* Not the Yahoo port - not a Yahoo Messenger packet. */ return FALSE; diff --git a/proto.c b/proto.c index 404f0b5630..c26f90b24e 100644 --- a/proto.c +++ b/proto.c @@ -1,7 +1,7 @@ /* proto.c * Routines for protocol tree * - * $Id: proto.c,v 1.76 2000/08/11 13:35:33 deniel Exp $ + * $Id: proto.c,v 1.77 2000/08/13 14:03:37 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -1444,10 +1444,45 @@ proto_register_protocol(char *name, char *abbrev) hfinfo->bitshift = 0; hfinfo->blurb = ""; hfinfo->parent = -1; /* this field differentiates protos and fields */ + hfinfo->display = TRUE; /* XXX protocol is enabled by default */ return proto_register_field_init(hfinfo, hfinfo->parent); } + +/* + * XXX - In the future, we might need a hash table or list of procotol + * characteristics that will be fill in each time proto_register_protocol is + * called. + * A protocol entry could contain the display flag among others (such as the + * address of the dissector function for intance). The access to an entry + * by protocol abbrev (which shall be unique) would be faster than the actual + * way. + */ + +gboolean +proto_is_protocol_enabled(int n) +{ + struct header_field_info *hfinfo; + + hfinfo = proto_registrar_get_nth(n); + if (hfinfo) + return (hfinfo->display); + else + return FALSE; + +} + +void +proto_set_decoding(int n, gboolean enabled) +{ + struct header_field_info *hfinfo; + + hfinfo = proto_registrar_get_nth(n); + if (hfinfo) + hfinfo->display = enabled; +} + /* 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/proto.h b/proto.h index 4e3014344e..d93acc0caf 100644 --- a/proto.h +++ b/proto.h @@ -1,7 +1,7 @@ /* proto.h * Definitions for protocol display * - * $Id: proto.h,v 1.39 2000/08/11 13:34:36 deniel Exp $ + * $Id: proto.h,v 1.40 2000/08/13 14:03:38 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -58,6 +58,21 @@ struct value_string; /* ... and similarly, */ #define TFS(x) (struct true_false_string*)(x) +/* check protocol activation */ +#define OLD_CHECK_DISPLAY_AS_DATA(index, pd, offset, fd, tree) {\ + if (!proto_is_protocol_enabled(index)) { \ + old_dissect_data(pd, offset, fd, tree); \ + return; \ + } \ + } + +#define CHECK_DISPLAY_AS_DATA(index, tvb, pinfo, tree) { \ + if (!proto_is_protocol_enabled(index)) { \ + dissect_data(tvb, pinfo, tree); \ + return; \ + } \ + } + /* field types */ enum ftenum { FT_NONE, /* used for protocol labels (thus no field type) */ @@ -484,6 +499,12 @@ int proto_registrar_get_parent(int n); /* Is item #n a protocol? */ gboolean proto_registrar_is_protocol(int n); +/* Is item #n decoding enabled ? */ +gboolean proto_is_protocol_enabled(int n); + +/* Enable / Disable protocol */ +void proto_set_decoding(int n, gboolean enabled); + /* Get length of registered field according to field type. * 0 means undeterminable at registration time. * -1 means unknown field */