Add a "register_dfilter_stat()", to register stats that take a display
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 21 Aug 2005 09:48:27 +0000 (09:48 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 21 Aug 2005 09:48:27 +0000 (09:48 +0000)
filter as an argument on the command line and have a dialog box to enter
the display filter through the GUI.  Use it for all stats using
"gtk_tap_dfilter_dlg_cb()".

Add a top-level "stat_menu.h" file to declare "REGISTER_STAT_GROUP_E"
for the benefit of the declaration of "register_dfilter_stat()" in the
top-level "tap_dfilter_dlg.h".  Rename the "stat_menu.h" in the gtk
directory to "gtk_stat_menu.h", so as not to have two headers with the
same name.

Get rid of headers not declaring any functions not being used in the
module.

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

67 files changed:
Makefile.common
epan/dissectors/packet-ansi_637.c
file.c
gtk/Makefile.am
gtk/afp_stat.c
gtk/ansi_a_stat.c
gtk/ansi_map_stat.c
gtk/bootp_stat.c
gtk/conversations_eth.c
gtk/conversations_fc.c
gtk/conversations_fddi.c
gtk/conversations_ip.c
gtk/conversations_ipx.c
gtk/conversations_jxta.c
gtk/conversations_sctp.c
gtk/conversations_tcpip.c
gtk/conversations_tr.c
gtk/conversations_udpip.c
gtk/conversations_wlan.c
gtk/dcerpc_stat.c
gtk/fc_stat.c
gtk/flow_graph.c
gtk/follow_dlg.c
gtk/gsm_a_stat.c
gtk/gsm_map_stat.c
gtk/gsm_map_summary.c
gtk/gtk_stat_menu.h [moved from gtk/stat_menu.h with 86% similarity]
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_jxta.c
gtk/hostlist_tcpip.c
gtk/hostlist_tr.c
gtk/hostlist_udpip.c
gtk/hostlist_wlan.c
gtk/io_stat.c
gtk/ldap_stat.c
gtk/menu.c
gtk/mgcp_stat.c
gtk/mtp3_stat.c
gtk/mtp3_summary.c
gtk/rpc_progs.c
gtk/rpc_stat.c
gtk/rtp_analysis.c
gtk/rtp_stream.c
gtk/rtp_stream_dlg.c
gtk/sctp_assoc_analyse.c
gtk/sctp_byte_graph_dlg.c
gtk/sctp_chunk_stat.c
gtk/sctp_chunk_stat_dlg.c
gtk/sctp_error_dlg.c
gtk/sctp_graph_dlg.c
gtk/sctp_stat.c
gtk/sctp_stat_dlg.c
gtk/sip_stat.c
gtk/smb_stat.c
gtk/stats_tree_stat.c
gtk/tap_dfilter_dlg.c
gtk/tcp_graph.c
gtk/voip_calls_dlg.c
gtk/wsp_stat.c
stat_menu.h [new file with mode: 0644]
tap_dfilter_dlg.h

index c192dccd735210267b6a335365f77a4a85e8954b..4ec024251fe572d86444f80bbda57d986e80837b 100644 (file)
@@ -184,6 +184,7 @@ ethereal_INCLUDES = \
        progress_dlg.h  \
        proto_hier_stats.h      \
        simple_dialog.h \
+       stat_menu.h     \
        statusbar.h     \
        summary.h       \
        tap_dfilter_dlg.h       \
index d424c75445e50eab5541b8e3896ac02372c6a587..a3249f85c89b40b8f5cf427beb977e1f91e50c69 100644 (file)
@@ -1687,7 +1687,7 @@ dissect_ansi_637_trans_param(tvbuff_t *tvb, proto_tree *tree, guint32 *offset)
        {
             gchar *ansi_637_add_string;
 
-           ansi_637_add_string[0] = ep_alloc(1024);
+           ansi_637_add_string = ep_alloc(1024);
            ansi_637_add_string[0] = '\0';
            (*param_fcn)(tvb, subtree, len, curr_offset, ansi_637_add_string, 1024);
 
diff --git a/file.c b/file.c
index 3ff97c96ec4efd54dce4b33d456500aebc87c134..4e73f429fb25e53b0898a0098c38ec8bcb03c8f3 100644 (file)
--- a/file.c
+++ b/file.c
@@ -73,6 +73,7 @@
 #include <epan/conversation.h>
 #include <epan/epan_dissect.h>
 #include <epan/tap.h>
+#include "stat_menu.h"
 #include "tap_dfilter_dlg.h"
 #include <epan/dissectors/packet-data.h>
 
index 97b29ef3df9474fa627bde1b42f0cb8b2578c2ba..95d67ff9b383e40e35332c3067e1f163eb3d1508 100644 (file)
@@ -91,7 +91,7 @@ noinst_HEADERS = \
        sat.h           \
        sctp_stat.h     \
        service_response_time_table.h   \
-       stat_menu.h     \
+       gtk_stat_menu.h \
        stream_prefs.h  \
        summary_dlg.h   \
        supported_protos_dlg.h   \
index d0c77a791cd0d74baf4eba90ae2df705ad5a017a..171f0279f9ed08629ae680af0277eaa57707d155 100644 (file)
@@ -40,7 +40,8 @@
 #include <epan/value_string.h>
 
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include <epan/dissectors/packet-afp.h>
 #include "../register.h"
index c5e9d9453550bce565de706566f02ee48d485938..97edeaa9dfd245f520da89d51d12a1205ee9e026 100644 (file)
@@ -41,7 +41,8 @@
 #include "epan/epan.h"
 #include "epan/value_string.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "image/clist_ascend.xpm"
 #include "image/clist_descend.xpm"
 #include "simple_dialog.h"
index e831708ac618903766044e97379101f55c6762e4..3f460b89947ed53c31b02ab3e887650a66ba3954 100644 (file)
@@ -41,7 +41,8 @@
 #include "epan/epan.h"
 #include "epan/value_string.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "image/clist_ascend.xpm"
 #include "image/clist_descend.xpm"
 #include "simple_dialog.h"
index bf90b5a6cb9e3dda1c7ba821afbcfbe9c269becc..539682c7f065bf040ce4c46c75566d1be1e2a060 100644 (file)
@@ -33,8 +33,6 @@
 #include <epan/packet_info.h>
 #include <epan/epan.h>
 
-#include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
 #include "simple_dialog.h"
 #include "gui_utils.h"
 #include "dlg_utils.h"
@@ -42,6 +40,7 @@
 #include "../register.h"
 #include "../globals.h"
 #include "compat_macros.h"
+#include "../stat_menu.h"
 #include "../tap_dfilter_dlg.h"
 #include "tap_dfilter_dlg.h"
 
@@ -282,8 +281,6 @@ static tap_dfilter_dlg dhcp_stat_dlg = {
 void
 register_tap_listener_gtkdhcpstat(void)
 {
-       register_stat_cmd_arg("bootp,stat", dhcpstat_init);
-
-       register_stat_menu_item("BOOTP-DHCP", REGISTER_STAT_GROUP_NONE,
-           gtk_tap_dfilter_dlg_cb, NULL, NULL, &(dhcp_stat_dlg));
+       register_dfilter_stat(&dhcp_stat_dlg, "BOOTP-DHCP",
+           REGISTER_STAT_GROUP_NONE);
 }
index af670ff4a9631f8e60e057bfde1e0061916c2b2a..e582e30a58b118e591c243d2c4ec86f5d025fff7 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index 978a68e71f41c736c4457d23b4514718173b2b40..16e96f4c694a3b1419594923103ffde748a06409 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index cae1be98f05226aedeb12543235e55e034879d86..f27e89a9932b9927271ecbb80d7294d1a1091fc5 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index 5c4f58179d95096cb202fe5de0d44fae8a8892b9..1ec3e4aa2fa7e54498fb3d657acf256f5f45d24b 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index ba361a6f7f72344869136d617d49d5d77064470e..00e5393d91f3bcf475789fb6e1110da5ea0e457d 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index d28c75a77543e089c6fbbed5a70c43f5e174254f..210ab4a49e0a505ffee0908acf93522228a2c1e3 100644 (file)
@@ -35,7 +35,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index 6fd15d8e499795fa4bdadc0cea256da137a1aa61..f6ea83df749e4ac746d72c1b6aaa7691dfcba79b 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index d0072b17f8e29c40728ccf189510763ac3cbe2b9..1cbd3d4adc55549c633eb3b1ff0dbea5dfd198b3 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index cca32afdcfe16da0f03e81b6b42e0b35e8bbc23f..8af5f7802bfcd709df15ad9005c1ff4ef2415b51 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index 0163aef05102d7e1e8e38e743e0c25edbc4b9f45..c8bf2ed70f58fb6e6da497f59cd868c1148e7109 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index e0a2dda0296f3310b299ecdd67b8fc7c89732af9..3060d5f5621e1fe3cea66094cd036bd48587dd1a 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "conversations_table.h"
index ee67f3ee988a061c63fa205c7de484851f4b8644..88dca08a662a00d69648b1ffa4ee2dc79b3dee5a 100644 (file)
@@ -41,7 +41,8 @@
 #include <epan/epan.h>
 
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "simple_dialog.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
index 052fed0b0fcb4d72126dc03e2f3cd363ec07c28f..f95ebba00f54ecb30a88c406aa238a4526b91a84 100644 (file)
@@ -39,7 +39,8 @@
 #include <epan/value_string.h>
 
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include <epan/dissectors/packet-fc.h>
 #include "../register.h"
index 405a4c2b5546e2f967f0a5a7728f576ab33a405c..978baf18b7a9cbfb9adbd9448ac437f9e3297ae2 100644 (file)
@@ -34,7 +34,8 @@
 
 #include "graph_analysis.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "compat_macros.h"
index 5288560e691535d4837ae470e6fb76ec54364b19..8765363952516594745875cf730aaf5478125109 100644 (file)
@@ -63,7 +63,6 @@
 #include <epan/filesystem.h>
 #include "compat_macros.h"
 #include <epan/ipproto.h>
-#include "stat_menu.h"
 #include "print_mswin.h"
 #include "font_utils.h"
 
index 46eebaf2646495ab0210e16f0762909d42e5417f..2190a627a93dc21b135d7cc535dbb7c31594a527 100644 (file)
@@ -41,7 +41,8 @@
 #include "epan/epan.h"
 #include "epan/value_string.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "image/clist_ascend.xpm"
 #include "image/clist_descend.xpm"
 #include "simple_dialog.h"
index 8d5b32a4c3359915d2eb37c785d783c536ccfd3d..d80b4e6dd50dc088e15fecee31060f1f57c6133f 100644 (file)
@@ -41,7 +41,8 @@
 #include "epan/epan.h"
 #include "epan/value_string.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "image/clist_ascend.xpm"
 #include "image/clist_descend.xpm"
 #include "simple_dialog.h"
index 6cc8fa69e6c8105c39fe78029cb68801babc8c43..3fbc701a011a3e76639754a835e7799bc3271729 100644 (file)
@@ -38,7 +38,8 @@
 #include "epan/packet_info.h"
 #include "epan/epan.h"
 #include "epan/value_string.h"
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "globals.h"
 #include "file.h"
 #include "summary.h"
similarity index 86%
rename from gtk/stat_menu.h
rename to gtk/gtk_stat_menu.h
index 43329e816827a9996bf51de1af97a947f86cb760..fc149a76aab48a3d4e9c2f927fe34df92f292897 100644 (file)
@@ -1,5 +1,5 @@
-/* stat_menu.h
- * Menu definitions for use by stats
+/* gtk_stat_menu.h
+ * GTK+-specific menu definitions for use by stats
  *
  * $Id$
  *
@@ -33,17 +33,6 @@ extern "C" {
  * Add a new menu item for a stat.
  */
 
-/** The menu group this stat should be registered in. */
-typedef enum {
-    REGISTER_STAT_GROUP_NONE,
-    REGISTER_STAT_GROUP_GENERIC,
-    REGISTER_STAT_GROUP_CONVERSATION_LIST,
-    REGISTER_STAT_GROUP_ENDPOINT_LIST,
-    REGISTER_STAT_GROUP_RESPONSE_TIME,
-    REGISTER_STAT_GROUP_TELEPHONY
-    /* XXX - split into telephony and VoIP? */
-} REGISTER_STAT_GROUP_E;
-
 /**
  * Add a new menu item for a stat.
  * This must be called after we've created the main menu, so it can't
index e94a55266cbcd2a5de1169f2ab1393baa5752a59..38505d9abadb9d8a837d586190373717768f69bc 100644 (file)
@@ -39,8 +39,6 @@
 #include <epan/epan.h>
 #include <epan/value_string.h>
 
-#include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include <epan/dissectors/packet-h225.h>
@@ -50,6 +48,7 @@
 #include "dlg_utils.h"
 #include "../file.h"
 #include "../globals.h"
+#include "../stat_menu.h"
 #include "../tap_dfilter_dlg.h"
 #include "tap_dfilter_dlg.h"
 #include "gui_utils.h"
@@ -563,8 +562,6 @@ gtk_h225counter_init(const char *optarg)
 void
 register_tap_listener_gtk_h225counter(void)
 {
-       register_stat_cmd_arg("h225,counter", gtk_h225counter_init);
-
-       register_stat_menu_item("H.225...", REGISTER_STAT_GROUP_TELEPHONY,
-           gtk_tap_dfilter_dlg_cb, NULL, NULL, &(h225_counter_dlg));
+       register_dfilter_stat(&h225_counter_dlg, "H.225...",
+           REGISTER_STAT_GROUP_TELEPHONY);
 }
index 6203bff88c8685bc91fc5ed054c0a335cf3fc215..6e3ea7c81d30bfa7a357a36861d0f17e206c5513 100644 (file)
@@ -39,8 +39,6 @@
 #include <epan/epan.h>
 #include <epan/value_string.h>
 
-#include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include <epan/dissectors/packet-h225.h>
@@ -51,6 +49,7 @@
 #include "dlg_utils.h"
 #include "../file.h"
 #include "../globals.h"
+#include "../stat_menu.h"
 #include "../tap_dfilter_dlg.h"
 #include "tap_dfilter_dlg.h"
 #include "gui_utils.h"
@@ -343,8 +342,6 @@ gtk_h225rassrt_init(const char *optarg)
 void
 register_tap_listener_gtk_h225rassrt(void)
 {
-       register_stat_cmd_arg("h225,srt", gtk_h225rassrt_init);
-
-       register_stat_menu_item("H.225 RAS...", REGISTER_STAT_GROUP_RESPONSE_TIME,
-           gtk_tap_dfilter_dlg_cb, NULL, NULL, &(h225_rassrt_dlg));
+       register_dfilter_stat(&h225_rassrt_dlg, "H.225 RAS...",
+           REGISTER_STAT_GROUP_RESPONSE_TIME);
 }
index a5bdaad93f7f16f11d28cccfc1ef2639ae271240..cca7d01640a313990638431e60c10e962c1991ab 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index 8e5cbb3288488d6023c8549ff5d91cdf0468c0ae..c3af37242b7b2f539f90970e079fffde12caf871 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index 9eb82d9b22486da3f8b01b4825d750e8023999c9..ce78f8bd3cbf46bfe4b9df7b0aa1b18396dc511b 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index 370e76216be673078aa0fa1e9201fbc1a842410b..67d5fbe11bb955bf139d35cfbf22309a6f0ff682 100644 (file)
@@ -36,7 +36,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index 792d8e4c2d4d2937b5ffd5a86779ff515e4023a0..875f9cd0e06cac972071b0d433c31b1fe1b45e17 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index ca2c053225343b0058e7f97722438191a8d6ed1d..ca028f5c94f48b5ce78b091cf8416acc52bbf318 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index 4daef99b9f1e8558fe694f7807d9557763c1de71..da0edb7054a2e5e695c5f8ebf2c404cf11147566 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index 81486605cd6bd885241b004bf7a14544cdadb803..4795c70922d72aa0ac1dc441947e7deca681ac8e 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index 2d6db2a6e9570cc7b7eb66fda98bc47053b5bebd..d92a414b4d2730e21f5ce3bb828d5817f0c3010c 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index f57326d3cff70ab6598cf74da42e6820b5598c1c..92df1bae64abf829eff8ec4ae33ea0ceebfe07ac 100644 (file)
@@ -34,7 +34,8 @@
 #include <string.h>
 #include "epan/packet.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
index 900552e6b7f80e73411382127dd1e3500d67c82b..bb5d6133a240ee9b3c877d2c7a6510ca23c5ab68 100644 (file)
@@ -43,7 +43,8 @@
 #include "gtkglobals.h"
 #include "gui_utils.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "alert_box.h"
index 83d1e56d735558090e8a5948af9d3216a68a54f0..b0eae1307882f0b92bb324b9087c6b6270d9af0b 100644 (file)
@@ -39,7 +39,8 @@
 #include <epan/value_string.h>
 
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include <epan/dissectors/packet-ldap.h>
 #include "../register.h"
index 2379a91b305680e387da77e152e439cf588438f4..58d55a423175e27fe49d08226cd0f2d0cf640af4 100644 (file)
@@ -32,7 +32,8 @@
 
 #include "main.h"
 #include "menu.h"
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/packet.h>
 #include <epan/addr_resolv.h>
 #include <epan/prefs.h>
index 33492329631833a658606523561733b557f40893..1fc13ff188108c5aff41458e8022426876bb82c6 100644 (file)
@@ -39,8 +39,6 @@
 #include <epan/epan.h>
 #include <epan/value_string.h>
 
-#include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include "../plugins/mgcp/packet-mgcp.h"
@@ -51,6 +49,7 @@
 #include "dlg_utils.h"
 #include "../file.h"
 #include "../globals.h"
+#include "../stat_menu.h"
 #include "../tap_dfilter_dlg.h"
 #include "tap_dfilter_dlg.h"
 #include "gui_utils.h"
@@ -327,9 +326,7 @@ register_tap_listener_gtkmgcpstat(void)
 {
        /* We don't register this tap, if we don't have the mgcp plugin loaded.*/
        if (find_tap_id("mgcp")) {
-               register_stat_cmd_arg("mgcp,srt", gtk_mgcpstat_init);
-
-               register_stat_menu_item("MGCP...", REGISTER_STAT_GROUP_RESPONSE_TIME,
-                   gtk_tap_dfilter_dlg_cb, NULL, NULL, &(mgcp_srt_dlg));
+               register_dfilter_stat(&mgcp_srt_dlg, "MGCP...",
+                   REGISTER_STAT_GROUP_RESPONSE_TIME);
        }
 }
index c2b2a957a6aefd605577e8ae9cb9d502b2936205..afc2a0a1b469dc082b1ff099177fc79d422fa863 100644 (file)
@@ -41,7 +41,8 @@
 #include "epan/epan.h"
 #include "epan/value_string.h"
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "image/clist_ascend.xpm"
 #include "image/clist_descend.xpm"
 #include "simple_dialog.h"
index bde41d30035976c87a0928307bfeafe66031d583..fbbddaf4ef892d3e6b27c3dec8f899a1b3f41843 100644 (file)
@@ -39,7 +39,8 @@
 #include "epan/packet_info.h"
 #include "epan/epan.h"
 #include "epan/value_string.h"
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "globals.h"
 #include "file.h"
 #include "summary.h"
index 296e98c1213136b8751bd82a5787bc305981f526..4db1898e3a8d0b7fe3b373592152345ecc4ddcc6 100644 (file)
@@ -38,7 +38,8 @@
 #include <epan/epan.h>
 
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include <epan/dissectors/packet-rpc.h>
index 2edc7d961cc8e9ca0d01bc1c594b2003a7645fed..df1fe00faf2e9442327bce113e97aba26a7aa2f8 100644 (file)
@@ -38,7 +38,8 @@
 #include <epan/epan.h>
 
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "simple_dialog.h"
 #include "gui_utils.h"
 #include "dlg_utils.h"
index b87bb9d1bd626eff02601384e7a84da3c0dc0325..2686da9e1d93f596aaa4f5da015959550b69524d 100644 (file)
@@ -68,7 +68,8 @@
 #include "gui_utils.h"
 #include "alert_box.h"
 #include "simple_dialog.h"
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "main.h"
 #include "progress_dlg.h"
 #include "compat_macros.h"
index deb90070b7a1e1f2d93c4808190a6bff4e3954ec..a003b24c99c43af28cd0c18a2c6de8c68779b113 100644 (file)
@@ -33,7 +33,6 @@
 #include "rtp_stream_dlg.h"
 
 #include "globals.h"
-#include <epan/stat_cmd_args.h>
 
 #include <epan/tap.h>
 #include "register.h"
index adfc3f128d0563ff4ccfb6a811d3607f10f1cd7f..5d16c3925f4023ef25c6b527351f664da3079a57 100644 (file)
@@ -36,7 +36,8 @@
 #include "globals.h"
 #include "epan/filesystem.h"
 
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "compat_macros.h"
index 40bba3d24328788c9f6704655dbb47ad4517a999..d14b7c98f0ad675290db0891f4afb3d7ccef6582 100644 (file)
@@ -33,7 +33,8 @@
 #include <epan/epan_dissect.h>
 #include "epan/filesystem.h"
 #include "register.h"
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "main.h"
index 52baa680cb180e6943ff6b37e97b0db498aa56ee..1d1dd7539b1f48935d2857cc30e2fc075a6ae1df 100644 (file)
@@ -35,7 +35,6 @@
 #include "globals.h"
 #include "epan/filesystem.h"
 #include "../color.h"
-#include "stat_menu.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "main.h"
index f425f47396ca321316e3b8ee40c9d36f5608c699..ea8252dc85df7a9ca9aaea26c1ad8a055376cf29 100644 (file)
@@ -40,8 +40,6 @@
 #include <epan/epan.h>
 #include <epan/value_string.h>
 
-#include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
 #include <epan/tap.h>
 #include "../register.h"
 #include <epan/dissectors/packet-sctp.h>
@@ -51,6 +49,7 @@
 #include "dlg_utils.h"
 #include "../file.h"
 #include "../globals.h"
+#include "../stat_menu.h"
 #include "../tap_dfilter_dlg.h"
 #include "tap_dfilter_dlg.h"
 #include "gui_utils.h"
@@ -345,8 +344,6 @@ sctpstat_init(const char *optarg)
 void
 register_tap_listener_sctpstat(void)
 {
-       register_stat_cmd_arg("sctp,stat", sctpstat_init);
-
-       register_stat_menu_item("SCTP/Chunk Counter", REGISTER_STAT_GROUP_TELEPHONY,
-                              gtk_tap_dfilter_dlg_cb, NULL, NULL, &(sctp_stat_dlg));
+       register_dfilter_stat(&sctp_stat_dlg, "SCTP/Chunk Counter",
+           REGISTER_STAT_GROUP_TELEPHONY);
 }
index 80c47494f4663066000e789d9e31935aa43aad97..646b40030a519c8c807d6a74e4fa05077cc2bd23 100644 (file)
@@ -35,7 +35,6 @@
 #include "image/clist_ascend.xpm"
 #include "image/clist_descend.xpm"
 
-#include "stat_menu.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "main.h"
index 6f72eab3da0afa422672ff5037663a8b8f28d99f..1eb37abf7a4192458f5ec18351841c8f4a8c2ae3 100644 (file)
@@ -31,7 +31,6 @@
 #include "globals.h"
 #include "epan/filesystem.h"
 #include "simple_dialog.h"
-#include "stat_menu.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "main.h"
index 7bb7a92768ef16951b24fab5cacc7d5c811d2e7d..bcfcec13e861a461a30739f8d119f1e6851b5b9e 100644 (file)
@@ -35,7 +35,6 @@
 #include "globals.h"
 #include "epan/filesystem.h"
 #include "../color.h"
-#include "stat_menu.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "main.h"
index 57c052970b87102e0a50fc7f90fb80d839e96dcc..5599ac41b78a142cbf194b79ad5f9c75497b1e50 100644 (file)
@@ -32,8 +32,6 @@
 #include "globals.h"
 #include "epan/packet_info.h"   /* Needed for packet_info */
 #include <epan/tap.h>           /* Needed for register_tap_listener */
-#include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
 #include "dlg_utils.h"
 #include "compat_macros.h"
 #include "register.h"
@@ -1445,12 +1443,6 @@ const sctp_allassocs_info_t* sctp_stat_get_info(void)
 }
 
 
-static void
-gtk_sctpstat_init(const char *dummy _U_)
-{
-
-}
-
 static void sctp_update(void *dummy _U_)
 {
        if (get_stat_dlg()!=NULL)
@@ -1464,7 +1456,6 @@ register_tap_listener_sctp_stat(void)
 
        if (!sctp_tapinfo_struct.is_registered)
        {
-               register_stat_cmd_arg("sctp",gtk_sctpstat_init);
                if ((error_string = register_tap_listener("sctp", &sctp_tapinfo_struct, NULL, reset, packet, sctp_update))) {
                        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str);
                        g_string_free(error_string, TRUE);
index 1591a88d133cfeba0c1827b24950d0a69cfce34a..77067c48a6f4ef4dbaba4ce3ecd134ca665aa3ca 100644 (file)
@@ -35,7 +35,8 @@
 #include "image/clist_ascend.xpm"
 #include "image/clist_descend.xpm"
 
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "main.h"
index e838fb6a17608211c5b8a74a629a20936f75cb2c..3618a720cedc0f60aa57d574c7376c675d4d3ea1 100644 (file)
@@ -34,8 +34,6 @@
 #include <epan/packet_info.h>
 #include <epan/epan.h>
 
-#include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
 #include "simple_dialog.h"
 #include "gui_utils.h"
 #include "dlg_utils.h"
@@ -44,6 +42,7 @@
 #include <epan/dissectors/packet-sip.h>
 #include "../globals.h"
 #include "compat_macros.h"
+#include "../stat_menu.h"
 #include "../tap_dfilter_dlg.h"
 #include "tap_dfilter_dlg.h"
 
@@ -663,8 +662,5 @@ static tap_dfilter_dlg sip_stat_dlg = {
 void
 register_tap_listener_gtksipstat(void)
 {
-    register_stat_cmd_arg("sip,stat", gtk_sipstat_init);
-
-    register_stat_menu_item("SIP", REGISTER_STAT_GROUP_TELEPHONY,
-                           gtk_tap_dfilter_dlg_cb, NULL, NULL, &(sip_stat_dlg));
+    register_dfilter_stat(&sip_stat_dlg, "SIP", REGISTER_STAT_GROUP_TELEPHONY);
 }
index b9aace599f290fc3c9c3e0d5f6312b366464abc2..8958af985d7988ac954ef097edfa029ede4bc0b9 100644 (file)
@@ -39,7 +39,8 @@
 #include <epan/value_string.h>
 
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include <epan/tap.h>
 #include "../smb.h"
 #include "../register.h"
index babd2048c1ef17df54eea8e80ab08ab378d851f9..34c5552790e1d00583514e9fb124d33d3bea0e82 100644 (file)
 
 #include "simple_dialog.h"
 #include "globals.h"
-#include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
 #include "gui_utils.h"
 #include "dlg_utils.h"
 #include "compat_macros.h"
+#include "../stat_menu.h"
 #include "tap_dfilter_dlg.h"
 #include "../tap_dfilter_dlg.h"
 
@@ -367,12 +366,7 @@ static void init_gtk_tree(const char* optarg) {
 
 static void register_gtk_stats_tree_tap (gpointer k _U_, gpointer v, gpointer p _U_) {
        stats_tree_cfg* cfg = v;
-       guint8* s;
 
-       s = g_strdup_printf("%s,tree",cfg->abbr);
-       
-       register_stat_cmd_arg(s, init_gtk_tree);
-       
        cfg->pr = g_malloc(sizeof(tree_pres));
        
        cfg->pr->stat_dlg = g_malloc(sizeof(tap_dfilter_dlg));
@@ -382,8 +376,8 @@ static void register_gtk_stats_tree_tap (gpointer k _U_, gpointer v, gpointer p
        cfg->pr->stat_dlg->tap_init_cb = init_gtk_tree;
        cfg->pr->stat_dlg->index = -1;
        
-       register_stat_menu_item(cfg->name, REGISTER_STAT_GROUP_NONE,
-                                                  gtk_tap_dfilter_dlg_cb, NULL, NULL, cfg->pr->stat_dlg);
+       register_dfilter_stat(cfg->pr->stat_dlg, cfg->name,
+           REGISTER_STAT_GROUP_NONE);
 }
 
 static void free_tree_presentation(stats_tree* st) {
index 262bc09ac7b5b216b15a13d9adbe03b615f85a16..5f937115bb6907d79f50da63759a4e2ee22c17b7 100644 (file)
@@ -42,6 +42,9 @@
 #include "../file.h"
 #include "../globals.h"
 #include "filter_dlg.h"
+#include <epan/stat_cmd_args.h>
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "../tap_dfilter_dlg.h"
 #include "tap_dfilter_dlg.h"
 #include "gui_utils.h"
@@ -60,6 +63,20 @@ static tap_dfilter_dlg_list_item *start_dlg_list=NULL;
 static tap_dfilter_dlg_list_item *end_dlg_list=NULL;
 static tap_dfilter_dlg_list_item *current_dlg = NULL;
 
+/*
+ * Register a stat that has a display filter dialog.
+ * We register it both as a command-line stat and a menu item stat.
+ */
+void
+register_dfilter_stat(tap_dfilter_dlg *info, const char *name,
+    REGISTER_STAT_GROUP_E group)
+{
+       register_stat_cmd_arg(info->init_string, info->tap_init_cb);
+
+       register_stat_menu_item(name, group, gtk_tap_dfilter_dlg_cb, NULL,
+           NULL, info);
+}              
+
 void tap_dfilter_dlg_update (void)
 {
        tap_dfilter_dlg_list_item *dialog = start_dlg_list;
index a414c511351b72493884e546398ddd7a1a8a58b3..951f6012f76e893dd207062dd0fd2f2e45189e75 100644 (file)
 #include "ppptypes.h"
 #include "dlg_utils.h"
 #include <epan/epan_dissect.h>
-#include "stat_menu.h"
-#include "../epan/dissectors/packet-tcp.h"
-#include "../epan/address.h"
-#include "../epan/tap.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
+#include <epan/dissectors/packet-tcp.h>
+#include <epan/address.h>
+#include <epan/tap.h>
 
 #define TH_FIN    0x01
 #define TH_SYN    0x02
index a1c14cd1feab0d70c75f28fe2fbab1ce88a078ea..69ea75a2f04e519e9a5731a9ff4e4c4a38bbf18c 100644 (file)
@@ -51,7 +51,8 @@
 
 #include <epan/tap.h>
 #include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
+#include "../stat_menu.h"
+#include "gtk_stat_menu.h"
 #include "dlg_utils.h"
 #include "gui_utils.h"
 #include "compat_macros.h"
index f3bb4ce36da49cecc3dddbfb6e6c763a0e561be4..e4a00782648f86e1be41dfdea3730cdd9568a1b7 100644 (file)
@@ -34,8 +34,6 @@
 #include <epan/packet_info.h>
 #include <epan/epan.h>
 
-#include <epan/stat_cmd_args.h>
-#include "stat_menu.h"
 #include "simple_dialog.h"
 #include "gui_utils.h"
 #include "dlg_utils.h"
@@ -44,6 +42,7 @@
 #include "../globals.h"
 #include "compat_macros.h"
 #include <epan/dissectors/packet-wsp.h>
+#include "../stat_menu.h"
 #include "../tap_dfilter_dlg.h"
 #include "tap_dfilter_dlg.h"
 
@@ -426,8 +425,6 @@ static tap_dfilter_dlg wsp_stat_dlg = {
 void
 register_tap_listener_gtkwspstat(void)
 {
-       register_stat_cmd_arg("wsp,stat", gtk_wspstat_init);
-
-       register_stat_menu_item("WAP-WSP...", REGISTER_STAT_GROUP_TELEPHONY,
-           gtk_tap_dfilter_dlg_cb, NULL, NULL, &(wsp_stat_dlg));
+       register_dfilter_stat(&wsp_stat_dlg, "WAP-WSP...",
+           REGISTER_STAT_GROUP_TELEPHONY);
 }
diff --git a/stat_menu.h b/stat_menu.h
new file mode 100644 (file)
index 0000000..88982c4
--- /dev/null
@@ -0,0 +1,59 @@
+/* stat_menu.h
+ * Menu definitions for use by stats
+ *
+ * $Id$
+ *
+ * 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 __STATMENU_H__
+#define __STATMENU_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/** @file
+ * Add a new menu item for a stat.
+ */
+
+/*
+ * XXX - defines stuff usable regardless of the GUI toolkit.  Right now,
+ * that's only the menu group, which is used by tap_dfilter_dlg.h.
+ *
+ * XXX - stats should be able to register additional menu groups, although
+ * the question then would be "in what order should they appear in the menu?"
+ */
+
+/** The menu group this stat should be registered in. */
+typedef enum {
+    REGISTER_STAT_GROUP_NONE,
+    REGISTER_STAT_GROUP_GENERIC,
+    REGISTER_STAT_GROUP_CONVERSATION_LIST,
+    REGISTER_STAT_GROUP_ENDPOINT_LIST,
+    REGISTER_STAT_GROUP_RESPONSE_TIME,
+    REGISTER_STAT_GROUP_TELEPHONY
+    /* XXX - split into telephony and VoIP? */
+} REGISTER_STAT_GROUP_E;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __STATMENU_H__ */
index a4f0166c849b21c4e2920f6c4e5687bc175b449d..5d398fa6dec0f3ea18e21e18f25e89aff8c7878c 100644 (file)
@@ -58,5 +58,12 @@ typedef struct _tap_dfilter_dlg {
        gint index;                     /* initiate this value always with "-1" */
 } tap_dfilter_dlg;
 
+/*
+ * Register a stat that has a display filter dialog.
+ * We register it both as a command-line stat and a menu item stat.
+ */
+void register_dfilter_stat(tap_dfilter_dlg *info, const char *name,
+    REGISTER_STAT_GROUP_E group);
+
 /* This will update the titles of the dialog windows when we load a new capture file. */
 void tap_dfilter_dlg_update (void);