Add a "register_dfilter_stat()", to register stats that take a display

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.

svn path=/trunk/; revision=15493
This commit is contained in:
Guy Harris 2005-08-21 09:48:27 +00:00
parent e88b3ccb32
commit a0e68da918
67 changed files with 203 additions and 128 deletions

View 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 \

View 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);

1
file.c
View File

@ -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>

View 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 \

View 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"

View 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"

View 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"

View 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);
}

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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

View 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);
}

View 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);
}

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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>

View 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);
}
}

View 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"

View 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"

View 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>

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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);
}

View 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"

View 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"

View 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"

View 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);

View 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"

View 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);
}

View 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"

View File

@ -34,11 +34,10 @@
#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) {

View 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;

View File

@ -45,10 +45,11 @@
#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

View 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"

View 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);
}

59
stat_menu.h Normal file
View File

@ -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__ */

View 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);