aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-04-23 05:37:23 +0000
committerGuy Harris <guy@alum.mit.edu>2003-04-23 05:37:23 +0000
commit81ebec370d30901623ef24b2112e91f8004c6ad0 (patch)
treed7edc8df42ad1945a9e96f593dd54f242937773b /gtk
parent4cfd8b0f360efd2d867333b80f201d13c630f7c8 (diff)
Have "register_tap_menu_item()" create submenus as necessary for a menu
item. Convert all Ethereal (GUI) taps to use "register_tap_menu_item()" rather than having hardcoded menu items in "gtk/menu.c". svn path=/trunk/; revision=7541
Diffstat (limited to 'gtk')
-rw-r--r--gtk/Makefile.am8
-rw-r--r--gtk/dcerpc_stat.c12
-rw-r--r--gtk/dcerpc_stat.h30
-rw-r--r--gtk/io_stat.c10
-rw-r--r--gtk/io_stat.h30
-rw-r--r--gtk/menu.c82
-rw-r--r--gtk/menu.h5
-rw-r--r--gtk/mgcp_stat.c13
-rw-r--r--gtk/mgcp_stat.h30
-rw-r--r--gtk/rpc_progs.c12
-rw-r--r--gtk/rpc_progs.h30
-rw-r--r--gtk/rpc_stat.c12
-rw-r--r--gtk/rpc_stat.h30
-rw-r--r--gtk/smb_stat.c24
-rw-r--r--gtk/smb_stat.h30
15 files changed, 110 insertions, 248 deletions
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 25e0ce0ca8..b117651b05 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.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
diff --git a/gtk/dcerpc_stat.c b/gtk/dcerpc_stat.c
index 064332894d..ab455ee151 100644
--- a/gtk/dcerpc_stat.c
+++ b/gtk/dcerpc_stat.c
@@ -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>
@@ -33,12 +33,12 @@
#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
index f07843d4f0..0000000000
--- a/gtk/dcerpc_stat.h
+++ /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
diff --git a/gtk/io_stat.c b/gtk/io_stat.c
index f93d5d8d71..ccb7238a3f 100644
--- a/gtk/io_stat.c
+++ b/gtk/io_stat.c
@@ -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
index 5318d71ec0..0000000000
--- a/gtk/io_stat.h
+++ /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
diff --git a/gtk/menu.c b/gtk/menu.c
index 61d780ff61..3655b9d377 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -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>
@@ -57,12 +57,6 @@
#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,14 +418,60 @@ 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.
*
* "sizeof statspath" includes the trailing '\0', so the sum
diff --git a/gtk/menu.h b/gtk/menu.h
index 73ec92aeea..3fb5e35f12 100644
--- a/gtk/menu.h
+++ b/gtk/menu.h
@@ -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;
diff --git a/gtk/mgcp_stat.c b/gtk/mgcp_stat.c
index 54a808de2b..1cb9b1052d 100644
--- a/gtk/mgcp_stat.c
+++ b/gtk/mgcp_stat.c
@@ -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
index 0cd650808b..0000000000
--- a/gtk/mgcp_stat.h
+++ /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
diff --git a/gtk/rpc_progs.c b/gtk/rpc_progs.c
index 1aeb9e7473..f54d68881b 100644
--- a/gtk/rpc_progs.c
+++ b/gtk/rpc_progs.c
@@ -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
index 1264641210..0000000000
--- a/gtk/rpc_progs.h
+++ /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
diff --git a/gtk/rpc_stat.c b/gtk/rpc_stat.c
index e5b6d14ef9..3800c32f32 100644
--- a/gtk/rpc_stat.c
+++ b/gtk/rpc_stat.c
@@ -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>
@@ -33,11 +33,11 @@
#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
index d8d02c8f0f..0000000000
--- a/gtk/rpc_stat.h
+++ /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
diff --git a/gtk/smb_stat.c b/gtk/smb_stat.c
index 9bedf49306..51e70a2e6f 100644
--- a/gtk/smb_stat.c
+++ b/gtk/smb_stat.c
@@ -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>
@@ -34,12 +34,12 @@
#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
index 5e439f4b96..0000000000
--- a/gtk/smb_stat.h
+++ /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