Redesigned the menu structure of the former statistics stuff,
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 22 Feb 2004 18:47:04 +0000 (18:47 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 22 Feb 2004 18:47:04 +0000 (18:47 +0000)
now sorted by ISO-layer, than alphabetically (now longer by functionality).
Seperated the tap registering from the actual menu making stuff,
so the seperate step of registering the tap and the menu is no longer needed.
Removed all things related to this double registering.

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

43 files changed:
gtk/Makefile.common
gtk/ansi_a_stat.c
gtk/ansi_map_stat.c
gtk/bootp_stat.c
gtk/dcerpc_stat.c
gtk/endpoint_talkers_eth.c
gtk/endpoint_talkers_fc.c
gtk/endpoint_talkers_fddi.c
gtk/endpoint_talkers_ip.c
gtk/endpoint_talkers_ipx.c
gtk/endpoint_talkers_tcpip.c
gtk/endpoint_talkers_tr.c
gtk/endpoint_talkers_udpip.c
gtk/fc_stat.c
gtk/follow_dlg.c
gtk/gsm_a_stat.c
gtk/gsm_map_stat.c
gtk/h225_counter.c
gtk/h225_ras_srt.c
gtk/hostlist_eth.c
gtk/hostlist_fc.c
gtk/hostlist_fddi.c
gtk/hostlist_ip.c
gtk/hostlist_ipx.c
gtk/hostlist_tcpip.c
gtk/hostlist_tr.c
gtk/hostlist_udpip.c
gtk/http_stat.c
gtk/io_stat.c
gtk/isup_stat.c
gtk/ldap_stat.c
gtk/main.c
gtk/menu.c
gtk/mgcp_stat.c
gtk/rpc_progs.c
gtk/rpc_stat.c
gtk/rtp_analysis.c
gtk/rtp_stream_dlg.c
gtk/smb_stat.c
gtk/tap_menu.h
gtk/tcp_graph.c
gtk/wsp_stat.c
make-tapreg-dotc

index 4da46466f0261571b804f0084a81351e62bacf2a..c3d5bb88aa24ceea4980bea168d38acb59962b32 100644 (file)
@@ -3,7 +3,7 @@
 #     a) common to both files and
 #     b) portable between both files
 #
-# $Id: Makefile.common,v 1.6 2004/02/20 09:09:11 guy Exp $
+# $Id: Makefile.common,v 1.7 2004/02/22 18:44:02 ulfl Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Gerald Combs <gerald@ethereal.com>
@@ -46,7 +46,6 @@ ETHEREAL_GTK_SRC = \
        file_dlg.c      \
        filter_prefs.c  \
        find_dlg.c      \
-       follow_dlg.c    \
        goto_dlg.c      \
        gtk_stat_util.c \
        gui_prefs.c     \
@@ -73,7 +72,6 @@ ETHEREAL_GTK_SRC = \
        summary_dlg.c   \
        supported_protos_dlg.c  \
        tap_dfilter_dlg.c       \
-       tcp_graph.c     \
        toolbar.c       \
        ui_util.c
 
@@ -92,6 +90,7 @@ ETHEREAL_TAP_SRC = \
        endpoint_talkers_tr.c   \
        endpoint_talkers_udpip.c        \
        fc_stat.c       \
+       follow_dlg.c    \
        gsm_a_stat.c    \
        gsm_map_stat.c  \
        h225_counter.c  \
@@ -113,5 +112,6 @@ ETHEREAL_TAP_SRC = \
        rpc_stat.c      \
        rtp_analysis.c  \
        rtp_stream_dlg.c        \
+       tcp_graph.c     \
        smb_stat.c      \
        wsp_stat.c
index 51249f0e0325049f88dc321a50d3130d0b3ce4dc..78f5157753ebbca829037b0f5ee1fcea21c5baec 100644 (file)
@@ -5,7 +5,7 @@
  *
  * MUCH code modified from service_response_time_table.c.
  *
- * $Id: ansi_a_stat.c,v 1.13 2004/02/11 04:28:47 guy Exp $
+ * $Id: ansi_a_stat.c,v 1.14 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -534,12 +534,9 @@ register_tap_listener_gtkansi_a_stat(void)
 
        exit(1);
     }
-}
-
 
-void
-register_tap_menu_gtkansi_a_stat(void)
-{
-    register_tap_menu_item("_Statistics/ANSI A-Interface/BSMAP", ansi_a_stat_gtk_bsmap_cb, NULL, NULL ,NULL);
-    register_tap_menu_item("_Statistics/ANSI A-Interface/DTAP", ansi_a_stat_gtk_dtap_cb, NULL, NULL ,NULL);
+    register_tap_menu_item("ANSI/A-Interface BSMAP", REGISTER_TAP_LAYER_APPLICATION, 
+        ansi_a_stat_gtk_bsmap_cb, NULL, NULL ,NULL);
+    register_tap_menu_item("ANSI/A-Interface DTAP", REGISTER_TAP_LAYER_APPLICATION,
+        ansi_a_stat_gtk_dtap_cb, NULL, NULL ,NULL);
 }
index 2c7832f750b90b604b50867156552df03797fe5c..b2965723b4cfa6c6217df063620859d8024113d8 100644 (file)
@@ -5,7 +5,7 @@
  *
  * MUCH code modified from service_response_time_table.c.
  *
- * $Id: ansi_map_stat.c,v 1.16 2004/02/11 04:28:47 guy Exp $
+ * $Id: ansi_map_stat.c,v 1.17 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -467,11 +467,7 @@ register_tap_listener_gtkansi_map_stat(void)
 
        exit(1);
     }
-}
-
 
-void
-register_tap_menu_gtkansi_map_stat(void)
-{
-    register_tap_menu_item("_Statistics/ANSI MAP Operation", ansi_map_stat_gtk_cb, NULL, NULL, NULL);
+    register_tap_menu_item("ANSI/MAP Operation", REGISTER_TAP_LAYER_APPLICATION,
+        ansi_map_stat_gtk_cb, NULL, NULL, NULL);
 }
index 2a992107951793361de0c5beb1143771a36a1719..5b11b5ffd246e4e42a9793a77740c8c38d1749be 100644 (file)
@@ -1,7 +1,7 @@
 /* bootp_stat.c
  * boop_stat   2003 Jean-Michel FAYARD
  *
- * $Id: bootp_stat.c,v 1.18 2004/02/13 00:53:34 guy Exp $
+ * $Id: bootp_stat.c,v 1.19 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -357,11 +357,7 @@ void
 register_tap_listener_gtkdhcpstat(void)
 {
        register_ethereal_tap("bootp,stat,", gtk_dhcpstat_init);
-}
 
-void
-register_tap_menu_gtkdhcpstat(void)
-{
-       register_tap_menu_item("_Statistics/Watch protocol/BOOTP-DHCP...",
+       register_tap_menu_item("BOOTP-DHCP (Watch Protocol)", REGISTER_TAP_LAYER_NETWORK,
            gtk_dhcpstat_cb, NULL, NULL, NULL);
 }
index 8345fe050488adb8459a7d15face0d9787084f60..3b08c7d1e328e2006af4f49180ba580e8b8b1eef 100644 (file)
@@ -1,7 +1,7 @@
 /* dcerpc_stat.c
  * dcerpc_stat   2002 Ronnie Sahlberg
  *
- * $Id: dcerpc_stat.c,v 1.49 2004/02/13 00:53:34 guy Exp $
+ * $Id: dcerpc_stat.c,v 1.50 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -676,11 +676,7 @@ void
 register_tap_listener_gtkdcerpcstat(void)
 {
        register_ethereal_tap("dcerpc,srt,", gtk_dcerpcstat_init);
-}
 
-void
-register_tap_menu_gtkdcerpcstat(void)
-{
-       register_tap_menu_item("_Statistics/Service Response Time/DCE-RPC...",
+       register_tap_menu_item("DCE-RPC (Service Response Time...)", REGISTER_TAP_LAYER_APPLICATION,
            gtk_dcerpcstat_cb, NULL, NULL, NULL);
 }
index 447faf5f08a707d8110a57e26cbe34161c1334dc..0ee33796c9f6e18e89592b21a56803c787c2901c 100644 (file)
@@ -1,7 +1,7 @@
 /* endpoint_talkers_eth.c
  * endpoint_talkers_eth   2003 Ronnie Sahlberg
  *
- * $Id: endpoint_talkers_eth.c,v 1.22 2004/02/11 04:28:47 guy Exp $
+ * $Id: endpoint_talkers_eth.c,v 1.23 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -76,19 +76,12 @@ gtk_eth_endpoints_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_eth_talkers(void)
-{
-       register_tap_menu_item("_Statistics/Conversation List/Ethernet",
-           gtk_eth_endpoints_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_eth_talkers(void)
 {
        register_ethereal_tap("conv,eth", gtk_eth_talkers_init);
+
+       register_tap_menu_item("Ethernet/Conversation List", REGISTER_TAP_LAYER_DATA_LINK,
+           gtk_eth_endpoints_cb, NULL, NULL, NULL);
 }
 
index b3b081ac03a4ac139c25ed3c9b5332c1beee2bd3..098e3d09d701bb4573d1dd3cb565aa25dcadf51e 100644 (file)
@@ -1,7 +1,7 @@
 /* endpoint_talkers_fc.c
  * endpoint_talkers_fc   2003 Ronnie Sahlberg
  *
- * $Id: endpoint_talkers_fc.c,v 1.22 2004/02/11 04:28:47 guy Exp $
+ * $Id: endpoint_talkers_fc.c,v 1.23 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -76,19 +76,12 @@ gtk_fc_endpoints_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_fc_talkers(void)
-{
-       register_tap_menu_item("_Statistics/Conversation List/Fibre Channel",
-           gtk_fc_endpoints_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_fc_talkers(void)
 {
        register_ethereal_tap("conv,fc", gtk_fc_talkers_init);
+
+       register_tap_menu_item("Fibre Channel/Conversation List", REGISTER_TAP_LAYER_DATA_LINK,
+           gtk_fc_endpoints_cb, NULL, NULL, NULL);
 }
 
index 3ccc31e3898e9f0a86f6c6e1d2d7fbd3eb8bdf91..4bdab82a76bc20f754dff67a785749a1bf5da95b 100644 (file)
@@ -1,7 +1,7 @@
 /* endpoint_talkers_fddi.c
  * endpoint_talkers_fddi   2003 Ronnie Sahlberg
  *
- * $Id: endpoint_talkers_fddi.c,v 1.17 2004/02/11 04:28:47 guy Exp $
+ * $Id: endpoint_talkers_fddi.c,v 1.18 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -76,19 +76,12 @@ gtk_fddi_endpoints_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_fddi_talkers(void)
-{
-       register_tap_menu_item("_Statistics/Conversation List/FDDI",
-           gtk_fddi_endpoints_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_fddi_talkers(void)
 {
        register_ethereal_tap("conv,fddi", gtk_fddi_talkers_init);
+
+       register_tap_menu_item("FDDI/Conversation List", REGISTER_TAP_LAYER_DATA_LINK,
+           gtk_fddi_endpoints_cb, NULL, NULL, NULL);
 }
 
index 713f81c1bb01a332694eedc813489698c27a6a82..15448964bed6d88c270c1963bb0a6693ca253557 100644 (file)
@@ -1,7 +1,7 @@
 /* endpoint_talkers_ip.c
  * endpoint_talkers_ip   2003 Ronnie Sahlberg
  *
- * $Id: endpoint_talkers_ip.c,v 1.23 2004/02/11 04:28:47 guy Exp $
+ * $Id: endpoint_talkers_ip.c,v 1.24 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -74,19 +74,12 @@ gtk_ip_endpoints_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_ip_talkers(void)
-{
-       register_tap_menu_item("_Statistics/Conversation List/IPv4",
-           gtk_ip_endpoints_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_ip_talkers(void)
 {
        register_ethereal_tap("conv,ip", gtk_ip_talkers_init);
+
+       register_tap_menu_item("IP/Conversation List (IPv4)", REGISTER_TAP_LAYER_NETWORK,
+           gtk_ip_endpoints_cb, NULL, NULL, NULL);
 }
 
index abbe845c697b5f798fe100f0c223653249d51bcc..d1034ced86f9af524115d56ec503d311b440a527 100644 (file)
@@ -1,7 +1,7 @@
 /* endpoint_talkers_ipx.c
  * endpoint_talkers_ipx   2003 Ronnie Sahlberg
  *
- * $Id: endpoint_talkers_ipx.c,v 1.21 2004/02/11 04:28:47 guy Exp $
+ * $Id: endpoint_talkers_ipx.c,v 1.22 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -76,19 +76,12 @@ gtk_ipx_endpoints_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_ipx_talkers(void)
-{
-       register_tap_menu_item("_Statistics/Conversation List/IPX",
-           gtk_ipx_endpoints_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_ipx_talkers(void)
 {
        register_ethereal_tap("conv,ipx", gtk_ipx_talkers_init);
+
+       register_tap_menu_item("IPX/Conversation List", REGISTER_TAP_LAYER_NETWORK,
+           gtk_ipx_endpoints_cb, NULL, NULL, NULL);
 }
 
index 967deaed6a2d8ab636d3ccdee434c64c7e188e60..5b5c596ee76290cb04416a550725d764f16aa4f0 100644 (file)
@@ -1,7 +1,7 @@
 /* endpoint_talkers_tcpip.c
  * endpoint_talkers_tcpip   2003 Ronnie Sahlberg
  *
- * $Id: endpoint_talkers_tcpip.c,v 1.24 2004/02/11 04:28:48 guy Exp $
+ * $Id: endpoint_talkers_tcpip.c,v 1.25 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -76,19 +76,12 @@ gtk_tcpip_endpoints_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_tcpip_talkers(void)
-{
-       register_tap_menu_item("_Statistics/Conversation List/TCP (IPv4 IPv6)",
-           gtk_tcpip_endpoints_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_tcpip_talkers(void)
 {
        register_ethereal_tap("conv,tcp", gtk_tcpip_talkers_init);
+
+       register_tap_menu_item("TCP/Conversation List (IPv4 & IPv6)", REGISTER_TAP_LAYER_TRANSPORT,
+           gtk_tcpip_endpoints_cb, NULL, NULL, NULL);
 }
 
index c37a150872c70eb50c736011ed2e70da5d5b48c0..01e9efa2b67af9a4410a78739bf651b6a28e59b4 100644 (file)
@@ -1,7 +1,7 @@
 /* endpoint_talkers_tr.c
  * endpoint_talkers_tr   2003 Ronnie Sahlberg
  *
- * $Id: endpoint_talkers_tr.c,v 1.23 2004/02/11 04:28:48 guy Exp $
+ * $Id: endpoint_talkers_tr.c,v 1.24 2004/02/22 18:44:00 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -76,19 +76,12 @@ gtk_tr_endpoints_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_tr_talkers(void)
-{
-       register_tap_menu_item("_Statistics/Conversation List/Token Ring",
-           gtk_tr_endpoints_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_tr_talkers(void)
 {
        register_ethereal_tap("conv,tr", gtk_tr_talkers_init);
+
+       register_tap_menu_item("Token Ring/Conversation List", REGISTER_TAP_LAYER_DATA_LINK,
+           gtk_tr_endpoints_cb, NULL, NULL, NULL);
 }
 
index 5140326a1092f535acec2a315579ae75d7a4b710..9507d257fa0ccb33ed1c0da44c6f45c6f0271904 100644 (file)
@@ -1,7 +1,7 @@
 /* endpoint_talkers_udpip.c
  * endpoint_talkers_udpip   2003 Ronnie Sahlberg
  *
- * $Id: endpoint_talkers_udpip.c,v 1.24 2004/02/11 04:28:48 guy Exp $
+ * $Id: endpoint_talkers_udpip.c,v 1.25 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -76,19 +76,12 @@ gtk_udpip_endpoints_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_udpip_talkers(void)
-{
-       register_tap_menu_item("_Statistics/Conversation List/UDP (IPv4 IPv6)",
-           gtk_udpip_endpoints_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_udpip_talkers(void)
 {
        register_ethereal_tap("conv,udp", gtk_udpip_talkers_init);
+
+       register_tap_menu_item("UDP/Conversation List (IPv4 & IPv6)", REGISTER_TAP_LAYER_TRANSPORT,
+           gtk_udpip_endpoints_cb, NULL, NULL, NULL);
 }
 
index 3129aa98eb93093c454c526c2b5eee5850b1672d..2a703783f716304be476651aba4366d96efd0531 100644 (file)
@@ -1,7 +1,7 @@
 /* fc_stat.c
  * fc_stat   2003 Ronnie Sahlberg
  *
- * $Id: fc_stat.c,v 1.25 2004/02/13 00:53:35 guy Exp $
+ * $Id: fc_stat.c,v 1.26 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -312,11 +312,7 @@ void
 register_tap_listener_gtkfcstat(void)
 {
        register_ethereal_tap("fc,srt", gtk_fcstat_init);
-}
 
-void
-register_tap_menu_gtkfcstat(void)
-{
-       register_tap_menu_item("_Statistics/Service Response Time/Fibre Channel...",
+       register_tap_menu_item("Fibre Channel/Service Response Time...", REGISTER_TAP_LAYER_DATA_LINK,
            gtk_fcstat_cb, NULL, NULL, NULL);
 }
index a04f9376d714b18d6f7cbf1b41ba8efb2a051683..724ad8504043d7206454d32d490ab0ea0ed5845b 100644 (file)
@@ -1,6 +1,6 @@
 /* follow_dlg.c
  *
- * $Id: follow_dlg.c,v 1.46 2004/02/13 00:53:35 guy Exp $
+ * $Id: follow_dlg.c,v 1.47 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -64,6 +64,8 @@
 #include <epan/epan_dissect.h>
 #include <epan/filesystem.h>
 #include "compat_macros.h"
+#include "ipproto.h"
+#include "tap_menu.h"
 
 /* Show Stream */
 typedef enum {
@@ -1014,3 +1016,20 @@ follow_save_as_destroy_cb(GtkWidget * win _U_, gpointer data)
        /* Note that we no longer have a dialog box. */
        follow_info->follow_save_as_w = NULL;
 }
+
+
+
+gboolean follow_stream_selected_packet_enabled(frame_data *current_frame, epan_dissect_t *edt) 
+{
+  return current_frame != NULL ? (edt->pi.ipproto == IP_PROTO_TCP) : FALSE;
+}
+
+
+void
+register_tap_listener_follow_stream(void)
+{
+    register_tap_menu_item("TCP/Follow Stream", REGISTER_TAP_LAYER_TRANSPORT,
+        follow_stream_cb, follow_stream_selected_packet_enabled, NULL, NULL);
+}
+
+    
index cd69b1d787a173b55d9ed3266b44516cda7d0200..6dc40385b76e5b2221572037ff5bbed1c2a61fdf 100644 (file)
@@ -5,7 +5,7 @@
  *
  * MUCH code modified from service_response_time_table.c.
  *
- * $Id: gsm_a_stat.c,v 1.13 2004/02/11 04:28:48 guy Exp $
+ * $Id: gsm_a_stat.c,v 1.14 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -690,33 +690,28 @@ register_tap_listener_gtkgsm_a_stat(void)
 
        exit(1);
     }
-}
-
 
-void
-register_tap_menu_gtkgsm_a_stat(void)
-{
-    register_tap_menu_item("_Statistics/GSM A-Interface/BSSMAP",
+    register_tap_menu_item("GSM/A-Interface BSSMAP", REGISTER_TAP_LAYER_APPLICATION,
        gsm_a_stat_gtk_bssmap_cb, NULL, NULL, NULL);
 
-    register_tap_menu_item("_Statistics/GSM A-Interface/DTAP/Mobility Management",
+    register_tap_menu_item("GSM/A-Interface DTAP/Mobility Management", REGISTER_TAP_LAYER_APPLICATION,
        gsm_a_stat_gtk_dtap_mm_cb, NULL, NULL, NULL);
 
-    register_tap_menu_item("_Statistics/GSM A-Interface/DTAP/Radio Resource Management",
+    register_tap_menu_item("GSM/A-Interface DTAP/Radio Resource Management", REGISTER_TAP_LAYER_APPLICATION,
        gsm_a_stat_gtk_dtap_rr_cb, NULL, NULL, NULL);
 
-    register_tap_menu_item("_Statistics/GSM A-Interface/DTAP/Call Control",
+    register_tap_menu_item("GSM/A-Interface DTAP/Call Control", REGISTER_TAP_LAYER_APPLICATION,
        gsm_a_stat_gtk_dtap_cc_cb, NULL, NULL, NULL);
 
-    register_tap_menu_item("_Statistics/GSM A-Interface/DTAP/GPRS Mobility Management",
+    register_tap_menu_item("GSM/A-Interface DTAP/GPRS Mobility Management", REGISTER_TAP_LAYER_APPLICATION,
        gsm_a_stat_gtk_dtap_gmm_cb, NULL, NULL, NULL);
 
-    register_tap_menu_item("_Statistics/GSM A-Interface/DTAP/Short Message Service",
+    register_tap_menu_item("GSM/A-Interface DTAP/Short Message Service", REGISTER_TAP_LAYER_APPLICATION,
        gsm_a_stat_gtk_dtap_sms_cb, NULL, NULL, NULL);
 
-    register_tap_menu_item("_Statistics/GSM A-Interface/DTAP/GPRS Session Management",
+    register_tap_menu_item("GSM/A-Interface DTAP/GPRS Session Management", REGISTER_TAP_LAYER_APPLICATION,
        gsm_a_stat_gtk_dtap_sm_cb, NULL, NULL, NULL);
 
-    register_tap_menu_item("_Statistics/GSM A-Interface/DTAP/Supplementary Services",
+    register_tap_menu_item("GSM/A-Interface DTAP/Supplementary Services", REGISTER_TAP_LAYER_APPLICATION,
        gsm_a_stat_gtk_dtap_ss_cb, NULL, NULL, NULL);
 }
index 52c73040f1d12a412afbbe4fda808d2e568d9346..f02d6a8fa9223c8d653fcb845008515dbdda6991 100644 (file)
@@ -5,7 +5,7 @@
  *
  * MUCH code modified from service_response_time_table.c.
  *
- * $Id: gsm_map_stat.c,v 1.2 2004/02/18 04:11:42 jmayer Exp $
+ * $Id: gsm_map_stat.c,v 1.3 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -478,11 +478,7 @@ register_tap_listener_gtkgsm_map_stat(void)
 
        exit(1);
     }
-}
-
 
-void
-register_tap_menu_gtkgsm_map_stat(void)
-{
-    register_tap_menu_item("_Statistics/GSM MAP Operation", gsm_map_stat_gtk_cb, NULL, NULL, NULL);
+    register_tap_menu_item("GSM/MAP Operation",  REGISTER_TAP_LAYER_APPLICATION,
+        gsm_map_stat_gtk_cb, NULL, NULL, NULL);
 }
index a338f79ce1f0ed833bc6178f83668e60c46fbfe7..ef257f1307274b6ca05a7c546b08b7ecfedf2c3d 100644 (file)
@@ -2,7 +2,7 @@
  * h225 message counter for ethereal
  * Copyright 2003 Lars Roland
  *
- * $Id: h225_counter.c,v 1.12 2004/02/13 00:53:35 guy Exp $
+ * $Id: h225_counter.c,v 1.13 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -519,11 +519,7 @@ void
 register_tap_listener_gtk_h225counter(void)
 {
        register_ethereal_tap("h225,counter", gtk_h225counter_init);
-}
 
-void
-register_tap_menu_gtk_h225counter(void)
-{
-       register_tap_menu_item("_Statistics/Watch protocol/ITU-T H.225...",
+       register_tap_menu_item("ITU-T H.225/Watch Protocol...", REGISTER_TAP_LAYER_APPLICATION,
            gtk_tap_dfilter_dlg_cb, NULL, NULL, &(h225_counter_dlg));
 }
index 331c0a26f295874b75f7a0afccb6f205f09fc613..479d2f7fc09fcbd39616da827ae9b21bfa6d1d90 100644 (file)
@@ -2,7 +2,7 @@
  * h225 RAS Service Response Time statistics for ethereal
  * Copyright 2003 Lars Roland
  *
- * $Id: h225_ras_srt.c,v 1.11 2004/02/13 00:53:35 guy Exp $
+ * $Id: h225_ras_srt.c,v 1.12 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -316,11 +316,7 @@ void
 register_tap_listener_gtk_h225rassrt(void)
 {
        register_ethereal_tap("h225,srt", gtk_h225rassrt_init);
-}
 
-void
-register_tap_menu_gtk_h225rassrt(void)
-{
-       register_tap_menu_item("_Statistics/Service Response Time/ITU-T H.225 RAS ...",
+       register_tap_menu_item("ITU-T H.225/RAS (Service Response Time ...)", REGISTER_TAP_LAYER_APPLICATION,
            gtk_tap_dfilter_dlg_cb, NULL, NULL, &(h225_rassrt_dlg));
 }
index 57810f68a60e36f36eee55a909b063017ca69e4b..c374c17bc0a122bc686b8ea825bcc0406f402c6a 100644 (file)
@@ -1,7 +1,7 @@
 /* hostlist_eth.c   2004 Ian Schorr
  * modified from endpoint_talkers_eth.c   2003 Ronnie Sahlberg
  *
- * $Id: hostlist_eth.c,v 1.1 2004/02/20 09:09:11 guy Exp $
+ * $Id: hostlist_eth.c,v 1.2 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -80,19 +80,12 @@ gtk_eth_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_eth_hostlist(void)
-{
-       register_tap_menu_item("_Statistics/Host List/Ethernet",
-           gtk_eth_hostlist_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_eth_hostlist(void)
 {
        register_ethereal_tap("conv,eth", gtk_eth_hostlist_init);
+
+       register_tap_menu_item("Ethernet/Host List", REGISTER_TAP_LAYER_DATA_LINK,
+           gtk_eth_hostlist_cb, NULL, NULL, NULL);
 }
 
index 1c43e5812f4d964b1ed2745ba08f7033218d586c..e64e2ac73f7d39f645e14098075f76c88497911a 100644 (file)
@@ -1,7 +1,7 @@
 /* hostlist_fc.c   2004 Ian Schorr
  * modified from endpoint_talkers_fc.c   2003 Ronnie Sahlberg
  *
- * $Id: hostlist_fc.c,v 1.1 2004/02/20 09:09:11 guy Exp $
+ * $Id: hostlist_fc.c,v 1.2 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -80,19 +80,12 @@ gtk_fc_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_fc_hostlist(void)
-{
-       register_tap_menu_item("_Statistics/Host List/Fibre Channel",
-           gtk_fc_hostlist_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_fc_hostlist(void)
 {
        register_ethereal_tap("conv,fc", gtk_fc_hostlist_init);
+
+       register_tap_menu_item("Fibre Channel/Host List", REGISTER_TAP_LAYER_DATA_LINK,
+           gtk_fc_hostlist_cb, NULL, NULL, NULL);
 }
 
index 419f828a00e6debb7f10d34279c79499acccd088..463d57421bebb735e25043ad90f45a0bd3956e59 100644 (file)
@@ -1,7 +1,7 @@
 /* hostlist_fddi.c   2004 Ian Schorr
  * modified from endpoint_talkers_fddi.c   2003 Ronnie Sahlberg
  *
- * $Id: hostlist_fddi.c,v 1.1 2004/02/20 09:09:11 guy Exp $
+ * $Id: hostlist_fddi.c,v 1.2 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -80,19 +80,12 @@ gtk_fddi_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_fddi_hostlist(void)
-{
-       register_tap_menu_item("_Statistics/Host List/FDDI",
-           gtk_fddi_hostlist_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_fddi_hostlist(void)
 {
        register_ethereal_tap("conv,fddi", gtk_fddi_hostlist_init);
+
+       register_tap_menu_item("FDDI/Host List", REGISTER_TAP_LAYER_DATA_LINK,
+           gtk_fddi_hostlist_cb, NULL, NULL, NULL);
 }
 
index 26f83ba3b42b8147e4a4c6674574ea09f3bcbb1b..d845dd8e79de11ccf6abaf672123064abbcbd228 100644 (file)
@@ -1,7 +1,7 @@
 /* hostlist_ip.c   2004 Ian Schorr
  * modified from endpoint_talkers_ip.c   2003 Ronnie Sahlberg
  *
- * $Id: hostlist_ip.c,v 1.1 2004/02/20 09:09:11 guy Exp $
+ * $Id: hostlist_ip.c,v 1.2 2004/02/22 18:44:01 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -79,17 +79,12 @@ gtk_ip_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_ip_hostlist(void)
-{
-       register_tap_menu_item("_Statistics/Host List/IPv4",
-               gtk_ip_hostlist_cb, NULL, NULL, NULL);
-}
-
-
 void
 register_tap_listener_ip_hostlist(void)
 {
        register_ethereal_tap("conv,ip", gtk_ip_hostlist_init);
+
+       register_tap_menu_item("IP/Host List (IPv4)", REGISTER_TAP_LAYER_NETWORK,
+               gtk_ip_hostlist_cb, NULL, NULL, NULL);
 }
 
index a1674084338e9e977b187155433ceed3be9124fb..79cb79a087e7403ebe69454e7dc0b0e302b21112 100644 (file)
@@ -1,7 +1,7 @@
 /* hostlist_ipx.c   2004 Ian Schorr
  * modified from endpoint_talkers_ipx.c   2003 Ronnie Sahlberg
  *
- * $Id: hostlist_ipx.c,v 1.1 2004/02/20 09:09:11 guy Exp $
+ * $Id: hostlist_ipx.c,v 1.2 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -80,19 +80,12 @@ gtk_ipx_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_ipx_hostlist(void)
-{
-       register_tap_menu_item("_Statistics/Host List/IPX",
-           gtk_ipx_hostlist_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_ipx_hostlist(void)
 {
        register_ethereal_tap("conv,ipx", gtk_ipx_hostlist_init);
+
+       register_tap_menu_item("IPX/Host List", REGISTER_TAP_LAYER_NETWORK,
+           gtk_ipx_hostlist_cb, NULL, NULL, NULL);
 }
 
index 8349d453fe66f1f491dffa75e3ee04cc2f103683..13b312ba29ccc53b8dd7726bdd0b9cb90bf58b57 100644 (file)
@@ -1,7 +1,7 @@
 /* hostlist_tcpip.c   2004 Ian Schorr
  * modified from endpoint_talkers_tcpip.c   2003 Ronnie Sahlberg
  *
- * $Id: hostlist_tcpip.c,v 1.1 2004/02/20 09:09:12 guy Exp $
+ * $Id: hostlist_tcpip.c,v 1.2 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -80,19 +80,12 @@ gtk_tcpip_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_tcpip_hostlist(void)
-{
-       register_tap_menu_item("_Statistics/Host List/TCP (IPv4 IPv6)",
-           gtk_tcpip_hostlist_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_tcpip_hostlist(void)
 {
        register_ethereal_tap("conv,tcp", gtk_tcpip_hostlist_init);
+
+       register_tap_menu_item("TCP/Host List (IPv4 & IPv6)", REGISTER_TAP_LAYER_TRANSPORT,
+           gtk_tcpip_hostlist_cb, NULL, NULL, NULL);
 }
 
index 44de1a7caf37773e537a38c26212d72ef7d66ecb..5149f77f699426a71e2e971b4e259710a66bfd1a 100644 (file)
@@ -1,7 +1,7 @@
 /* hostlist_tr.c   2004 Ian Schorr
  * modified from endpoint_talkers_tr.c   2003 Ronnie Sahlberg
  *
- * $Id: hostlist_tr.c,v 1.1 2004/02/20 09:09:12 guy Exp $
+ * $Id: hostlist_tr.c,v 1.2 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -80,19 +80,12 @@ gtk_tr_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_tr_hostlist(void)
-{
-       register_tap_menu_item("_Statistics/Host List/Token Ring",
-           gtk_tr_hostlist_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_tr_hostlist(void)
 {
        register_ethereal_tap("conv,tr", gtk_tr_hostlist_init);
+
+       register_tap_menu_item("Token Ring/Host List", REGISTER_TAP_LAYER_DATA_LINK,
+           gtk_tr_hostlist_cb, NULL, NULL, NULL);
 }
 
index f4d8ec537b321fb8e5b6650b63c7b43bb21da4e8..cc5c4383bcf1d64d01fc0f039b7656956f58d84d 100644 (file)
@@ -1,7 +1,7 @@
 /* hostlist_udpip.c   2004 Ian Schorr
  * modified from endpoint_talkers_udpip.c   2003 Ronnie Sahlberg
  *
- * $Id: hostlist_udpip.c,v 1.1 2004/02/20 09:09:12 guy Exp $
+ * $Id: hostlist_udpip.c,v 1.2 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -80,19 +80,12 @@ gtk_udpip_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 }
 
 
-void
-register_tap_menu_udpip_hostlist(void)
-{
-       register_tap_menu_item("_Statistics/Host List/UDP (IPv4 IPv6)",
-           gtk_udpip_hostlist_cb, NULL, NULL, NULL);
-}
-
-
-
-
 void
 register_tap_listener_udpip_hostlist(void)
 {
        register_ethereal_tap("conv,udp", gtk_udpip_hostlist_init);
+
+       register_tap_menu_item("UDP/Host List (IPv4 & IPv6)", REGISTER_TAP_LAYER_TRANSPORT,
+           gtk_udpip_hostlist_cb, NULL, NULL, NULL);
 }
 
index 3fe78e75a8f6db838992ad365366795934f36c59..3e93a9e372777bba24bf21ff8e48b4b6961219db 100644 (file)
@@ -1,7 +1,7 @@
 /* http_stat.c
  * http_stat   2003 Jean-Michel FAYARD
  *
- * $Id: http_stat.c,v 1.20 2004/02/13 00:53:35 guy Exp $
+ * $Id: http_stat.c,v 1.21 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -603,11 +603,7 @@ void
 register_tap_listener_gtkhttpstat(void)
 {
        register_ethereal_tap("http,stat,", gtk_httpstat_init);
-}
 
-void
-register_tap_menu_gtkhttpstat(void)
-{
-       register_tap_menu_item("_Statistics/Watch protocol/HTTP...",
+       register_tap_menu_item("HTTP (Watch Protocol)", REGISTER_TAP_LAYER_APPLICATION,
            gtk_httpstat_cb, NULL, NULL, NULL);
 }
index 7063d0b0f21e0a1267f4a8995e9a384d8f174586..c3feaf0189441bc2f2563b4afc0753afd9e75995 100644 (file)
@@ -1,7 +1,7 @@
 /* io_stat.c
  * io_stat   2002 Ronnie Sahlberg
  *
- * $Id: io_stat.c,v 1.63 2004/02/13 00:53:35 guy Exp $
+ * $Id: io_stat.c,v 1.64 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1791,11 +1791,7 @@ void
 register_tap_listener_gtk_iostat(void)
 {
        register_ethereal_tap("io,stat", gtk_iostat_init);
-}
 
-void
-register_tap_menu_gtkiostat(void)
-{
-       register_tap_menu_item("_Statistics/IO/IO-Stat", gtk_iostat_cb, NULL,
-           NULL, NULL);
+       register_tap_menu_item("IO Statistics", REGISTER_TAP_LAYER_GENERIC,
+        gtk_iostat_cb, NULL, NULL, NULL);
 }
index 827302297f0320810a3877137536960d8a694854..b22f6eb7cc75a2e8c4fd7d3f3a842a8d8461768a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * MUCH code modified from service_response_time_table.c.
  *
- * $Id: isup_stat.c,v 1.17 2004/02/18 04:11:42 jmayer Exp $
+ * $Id: isup_stat.c,v 1.18 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -472,11 +472,7 @@ register_tap_listener_gtkisup_stat(void)
 
        exit(1);
     }
-}
-
 
-void
-register_tap_menu_gtkisup_stat(void)
-{
-    register_tap_menu_item("_Statistics/ISUP Message Type", isup_stat_gtk_cb, NULL, NULL, NULL);
+    register_tap_menu_item("ISUP (Message Types)", REGISTER_TAP_LAYER_APPLICATION,
+        isup_stat_gtk_cb, NULL, NULL, NULL);
 }
index a09a1d70a36f265145304b3b0d620632eca8fed6..23f1f440842faba57ff64dab15cc8d5064f6087b 100644 (file)
@@ -1,7 +1,7 @@
 /* ldap_stat.c
  * ldap_stat   2003 Ronnie Sahlberg
  *
- * $Id: ldap_stat.c,v 1.13 2004/02/13 00:53:35 guy Exp $
+ * $Id: ldap_stat.c,v 1.14 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -347,11 +347,7 @@ void
 register_tap_listener_gtkldapstat(void)
 {
        register_ethereal_tap("ldap,srt", gtk_ldapstat_init);
-}
 
-void
-register_tap_menu_gtkldapstat(void)
-{
-       register_tap_menu_item("_Statistics/Service Response Time/LDAP...",
+       register_tap_menu_item("LDAP (Service Response Time...)", REGISTER_TAP_LAYER_APPLICATION,
            gtk_ldapstat_cb, NULL, NULL, NULL);
 }
index f0fc60feb66accd3ff3955ecd96cc0f2bb29dbfa..52cced8933011aa2a22b491078c044203e0ee320 100644 (file)
@@ -1,6 +1,6 @@
 /* main.c
  *
- * $Id: main.c,v 1.403 2004/02/21 13:40:06 ulfl Exp $
+ * $Id: main.c,v 1.404 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -3787,7 +3787,7 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs)
     set_menu_object_data("/File/Open...", E_DFILTER_TE_KEY, filter_te);
     set_menu_object_data("/Analyze/Display Filters...", E_FILT_TE_PTR_KEY,
                          filter_te);
-    set_menu_object_data("/Analyze/Follow TCP Stream", E_DFILTER_TE_KEY,
+    set_menu_object_data("/Analyze/TCP/Follow Stream", E_DFILTER_TE_KEY,
                          filter_te);
     set_menu_object_data("/Analyze/Match/Selected", E_DFILTER_TE_KEY,
                          filter_te);
@@ -3814,6 +3814,9 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs)
     set_menu_object_data("/Analyze/Prepare/Or Not Selected", E_DFILTER_TE_KEY,
                          filter_te);
     set_toolbar_object_data(E_DFILTER_TE_KEY, filter_te);
+    /* XXX: why does the popup menues depend on this? */
+    set_menu_object_data("/Follow TCP Stream", E_DFILTER_TE_KEY,
+                         filter_te);
     OBJECT_SET_DATA(popup_menu_object, E_DFILTER_TE_KEY, filter_te);
     OBJECT_SET_DATA(popup_menu_object, E_MPACKET_LIST_KEY, packet_list);
 
index 781cb665b7b1912905a65e4bc0246a9508cf4bfa..0d947f30a5edf9e6c68dc53ebbe9ed67c2fc49d5 100644 (file)
@@ -1,7 +1,7 @@
 /* menu.c
  * Menu routines
  *
- * $Id: menu.c,v 1.166 2004/02/20 18:43:59 ulfl Exp $
+ * $Id: menu.c,v 1.167 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -77,6 +77,22 @@ extern void savehex_cb(GtkWidget * w, gpointer data _U_);
 static void
 clear_menu_recent_capture_file_cmd_cb(GtkWidget *w, gpointer unused _U_);
 
+typedef struct _menu_item {
+       char    *name;
+    gint    layer;
+       gboolean enabled;
+    GtkItemFactoryCallback callback;
+    gpointer callback_data;
+       gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *);
+       gboolean (*selected_tree_row_enabled)(field_info *);
+       GList *children;
+} menu_item_t;
+
+static GList *tap_menu_tree_root = NULL;
+
+static void 
+merge_all_tap_menus(GList *node);
+
 #define GTK_MENU_FUNC(a) ((GtkItemFactoryCallback)(a))
 
 static void menus_init(void);
@@ -276,20 +292,6 @@ static GtkItemFactoryEntry menu_items[] =
     ITEM_FACTORY_ENTRY("/Analyze/_User Specified Decodes...", NULL,
                        decode_show_cb, 0, NULL, NULL),
     ITEM_FACTORY_ENTRY("/Analyze/<separator>", NULL, NULL, 0, "<Separator>", NULL),
-    ITEM_FACTORY_ENTRY("/Analyze/_Follow TCP Stream", NULL, follow_stream_cb,
-                       0, NULL, NULL),
-/*  {"/Analyze/Graph", NULL, NULL, 0, NULL}, future use */
-    ITEM_FACTORY_ENTRY("/Analyze/_TCP Stream Analysis", NULL, NULL,
-                       0, "<Branch>", NULL),
-    ITEM_FACTORY_ENTRY("/Analyze/TCP Stream Analysis/Time-Sequence Graph (Stevens)",
-                       NULL, tcp_graph_cb, 0, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Analyze/TCP Stream Analysis/Time-Sequence Graph (tcptrace)",
-                       NULL, tcp_graph_cb, 1, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Analyze/TCP Stream Analysis/Throughput Graph", NULL,
-                       tcp_graph_cb, 2, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Analyze/TCP Stream Analysis/Round Trip Time Graph", NULL,
-                       tcp_graph_cb, 3, NULL, NULL),
-    ITEM_FACTORY_ENTRY("/Analyze/<separator>", NULL, NULL, 0, "<Separator>", NULL),
     ITEM_FACTORY_ENTRY("/Analyze/Summar_y", NULL, summary_open_cb, 0, NULL, NULL),
     ITEM_FACTORY_ENTRY("/Analyze/Protocol _Hierarchy Statistics", NULL,
                        proto_hier_stats_cb, 0, NULL, NULL),
@@ -442,7 +444,6 @@ main_menu_new(GtkAccelGroup ** table) {
 
 static void
 menus_init(void) {
-
   if (initialize) {
     initialize = FALSE;
 
@@ -469,7 +470,8 @@ menus_init(void) {
     /* main */
     main_menu_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", grp);
     gtk_item_factory_create_items_ac(main_menu_factory, nmenu_items, menu_items, NULL, 2);
-    register_all_tap_menus();  /* must be done after creating the main menu */
+
+    merge_all_tap_menus(tap_menu_tree_root);
 
     /* Initialize enabled/disabled state of menu items */
     set_menus_for_unsaved_capture_file(FALSE);
@@ -491,17 +493,47 @@ menus_init(void) {
   }
 }
 
-typedef struct _menu_item {
-       char    *name;
-       gboolean enabled;
-       gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *);
-       gboolean (*selected_tree_row_enabled)(field_info *);
-       struct _menu_item *parent;
-       struct _menu_item *children;
-       struct _menu_item *next;
-} menu_item_t;
 
-static menu_item_t tap_menu_tree_root;
+gint tap_menu_item_add_compare(gconstpointer a, gconstpointer b)
+{
+    return strcmp(
+        ((const menu_item_t *) a)->name, 
+        ((const menu_item_t *) b)->name);
+}
+
+
+/* add a menuitem below the current node */
+GList * tap_menu_item_add(
+    gint layer, 
+    char *name, 
+    GtkItemFactoryCallback callback,
+    gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *),
+    gboolean (*selected_tree_row_enabled)(field_info *),
+    gpointer callback_data,
+       GList *curnode)
+{
+    menu_item_t *curr;
+       menu_item_t *child;
+
+
+       child = g_malloc(sizeof (menu_item_t));
+    child->layer            = layer;
+       child->name             = name;
+    child->callback         = callback;
+       child->selected_packet_enabled = selected_packet_enabled;
+       child->selected_tree_row_enabled = selected_tree_row_enabled;
+    child->callback_data    = callback_data;
+       child->enabled          = FALSE;
+    child->children         = NULL;
+
+    /* insert the new child node into the parent */
+    curr = curnode->data;
+    curr->children = g_list_insert_sorted(curr->children, child, tap_menu_item_add_compare);
+
+    /* return the new node */
+    /* XXX: improve this */
+    return g_list_find(curr->children, child);
+}
 
 /*
  * Add a new menu item for a tap.
@@ -525,27 +557,53 @@ static menu_item_t tap_menu_tree_root;
  * is selected and, if one is, on the tree row) and FALSE if not.
  */
 void
-register_tap_menu_item(char *name, GtkItemFactoryCallback callback,
+register_tap_menu_item(
+    char *name, 
+    gint layer, 
+    GtkItemFactoryCallback callback,
     gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *),
     gboolean (*selected_tree_row_enabled)(field_info *),
     gpointer callback_data)
 {
        static const char toolspath[] = "/Analyze/";
+       /*char *toolspath; */
        char *p;
        char *menupath;
        size_t menupathlen;
-       GtkItemFactoryEntry *entry;
-       menu_item_t *curnode, *child;
+       menu_item_t *child;
+    GList *curnode;
+    GList *childnode;
 
        /*
         * The menu path must be relative.
         */
        g_assert(*name != '/');
 
+#if 0
+    switch(layer) {
+    case(REGISTER_TAP_LAYER_GENERIC): toolspath = "/Analyze/"; break;
+    case(REGISTER_TAP_LAYER_PHYSICAL): toolspath = "/Physical/"; break;
+    case(REGISTER_TAP_LAYER_DATA_LINK): toolspath = "/Link/"; break;
+    case(REGISTER_TAP_LAYER_NETWORK): toolspath = "/Network/"; break;
+    case(REGISTER_TAP_LAYER_TRANSPORT): toolspath = "/Transport/"; break;
+    case(REGISTER_TAP_LAYER_SESSION): toolspath = "/Session/"; break;
+    case(REGISTER_TAP_LAYER_PRESENTATION): toolspath = "/Presentation/"; break;
+    case(REGISTER_TAP_LAYER_APPLICATION): toolspath = "/Application/"; break;
+    default:
+        g_assert(0);
+    }
+#endif
+
+    /* add the (empty) root node, if not already done */
+    if(tap_menu_tree_root == NULL) {
+       child = g_malloc0(sizeof (menu_item_t));
+        tap_menu_tree_root = g_list_append(NULL, child);
+    }
+
        /*
         * Create any submenus required.
         */
-       curnode = &tap_menu_tree_root;
+       curnode = tap_menu_tree_root;
        p = name;
        while ((p = strchr(p, '/')) != NULL) {
                /*
@@ -555,7 +613,7 @@ register_tap_menu_item(char *name, GtkItemFactoryCallback callback,
                 *
                 * Construct the absolute path name of that subtree.
                 */
-               menupathlen = sizeof toolspath + (p - name);
+               menupathlen = strlen(toolspath) + 1 + (p - name);
                menupath = g_malloc(menupathlen);
                strcpy(menupath, toolspath);
                strncat(menupath, name, p - name);
@@ -564,39 +622,26 @@ register_tap_menu_item(char *name, GtkItemFactoryCallback callback,
                 * Does there exist an entry with that path at this
                 * level of the Analyze menu tree?
                 */
-               for (child = curnode->children; child != NULL;
-                   child = child->next) {
+        child = curnode->data;
+               for (childnode = child->children; childnode != NULL; childnode = childnode->next) {
+            child = childnode->data;
                        if (strcmp(child->name, menupath) == 0)
                                break;
                }
-               if (child == NULL) {
+               if (childnode == NULL) {
                        /*
                         * No.  Create such an item as a subtree, and
                         * add it to the Tools menu tree.
                         */
-                       entry = g_malloc0(sizeof (GtkItemFactoryEntry));
-                       entry->path = menupath;
-                       entry->item_type = "<Branch>";
-                       gtk_item_factory_create_item(main_menu_factory, entry,
-                           NULL, 2);
-                       set_menu_sensitivity(main_menu_factory, menupath,
-                           FALSE);     /* no children yet */
-                       child = g_malloc(sizeof (menu_item_t));
-                       child->name = menupath;
-                       child->selected_packet_enabled = NULL;
-                       child->selected_tree_row_enabled = NULL;
-                       child->enabled = FALSE; /* no children yet */
-                       child->parent = curnode;
-                       child->children = NULL;
-                       child->next = curnode->children;
-                       curnode->children = child;
+            childnode = tap_menu_item_add(
+                layer, menupath, NULL, NULL ,NULL, NULL, curnode);
                } else {
                        /*
-                        * Yes.  We don't need "menupath" any more.
+                        * Yes.  We don't need this "menupath" any longer.
                         */
                        g_free(menupath);
                }
-               curnode = child;
+               curnode = childnode;
 
                /*
                 * Skip over the '/' we found.
@@ -606,12 +651,8 @@ register_tap_menu_item(char *name, GtkItemFactoryCallback callback,
 
        /*
         * Construct the main menu path for the menu item.
-        *
-        * "sizeof toolspath" includes the trailing '\0', so the sum
-        * of that and the length of "name" is enough to hold a string
-        * containing their concatenation.
-        */
-       menupathlen = sizeof toolspath + strlen(name);
+     */
+       menupathlen = strlen(toolspath) + 1 + strlen(name);
        menupath = g_malloc(menupathlen);
        strcpy(menupath, toolspath);
        strcat(menupath, name);
@@ -620,22 +661,101 @@ register_tap_menu_item(char *name, GtkItemFactoryCallback callback,
         * Construct an item factory entry for the item, and add it to
         * the main menu.
         */
-       entry = g_malloc0(sizeof (GtkItemFactoryEntry));
-       entry->path = menupath;
-       entry->callback = callback;
-       gtk_item_factory_create_item(main_menu_factory, entry, callback_data, 2);
-       set_menu_sensitivity(main_menu_factory, menupath, FALSE); /* no capture file yet */
-       child = g_malloc(sizeof (menu_item_t));
-       child->name = menupath;
-       child->enabled = FALSE; /* no capture file yet, hence no taps yet */
-       child->selected_packet_enabled = selected_packet_enabled;
-       child->selected_tree_row_enabled = selected_tree_row_enabled;
-       child->parent = curnode;
-       child->children = NULL;
-       child->next = curnode->children;
-       curnode->children = child;
+    tap_menu_item_add(
+        layer, menupath, callback, 
+        selected_packet_enabled, selected_tree_row_enabled, 
+        callback_data, curnode);
 }
 
+
+guint merge_tap_menus_layered(GList *node, gint layer) {
+       GtkItemFactoryEntry *entry;
+       GList       *child;
+    guint       added = 0;
+    menu_item_t *node_data = node->data;
+
+       /*
+        * Is this a leaf node or an interior node?
+        */
+       if (node_data->children == NULL) {
+               /*
+                * It's a leaf node.
+                */
+
+           /*
+            * The root node doesn't correspond to a menu tree item; it
+            * has a null name pointer.
+            */
+           if (node_data->name != NULL && layer == node_data->layer) {
+               entry = g_malloc0(sizeof (GtkItemFactoryEntry));
+               entry->path = node_data->name;
+               entry->callback = node_data->callback;
+               gtk_item_factory_create_item(main_menu_factory, entry, node_data->callback_data, 2);
+               set_menu_sensitivity(main_menu_factory, node_data->name, FALSE); /* no capture file yet */
+            added++;
+        }
+       } else {
+               /*
+                * It's an interior node; call
+                * "merge_tap_menus_layered()" on all its children 
+                */
+
+           /*
+            * The root node doesn't correspond to a menu tree item; it
+            * has a null name pointer.
+            */
+           if (node_data->name != NULL && layer == node_data->layer) {
+            entry = g_malloc0(sizeof (GtkItemFactoryEntry));
+                   entry->path = node_data->name;
+                   entry->item_type = "<Branch>";
+                   gtk_item_factory_create_item(main_menu_factory, entry,
+                           NULL, 2);
+                   set_menu_sensitivity(main_menu_factory, node_data->name,
+                           FALSE);     /* no children yet */
+            added++;
+        }
+
+               for (child = node_data->children; child != NULL; child =
+                   child->next) {
+                       added += merge_tap_menus_layered(child, layer);
+               }
+       }
+
+    return added;
+}
+
+
+void merge_all_tap_menus(GList *node) {
+       GtkItemFactoryEntry *entry;
+       static char toolspath[] = "/Analyze/";
+
+    entry = g_malloc0(sizeof (GtkItemFactoryEntry));
+       entry->path = toolspath;
+       entry->item_type = "<Separator>";
+
+    /* 
+     * merge only the menu items of the specific layer,
+     * and then append a seperator
+     */
+    if (merge_tap_menus_layered(node, REGISTER_TAP_LAYER_GENERIC))
+           gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
+    if (merge_tap_menus_layered(node, REGISTER_TAP_LAYER_PHYSICAL))
+           gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
+    if (merge_tap_menus_layered(node, REGISTER_TAP_LAYER_DATA_LINK))
+           gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
+    if (merge_tap_menus_layered(node, REGISTER_TAP_LAYER_NETWORK))
+           gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
+    if (merge_tap_menus_layered(node, REGISTER_TAP_LAYER_TRANSPORT))
+           gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
+    if (merge_tap_menus_layered(node, REGISTER_TAP_LAYER_SESSION))
+           gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
+    if (merge_tap_menus_layered(node, REGISTER_TAP_LAYER_PRESENTATION))
+           gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);
+    merge_tap_menus_layered(node, REGISTER_TAP_LAYER_APPLICATION);
+}
+
+
+
 /*
  * Enable/disable menu sensitivity.
  */
@@ -1323,16 +1443,17 @@ set_menus_for_capture_in_progress(gboolean capture_in_progress)
 /* Enable or disable menu items based on whether you have some captured
    packets. */
 static gboolean
-walk_menu_tree_for_captured_packets(menu_item_t *node,
+walk_menu_tree_for_captured_packets(GList *node,
     gboolean have_captured_packets)
 {
-       gboolean is_enabled;
-       menu_item_t *child;
+       gboolean    is_enabled;
+       GList       *child;
+    menu_item_t *node_data = node->data;
 
        /*
         * Is this a leaf node or an interior node?
         */
-       if (node->children == NULL) {
+       if (node_data->children == NULL) {
                /*
                 * It's a leaf node.
                 *
@@ -1355,11 +1476,11 @@ walk_menu_tree_for_captured_packets(menu_item_t *node,
                 * selected, that's OK.
                 * XXX - that should be done better.
                 */
-               if (node->selected_packet_enabled == NULL &&
-                   node->selected_tree_row_enabled == NULL)
-                       node->enabled = TRUE;
+               if (node_data->selected_packet_enabled == NULL &&
+                   node_data->selected_tree_row_enabled == NULL)
+                       node_data->enabled = TRUE;
                else
-                       node->enabled = FALSE;
+                       node_data->enabled = FALSE;
        } else {
                /*
                 * It's an interior node; call
@@ -1371,24 +1492,24 @@ walk_menu_tree_for_captured_packets(menu_item_t *node,
                 * Which is a better UI choice?
                 */
                is_enabled = FALSE;
-               for (child = node->children; child != NULL; child =
+               for (child = node_data->children; child != NULL; child =
                    child->next) {
                        if (walk_menu_tree_for_captured_packets(child,
                            have_captured_packets))
                                is_enabled = TRUE;
                }
-               node->enabled = is_enabled;
+               node_data->enabled = is_enabled;
        }
 
        /*
         * The root node doesn't correspond to a menu tree item; it
         * has a null name pointer.
         */
-       if (node->name != NULL) {
-               set_menu_sensitivity(main_menu_factory, node->name,
-                   node->enabled);
+       if (node_data->name != NULL) {
+               set_menu_sensitivity(main_menu_factory, node_data->name,
+                   node_data->enabled);
        }
-       return node->enabled;
+       return node_data->enabled;
 }
 
 void
@@ -1425,7 +1546,7 @@ set_menus_for_captured_packets(gboolean have_captured_packets)
   set_menu_sensitivity(main_menu_factory, "/Analyze/Protocol Hierarchy Statistics", 
       have_captured_packets);
       
-  walk_menu_tree_for_captured_packets(&tap_menu_tree_root,
+  walk_menu_tree_for_captured_packets(tap_menu_tree_root,
       have_captured_packets);
   set_toolbar_for_captured_packets(have_captured_packets);
   packets_bar_update();
@@ -1434,16 +1555,17 @@ set_menus_for_captured_packets(gboolean have_captured_packets)
 /* Enable or disable menu items based on whether a packet is selected and,
    if so, on the properties of the packet. */
 static gboolean
-walk_menu_tree_for_selected_packet(menu_item_t *node, frame_data *fd,
+walk_menu_tree_for_selected_packet(GList *node, frame_data *fd,
     epan_dissect_t *edt)
 {
        gboolean is_enabled;
-       menu_item_t *child;
+       GList *child;
+    menu_item_t *node_data = node->data;
 
        /*
         * Is this a leaf node or an interior node?
         */
-       if (node->children == NULL) {
+       if (node_data->children == NULL) {
                /*
                 * It's a leaf node.
                 *
@@ -1456,8 +1578,8 @@ walk_menu_tree_for_selected_packet(menu_item_t *node, frame_data *fd,
                 * call it and set the item's enabled/disabled status
                 * based on its return value.
                 */
-               if (node->selected_packet_enabled != NULL)
-                       node->enabled = node->selected_packet_enabled(fd, edt);
+               if (node_data->selected_packet_enabled != NULL)
+                       node_data->enabled = node_data->selected_packet_enabled(fd, edt);
        } else {
                /*
                 * It's an interior node; call
@@ -1469,23 +1591,23 @@ walk_menu_tree_for_selected_packet(menu_item_t *node, frame_data *fd,
                 * Which is a better UI choice?
                 */
                is_enabled = FALSE;
-               for (child = node->children; child != NULL; child =
+               for (child = node_data->children; child != NULL; child =
                    child->next) {
                        if (walk_menu_tree_for_selected_packet(child, fd, edt))
                                is_enabled = TRUE;
                }
-               node->enabled = is_enabled;
+               node_data->enabled = is_enabled;
        }
 
        /*
         * The root node doesn't correspond to a menu tree item; it
         * has a null name pointer.
         */
-       if (node->name != NULL) {
-               set_menu_sensitivity(main_menu_factory, node->name,
-                   node->enabled);
+       if (node_data->name != NULL) {
+               set_menu_sensitivity(main_menu_factory, node_data->name,
+                   node_data->enabled);
        }
-       return node->enabled;
+       return node_data->enabled;
 }
 
 void
@@ -1515,8 +1637,6 @@ set_menus_for_selected_packet(capture_file *cf)
       cf->current_frame != NULL);
   set_menu_sensitivity(packet_list_menu_factory, "/Show Packet In New Window",
       cf->current_frame != NULL);
-  set_menu_sensitivity(main_menu_factory, "/Analyze/Follow TCP Stream",
-      cf->current_frame != NULL ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
   set_menu_sensitivity(NULL, "/Follow TCP Stream",
       cf->current_frame != NULL ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
   set_menu_sensitivity(main_menu_factory, "/Analyze/Decode As...",
@@ -1525,14 +1645,12 @@ set_menus_for_selected_packet(capture_file *cf)
       cf->current_frame != NULL && decode_as_ok());
   set_menu_sensitivity(tree_view_menu_factory, "/Resolve Name",
       cf->current_frame != NULL && (g_resolv_flags & RESOLV_ALL_ADDRS) != RESOLV_ALL_ADDRS);
-  set_menu_sensitivity(main_menu_factory, "/Analyze/TCP Stream Analysis",
-      cf->current_frame != NULL ? (cf->edt->pi.ipproto == IP_PROTO_TCP) : FALSE);
   set_menu_sensitivity(packet_list_menu_factory, "/Match",
       cf->current_frame != NULL);
   set_menu_sensitivity(packet_list_menu_factory, "/Prepare",
       cf->current_frame != NULL);
 
-  walk_menu_tree_for_selected_packet(&tap_menu_tree_root, cf->current_frame,
+  walk_menu_tree_for_selected_packet(tap_menu_tree_root, cf->current_frame,
       cf->edt);
   packets_bar_update();
 }
@@ -1540,15 +1658,16 @@ set_menus_for_selected_packet(capture_file *cf)
 /* Enable or disable menu items based on whether a tree row is selected
    and, if so, on the properties of the tree row. */
 static gboolean
-walk_menu_tree_for_selected_tree_row(menu_item_t *node, field_info *fi)
+walk_menu_tree_for_selected_tree_row(GList *node, field_info *fi)
 {
        gboolean is_enabled;
-       menu_item_t *child;
+       GList *child;
+    menu_item_t *node_data = node->data;
 
        /*
         * Is this a leaf node or an interior node?
         */
-       if (node->children == NULL) {
+       if (node_data->children == NULL) {
                /*
                 * It's a leaf node.
                 *
@@ -1561,8 +1680,8 @@ walk_menu_tree_for_selected_tree_row(menu_item_t *node, field_info *fi)
                 * call it and set the item's enabled/disabled status
                 * based on its return value.
                 */
-               if (node->selected_tree_row_enabled != NULL)
-                       node->enabled = node->selected_tree_row_enabled(fi);
+               if (node_data->selected_tree_row_enabled != NULL)
+                       node_data->enabled = node_data->selected_tree_row_enabled(fi);
        } else {
                /*
                 * It's an interior node; call
@@ -1574,23 +1693,23 @@ walk_menu_tree_for_selected_tree_row(menu_item_t *node, field_info *fi)
                 * Which is a better UI choice?
                 */
                is_enabled = FALSE;
-               for (child = node->children; child != NULL; child =
+               for (child = node_data->children; child != NULL; child =
                    child->next) {
                        if (walk_menu_tree_for_selected_tree_row(child, fi))
                                is_enabled = TRUE;
                }
-               node->enabled = is_enabled;
+               node_data->enabled = is_enabled;
        }
 
        /*
         * The root node doesn't correspond to a menu tree item; it
         * has a null name pointer.
         */
-       if (node->name != NULL) {
-               set_menu_sensitivity(main_menu_factory, node->name,
-                   node->enabled);
+       if (node_data->name != NULL) {
+               set_menu_sensitivity(main_menu_factory, node_data->name,
+                   node_data->enabled);
        }
-       return node->enabled;
+       return node_data->enabled;
 }
 
 void
@@ -1640,5 +1759,5 @@ set_menus_for_selected_tree_row(capture_file *cf)
          FALSE);
   }
 
-  walk_menu_tree_for_selected_tree_row(&tap_menu_tree_root, cf->finfo_selected);
+  walk_menu_tree_for_selected_tree_row(tap_menu_tree_root, cf->finfo_selected);
 }
index a9dd4cdbecdec1d44834e3f5d867c2470f938b54..c6e5bd0d03ae0593dacb96d7627279f641c82227 100644 (file)
@@ -2,7 +2,7 @@
  * mgcp-statistics for ethereal
  * Copyright 2003 Lars Roland
  *
- * $Id: mgcp_stat.c,v 1.28 2004/02/13 00:53:35 guy Exp $
+ * $Id: mgcp_stat.c,v 1.29 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -310,13 +310,8 @@ void
 register_tap_listener_gtkmgcpstat(void)
 {
        register_ethereal_tap("mgcp,srt", gtk_mgcpstat_init);
-}
 
-void
-register_tap_menu_gtkmgcpstat(void)
-{
        if (find_tap_id("mgcp"))
-               register_tap_menu_item("_Statistics/Service Response Time/MGCP...",
+               register_tap_menu_item("MGCP (Service Response Time...)", REGISTER_TAP_LAYER_APPLICATION,
                    gtk_tap_dfilter_dlg_cb, NULL, NULL, &(mgcp_srt_dlg));
 }
-
index cfd117a27b0a31f099ecdca16900d52c1735ca28..55b703ce4d762c987ba6dd32d54018689440301c 100644 (file)
@@ -1,7 +1,7 @@
 /* rpc_progs.c
  * rpc_progs   2002 Ronnie Sahlberg
  *
- * $Id: rpc_progs.c,v 1.19 2004/02/13 00:53:36 guy Exp $
+ * $Id: rpc_progs.c,v 1.20 2004/02/22 18:44:02 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -403,12 +403,7 @@ void
 register_tap_listener_gtkrpcprogs(void)
 {
        register_ethereal_tap("rpc,programs", gtk_rpcprogs_init);
-}
 
-void
-register_tap_menu_gtkrpcprogs(void)
-{
-       register_tap_menu_item("_Statistics/ONC-RPC/Programs", gtk_rpcprogs_cb,
-           NULL, NULL, NULL);
+       register_tap_menu_item("ONC-RPC/Programs", REGISTER_TAP_LAYER_APPLICATION,
+        gtk_rpcprogs_cb, NULL, NULL, NULL);
 }
-
index c87fd747a444fbe3ce878cc9e7cdbb02717e414d..910226372e501e2bd3e0c3c442da5e500f25873f 100644 (file)
@@ -1,7 +1,7 @@
 /* rpc_stat.c
  * rpc_stat   2002 Ronnie Sahlberg
  *
- * $Id: rpc_stat.c,v 1.38 2004/02/13 00:53:36 guy Exp $
+ * $Id: rpc_stat.c,v 1.39 2004/02/22 18:44:03 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -522,11 +522,8 @@ void
 register_tap_listener_gtkrpcstat(void)
 {
        register_ethereal_tap("rpc,srt,", gtk_rpcstat_init);
-}
 
-void
-register_tap_menu_gtkrpcstat(void)
-{
-       register_tap_menu_item("_Statistics/Service Response Time/ONC-RPC...",
+       register_tap_menu_item("ONC-RPC/Service Response Time...", REGISTER_TAP_LAYER_APPLICATION,
            gtk_rpcstat_cb, NULL, NULL, NULL);
 }
+
index 0293080f849d0c92c06f7424ec178a625e179be0..7ee792692f954f21fbd4652e524f46e447bdb82d 100644 (file)
@@ -1,7 +1,7 @@
 /* rtp_analysis.c
  * RTP analysis addition for ethereal
  *
- * $Id: rtp_analysis.c,v 1.37 2004/02/13 00:53:36 guy Exp $
+ * $Id: rtp_analysis.c,v 1.38 2004/02/22 18:44:03 ulfl Exp $
  *
  * Copyright 2003, Alcatel Business Systems
  * By Lars Ruoff <lars.ruoff@gmx.net>
@@ -2344,11 +2344,7 @@ void
 register_tap_listener_rtp_analysis(void)
 {
        register_ethereal_tap("rtp", rtp_analysis_init);
-}
 
-void
-register_tap_menu_rtp_analysis(void)
-{
-       register_tap_menu_item("_Statistics/RTP Streams/Analyse...",
+       register_tap_menu_item("RTP/Stream Analysis...", REGISTER_TAP_LAYER_APPLICATION,
            rtp_analysis_cb, NULL, NULL, NULL);
 }
index d310ab7aaa2dffec354d8ed8ff46a725f790b074..eef1e40bd19ce790c8f620a7e97b124a9564bb03 100644 (file)
@@ -1,7 +1,7 @@
 /* rtp_stream_dlg.c
  * RTP streams summary addition for ethereal
  *
- * $Id: rtp_stream_dlg.c,v 1.14 2004/02/11 04:17:04 guy Exp $
+ * $Id: rtp_stream_dlg.c,v 1.15 2004/02/22 18:44:03 ulfl Exp $
  *
  * Copyright 2003, Alcatel Business Systems
  * By Lars Ruoff <lars.ruoff@gmx.net>
@@ -824,8 +824,8 @@ void rtpstream_launch(GtkWidget *w _U_, gpointer data _U_)
 
 /****************************************************************************/
 void
-register_tap_menu_rtp_stream(void)
+register_tap_listener_rtp_stream_dlg(void)
 {
-       register_tap_menu_item("_Statistics/RTP Streams/Show All...",
+       register_tap_menu_item("RTP/Show All Streams...", REGISTER_TAP_LAYER_APPLICATION,
            rtpstream_launch, NULL, NULL, NULL);
 }
index 515788bc681c545760810e296743268c34120135..110b0d25a6cb6a994a6af86a40584b809b30eb5e 100644 (file)
@@ -1,7 +1,7 @@
 /* smb_stat.c
  * smb_stat   2003 Ronnie Sahlberg
  *
- * $Id: smb_stat.c,v 1.36 2004/02/13 00:53:36 guy Exp $
+ * $Id: smb_stat.c,v 1.37 2004/02/22 18:44:03 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -352,11 +352,7 @@ void
 register_tap_listener_gtksmbstat(void)
 {
        register_ethereal_tap("smb,srt", gtk_smbstat_init);
-}
 
-void
-register_tap_menu_gtksmbstat(void)
-{
-       register_tap_menu_item("_Statistics/Service Response Time/SMB...",
+       register_tap_menu_item("SMB (Service Response Time...)", REGISTER_TAP_LAYER_APPLICATION,
            gtk_smbstat_cb, NULL, NULL, NULL);
 }
index 7d4b42faaba5a55d83f3cee16c39ae6cb3f1f5be..4836e67c472933b95c9493a438bf3ea1b80ef03e 100644 (file)
@@ -1,7 +1,7 @@
 /* tap_menu.h
  * Menu definitions for use by taps
  *
- * $Id: tap_menu.h,v 1.1 2004/02/11 04:17:05 guy Exp $
+ * $Id: tap_menu.h,v 1.2 2004/02/22 18:44:03 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -51,11 +51,24 @@ extern "C" {
  * whether a tree row is selected and, if one is, on the tree row) and
  * FALSE if not.
  */
-extern void register_tap_menu_item(char *name, GtkItemFactoryCallback callback,
+extern void register_tap_menu_item(
+    char *name, 
+    gint layer,
+    GtkItemFactoryCallback callback,
     gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *),
     gboolean (*selected_tree_row_enabled)(field_info *),
     gpointer callback_data);
 
+/* XXX: would it better to use an enum here? */
+#define REGISTER_TAP_LAYER_GENERIC      0
+#define REGISTER_TAP_LAYER_PHYSICAL     1   /* currently unused */
+#define REGISTER_TAP_LAYER_DATA_LINK    2
+#define REGISTER_TAP_LAYER_NETWORK      3
+#define REGISTER_TAP_LAYER_TRANSPORT    4
+#define REGISTER_TAP_LAYER_SESSION      5   /* currently unused */
+#define REGISTER_TAP_LAYER_PRESENTATION 6   /* currently unused */
+#define REGISTER_TAP_LAYER_APPLICATION  7
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 33ad54cbb48abf83cddeb254ddf481f757816ef7..2f485247b4beb551585b6767bfa8f96bfb74b6f4 100644 (file)
@@ -3,7 +3,7 @@
  * By Pavel Mores <pvl@uh.cz>
  * Win32 port:  rwh@unifiedtech.com
  *
- * $Id: tcp_graph.c,v 1.51 2004/02/13 00:53:36 guy Exp $
+ * $Id: tcp_graph.c,v 1.52 2004/02/22 18:44:03 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -49,6 +49,8 @@
 #include "etypes.h"
 #include "ppptypes.h"
 #include "dlg_utils.h"
+#include <epan/epan_dissect.h>
+#include "tap_menu.h"
 
 /* from <net/ethernet.h> */
 struct ether_header {
@@ -539,10 +541,11 @@ static char helptext[] =
 ";
 #endif
 
-void tcp_graph_cb (GtkWidget *w _U_, gpointer data _U_, guint graph_type)
+void tcp_graph_cb (GtkWidget *w _U_, gpointer data, guint callback_action /*graph_type*/ _U_)
 {
        struct segment current;
        struct graph *g;
+    guint graph_type = GPOINTER_TO_INT(data);
 
        debug(DBS_FENTRY) puts ("tcp_graph_cb()");
 
@@ -3961,3 +3964,24 @@ static int rint (double x)
        return(i);
 }
 #endif
+
+
+gboolean tcp_graph_selected_packet_enabled(frame_data *current_frame, epan_dissect_t *edt) 
+{
+    return current_frame != NULL ? (edt->pi.ipproto == IP_PROTO_TCP) : FALSE;
+}
+
+
+void
+register_tap_listener_tcp_graph(void)
+{
+    register_tap_menu_item("TCP/Stream Analysis/Time-Sequence Graph (Stevens)", REGISTER_TAP_LAYER_TRANSPORT,
+        tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(0));
+    register_tap_menu_item("TCP/Stream Analysis/Time-Sequence Graph (tcptrace)", REGISTER_TAP_LAYER_TRANSPORT,
+        tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(1));
+    register_tap_menu_item("TCP/Stream Analysis/Throughput Graph", REGISTER_TAP_LAYER_TRANSPORT,
+        tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(2));
+    register_tap_menu_item("TCP/Stream Analysis/Round Trip Time Graph", REGISTER_TAP_LAYER_TRANSPORT,
+        tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(3));
+}
+
index b21d1701abf1fa4425b2a2fb7874f95a0216a939..6f2cef7e927de77592243753673520561a8082ef 100644 (file)
@@ -1,7 +1,7 @@
 /* wsp_stat.c
  * wsp_stat   2003 Jean-Michel FAYARD
  *
- * $Id: wsp_stat.c,v 1.18 2004/02/13 00:53:37 guy Exp $
+ * $Id: wsp_stat.c,v 1.19 2004/02/22 18:44:03 ulfl Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -507,11 +507,7 @@ void
 register_tap_listener_gtkwspstat(void)
 {
        register_ethereal_tap("wsp,stat,", gtk_wspstat_init);
-}
 
-void
-register_tap_menu_gtkwspstat(void)
-{
-       register_tap_menu_item("_Statistics/Watch protocol/WAP-WSP...",
+       register_tap_menu_item("WAP-WSP (Watch Protocol...)", REGISTER_TAP_LAYER_APPLICATION,
            gtk_wspstat_cb, NULL, NULL, NULL);
 }
index f68720633c3be80e35e4a6952f612873753b2a85..d3c470529c3739746ee7b44c394c86dbf79f291c 100755 (executable)
@@ -39,23 +39,4 @@ done | while read func; do
 done 
 echo '}' >>${outfile}-tmp
 
-#
-# Build code to call all the tap listener menu item registration routines.
-#
-echo 'void register_all_tap_menus(void) {' >>${outfile}-tmp
-for f in "$@"
-do
-       if [ -f $f ]
-       then
-               srcfile=$f
-       else
-               srcfile=$srcdir/$f
-       fi
-       grep '^register_tap_menu_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';' | sed -e 's/(.*//'
-done | while read func; do
-       echo "  { extern void $func (void);" >>${outfile}-tmp
-       echo "    $func ();}" >>${outfile}-tmp
-done 
-echo '}' >>${outfile}-tmp
-
 mv ${outfile}-tmp ${outfile}