Have "register_tap_menu_item()" create submenus as necessary for a menu
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 23 Apr 2003 05:37:23 +0000 (05:37 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 23 Apr 2003 05:37:23 +0000 (05:37 +0000)
item.

Convert all Ethereal (GUI) taps to use "register_tap_menu_item()" rather
than having hardcoded menu items in "gtk/menu.c".

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7541 f5534014-38df-0310-8fa8-9805f1628bb7

15 files changed:
gtk/Makefile.am
gtk/dcerpc_stat.c
gtk/dcerpc_stat.h [deleted file]
gtk/io_stat.c
gtk/io_stat.h [deleted file]
gtk/menu.c
gtk/menu.h
gtk/mgcp_stat.c
gtk/mgcp_stat.h [deleted file]
gtk/rpc_progs.c
gtk/rpc_progs.h [deleted file]
gtk/rpc_stat.c
gtk/rpc_stat.h [deleted file]
gtk/smb_stat.c
gtk/smb_stat.h [deleted file]

index 25e0ce0ca8d9ecfc8f71f752c55572fd7825f555..b117651b05950e76458b1367902bab17869fece4 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for the GTK interface routines for Ethereal
 #
-# $Id: Makefile.am,v 1.56 2003/04/23 03:51:02 guy Exp $
+# $Id: Makefile.am,v 1.57 2003/04/23 05:37:21 guy Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Gerald Combs <gerald@ethereal.com>
@@ -29,17 +29,11 @@ CLEANFILES = \
 
 ETHEREAL_TAP_SRC = \
        dcerpc_stat.c   \
-       dcerpc_stat.h   \
        io_stat.c       \
-       io_stat.h       \
        mgcp_stat.c     \
-       mgcp_stat.h     \
        rpc_stat.c      \
-       rpc_stat.h      \
        rpc_progs.c     \
-       rpc_progs.h     \
        smb_stat.c      \
-       smb_stat.h      \
        tap_rtp.c
 
 ethereal-tap-register.c: $(ETHEREAL_TAP_SRC) $(top_srcdir)/make-tapreg-dotc
index 064332894d2aa08bc0eb9ad6c9768860beec1a01..ab455ee1515c0ce112a97726e203a9f07a617c38 100644 (file)
@@ -1,7 +1,7 @@
 /* dcerpc_stat.c
  * dcerpc_stat   2002 Ronnie Sahlberg
  *
- * $Id: dcerpc_stat.c,v 1.4 2003/04/23 03:51:02 guy Exp $
+ * $Id: dcerpc_stat.c,v 1.5 2003/04/23 05:37:22 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #endif
 
 #include <gtk/gtk.h>
+#include "menu.h"
 #include "epan/packet_info.h"
 #include "simple_dialog.h"
 #include "tap.h"
 #include "../register.h"
 #include "packet-dcerpc.h"
-#include "dcerpc_stat.h"
 #include "../globals.h"
 #include "compat_macros.h"
 
@@ -529,7 +529,7 @@ dlg_destroy_cb(void)
 }
 
 
-void
+static void
 gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
 {
        /* if the window is already open, bring it to front */
@@ -612,3 +612,9 @@ register_tap_listener_gtkdcerpcstat(void)
 {
        register_ethereal_tap("dcerpc,rtt,", gtk_dcerpcstat_init);
 }
+
+void
+register_tap_menu_gtkdcerpcstat(void)
+{
+       register_tap_menu_item("DCE-RPC/RTT", gtk_dcerpcstat_cb);
+}
diff --git a/gtk/dcerpc_stat.h b/gtk/dcerpc_stat.h
deleted file mode 100644 (file)
index f07843d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* dcerpc_stat.h
- * dcerpc_stat   2002 Ronnie Sahlberg
- *
- * $Id: dcerpc_stat.h,v 1.2 2002/11/06 10:53:36 sahlberg Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
- * Copyright 1998 Gerald Combs
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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 __DCERPCSTAT_H__
-#define __DCERPCSTAT_H__
-
-void gtk_dcerpcstat_cb(GtkWidget *w, gpointer d);
-
-#endif
index f93d5d8d714ab9afa5564ca9bc6f04fd3e902508..ccb7238a3fbc6d2010d1c789207d75b4beb27407 100644 (file)
@@ -1,7 +1,7 @@
 /* io_stat.c
  * io_stat   2002 Ronnie Sahlberg
  *
- * $Id: io_stat.c,v 1.19 2003/04/23 03:51:02 guy Exp $
+ * $Id: io_stat.c,v 1.20 2003/04/23 05:37:22 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -43,7 +43,6 @@
 #include "epan/packet_info.h"
 #include "../tap.h"
 #include "../register.h"
-#include "io_stat.h"
 #include "simple_dialog.h"
 #include "../globals.h"
 #include "../color.h"
@@ -1636,7 +1635,7 @@ init_io_stat_window(io_stat_t *io)
 }
 
 
-void 
+static void 
 gtk_iostat_cb(GtkWidget *w _U_, gpointer d _U_)
 {
        gtk_iostat_init(NULL);
@@ -1653,3 +1652,8 @@ register_tap_listener_gtk_iostat(void)
        register_ethereal_tap("io,stat", gtk_iostat_init);
 }
 
+void
+register_tap_menu_gtkiostat(void)
+{
+       register_tap_menu_item("IO/IO-Stat", gtk_iostat_cb);
+}
diff --git a/gtk/io_stat.h b/gtk/io_stat.h
deleted file mode 100644 (file)
index 5318d71..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* io_stat.h
- * io_stat   2002 Ronnie Sahlberg
- *
- * $Id: io_stat.h,v 1.1 2002/11/14 10:32:22 sahlberg Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
- * Copyright 1998 Gerald Combs
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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 __IOSTAT_H__
-#define __IOSTAT_H__
-
-void gtk_iostat_cb(GtkWidget *w, gpointer d);
-
-#endif
index 61d780ff616bb4e47f282371370836d374bd5871..3655b9d37703dc63e6d5b0c830a463bbc3e9d0fd 100644 (file)
@@ -1,7 +1,7 @@
 /* menu.c
  * Menu routines
  *
- * $Id: menu.c,v 1.91 2003/04/23 03:51:03 guy Exp $
+ * $Id: menu.c,v 1.92 2003/04/23 05:37:22 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #include <epan/plugins.h>
 #include "tcp_graph.h"
 #include <epan/epan_dissect.h>
-#include "io_stat.h"
-#include "rpc_stat.h"
-#include "rpc_progs.h"
-#include "dcerpc_stat.h"
-#include "smb_stat.h"
-#include "mgcp_stat.h"
 #include "compat_macros.h"
 #include "gtkglobals.h"
 #include "../tap.h"
@@ -237,28 +231,6 @@ static GtkItemFactoryEntry menu_items[] =
     ITEM_FACTORY_ENTRY("/Tools/Protocol Hierarchy Statistics", NULL,
                        proto_hier_stats_cb, 0, NULL, NULL),
     ITEM_FACTORY_ENTRY("/Tools/Statistics", NULL, NULL, 0, "<Branch>", NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/ONC-RPC", NULL, NULL, 0, "<Branch>",
-                       NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/ONC-RPC/RTT", NULL, gtk_rpcstat_cb,
-                       0, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/ONC-RPC/Programs", NULL,
-                       gtk_rpcprogs_cb, 0, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/DCE-RPC", NULL, NULL, 0, "<Branch>",
-                       NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/DCE-RPC/RTT", NULL, gtk_dcerpcstat_cb,
-                       0, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/IO", NULL, NULL, 0, "<Branch>",
-                       NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/IO/IO-Stat", NULL, gtk_iostat_cb,
-                       0, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/SMB", NULL, NULL, 0, "<Branch>",
-                       NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/SMB/RTT", NULL, gtk_smbstat_cb,
-                       0, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/MGCP", NULL, NULL, 0, "<Branch>",
-                       NULL),
-    ITEM_FACTORY_ENTRY("/Tools/Statistics/MGCP/RTD", NULL, gtk_mgcpstat_cb,
-                       0, NULL, NULL),
     ITEM_FACTORY_ENTRY("/_Help", NULL, NULL, 0, "<LastBranch>", NULL),
     ITEM_FACTORY_STOCK_ENTRY("/Help/_Help", NULL, help_cb, 0, GTK_STOCK_HELP),
     ITEM_FACTORY_ENTRY("/Help/<separator>", NULL, NULL, 0, "<Separator>", NULL),
@@ -433,10 +405,6 @@ menus_init(void) {
     set_menu_sensitivity(main_menu_factory, "/Edit/Paste", FALSE);
 #endif
 
-    if(!find_tap_id("mgcp")) {
-       set_menu_sensitivity(main_menu_factory, "/Tools/Statistics/MGCP",
-           FALSE);
-    }
     set_menus_for_captured_packets(FALSE);
     set_menus_for_selected_packet(FALSE);
     set_menus_for_selected_tree_row(FALSE);
@@ -450,13 +418,59 @@ menus_init(void) {
  * another per-tap registration routine.
  */
 void
-register_tap_menu_item(const char *name, GtkItemFactoryCallback callback)
+register_tap_menu_item(char *name, GtkItemFactoryCallback callback)
 {
        static const char statspath[] = "/Tools/Statistics/";
+       char *p;
        char *menupath;
        size_t menupathlen;
+       GtkWidget *w;
        GtkItemFactoryEntry *entry;
 
+       /*
+        * The menu path must be relative.
+        */
+       g_assert(*name != '/');
+
+       /*
+        * Create any submenus required.
+        */
+       p = name;
+       while ((p = strchr(p, '/')) != NULL) {
+               /*
+                * OK, everything between "name" and "p" is
+                * a menu relative subtree into which the menu item
+                * will be placed.
+                *
+                * Construct the absolute path name of that subtree.
+                */
+               menupathlen = sizeof statspath + (p - name);
+               menupath = g_malloc(menupathlen);
+               strcpy(menupath, statspath);
+               strncat(menupath, name, p - name);
+
+               /*
+                * Does there exist an entry with that path in the main
+                * menu item factory?
+                */
+               w = gtk_item_factory_get_widget(main_menu_factory, menupath);
+               if (w == NULL) {
+                       /*
+                        * No.  Create such an item as a subtree.
+                        */
+                       entry = g_malloc0(sizeof (GtkItemFactoryEntry));
+                       entry->path = menupath;
+                       entry->item_type = "<Branch>";
+                       gtk_item_factory_create_item(main_menu_factory, entry,
+                           NULL, 2);
+               }
+
+               /*
+                * Skip over the '/' we found.
+                */
+               p++;
+       }
+
        /*
         * Construct the main menu path for the menu item.
         *
index 73ec92aeeae98d8923181aa55896721f5f4d678e..3fb5e35f121f4342e0c84fd590663acb27f4e9e6 100644 (file)
@@ -1,7 +1,7 @@
 /* menu.h
  * Menu definitions
  *
- * $Id: menu.h,v 1.8 2003/04/23 03:13:16 guy Exp $
+ * $Id: menu.h,v 1.9 2003/04/23 05:37:22 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -40,8 +40,7 @@ gint popup_menu_handler(GtkWidget *widget, GdkEvent *event, gpointer data);
  * be called from the routine that registers taps - we have to introduce
  * another per-tap registration routine.
  */
-extern void register_tap_menu_item(const char *name,
-    GtkItemFactoryCallback callback);
+extern void register_tap_menu_item(char *name, GtkItemFactoryCallback callback);
 
 extern GtkWidget           *popup_menu_object;
 
index 54a808de2ba5b507f294eb4bacb3d20360338c79..1cb9b1052da5683a3075ed2a63a061426843a323 100644 (file)
@@ -2,7 +2,7 @@
  * mgcp-statistics for ethereal
  * Copyright 2003 Lars Roland
  *
- * $Id: mgcp_stat.c,v 1.2 2003/04/23 03:51:03 guy Exp $
+ * $Id: mgcp_stat.c,v 1.3 2003/04/23 05:37:22 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -41,7 +41,6 @@
 #include "../register.h"
 #include "../plugins/mgcp/packet-mgcp.h"
 #include "../timestats.h"
-#include "mgcp_stat.h"
 #include "compat_macros.h"
 #include "../simple_dialog.h"
 #include "../file.h"
@@ -346,8 +345,16 @@ register_tap_listener_gtkmgcpstat(void)
 }
 
 
-void
+static void
 gtk_mgcpstat_cb(GtkWidget *w _U_, gpointer d _U_)
 {
        gtk_mgcpstat_init("mgcp,rtd");
 }
+
+void
+register_tap_menu_gtkmgcpstat(void)
+{
+       if (find_tap_id("mgcp"))
+               register_tap_menu_item("MGCP/RTD", gtk_mgcpstat_cb);
+}
+
diff --git a/gtk/mgcp_stat.h b/gtk/mgcp_stat.h
deleted file mode 100644 (file)
index 0cd6508..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mgcp_stat.h
- * mgcp_stat   2003 Lars Roland
- *
- * $Id: mgcp_stat.h,v 1.1 2003/04/16 07:24:06 guy Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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 __MGCPSTAT_H__
-#define __MGCPSTAT_H__
-
-void gtk_mgcpstat_cb(GtkWidget *w, gpointer d);
-
-#endif
index 1aeb9e7473928935ce25c1a07d796f5ff245bff5..f54d68881b97215a328395229b45c6f1fe56fefe 100644 (file)
@@ -1,7 +1,7 @@
 /* rpc_progs.c
  * rpc_progs   2002 Ronnie Sahlberg
  *
- * $Id: rpc_progs.c,v 1.7 2003/04/23 03:51:03 guy Exp $
+ * $Id: rpc_progs.c,v 1.8 2003/04/23 05:37:23 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -36,7 +36,6 @@
 #include "epan/packet_info.h"
 #include "tap.h"
 #include "../register.h"
-#include "rpc_progs.h"
 #include "packet-rpc.h"
 #include "../globals.h"
 #include "compat_macros.h"
@@ -388,7 +387,7 @@ gtk_rpcprogs_init(char *optarg _U_)
        redissect_packets(&cfile);
 }
 
-void
+static void
 gtk_rpcprogs_cb(GtkWidget *w _U_, gpointer d _U_)
 {
        gtk_rpcprogs_init("");
@@ -399,3 +398,10 @@ register_tap_listener_gtkrpcprogs(void)
 {
        register_ethereal_tap("rpc,programs", gtk_rpcprogs_init);
 }
+
+void
+register_tap_menu_gtkrpcprogs(void)
+{
+       register_tap_menu_item("ONC-RPC/Programs", gtk_rpcprogs_cb);
+}
+
diff --git a/gtk/rpc_progs.h b/gtk/rpc_progs.h
deleted file mode 100644 (file)
index 1264641..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* rpc_progs.h
- * rpc_progs   2002 Ronnie Sahlberg
- *
- * $Id: rpc_progs.h,v 1.2 2002/11/06 10:53:36 sahlberg Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
- * Copyright 1998 Gerald Combs
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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 __RPC_PROGS_H__
-#define __RPC_PROGS_H__
-
-void gtk_rpcprogs_cb(GtkWidget *w, gpointer d);
-
-#endif
index e5b6d14ef9822c6785c1582b68aa98fadb1d4e2c..3800c32f32521ebcc8ea41549908f8599f3ab79b 100644 (file)
@@ -1,7 +1,7 @@
 /* rpc_stat.c
  * rpc_stat   2002 Ronnie Sahlberg
  *
- * $Id: rpc_stat.c,v 1.7 2003/04/23 03:51:03 guy Exp $
+ * $Id: rpc_stat.c,v 1.8 2003/04/23 05:37:23 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #endif
 
 #include <gtk/gtk.h>
+#include "menu.h"
 #include "epan/packet_info.h"
 #include "simple_dialog.h"
 #include "tap.h"
 #include "../register.h"
-#include "rpc_stat.h"
 #include "packet-rpc.h"
 #include "../globals.h"
 #include "compat_macros.h"
@@ -507,7 +507,7 @@ dlg_destroy_cb(void)
        dlg=NULL;
 }
 
-void
+static void
 gtk_rpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
 {
        int i;
@@ -606,3 +606,9 @@ register_tap_listener_gtkrpcstat(void)
 {
        register_ethereal_tap("rpc,rtt,", gtk_rpcstat_init);
 }
+
+void
+register_tap_menu_gtkrpcstat(void)
+{
+       register_tap_menu_item("ONC-RPC/RTT", gtk_rpcstat_cb);
+}
diff --git a/gtk/rpc_stat.h b/gtk/rpc_stat.h
deleted file mode 100644 (file)
index d8d02c8..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* rpc_stat.h
- * rpc_stat   2002 Ronnie Sahlberg
- *
- * $Id: rpc_stat.h,v 1.3 2002/11/06 10:53:36 sahlberg Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
- * Copyright 1998 Gerald Combs
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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 __RPCSTAT_H__
-#define __RPCSTAT_H__
-
-void gtk_rpcstat_cb(GtkWidget *w, gpointer d);
-
-#endif
index 9bedf4930695b82cdf20b37b160883407b3fab0c..51e70a2e6fb4745f7aefc3de4216ba58ccae7047 100644 (file)
@@ -1,7 +1,7 @@
 /* smb_stat.c
  * smb_stat   2003 Ronnie Sahlberg
  *
- * $Id: smb_stat.c,v 1.3 2003/04/23 03:51:03 guy Exp $
+ * $Id: smb_stat.c,v 1.4 2003/04/23 05:37:23 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 
 #include <gtk/gtk.h>
 #include <string.h>
+#include "menu.h"
 #include "../epan/packet_info.h"
 #include "../tap.h"
 #include "../epan/value_string.h"
 #include "../smb.h"
 #include "../register.h"
-#include "smb_stat.h"
 #include "compat_macros.h"
 #include "../simple_dialog.h"
 #include "../file.h"
@@ -67,6 +67,7 @@ typedef struct _smbstat_t {
 
 
 
+
 static void
 add_table_entry(smbstat_t *ss, char *str, int x, int y)
 {
@@ -486,12 +487,6 @@ gtk_smbstat_init(char *optarg)
 }
 
 
-void
-register_tap_listener_gtksmbstat(void)
-{
-       register_ethereal_tap("smb,rtt", gtk_smbstat_init);
-}
-
 
 static GtkWidget *dlg=NULL, *dlg_box;
 static GtkWidget *filter_box;
@@ -519,7 +514,7 @@ smbstat_start_button_clicked(GtkWidget *item _U_, gpointer data _U_)
        }
 }
 
-void
+static void
 gtk_smbstat_cb(GtkWidget *w _U_, gpointer d _U_)
 {
        /* if the window is already open, bring it to front */
@@ -562,3 +557,14 @@ gtk_smbstat_cb(GtkWidget *w _U_, gpointer d _U_)
        gtk_widget_show_all(dlg);
 }
 
+void
+register_tap_listener_gtksmbstat(void)
+{
+       register_ethereal_tap("smb,rtt", gtk_smbstat_init);
+}
+
+void
+register_tap_menu_gtksmbstat(void)
+{
+       register_tap_menu_item("SMB/RTT", gtk_smbstat_cb);
+}
diff --git a/gtk/smb_stat.h b/gtk/smb_stat.h
deleted file mode 100644 (file)
index 5e439f4..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* smb_stat.h
- * smb_stat   2003 Ronnie Sahlberg
- *
- * $Id: smb_stat.h,v 1.1 2003/01/22 00:42:05 sahlberg Exp $
- *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
- * Copyright 1998 Gerald Combs
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * 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 __SMBSTAT_H__
-#define __SMBSTAT_H__
-
-void gtk_smbstat_cb(GtkWidget *w, gpointer d);
-
-#endif