From b2807e2ab65c7c96b38c4b08b4b491986719378a Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 19 Aug 2005 09:29:41 +0000 Subject: Move the APIs for registering and processing "-z" command-line arguments and "Statistics" menu items into "stat.h" and "stat.c", to separate them from the core tapping APIs. A tap could conceivably not register as a "-z" command-line argument or "Statistics" menu item, and a stat could conceivably not be implemented as a tap, and dissectors that implement tapping points don't need the UI-related stuff from "stat.h", they just want the tap-related stuff in . svn path=/trunk/; revision=15427 --- Makefile.common | 2 + epan/libethereal.def | 4 -- epan/tap.c | 86 -------------------------------- epan/tap.h | 5 -- gtk/Makefile.am | 2 +- gtk/ansi_a_stat.c | 9 ++-- gtk/ansi_map_stat.c | 7 +-- gtk/bootp_stat.c | 7 +-- gtk/conversations_eth.c | 7 +-- gtk/conversations_fc.c | 7 +-- gtk/conversations_fddi.c | 7 +-- gtk/conversations_ip.c | 7 +-- gtk/conversations_ipx.c | 7 +-- gtk/conversations_jxta.c | 9 ++-- gtk/conversations_sctp.c | 7 +-- gtk/conversations_tcpip.c | 7 +-- gtk/conversations_tr.c | 7 +-- gtk/conversations_udpip.c | 7 +-- gtk/conversations_wlan.c | 7 +-- gtk/dcerpc_stat.c | 7 +-- gtk/fc_stat.c | 7 +-- gtk/flow_graph.c | 7 +-- gtk/follow_dlg.c | 2 +- gtk/gsm_a_stat.c | 21 ++++---- gtk/gsm_map_stat.c | 7 +-- gtk/gsm_map_summary.c | 4 +- gtk/h225_counter.c | 7 +-- gtk/h225_ras_srt.c | 7 +-- gtk/hostlist_eth.c | 7 +-- gtk/hostlist_fc.c | 7 +-- gtk/hostlist_fddi.c | 7 +-- gtk/hostlist_ip.c | 7 +-- gtk/hostlist_ipx.c | 7 +-- gtk/hostlist_jxta.c | 7 +-- gtk/hostlist_tcpip.c | 7 +-- gtk/hostlist_tr.c | 7 +-- gtk/hostlist_udpip.c | 7 +-- gtk/hostlist_wlan.c | 7 +-- gtk/io_stat.c | 7 +-- gtk/ldap_stat.c | 7 +-- gtk/main.c | 34 ++++++------- gtk/menu.c | 42 ++++++++-------- gtk/mgcp_stat.c | 7 +-- gtk/mtp3_stat.c | 7 +-- gtk/mtp3_summary.c | 4 +- gtk/rpc_progs.c | 7 +-- gtk/rpc_stat.c | 7 +-- gtk/rtp_analysis.c | 7 +-- gtk/rtp_stream.c | 3 +- gtk/rtp_stream_dlg.c | 4 +- gtk/sctp_assoc_analyse.c | 4 +- gtk/sctp_byte_graph_dlg.c | 2 +- gtk/sctp_chunk_stat.c | 7 +-- gtk/sctp_chunk_stat_dlg.c | 2 +- gtk/sctp_error_dlg.c | 2 +- gtk/sctp_graph_dlg.c | 2 +- gtk/sctp_stat.c | 5 +- gtk/sctp_stat_dlg.c | 4 +- gtk/sip_stat.c | 7 +-- gtk/smb_stat.c | 7 +-- gtk/stat_menu.h | 87 +++++++++++++++++++++++++++++++++ gtk/stats_tree_stat.c | 7 +-- gtk/tap_menu.h | 87 --------------------------------- gtk/tcp_graph.c | 10 ++-- gtk/voip_calls_dlg.c | 7 +-- gtk/wsp_stat.c | 7 +-- stat.c | 122 ++++++++++++++++++++++++++++++++++++++++++++++ stat.h | 35 +++++++++++++ tap-ansi_astat.c | 3 +- tap-bootpstat.c | 5 +- tap-dcerpcstat.c | 3 +- tap-gsm_astat.c | 3 +- tap-h225counter.c | 3 +- tap-h225rassrt.c | 3 +- tap-httpstat.c | 3 +- tap-iostat.c | 3 +- tap-iousers.c | 4 +- tap-mgcpstat.c | 3 +- tap-protocolinfo.c | 3 +- tap-protohierstat.c | 3 +- tap-rpcprogs.c | 3 +- tap-rpcstat.c | 3 +- tap-sctpchunkstat.c | 3 +- tap-sipstat.c | 3 +- tap-smbsids.c | 3 +- tap-smbstat.c | 3 +- tap-stats_tree.c | 3 +- tap-wspstat.c | 3 +- tap_dfilter_dlg.h | 4 +- tethereal.c | 14 +++--- 90 files changed, 545 insertions(+), 416 deletions(-) create mode 100644 gtk/stat_menu.h delete mode 100644 gtk/tap_menu.h create mode 100644 stat.c create mode 100644 stat.h diff --git a/Makefile.common b/Makefile.common index cf43eb6d3a..bc4db2cf03 100644 --- a/Makefile.common +++ b/Makefile.common @@ -82,6 +82,7 @@ ETHEREAL_COMMON_SRC = \ print.c \ ps.c \ ringbuffer.c \ + stat.c \ timestats.c \ util.c \ version_info.c @@ -106,6 +107,7 @@ ETHEREAL_COMMON_INCLUDES = \ ps.h \ register.h \ ringbuffer.h \ + stat.h \ timestats.h \ util.h \ version_info.h diff --git a/epan/libethereal.def b/epan/libethereal.def index d3b8cd9368..1ab118cec6 100644 --- a/epan/libethereal.def +++ b/epan/libethereal.def @@ -339,7 +339,6 @@ isup_message_type_value DATA isup_message_type_value_acro DATA is_big_endian is_tpkt -list_tap_cmd_args LocationRejectReason_vals DATA match_strval match_strval_idx @@ -370,7 +369,6 @@ prefs_register_string_preference prefs_register_uint_preference prefs_set_pref process_reassembled_data -process_tap_cmd_arg protocols_module DATA proto_can_match_selected proto_can_toggle_protocol @@ -492,7 +490,6 @@ register_init_routine register_postseq_cleanup_routine register_tap register_tap_listener -register_tap_listener_cmd_arg RegistrationRejectReason_vals DATA ReleaseCompleteReason_vals DATA remove_tap_listener @@ -522,7 +519,6 @@ sid_name_snooping DATA sid_name_table DATA smb_cmd_vals DATA sminmpec_values DATA -start_requested_taps stats_tree_branch_max_namelen stats_tree_branch_to_str stats_tree_create_node diff --git a/epan/tap.c b/epan/tap.c index 14f100c195..2b8dd1da20 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -79,25 +79,6 @@ typedef struct _tap_listener_t { } tap_listener_t; static volatile tap_listener_t *tap_listener_queue=NULL; -/* structure to keep track of what tap listeners have registered - command-line arguments. - */ -typedef struct _tap_cmd_arg { - struct _tap_cmd_arg *next; - const char *cmd; - void (*func)(const char *arg); -} tap_cmd_arg; -static tap_cmd_arg *tap_cmd_arg_list=NULL; - -/* structure to keep track of what taps have been specified on the - command line. - */ -typedef struct { - tap_cmd_arg *tca; - char *arg; -} tap_requested; -static GSList *taps_requested = NULL; - /* ********************************************************************** * Init routine only called from epan at application startup * ********************************************************************** */ @@ -112,73 +93,6 @@ tap_init(void) return; } -/* ********************************************************************** - * Function called from tap to register the tap's command-line argument - * and initialization routine - * ********************************************************************** */ -void -register_tap_listener_cmd_arg(const char *cmd, void (*func)(const char *arg)) -{ - tap_cmd_arg *newtca; - - newtca=g_malloc(sizeof(tap_cmd_arg)); - newtca->next=tap_cmd_arg_list; - tap_cmd_arg_list=newtca; - newtca->cmd=cmd; - newtca->func=func; -} - -/* ********************************************************************** - * Function called for a tap command-line argument - * ********************************************************************** */ -gboolean -process_tap_cmd_arg(char *optarg) -{ - tap_cmd_arg *tca; - tap_requested *tr; - - for(tca=tap_cmd_arg_list;tca;tca=tca->next){ - if(!strncmp(tca->cmd,optarg,strlen(tca->cmd))){ - tr=g_malloc(sizeof (tap_requested)); - tr->tca = tca; - tr->arg=g_strdup(optarg); - taps_requested=g_slist_append(taps_requested, tr); - return TRUE; - } - } - return FALSE; -} - -/* ********************************************************************** - * Function to list all possible tap command-line arguments - * ********************************************************************** */ -void -list_tap_cmd_args(void) -{ - tap_cmd_arg *tca; - - for(tca=tap_cmd_arg_list;tca;tca=tca->next){ - fprintf(stderr," %s\n",tca->cmd); - } -} - -/* ********************************************************************** - * Function to process taps requested with command-line arguments - * ********************************************************************** */ -void -start_requested_taps(void) -{ - tap_requested *tr; - - while(taps_requested){ - tr=taps_requested->data; - (*tr->tca->func)(tr->arg); - g_free(tr->arg); - g_free(tr); - taps_requested=g_slist_remove(taps_requested, tr); - } -} - /* ********************************************************************** * Functions called from dissector when made tappable * ********************************************************************** */ diff --git a/epan/tap.h b/epan/tap.h index c37dd450db..9fc8233b46 100644 --- a/epan/tap.h +++ b/epan/tap.h @@ -38,11 +38,6 @@ typedef void (*tap_draw_cb)(void *tapdata); extern void tap_init(void); -extern void register_tap_listener_cmd_arg(const char *cmd, - void (*func)(const char *arg)); -extern gboolean process_tap_cmd_arg(char *optarg); -extern void list_tap_cmd_args(void); -extern void start_requested_taps(void); extern int register_tap(const char *name); extern int find_tap_id(const char *name); extern void tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data); diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 45b5db1905..f91adfe53e 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -89,11 +89,11 @@ noinst_HEADERS = \ sat.h \ sctp_stat.h \ service_response_time_table.h \ + stat_menu.h \ stream_prefs.h \ summary_dlg.h \ supported_protos_dlg.h \ tap_dfilter_dlg.h \ - tap_menu.h \ text_page.h \ toolbar.h \ ui_util.h \ diff --git a/gtk/ansi_a_stat.c b/gtk/ansi_a_stat.c index b4550ad6ab..eafe9f5a80 100644 --- a/gtk/ansi_a_stat.c +++ b/gtk/ansi_a_stat.c @@ -40,7 +40,8 @@ #include "epan/packet_info.h" #include "epan/epan.h" #include "epan/value_string.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "image/clist_ascend.xpm" #include "image/clist_descend.xpm" #include "simple_dialog.h" @@ -458,7 +459,7 @@ register_tap_listener_gtkansi_a_stat(void) GString *err_p; - register_tap_listener_cmd_arg("ansi_a,", ansi_a_stat_gtk_init); + register_stat_cmd_arg("ansi_a,", ansi_a_stat_gtk_init); memset((void *) &stat, 0, sizeof(ansi_a_stat_t)); @@ -476,8 +477,8 @@ register_tap_listener_gtkansi_a_stat(void) exit(1); } - register_tap_menu_item("ANSI/A-Interface BSMAP", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("ANSI/A-Interface BSMAP", REGISTER_STAT_GROUP_TELEPHONY, ansi_a_stat_gtk_bsmap_cb, NULL, NULL ,NULL); - register_tap_menu_item("ANSI/A-Interface DTAP", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("ANSI/A-Interface DTAP", REGISTER_STAT_GROUP_TELEPHONY, ansi_a_stat_gtk_dtap_cb, NULL, NULL ,NULL); } diff --git a/gtk/ansi_map_stat.c b/gtk/ansi_map_stat.c index 764cdb78c8..ab54d4d957 100644 --- a/gtk/ansi_map_stat.c +++ b/gtk/ansi_map_stat.c @@ -40,7 +40,8 @@ #include "epan/packet_info.h" #include "epan/epan.h" #include "epan/value_string.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "image/clist_ascend.xpm" #include "image/clist_descend.xpm" #include "simple_dialog.h" @@ -422,7 +423,7 @@ register_tap_listener_gtkansi_map_stat(void) GString *err_p; - register_tap_listener_cmd_arg("ansi_map,", ansi_map_stat_gtk_init); + register_stat_cmd_arg("ansi_map,", ansi_map_stat_gtk_init); memset((void *) &stat, 0, sizeof(ansi_map_stat_t)); @@ -440,6 +441,6 @@ register_tap_listener_gtkansi_map_stat(void) exit(1); } - register_tap_menu_item("ANSI/MAP Operation", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("ANSI/MAP Operation", REGISTER_STAT_GROUP_TELEPHONY, ansi_map_stat_gtk_cb, NULL, NULL, NULL); } diff --git a/gtk/bootp_stat.c b/gtk/bootp_stat.c index 54df43e2cb..a63b300016 100644 --- a/gtk/bootp_stat.c +++ b/gtk/bootp_stat.c @@ -33,7 +33,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "simple_dialog.h" #include "ui_util.h" #include "dlg_utils.h" @@ -281,8 +282,8 @@ static tap_dfilter_dlg dhcp_stat_dlg = { void register_tap_listener_gtkdhcpstat(void) { - register_tap_listener_cmd_arg("bootp,stat", dhcpstat_init); + register_stat_cmd_arg("bootp,stat", dhcpstat_init); - register_tap_menu_item("BOOTP-DHCP", REGISTER_TAP_GROUP_NONE, + register_stat_menu_item("BOOTP-DHCP", REGISTER_STAT_GROUP_NONE, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(dhcp_stat_dlg)); } diff --git a/gtk/conversations_eth.c b/gtk/conversations_eth.c index 262590b3b4..0b1a34bd44 100644 --- a/gtk/conversations_eth.c +++ b/gtk/conversations_eth.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -78,9 +79,9 @@ eth_endpoints_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_eth_conversation(void) { - register_tap_listener_cmd_arg("conv,eth", eth_conversation_init); + register_stat_cmd_arg("conv,eth", eth_conversation_init); - register_tap_menu_item("Ethernet", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("Ethernet", REGISTER_STAT_GROUP_CONVERSATION_LIST, eth_endpoints_cb, NULL, NULL, NULL); register_conversation_table(TRUE, "Ethernet", "eth", NULL /*filter*/, eth_conversation_packet); diff --git a/gtk/conversations_fc.c b/gtk/conversations_fc.c index ed4e12e1e0..70acf6d683 100644 --- a/gtk/conversations_fc.c +++ b/gtk/conversations_fc.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -78,9 +79,9 @@ fc_endpoints_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_fc_conversation(void) { - register_tap_listener_cmd_arg("conv,fc", fc_conversation_init); + register_stat_cmd_arg("conv,fc", fc_conversation_init); - register_tap_menu_item("Fibre Channel", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("Fibre Channel", REGISTER_STAT_GROUP_CONVERSATION_LIST, fc_endpoints_cb, NULL, NULL, NULL); register_conversation_table(TRUE, "Fibre Channel", "fc", NULL /*filter*/, fc_conversation_packet); diff --git a/gtk/conversations_fddi.c b/gtk/conversations_fddi.c index 135d03865d..0551e1c564 100644 --- a/gtk/conversations_fddi.c +++ b/gtk/conversations_fddi.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -78,9 +79,9 @@ fddi_endpoints_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_fddi_conversation(void) { - register_tap_listener_cmd_arg("conv,fddi", fddi_conversation_init); + register_stat_cmd_arg("conv,fddi", fddi_conversation_init); - register_tap_menu_item("FDDI", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("FDDI", REGISTER_STAT_GROUP_CONVERSATION_LIST, fddi_endpoints_cb, NULL, NULL, NULL); register_conversation_table(TRUE, "FDDI", "fddi", NULL /*filter*/, fddi_conversation_packet); diff --git a/gtk/conversations_ip.c b/gtk/conversations_ip.c index baac47ca88..4a8b10c55a 100644 --- a/gtk/conversations_ip.c +++ b/gtk/conversations_ip.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -76,9 +77,9 @@ ip_endpoints_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_ip_conversation(void) { - register_tap_listener_cmd_arg("conv,ip", ip_conversation_init); + register_stat_cmd_arg("conv,ip", ip_conversation_init); - register_tap_menu_item("IPv4", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("IPv4", REGISTER_STAT_GROUP_CONVERSATION_LIST, ip_endpoints_cb, NULL, NULL, NULL); register_conversation_table(TRUE, "IPv4", "ip", NULL /*filter*/, ip_conversation_packet); diff --git a/gtk/conversations_ipx.c b/gtk/conversations_ipx.c index d397d14263..af235ad8c5 100644 --- a/gtk/conversations_ipx.c +++ b/gtk/conversations_ipx.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -78,9 +79,9 @@ ipx_endpoints_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_ipx_conversation(void) { - register_tap_listener_cmd_arg("conv,ipx", ipx_conversation_init); + register_stat_cmd_arg("conv,ipx", ipx_conversation_init); - register_tap_menu_item("IPX", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("IPX", REGISTER_STAT_GROUP_CONVERSATION_LIST, ipx_endpoints_cb, NULL, NULL, NULL); register_conversation_table(TRUE, "IPX", "ipx", NULL /*filter*/, ipx_conversation_packet); diff --git a/gtk/conversations_jxta.c b/gtk/conversations_jxta.c index 29acc7d78b..e49f5896e1 100644 --- a/gtk/conversations_jxta.c +++ b/gtk/conversations_jxta.c @@ -34,7 +34,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -86,10 +87,10 @@ jxta_conversation_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_jxta_conversation(void) { - register_tap_listener_cmd_arg("conv,jxta", jxta_conversation_init); + register_stat_cmd_arg("conv,jxta", jxta_conversation_init); - register_tap_menu_item("JXTA", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("JXTA", REGISTER_STAT_GROUP_CONVERSATION_LIST, jxta_conversation_cb, NULL, NULL, NULL); - register_conversation_table(TRUE, "JXTA", "jxta", NULL /*filter*/, jxta_conversation_packet); + register_conversation_table(TRUE, "JXTA", "jxta", NULL /*filter*/, jxta_conversation_packet); } diff --git a/gtk/conversations_sctp.c b/gtk/conversations_sctp.c index 2a62cec083..aa3458924a 100644 --- a/gtk/conversations_sctp.c +++ b/gtk/conversations_sctp.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -87,9 +88,9 @@ sctp_conversation_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_sctp_conversation(void) { - register_tap_listener_cmd_arg("conv,sctp", sctp_conversation_init); + register_stat_cmd_arg("conv,sctp", sctp_conversation_init); - register_tap_menu_item("SCTP", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("SCTP", REGISTER_STAT_GROUP_CONVERSATION_LIST, sctp_conversation_cb, NULL, NULL, NULL); register_conversation_table(FALSE, "SCTP", "sctp", NULL /*filter*/, sctp_conversation_packet); diff --git a/gtk/conversations_tcpip.c b/gtk/conversations_tcpip.c index f35051275b..ed77b85218 100644 --- a/gtk/conversations_tcpip.c +++ b/gtk/conversations_tcpip.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -78,9 +79,9 @@ tcpip_conversation_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_tcpip_conversation(void) { - register_tap_listener_cmd_arg("conv,tcp", tcpip_conversation_init); + register_stat_cmd_arg("conv,tcp", tcpip_conversation_init); - register_tap_menu_item("TCP (IPv4 & IPv6)", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("TCP (IPv4 & IPv6)", REGISTER_STAT_GROUP_CONVERSATION_LIST, tcpip_conversation_cb, NULL, NULL, NULL); register_conversation_table(FALSE, "TCP", "tcp", NULL /*filter*/, tcpip_conversation_packet); diff --git a/gtk/conversations_tr.c b/gtk/conversations_tr.c index ad7252fca6..b56684617e 100644 --- a/gtk/conversations_tr.c +++ b/gtk/conversations_tr.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -78,9 +79,9 @@ tr_conversation_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_tr_conversation(void) { - register_tap_listener_cmd_arg("conv,tr", tr_conversation_init); + register_stat_cmd_arg("conv,tr", tr_conversation_init); - register_tap_menu_item("Token Ring", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("Token Ring", REGISTER_STAT_GROUP_CONVERSATION_LIST, tr_conversation_cb, NULL, NULL, NULL); register_conversation_table(TRUE, "Token Ring", "tr", NULL /*filter*/, tr_conversation_packet); diff --git a/gtk/conversations_udpip.c b/gtk/conversations_udpip.c index 9e66323065..4a5cb40b9d 100644 --- a/gtk/conversations_udpip.c +++ b/gtk/conversations_udpip.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -78,9 +79,9 @@ udpip_conversation_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_udpip_conversation(void) { - register_tap_listener_cmd_arg("conv,udp", udpip_conversation_init); + register_stat_cmd_arg("conv,udp", udpip_conversation_init); - register_tap_menu_item("UDP (IPv4 & IPv6)", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("UDP (IPv4 & IPv6)", REGISTER_STAT_GROUP_CONVERSATION_LIST, udpip_conversation_cb, NULL, NULL, NULL); register_conversation_table(FALSE, "UDP", "udp", NULL /*filter*/, udpip_conversation_packet); diff --git a/gtk/conversations_wlan.c b/gtk/conversations_wlan.c index 88e76be369..028409a512 100644 --- a/gtk/conversations_wlan.c +++ b/gtk/conversations_wlan.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "conversations_table.h" @@ -78,9 +79,9 @@ wlan_endpoints_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_wlan_conversation(void) { - register_tap_listener_cmd_arg("conv,wlan", wlan_conversation_init); + register_stat_cmd_arg("conv,wlan", wlan_conversation_init); - register_tap_menu_item("WLAN", REGISTER_TAP_GROUP_CONVERSATION_LIST, + register_stat_menu_item("WLAN", REGISTER_STAT_GROUP_CONVERSATION_LIST, wlan_endpoints_cb, NULL, NULL, NULL); register_conversation_table(TRUE, "WLAN", "wlan", NULL /*filter*/, wlan_conversation_packet); diff --git a/gtk/dcerpc_stat.c b/gtk/dcerpc_stat.c index 9892f090e9..4a3fcdaa9d 100644 --- a/gtk/dcerpc_stat.c +++ b/gtk/dcerpc_stat.c @@ -40,7 +40,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "simple_dialog.h" #include "dlg_utils.h" #include "ui_util.h" @@ -675,8 +676,8 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_gtkdcerpcstat(void) { - register_tap_listener_cmd_arg("dcerpc,srt,", gtk_dcerpcstat_init); + register_stat_cmd_arg("dcerpc,srt,", gtk_dcerpcstat_init); - register_tap_menu_item("DCE-RPC...", REGISTER_TAP_GROUP_RESPONSE_TIME, + register_stat_menu_item("DCE-RPC...", REGISTER_STAT_GROUP_RESPONSE_TIME, gtk_dcerpcstat_cb, NULL, NULL, NULL); } diff --git a/gtk/fc_stat.c b/gtk/fc_stat.c index 04650a960e..5e6c5bd15c 100644 --- a/gtk/fc_stat.c +++ b/gtk/fc_stat.c @@ -38,7 +38,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include #include "../register.h" @@ -312,8 +313,8 @@ gtk_fcstat_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_gtkfcstat(void) { - register_tap_listener_cmd_arg("fc,srt", gtk_fcstat_init); + register_stat_cmd_arg("fc,srt", gtk_fcstat_init); - register_tap_menu_item("Fibre Channel...", REGISTER_TAP_GROUP_RESPONSE_TIME, + register_stat_menu_item("Fibre Channel...", REGISTER_STAT_GROUP_RESPONSE_TIME, gtk_fcstat_cb, NULL, NULL, NULL); } diff --git a/gtk/flow_graph.c b/gtk/flow_graph.c index 2eaa75e1d2..8b2e77749d 100644 --- a/gtk/flow_graph.c +++ b/gtk/flow_graph.c @@ -33,7 +33,8 @@ #include "epan/filesystem.h" #include "graph_analysis.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "ui_util.h" #include "compat_macros.h" @@ -556,8 +557,8 @@ void flow_graph_launch(GtkWidget *w _U_, gpointer data _U_) void register_tap_listener_flow_graph(void) { - register_tap_listener_cmd_arg("flow_graph",flow_graph_init_tap); - register_tap_menu_item("Flow graph", REGISTER_TAP_GROUP_NONE, + register_stat_cmd_arg("flow_graph",flow_graph_init_tap); + register_stat_menu_item("Flow graph", REGISTER_STAT_GROUP_NONE, flow_graph_launch, NULL, NULL, NULL); } diff --git a/gtk/follow_dlg.c b/gtk/follow_dlg.c index 7055e31201..9b2fc5e5ea 100644 --- a/gtk/follow_dlg.c +++ b/gtk/follow_dlg.c @@ -63,7 +63,7 @@ #include #include "compat_macros.h" #include -#include "tap_menu.h" +#include "stat_menu.h" #include "print_mswin.h" #include "font_utils.h" diff --git a/gtk/gsm_a_stat.c b/gtk/gsm_a_stat.c index 9e558a35fa..eec62033b9 100644 --- a/gtk/gsm_a_stat.c +++ b/gtk/gsm_a_stat.c @@ -40,7 +40,8 @@ #include "epan/packet_info.h" #include "epan/epan.h" #include "epan/value_string.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "image/clist_ascend.xpm" #include "image/clist_descend.xpm" #include "simple_dialog.h" @@ -618,7 +619,7 @@ register_tap_listener_gtkgsm_a_stat(void) GString *err_p; - register_tap_listener_cmd_arg("gsm_a,", gsm_a_stat_gtk_init); + register_stat_cmd_arg("gsm_a,", gsm_a_stat_gtk_init); memset((void *) &stat, 0, sizeof(gsm_a_stat_t)); @@ -636,27 +637,27 @@ register_tap_listener_gtkgsm_a_stat(void) exit(1); } - register_tap_menu_item("GSM/A-Interface BSSMAP", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/A-Interface BSSMAP", REGISTER_STAT_GROUP_TELEPHONY, gsm_a_stat_gtk_bssmap_cb, NULL, NULL, NULL); - register_tap_menu_item("GSM/A-Interface DTAP/Mobility Management", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/A-Interface DTAP/Mobility Management", REGISTER_STAT_GROUP_TELEPHONY, gsm_a_stat_gtk_dtap_mm_cb, NULL, NULL, NULL); - register_tap_menu_item("GSM/A-Interface DTAP/Radio Resource Management", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/A-Interface DTAP/Radio Resource Management", REGISTER_STAT_GROUP_TELEPHONY, gsm_a_stat_gtk_dtap_rr_cb, NULL, NULL, NULL); - register_tap_menu_item("GSM/A-Interface DTAP/Call Control", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/A-Interface DTAP/Call Control", REGISTER_STAT_GROUP_TELEPHONY, gsm_a_stat_gtk_dtap_cc_cb, NULL, NULL, NULL); - register_tap_menu_item("GSM/A-Interface DTAP/GPRS Mobility Management", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/A-Interface DTAP/GPRS Mobility Management", REGISTER_STAT_GROUP_TELEPHONY, gsm_a_stat_gtk_dtap_gmm_cb, NULL, NULL, NULL); - register_tap_menu_item("GSM/A-Interface DTAP/Short Message Service", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/A-Interface DTAP/Short Message Service", REGISTER_STAT_GROUP_TELEPHONY, gsm_a_stat_gtk_dtap_sms_cb, NULL, NULL, NULL); - register_tap_menu_item("GSM/A-Interface DTAP/GPRS Session Management", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/A-Interface DTAP/GPRS Session Management", REGISTER_STAT_GROUP_TELEPHONY, gsm_a_stat_gtk_dtap_sm_cb, NULL, NULL, NULL); - register_tap_menu_item("GSM/A-Interface DTAP/Supplementary Services", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/A-Interface DTAP/Supplementary Services", REGISTER_STAT_GROUP_TELEPHONY, gsm_a_stat_gtk_dtap_ss_cb, NULL, NULL, NULL); } diff --git a/gtk/gsm_map_stat.c b/gtk/gsm_map_stat.c index 7e4391d841..7f7b9abead 100644 --- a/gtk/gsm_map_stat.c +++ b/gtk/gsm_map_stat.c @@ -40,7 +40,8 @@ #include "epan/packet_info.h" #include "epan/epan.h" #include "epan/value_string.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "image/clist_ascend.xpm" #include "image/clist_descend.xpm" #include "simple_dialog.h" @@ -454,7 +455,7 @@ register_tap_listener_gtkgsm_map_stat(void) GString *err_p; - register_tap_listener_cmd_arg("gsm_map,", gsm_map_stat_gtk_init); + register_stat_cmd_arg("gsm_map,", gsm_map_stat_gtk_init); memset((void *) &gsm_map_stat, 0, sizeof(gsm_map_stat_t)); @@ -472,6 +473,6 @@ register_tap_listener_gtkgsm_map_stat(void) exit(1); } - register_tap_menu_item("GSM/MAP Operation", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/MAP Operation", REGISTER_STAT_GROUP_TELEPHONY, gsm_map_stat_gtk_cb, NULL, NULL, NULL); } diff --git a/gtk/gsm_map_summary.c b/gtk/gsm_map_summary.c index 0ccd1ee5be..0257edcd39 100644 --- a/gtk/gsm_map_summary.c +++ b/gtk/gsm_map_summary.c @@ -38,7 +38,7 @@ #include "epan/packet_info.h" #include "epan/epan.h" #include "epan/value_string.h" -#include "tap_menu.h" +#include "stat_menu.h" #include "globals.h" #include "file.h" #include "summary.h" @@ -290,6 +290,6 @@ gsm_map_stat_gtk_sum_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_gtkgsm_map_summary(void) { - register_tap_menu_item("GSM/MAP Summary", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("GSM/MAP Summary", REGISTER_STAT_GROUP_TELEPHONY, gsm_map_stat_gtk_sum_cb, NULL, NULL, NULL); } diff --git a/gtk/h225_counter.c b/gtk/h225_counter.c index c7cb4858f5..336dff1019 100644 --- a/gtk/h225_counter.c +++ b/gtk/h225_counter.c @@ -39,7 +39,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include @@ -562,8 +563,8 @@ gtk_h225counter_init(const char *optarg) void register_tap_listener_gtk_h225counter(void) { - register_tap_listener_cmd_arg("h225,counter", gtk_h225counter_init); + register_stat_cmd_arg("h225,counter", gtk_h225counter_init); - register_tap_menu_item("H.225...", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("H.225...", REGISTER_STAT_GROUP_TELEPHONY, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(h225_counter_dlg)); } diff --git a/gtk/h225_ras_srt.c b/gtk/h225_ras_srt.c index 92a6da1c3e..5b8758dd0a 100644 --- a/gtk/h225_ras_srt.c +++ b/gtk/h225_ras_srt.c @@ -39,7 +39,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include @@ -342,8 +343,8 @@ gtk_h225rassrt_init(const char *optarg) void register_tap_listener_gtk_h225rassrt(void) { - register_tap_listener_cmd_arg("h225,srt", gtk_h225rassrt_init); + register_stat_cmd_arg("h225,srt", gtk_h225rassrt_init); - register_tap_menu_item("H.225 RAS...", REGISTER_TAP_GROUP_RESPONSE_TIME, + register_stat_menu_item("H.225 RAS...", REGISTER_STAT_GROUP_RESPONSE_TIME, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(h225_rassrt_dlg)); } diff --git a/gtk/hostlist_eth.c b/gtk/hostlist_eth.c index 7e61370a42..226fbd0f92 100644 --- a/gtk/hostlist_eth.c +++ b/gtk/hostlist_eth.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -83,9 +84,9 @@ gtk_eth_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_eth_hostlist(void) { - register_tap_listener_cmd_arg("hosts,eth", gtk_eth_hostlist_init); + register_stat_cmd_arg("hosts,eth", gtk_eth_hostlist_init); - register_tap_menu_item("Ethernet", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("Ethernet", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_eth_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(TRUE, "Ethernet", "eth", NULL /*filter*/, eth_hostlist_packet); diff --git a/gtk/hostlist_fc.c b/gtk/hostlist_fc.c index 8aab16a808..dc7c86d0d8 100644 --- a/gtk/hostlist_fc.c +++ b/gtk/hostlist_fc.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -83,9 +84,9 @@ gtk_fc_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_fc_hostlist(void) { - register_tap_listener_cmd_arg("hosts,fc", gtk_fc_hostlist_init); + register_stat_cmd_arg("hosts,fc", gtk_fc_hostlist_init); - register_tap_menu_item("Fibre Channel", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("Fibre Channel", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_fc_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(TRUE, "Fibre Channel", "fc", NULL /*filter*/, fc_hostlist_packet); diff --git a/gtk/hostlist_fddi.c b/gtk/hostlist_fddi.c index 6df39c6048..7fcd91901f 100644 --- a/gtk/hostlist_fddi.c +++ b/gtk/hostlist_fddi.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -83,9 +84,9 @@ gtk_fddi_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_fddi_hostlist(void) { - register_tap_listener_cmd_arg("hosts,fddi", gtk_fddi_hostlist_init); + register_stat_cmd_arg("hosts,fddi", gtk_fddi_hostlist_init); - register_tap_menu_item("FDDI", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("FDDI", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_fddi_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(TRUE, "FDDI", "fddi", NULL /*filter*/, fddi_hostlist_packet); diff --git a/gtk/hostlist_ip.c b/gtk/hostlist_ip.c index 9ed2cf7190..f2c0633b67 100644 --- a/gtk/hostlist_ip.c +++ b/gtk/hostlist_ip.c @@ -35,7 +35,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -82,9 +83,9 @@ gtk_ip_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_ip_hostlist(void) { - register_tap_listener_cmd_arg("hosts,ip", gtk_ip_hostlist_init); + register_stat_cmd_arg("hosts,ip", gtk_ip_hostlist_init); - register_tap_menu_item("IPv4", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("IPv4", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_ip_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(TRUE, "IPv4", "ip", NULL /*filter*/, ip_hostlist_packet); diff --git a/gtk/hostlist_ipx.c b/gtk/hostlist_ipx.c index 04a54f1cfc..d703135586 100644 --- a/gtk/hostlist_ipx.c +++ b/gtk/hostlist_ipx.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -83,9 +84,9 @@ gtk_ipx_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_ipx_hostlist(void) { - register_tap_listener_cmd_arg("hosts,ipx", gtk_ipx_hostlist_init); + register_stat_cmd_arg("hosts,ipx", gtk_ipx_hostlist_init); - register_tap_menu_item("IPX", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("IPX", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_ipx_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(TRUE, "IPX", "ipx", NULL /*filter*/, ipx_hostlist_packet); diff --git a/gtk/hostlist_jxta.c b/gtk/hostlist_jxta.c index a31699cc29..951038c515 100644 --- a/gtk/hostlist_jxta.c +++ b/gtk/hostlist_jxta.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -80,9 +81,9 @@ gtk_jxta_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_jxta_hostlist(void) { - register_tap_listener_cmd_arg("hosts,jxta", gtk_jxta_hostlist_init); + register_stat_cmd_arg("hosts,jxta", gtk_jxta_hostlist_init); - register_tap_menu_item("JXTA", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("JXTA", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_jxta_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(TRUE, "JXTA", "jxta", NULL /*filter*/, jxta_hostlist_packet); diff --git a/gtk/hostlist_tcpip.c b/gtk/hostlist_tcpip.c index f84958db3f..7a68a793d0 100644 --- a/gtk/hostlist_tcpip.c +++ b/gtk/hostlist_tcpip.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -83,9 +84,9 @@ gtk_tcpip_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_tcpip_hostlist(void) { - register_tap_listener_cmd_arg("endpoints,tcp", gtk_tcpip_hostlist_init); + register_stat_cmd_arg("endpoints,tcp", gtk_tcpip_hostlist_init); - register_tap_menu_item("TCP (IPv4 & IPv6)", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("TCP (IPv4 & IPv6)", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_tcpip_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(FALSE, "TCP", "tcp", NULL /*filter*/, tcpip_hostlist_packet); diff --git a/gtk/hostlist_tr.c b/gtk/hostlist_tr.c index cb2021ef9d..a82c53b15e 100644 --- a/gtk/hostlist_tr.c +++ b/gtk/hostlist_tr.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -83,9 +84,9 @@ gtk_tr_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_tr_hostlist(void) { - register_tap_listener_cmd_arg("hosts,tr", gtk_tr_hostlist_init); + register_stat_cmd_arg("hosts,tr", gtk_tr_hostlist_init); - register_tap_menu_item("Token Ring", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("Token Ring", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_tr_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(TRUE, "Token Ring", "tr", NULL /*filter*/, tr_hostlist_packet); diff --git a/gtk/hostlist_udpip.c b/gtk/hostlist_udpip.c index 7565cf0cbc..c0c8dcb9a0 100644 --- a/gtk/hostlist_udpip.c +++ b/gtk/hostlist_udpip.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -83,9 +84,9 @@ gtk_udpip_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_udpip_hostlist(void) { - register_tap_listener_cmd_arg("endpoints,udp", gtk_udpip_hostlist_init); + register_stat_cmd_arg("endpoints,udp", gtk_udpip_hostlist_init); - register_tap_menu_item("UDP (IPv4 & IPv6)", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("UDP (IPv4 & IPv6)", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_udpip_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(FALSE, "UDP", "udp", NULL /*filter*/, udpip_hostlist_packet); diff --git a/gtk/hostlist_wlan.c b/gtk/hostlist_wlan.c index 65e0fe338b..0726cf7260 100644 --- a/gtk/hostlist_wlan.c +++ b/gtk/hostlist_wlan.c @@ -33,7 +33,8 @@ #include #include #include "epan/packet.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "hostlist_table.h" @@ -81,9 +82,9 @@ gtk_wlan_hostlist_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_wlan_hostlist(void) { - register_tap_listener_cmd_arg("hosts,wlan", gtk_wlan_hostlist_init); + register_stat_cmd_arg("hosts,wlan", gtk_wlan_hostlist_init); - register_tap_menu_item("WLAN", REGISTER_TAP_GROUP_ENDPOINT_LIST, + register_stat_menu_item("WLAN", REGISTER_STAT_GROUP_ENDPOINT_LIST, gtk_wlan_hostlist_cb, NULL, NULL, NULL); register_hostlist_table(TRUE, "WLAN", "wlan", NULL /*filter*/, wlan_hostlist_packet); diff --git a/gtk/io_stat.c b/gtk/io_stat.c index 2da21c7cbe..fe7953295f 100644 --- a/gtk/io_stat.c +++ b/gtk/io_stat.c @@ -42,7 +42,8 @@ #include "gtkglobals.h" #include "ui_util.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "alert_box.h" @@ -1935,8 +1936,8 @@ gtk_iostat_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_gtk_iostat(void) { - register_tap_listener_cmd_arg("io,stat", gtk_iostat_init); + register_stat_cmd_arg("io,stat", gtk_iostat_init); - register_tap_menu_item("_IO Graphs", REGISTER_TAP_GROUP_GENERIC, + register_stat_menu_item("_IO Graphs", REGISTER_STAT_GROUP_GENERIC, gtk_iostat_cb, NULL, NULL, NULL); } diff --git a/gtk/ldap_stat.c b/gtk/ldap_stat.c index 6f49002d1f..aa2df72db7 100644 --- a/gtk/ldap_stat.c +++ b/gtk/ldap_stat.c @@ -38,7 +38,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include #include "../register.h" @@ -347,8 +348,8 @@ gtk_ldapstat_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_gtkldapstat(void) { - register_tap_listener_cmd_arg("ldap,srt", gtk_ldapstat_init); + register_stat_cmd_arg("ldap,srt", gtk_ldapstat_init); - register_tap_menu_item("LDAP...", REGISTER_TAP_GROUP_RESPONSE_TIME, + register_stat_menu_item("LDAP...", REGISTER_STAT_GROUP_RESPONSE_TIME, gtk_ldapstat_cb, NULL, NULL, NULL); } diff --git a/gtk/main.c b/gtk/main.c index 5e99501c80..8449b31088 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -83,6 +83,7 @@ #include "ringbuffer.h" #include "../ui_util.h" /* beware: ui_util.h exists twice! */ #include +#include "../stat.h" #include "util.h" #include "clopts_common.h" #include "version_info.h" @@ -2098,15 +2099,15 @@ main(int argc, char *argv[]) } break; case 'z': - /* We won't call the init function for the tap this soon + /* We won't call the init function for the stat this soon as it would disallow MATE's fields (which are registered by the preferences set callback) from being used as part of a tap filter. Instead, we just add the argument - to a list of tap arguments. */ - if (!process_tap_cmd_arg(optarg)) { + to a list of stat arguments. */ + if (!process_stat_cmd_arg(optarg)) { fprintf(stderr,"ethereal: invalid -z argument.\n"); fprintf(stderr," -z argument must be one of :\n"); - list_tap_cmd_args(); + list_stat_cmd_args(); exit(1); } break; @@ -2446,14 +2447,14 @@ main(int argc, char *argv[]) attached to "cf". */ cfile.rfcode = rfcode; - /* Open tap windows; we do so after creating the main window, + /* Open stat windows; we do so after creating the main window, to avoid GTK warnings, and after successfully opening the - capture file, so we know we have something to tap, and - after registering all dissectors, so that MATE will have - registered its field array and we can have a filter with - one of MATE's late-registered fields as part of the tap's + capture file, so we know we have something to compute stats + on, and after registering all dissectors, so that MATE will + have registered its field array and we can have a tap filter + with one of MATE's late-registered fields as part of the filter. */ - start_requested_taps(); + start_requested_stats(); /* Read the capture file. */ switch (cf_read(&cfile)) { @@ -2504,14 +2505,13 @@ main(int argc, char *argv[]) /* "-k" was specified; start a capture. */ show_main_window(TRUE); if (capture_start(capture_opts)) { - /* The capture started. Open tap windows; we do so after creating + /* The capture started. Open stat windows; we do so after creating the main window, to avoid GTK warnings, and after successfully - opening the capture file, so we know we have something to tap, - and after registering all dissectors, so that MATE will have - registered its field array and we can have a filter with - one of MATE's late-registered fields as part of the tap's - filter. */ - start_requested_taps(); + opening the capture file, so we know we have something to compute + stats on, and after registering all dissectors, so that MATE will + have registered its field array and we can have a tap filter with + one of MATE's late-registered fields as part of the filter. */ + start_requested_stats(); } } else { diff --git a/gtk/menu.c b/gtk/menu.c index e8d5eed790..2379a91b30 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -32,7 +32,7 @@ #include "main.h" #include "menu.h" -#include "tap_menu.h" +#include "stat_menu.h" #include #include #include @@ -649,9 +649,9 @@ static GList * tap_menu_item_add( * is selected and, if one is, on the tree row) and FALSE if not. */ void -register_tap_menu_item( +register_stat_menu_item( const char *name, - REGISTER_TAP_GROUP_E group, + REGISTER_STAT_GROUP_E group, GtkItemFactoryCallback callback, gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *), gboolean (*selected_tree_row_enabled)(field_info *), @@ -672,12 +672,12 @@ register_tap_menu_item( g_assert(*name != '/'); switch(group) { - case(REGISTER_TAP_GROUP_GENERIC): toolspath = "/Statistics/"; break; - case(REGISTER_TAP_GROUP_CONVERSATION_LIST): toolspath = "/Statistics/_Conversation List/"; break; - case(REGISTER_TAP_GROUP_ENDPOINT_LIST): toolspath = "/Statistics/_Endpoint List/"; break; - case(REGISTER_TAP_GROUP_RESPONSE_TIME): toolspath = "/Statistics/Service _Response Time/"; break; - case(REGISTER_TAP_GROUP_TELEPHONY): toolspath = "/Statistics/"; break; - case(REGISTER_TAP_GROUP_NONE): toolspath = "/Statistics/"; break; + case(REGISTER_STAT_GROUP_GENERIC): toolspath = "/Statistics/"; break; + case(REGISTER_STAT_GROUP_CONVERSATION_LIST): toolspath = "/Statistics/_Conversation List/"; break; + case(REGISTER_STAT_GROUP_ENDPOINT_LIST): toolspath = "/Statistics/_Endpoint List/"; break; + case(REGISTER_STAT_GROUP_RESPONSE_TIME): toolspath = "/Statistics/Service _Response Time/"; break; + case(REGISTER_STAT_GROUP_TELEPHONY): toolspath = "/Statistics/"; break; + case(REGISTER_STAT_GROUP_NONE): toolspath = "/Statistics/"; break; default: g_assert(0); toolspath = NULL; @@ -781,23 +781,23 @@ static guint merge_tap_menus_layered(GList *node, gint group) { entry->callback = node_data->callback; #if GTK_MAJOR_VERSION >= 2 switch(group) { - case(REGISTER_TAP_GROUP_NONE): + case(REGISTER_STAT_GROUP_NONE): break; - case(REGISTER_TAP_GROUP_GENERIC): + case(REGISTER_STAT_GROUP_GENERIC): break; - case(REGISTER_TAP_GROUP_CONVERSATION_LIST): + case(REGISTER_STAT_GROUP_CONVERSATION_LIST): entry->item_type = ""; entry->extra_data = ETHEREAL_STOCK_CONVERSATIONS; break; - case(REGISTER_TAP_GROUP_ENDPOINT_LIST): + case(REGISTER_STAT_GROUP_ENDPOINT_LIST): entry->item_type = ""; entry->extra_data = ETHEREAL_STOCK_ENDPOINTS; break; - case(REGISTER_TAP_GROUP_RESPONSE_TIME): + case(REGISTER_STAT_GROUP_RESPONSE_TIME): entry->item_type = ""; entry->extra_data = ETHEREAL_STOCK_TIME; break; - case(REGISTER_TAP_GROUP_TELEPHONY): + case(REGISTER_STAT_GROUP_TELEPHONY): entry->item_type = ""; entry->extra_data = ETHEREAL_STOCK_TELEPHONY; break; @@ -851,22 +851,22 @@ void merge_all_tap_menus(GList *node) { * merge only the menu items of the specific group, * and then append a seperator */ - if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_GENERIC)) { + if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_GENERIC)) { gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2); } - if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_CONVERSATION_LIST)) { + if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_CONVERSATION_LIST)) { /*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/ } - if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_ENDPOINT_LIST)) { + if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_ENDPOINT_LIST)) { /*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/ } - if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_RESPONSE_TIME)) { + if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_RESPONSE_TIME)) { gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2); } - if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_TELEPHONY)) { + if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_TELEPHONY)) { gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2); } - if (merge_tap_menus_layered(node, REGISTER_TAP_GROUP_NONE)) { + if (merge_tap_menus_layered(node, REGISTER_STAT_GROUP_NONE)) { /*gtk_item_factory_create_item(main_menu_factory, entry, NULL, 2);*/ } } diff --git a/gtk/mgcp_stat.c b/gtk/mgcp_stat.c index 6ce3a3cbcd..68ec5c47e1 100644 --- a/gtk/mgcp_stat.c +++ b/gtk/mgcp_stat.c @@ -39,7 +39,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include "../plugins/mgcp/packet-mgcp.h" @@ -326,9 +327,9 @@ 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_tap_listener_cmd_arg("mgcp,srt", gtk_mgcpstat_init); + register_stat_cmd_arg("mgcp,srt", gtk_mgcpstat_init); - register_tap_menu_item("MGCP...", REGISTER_TAP_GROUP_RESPONSE_TIME, + register_stat_menu_item("MGCP...", REGISTER_STAT_GROUP_RESPONSE_TIME, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(mgcp_srt_dlg)); } } diff --git a/gtk/mtp3_stat.c b/gtk/mtp3_stat.c index 398578997e..503c6b33c6 100644 --- a/gtk/mtp3_stat.c +++ b/gtk/mtp3_stat.c @@ -40,7 +40,8 @@ #include "epan/packet_info.h" #include "epan/epan.h" #include "epan/value_string.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "image/clist_ascend.xpm" #include "image/clist_descend.xpm" #include "simple_dialog.h" @@ -445,7 +446,7 @@ register_tap_listener_gtkmtp3_stat(void) GString *err_p; - register_tap_listener_cmd_arg("mtp3,", mtp3_stat_gtk_init); + register_stat_cmd_arg("mtp3,", mtp3_stat_gtk_init); memset((void *) &mtp3_stat, 0, sizeof(mtp3_stat_t)); @@ -463,6 +464,6 @@ register_tap_listener_gtkmtp3_stat(void) exit(1); } - register_tap_menu_item("MTP3/MSUs", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("MTP3/MSUs", REGISTER_STAT_GROUP_TELEPHONY, mtp3_stat_gtk_cb, NULL, NULL, NULL); } diff --git a/gtk/mtp3_summary.c b/gtk/mtp3_summary.c index 05b674c826..0de9494d6a 100644 --- a/gtk/mtp3_summary.c +++ b/gtk/mtp3_summary.c @@ -39,7 +39,7 @@ #include "epan/packet_info.h" #include "epan/epan.h" #include "epan/value_string.h" -#include "tap_menu.h" +#include "stat_menu.h" #include "globals.h" #include "file.h" #include "summary.h" @@ -430,6 +430,6 @@ mtp3_sum_gtk_sum_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_gtkmtp3_summary(void) { - register_tap_menu_item("MTP3/MSU Summary", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("MTP3/MSU Summary", REGISTER_STAT_GROUP_TELEPHONY, mtp3_sum_gtk_sum_cb, NULL, NULL, NULL); } diff --git a/gtk/rpc_progs.c b/gtk/rpc_progs.c index d335496b7c..bf85645e60 100644 --- a/gtk/rpc_progs.c +++ b/gtk/rpc_progs.c @@ -37,7 +37,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include @@ -418,8 +419,8 @@ gtk_rpcprogs_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_gtkrpcprogs(void) { - register_tap_listener_cmd_arg("rpc,programs", gtk_rpcprogs_init); + register_stat_cmd_arg("rpc,programs", gtk_rpcprogs_init); - register_tap_menu_item("ONC-RPC Programs", REGISTER_TAP_GROUP_NONE, + register_stat_menu_item("ONC-RPC Programs", REGISTER_STAT_GROUP_NONE, gtk_rpcprogs_cb, NULL, NULL, NULL); } diff --git a/gtk/rpc_stat.c b/gtk/rpc_stat.c index 88d26caac1..3e97ac2ce9 100644 --- a/gtk/rpc_stat.c +++ b/gtk/rpc_stat.c @@ -37,7 +37,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "simple_dialog.h" #include "ui_util.h" #include "dlg_utils.h" @@ -536,8 +537,8 @@ gtk_rpcstat_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_gtkrpcstat(void) { - register_tap_listener_cmd_arg("rpc,srt,", gtk_rpcstat_init); + register_stat_cmd_arg("rpc,srt,", gtk_rpcstat_init); - register_tap_menu_item("ONC-RPC...", REGISTER_TAP_GROUP_RESPONSE_TIME, + register_stat_menu_item("ONC-RPC...", REGISTER_STAT_GROUP_RESPONSE_TIME, gtk_rpcstat_cb, NULL, NULL, NULL); } diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c index 34c43a18ea..230a3f4a46 100644 --- a/gtk/rtp_analysis.c +++ b/gtk/rtp_analysis.c @@ -63,11 +63,12 @@ #include #include "gtkglobals.h" +#include "../stat.h" #include "dlg_utils.h" #include "ui_util.h" #include "alert_box.h" #include "simple_dialog.h" -#include "tap_menu.h" +#include "stat_menu.h" #include "main.h" #include "progress_dlg.h" #include "compat_macros.h" @@ -3650,8 +3651,8 @@ rtp_analysis_init(const char *dummy _U_) void register_tap_listener_rtp_analysis(void) { - register_tap_listener_cmd_arg("rtp", rtp_analysis_init); + register_stat_cmd_arg("rtp", rtp_analysis_init); - register_tap_menu_item("RTP/Stream Analysis...", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("RTP/Stream Analysis...", REGISTER_STAT_GROUP_TELEPHONY, rtp_analysis_cb, NULL, NULL, NULL); } diff --git a/gtk/rtp_stream.c b/gtk/rtp_stream.c index ea9cf6e164..91f5d40962 100644 --- a/gtk/rtp_stream.c +++ b/gtk/rtp_stream.c @@ -33,6 +33,7 @@ #include "rtp_stream_dlg.h" #include "globals.h" +#include "../stat.h" #include #include "register.h" @@ -438,7 +439,7 @@ register_tap_listener_rtp_stream(void) GString *error_string; if (!the_tapinfo_struct.is_registered) { - register_tap_listener_cmd_arg("rtp", rtpstream_init_tap); + register_stat_cmd_arg("rtp", rtpstream_init_tap); error_string = register_tap_listener("rtp", &the_tapinfo_struct, NULL, rtpstream_reset_cb, rtpstream_packet, diff --git a/gtk/rtp_stream_dlg.c b/gtk/rtp_stream_dlg.c index dbf17ae61a..548697eb4b 100644 --- a/gtk/rtp_stream_dlg.c +++ b/gtk/rtp_stream_dlg.c @@ -36,7 +36,7 @@ #include "globals.h" #include "epan/filesystem.h" -#include "tap_menu.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "ui_util.h" #include "compat_macros.h" @@ -884,6 +884,6 @@ void rtpstream_launch(GtkWidget *w _U_, gpointer data _U_) void register_tap_listener_rtp_stream_dlg(void) { - register_tap_menu_item("RTP/Show All Streams...", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("RTP/Show All Streams...", REGISTER_STAT_GROUP_TELEPHONY, rtpstream_launch, NULL, NULL, NULL); } diff --git a/gtk/sctp_assoc_analyse.c b/gtk/sctp_assoc_analyse.c index 15881c4634..2a0610c215 100644 --- a/gtk/sctp_assoc_analyse.c +++ b/gtk/sctp_assoc_analyse.c @@ -33,7 +33,7 @@ #include #include "epan/filesystem.h" #include "register.h" -#include "tap_menu.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "ui_util.h" #include "main.h" @@ -875,6 +875,6 @@ void sctp_analyse_start(GtkWidget *w _U_, gpointer data _U_) void register_tap_listener_sctp_analyse(void) { - register_tap_menu_item("SCTP/Analyse Association", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("SCTP/Analyse Association", REGISTER_STAT_GROUP_TELEPHONY, sctp_analyse_start, NULL, NULL, NULL); } diff --git a/gtk/sctp_byte_graph_dlg.c b/gtk/sctp_byte_graph_dlg.c index ade141718b..aaf60dc37c 100644 --- a/gtk/sctp_byte_graph_dlg.c +++ b/gtk/sctp_byte_graph_dlg.c @@ -35,7 +35,7 @@ #include "globals.h" #include "epan/filesystem.h" #include "../color.h" -#include "tap_menu.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "ui_util.h" #include "main.h" diff --git a/gtk/sctp_chunk_stat.c b/gtk/sctp_chunk_stat.c index 0f7e4268bb..0aed0e9c0f 100644 --- a/gtk/sctp_chunk_stat.c +++ b/gtk/sctp_chunk_stat.c @@ -40,7 +40,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../register.h" #include @@ -344,8 +345,8 @@ sctpstat_init(const char *optarg) void register_tap_listener_sctpstat(void) { - register_tap_listener_cmd_arg("sctp,stat", sctpstat_init); + register_stat_cmd_arg("sctp,stat", sctpstat_init); - register_tap_menu_item("SCTP/Chunk Counter", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("SCTP/Chunk Counter", REGISTER_STAT_GROUP_TELEPHONY, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(sctp_stat_dlg)); } diff --git a/gtk/sctp_chunk_stat_dlg.c b/gtk/sctp_chunk_stat_dlg.c index 2a4185be45..cea840b03c 100644 --- a/gtk/sctp_chunk_stat_dlg.c +++ b/gtk/sctp_chunk_stat_dlg.c @@ -35,7 +35,7 @@ #include "image/clist_ascend.xpm" #include "image/clist_descend.xpm" -#include "tap_menu.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "ui_util.h" #include "main.h" diff --git a/gtk/sctp_error_dlg.c b/gtk/sctp_error_dlg.c index 3b6a5b1a6d..e74c1af6f8 100644 --- a/gtk/sctp_error_dlg.c +++ b/gtk/sctp_error_dlg.c @@ -31,7 +31,7 @@ #include "globals.h" #include "epan/filesystem.h" #include "simple_dialog.h" -#include "tap_menu.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "ui_util.h" #include "main.h" diff --git a/gtk/sctp_graph_dlg.c b/gtk/sctp_graph_dlg.c index 6a5f9dad6d..e75df1f715 100644 --- a/gtk/sctp_graph_dlg.c +++ b/gtk/sctp_graph_dlg.c @@ -35,7 +35,7 @@ #include "globals.h" #include "epan/filesystem.h" #include "../color.h" -#include "tap_menu.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "ui_util.h" #include "main.h" diff --git a/gtk/sctp_stat.c b/gtk/sctp_stat.c index 3dbc2c89f2..45b2b57fa3 100644 --- a/gtk/sctp_stat.c +++ b/gtk/sctp_stat.c @@ -32,7 +32,8 @@ #include "globals.h" #include "epan/packet_info.h" /* Needed for packet_info */ #include /* Needed for register_tap_listener */ -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "compat_macros.h" #include "register.h" @@ -1463,7 +1464,7 @@ register_tap_listener_sctp_stat(void) if (!sctp_tapinfo_struct.is_registered) { - register_tap_listener_cmd_arg("sctp",gtk_sctpstat_init); + 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); diff --git a/gtk/sctp_stat_dlg.c b/gtk/sctp_stat_dlg.c index fad456fef8..23de118f72 100644 --- a/gtk/sctp_stat_dlg.c +++ b/gtk/sctp_stat_dlg.c @@ -35,7 +35,7 @@ #include "image/clist_ascend.xpm" #include "image/clist_descend.xpm" -#include "tap_menu.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "ui_util.h" #include "main.h" @@ -607,7 +607,7 @@ void sctp_stat_start(GtkWidget *w _U_, gpointer data _U_) void register_tap_listener_sctp_stat_dlg(void) { - register_tap_menu_item("SCTP/Show All Associations...", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("SCTP/Show All Associations...", REGISTER_STAT_GROUP_TELEPHONY, sctp_stat_start, NULL, NULL, NULL); } diff --git a/gtk/sip_stat.c b/gtk/sip_stat.c index cff8020079..d35ed5e890 100644 --- a/gtk/sip_stat.c +++ b/gtk/sip_stat.c @@ -34,7 +34,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "simple_dialog.h" #include "ui_util.h" #include "dlg_utils.h" @@ -662,8 +663,8 @@ static tap_dfilter_dlg sip_stat_dlg = { void register_tap_listener_gtksipstat(void) { - register_tap_listener_cmd_arg("sip,stat", gtk_sipstat_init); + register_stat_cmd_arg("sip,stat", gtk_sipstat_init); - register_tap_menu_item("SIP", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("SIP", REGISTER_STAT_GROUP_TELEPHONY, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(sip_stat_dlg)); } diff --git a/gtk/smb_stat.c b/gtk/smb_stat.c index 46fa1d7967..051f1fbb00 100644 --- a/gtk/smb_stat.c +++ b/gtk/smb_stat.c @@ -38,7 +38,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include #include "../smb.h" #include "../register.h" @@ -351,8 +352,8 @@ gtk_smbstat_cb(GtkWidget *w _U_, gpointer d _U_) void register_tap_listener_gtksmbstat(void) { - register_tap_listener_cmd_arg("smb,srt", gtk_smbstat_init); + register_stat_cmd_arg("smb,srt", gtk_smbstat_init); - register_tap_menu_item("SMB...", REGISTER_TAP_GROUP_RESPONSE_TIME, + register_stat_menu_item("SMB...", REGISTER_STAT_GROUP_RESPONSE_TIME, gtk_smbstat_cb, NULL, NULL, NULL); } diff --git a/gtk/stat_menu.h b/gtk/stat_menu.h new file mode 100644 index 0000000000..43329e8168 --- /dev/null +++ b/gtk/stat_menu.h @@ -0,0 +1,87 @@ +/* stat_menu.h + * Menu definitions for use by stats + * + * $Id$ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs + * 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 __GTKGUISTATMENU_H__ +#define __GTKGUISTATMENU_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** @file + * 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 + * be called from the routine that registers stats - we have to introduce + * another per-stat registration routine. + * + * @param name the menu label + * + * @param group the menu group this stat should be registered to + * + * @param callback gets called when the menu item is selected; it should do + * the work of creating the stat window. + * + * @param selected_packet_enabled gets called by set_menus_for_selected_packet(); + * it's passed a pointer to the "frame_data" structure for the current frame, + * if any, and to the "epan_dissect_t" structure for that frame, if any, and + * should return TRUE if the stat will work now (which might depend on whether + * a frame is selected and, if one is, on the frame) and FALSE if not. + * + * @param selected_tree_row_enabled gets called by + * set_menus_for_selected_tree_row(); it's passed a pointer to the + * "field_info" structure for the currently selected field, if any, + * and should return TRUE if the stat will work now (which might depend on + * whether a tree row is selected and, if one is, on the tree row) and + * FALSE if not. + * + * @param callback_data data for callback function + */ +extern void register_stat_menu_item( + const char *name, + REGISTER_STAT_GROUP_E group, + GtkItemFactoryCallback callback, + gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *), + gboolean (*selected_tree_row_enabled)(field_info *), + gpointer callback_data); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GTKGUISTATMENU_H__ */ diff --git a/gtk/stats_tree_stat.c b/gtk/stats_tree_stat.c index ebde04b424..dba134b93f 100644 --- a/gtk/stats_tree_stat.c +++ b/gtk/stats_tree_stat.c @@ -34,7 +34,8 @@ #include "simple_dialog.h" #include "globals.h" -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "ui_util.h" #include "dlg_utils.h" #include "compat_macros.h" @@ -370,7 +371,7 @@ static void register_gtk_stats_tree_tap (gpointer k _U_, gpointer v, gpointer p s = g_strdup_printf("%s,tree",cfg->abbr); - register_tap_listener_cmd_arg(s, init_gtk_tree); + register_stat_cmd_arg(s, init_gtk_tree); cfg->pr = g_malloc(sizeof(tree_pres)); @@ -381,7 +382,7 @@ 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_tap_menu_item(cfg->name, REGISTER_TAP_GROUP_NONE, + register_stat_menu_item(cfg->name, REGISTER_STAT_GROUP_NONE, gtk_tap_dfilter_dlg_cb, NULL, NULL, cfg->pr->stat_dlg); } diff --git a/gtk/tap_menu.h b/gtk/tap_menu.h deleted file mode 100644 index 3a7de2a08d..0000000000 --- a/gtk/tap_menu.h +++ /dev/null @@ -1,87 +0,0 @@ -/* tap_menu.h - * Menu definitions for use by taps - * - * $Id$ - * - * Ethereal - Network traffic analyzer - * By Gerald Combs - * 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 __GTKGUITAPMENU_H__ -#define __GTKGUITAPMENU_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** @file - * Add a new menu item for a tap. - */ - -/** The menu group this tap should be registered at. */ -typedef enum { - REGISTER_TAP_GROUP_NONE, - REGISTER_TAP_GROUP_GENERIC, - REGISTER_TAP_GROUP_CONVERSATION_LIST, - REGISTER_TAP_GROUP_ENDPOINT_LIST, - REGISTER_TAP_GROUP_RESPONSE_TIME, - REGISTER_TAP_GROUP_TELEPHONY - /* XXX - split into telephony and VoIP? */ -} REGISTER_TAP_GROUP_E; - -/** - * Add a new menu item for a tap. - * This must be called after we've created the main menu, so it can't - * be called from the routine that registers taps - we have to introduce - * another per-tap registration routine. - * - * @param name the menu label - * - * @param group the menu group, this tap should be registered to - * - * @param callback gets called when the menu item is selected; it should do - * the work of creating the tap window. - * - * @param selected_packet_enabled gets called by set_menus_for_selected_packet(); - * it's passed a pointer to the "frame_data" structure for the current frame, - * if any, and to the "epan_dissect_t" structure for that frame, if any, and - * should return TRUE if the tap will work now (which might depend on whether - * a frame is selected and, if one is, on the frame) and FALSE if not. - * - * @param selected_tree_row_enabled gets called by - * set_menus_for_selected_tree_row(); it's passed a pointer to the - * "field_info" structure for the currently selected field, if any, - * and should return TRUE if the tap will work now (which might depend on - * whether a tree row is selected and, if one is, on the tree row) and - * FALSE if not. - * - * @param callback_data data for callback function - */ -extern void register_tap_menu_item( - const char *name, - REGISTER_TAP_GROUP_E group, - GtkItemFactoryCallback callback, - gboolean (*selected_packet_enabled)(frame_data *, epan_dissect_t *), - gboolean (*selected_tree_row_enabled)(field_info *), - gpointer callback_data); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __GTKGUITAPMENU_H__ */ diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c index 480af52c1d..1b48d014c6 100644 --- a/gtk/tcp_graph.c +++ b/gtk/tcp_graph.c @@ -45,7 +45,7 @@ #include "ppptypes.h" #include "dlg_utils.h" #include -#include "tap_menu.h" +#include "stat_menu.h" #include "../epan/dissectors/packet-tcp.h" #include "../epan/address.h" #include "../epan/tap.h" @@ -4050,12 +4050,12 @@ gboolean tcp_graph_selected_packet_enabled(frame_data *current_frame, epan_disse void register_tap_listener_tcp_graph(void) { - register_tap_menu_item("TCP Stream Graph/Time-Sequence Graph (Stevens)", REGISTER_TAP_GROUP_NONE, + register_stat_menu_item("TCP Stream Graph/Time-Sequence Graph (Stevens)", REGISTER_STAT_GROUP_NONE, tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(0)); - register_tap_menu_item("TCP Stream Graph/Time-Sequence Graph (tcptrace)", REGISTER_TAP_GROUP_NONE, + register_stat_menu_item("TCP Stream Graph/Time-Sequence Graph (tcptrace)", REGISTER_STAT_GROUP_NONE, tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(1)); - register_tap_menu_item("TCP Stream Graph/Throughput Graph", REGISTER_TAP_GROUP_NONE, + register_stat_menu_item("TCP Stream Graph/Throughput Graph", REGISTER_STAT_GROUP_NONE, tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(2)); - register_tap_menu_item("TCP Stream Graph/Round Trip Time Graph", REGISTER_TAP_GROUP_NONE, + register_stat_menu_item("TCP Stream Graph/Round Trip Time Graph", REGISTER_STAT_GROUP_NONE, tcp_graph_cb, tcp_graph_selected_packet_enabled, NULL, GINT_TO_POINTER(3)); } diff --git a/gtk/voip_calls_dlg.c b/gtk/voip_calls_dlg.c index b77562ac06..7601e42d6d 100644 --- a/gtk/voip_calls_dlg.c +++ b/gtk/voip_calls_dlg.c @@ -50,7 +50,8 @@ #include "epan/filesystem.h" #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "dlg_utils.h" #include "ui_util.h" #include "compat_macros.h" @@ -809,8 +810,8 @@ void voip_calls_launch(GtkWidget *w _U_, gpointer data _U_) void register_tap_listener_voip_calls_dlg(void) { - register_tap_listener_cmd_arg("voip,calls",voip_calls_init_tap); - register_tap_menu_item("VoIP Calls...", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_cmd_arg("voip,calls",voip_calls_init_tap); + register_stat_menu_item("VoIP Calls...", REGISTER_STAT_GROUP_TELEPHONY, voip_calls_launch, NULL, NULL, NULL); } diff --git a/gtk/wsp_stat.c b/gtk/wsp_stat.c index d3e713c032..f41df5337a 100644 --- a/gtk/wsp_stat.c +++ b/gtk/wsp_stat.c @@ -34,7 +34,8 @@ #include #include -#include "tap_menu.h" +#include "../stat.h" +#include "stat_menu.h" #include "simple_dialog.h" #include "ui_util.h" #include "dlg_utils.h" @@ -425,8 +426,8 @@ static tap_dfilter_dlg wsp_stat_dlg = { void register_tap_listener_gtkwspstat(void) { - register_tap_listener_cmd_arg("wsp,stat", gtk_wspstat_init); + register_stat_cmd_arg("wsp,stat", gtk_wspstat_init); - register_tap_menu_item("WAP-WSP...", REGISTER_TAP_GROUP_TELEPHONY, + register_stat_menu_item("WAP-WSP...", REGISTER_STAT_GROUP_TELEPHONY, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(wsp_stat_dlg)); } diff --git a/stat.c b/stat.c new file mode 100644 index 0000000000..369d4207d5 --- /dev/null +++ b/stat.c @@ -0,0 +1,122 @@ +/* stat.c + * Routines to register "-z" command-line argument or Statistics menu item + * handlers + * + * $Id$ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs + * 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. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#include + +#include + +#include "stat.h" + +/* structure to keep track of what stats have registered command-line + arguments. + */ +typedef struct _stat_cmd_arg { + struct _stat_cmd_arg *next; + const char *cmd; + void (*func)(const char *arg); +} stat_cmd_arg; +static stat_cmd_arg *stat_cmd_arg_list=NULL; + +/* structure to keep track of what stats have been specified on the + command line. + */ +typedef struct { + stat_cmd_arg *sca; + char *arg; +} stat_requested; +static GSList *stats_requested = NULL; + +/* ********************************************************************** + * Function called from stat to register the stat's command-line argument + * and initialization routine + * ********************************************************************** */ +void +register_stat_cmd_arg(const char *cmd, void (*func)(const char *arg)) +{ + stat_cmd_arg *newsca; + + newsca=g_malloc(sizeof(stat_cmd_arg)); + newsca->next=stat_cmd_arg_list; + stat_cmd_arg_list=newsca; + newsca->cmd=cmd; + newsca->func=func; +} + +/* ********************************************************************** + * Function called for a stat command-line argument + * ********************************************************************** */ +gboolean +process_stat_cmd_arg(char *optarg) +{ + stat_cmd_arg *sca; + stat_requested *tr; + + for(sca=stat_cmd_arg_list;sca;sca=sca->next){ + if(!strncmp(sca->cmd,optarg,strlen(sca->cmd))){ + tr=g_malloc(sizeof (stat_requested)); + tr->sca = sca; + tr->arg=g_strdup(optarg); + stats_requested=g_slist_append(stats_requested, tr); + return TRUE; + } + } + return FALSE; +} + +/* ********************************************************************** + * Function to list all possible tap command-line arguments + * ********************************************************************** */ +void +list_stat_cmd_args(void) +{ + stat_cmd_arg *sca; + + for(sca=stat_cmd_arg_list;sca;sca=sca->next){ + fprintf(stderr," %s\n",sca->cmd); + } +} + +/* ********************************************************************** + * Function to process stats requested with command-line arguments + * ********************************************************************** */ +void +start_requested_stats(void) +{ + stat_requested *sr; + + while(stats_requested){ + sr=stats_requested->data; + (*sr->sca->func)(sr->arg); + g_free(sr->arg); + g_free(sr); + stats_requested=g_slist_remove(stats_requested, sr); + } +} diff --git a/stat.h b/stat.h new file mode 100644 index 0000000000..31f81b4611 --- /dev/null +++ b/stat.h @@ -0,0 +1,35 @@ +/* stat.h + * Declarations of routines to register "-z" command-line argument or + * Statistics menu item handlers + * + * $Id$ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs + * 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 _STAT_H_ +#define _STAT_H_ + +extern void register_stat_cmd_arg(const char *cmd, + void (*func)(const char *arg)); +extern gboolean process_stat_cmd_arg(char *optarg); +extern void list_stat_cmd_args(void); +extern void start_requested_stats(void); + +#endif diff --git a/tap-ansi_astat.c b/tap-ansi_astat.c index 34f6684091..83d9c320b5 100644 --- a/tap-ansi_astat.c +++ b/tap-ansi_astat.c @@ -44,6 +44,7 @@ #include #include #include +#include "stat.h" #include "register.h" @@ -162,5 +163,5 @@ ansi_a_stat_init(const char *optarg _U_) void register_tap_listener_ansi_astat(void) { - register_tap_listener_cmd_arg("ansi_a,", ansi_a_stat_init); + register_stat_cmd_arg("ansi_a,", ansi_a_stat_init); } diff --git a/tap-bootpstat.c b/tap-bootpstat.c index a7b08ec0c2..3d722bb125 100644 --- a/tap-bootpstat.c +++ b/tap-bootpstat.c @@ -27,11 +27,12 @@ #endif #include +#include #include "epan/packet_info.h" #include +#include "stat.h" #include "register.h" -#include typedef const char* bootp_info_value_t; @@ -181,6 +182,6 @@ dhcpstat_init(const char *optarg) void register_tap_listener_gtkdhcpstat(void) { - register_tap_listener_cmd_arg("bootp,stat,", dhcpstat_init); + register_stat_cmd_arg("bootp,stat,", dhcpstat_init); } diff --git a/tap-dcerpcstat.c b/tap-dcerpcstat.c index a3dce1e4da..18a2402447 100644 --- a/tap-dcerpcstat.c +++ b/tap-dcerpcstat.c @@ -36,6 +36,7 @@ #include "epan/packet_info.h" #include #include +#include "stat.h" #include "register.h" /* used to keep track of statistics for a specific procedure */ @@ -305,5 +306,5 @@ dcerpcstat_init(const char *optarg) void register_tap_listener_dcerpcstat(void) { - register_tap_listener_cmd_arg("dcerpc,rtt,", dcerpcstat_init); + register_stat_cmd_arg("dcerpc,rtt,", dcerpcstat_init); } diff --git a/tap-gsm_astat.c b/tap-gsm_astat.c index 0390e4e53d..d5096d47dc 100644 --- a/tap-gsm_astat.c +++ b/tap-gsm_astat.c @@ -44,6 +44,7 @@ #include #include #include +#include "stat.h" #include "register.h" @@ -297,5 +298,5 @@ gsm_a_stat_init(const char *optarg _U_) void register_tap_listener_gsm_astat(void) { - register_tap_listener_cmd_arg("gsm_a,", gsm_a_stat_init); + register_stat_cmd_arg("gsm_a,", gsm_a_stat_init); } diff --git a/tap-h225counter.c b/tap-h225counter.c index 90950ab509..a19f0b5c1f 100644 --- a/tap-h225counter.c +++ b/tap-h225counter.c @@ -37,6 +37,7 @@ #include "epan/packet_info.h" #include #include "epan/value_string.h" +#include "stat.h" #include "register.h" #include @@ -422,5 +423,5 @@ h225counter_init(const char *optarg) void register_tap_listener_h225counter(void) { - register_tap_listener_cmd_arg("h225,counter", h225counter_init); + register_stat_cmd_arg("h225,counter", h225counter_init); } diff --git a/tap-h225rassrt.c b/tap-h225rassrt.c index c4fc55c9fc..0bb9148fc7 100644 --- a/tap-h225rassrt.c +++ b/tap-h225rassrt.c @@ -37,6 +37,7 @@ #include "epan/packet_info.h" #include #include "epan/value_string.h" +#include "stat.h" #include "register.h" #include #include "timestats.h" @@ -246,5 +247,5 @@ h225rassrt_init(const char *optarg) void register_tap_listener_h225rassrt(void) { - register_tap_listener_cmd_arg("h225,srt", h225rassrt_init); + register_stat_cmd_arg("h225,srt", h225rassrt_init); } diff --git a/tap-httpstat.c b/tap-httpstat.c index 6d4db13063..8d48e84756 100644 --- a/tap-httpstat.c +++ b/tap-httpstat.c @@ -32,6 +32,7 @@ #include "epan/packet_info.h" #include "epan/value_string.h" #include +#include "stat.h" #include "register.h" #include @@ -325,5 +326,5 @@ gtk_httpstat_init(const char *optarg) void register_tap_listener_gtkhttpstat(void) { - register_tap_listener_cmd_arg("http,stat,", gtk_httpstat_init); + register_stat_cmd_arg("http,stat,", gtk_httpstat_init); } diff --git a/tap-iostat.c b/tap-iostat.c index c25f430108..b3a6061988 100644 --- a/tap-iostat.c +++ b/tap-iostat.c @@ -36,6 +36,7 @@ #include "epan/epan_dissect.h" #include "epan/packet_info.h" #include +#include "stat.h" #include "register.h" @@ -651,5 +652,5 @@ iostat_init(const char *optarg) void register_tap_listener_iostat(void) { - register_tap_listener_cmd_arg("io,stat,", iostat_init); + register_stat_cmd_arg("io,stat,", iostat_init); } diff --git a/tap-iousers.c b/tap-iousers.c index 8ae39be983..37169311f4 100644 --- a/tap-iousers.c +++ b/tap-iousers.c @@ -37,6 +37,7 @@ #include #include #include +#include "stat.h" #include "register.h" #include #include @@ -47,7 +48,6 @@ #include #include #include -#include typedef struct _io_users_t { const char *type; @@ -710,5 +710,5 @@ iousers_init(const char *optarg) void register_tap_listener_iousers(void) { - register_tap_listener_cmd_arg("conv,", iousers_init); + register_stat_cmd_arg("conv,", iousers_init); } diff --git a/tap-mgcpstat.c b/tap-mgcpstat.c index bb38620bb1..9f01a523f7 100644 --- a/tap-mgcpstat.c +++ b/tap-mgcpstat.c @@ -36,6 +36,7 @@ #include "epan/packet_info.h" #include #include "epan/value_string.h" +#include "stat.h" #include "register.h" #include "plugins/mgcp/packet-mgcp.h" #include "timestats.h" @@ -234,7 +235,7 @@ register_tap_listener_mgcpstat(void) { /* We don't register this tap, if we don't have the mgcp plugin loaded.*/ if (find_tap_id("mgcp")) { - register_tap_listener_cmd_arg("mgcp,rtd", mgcpstat_init); + register_stat_cmd_arg("mgcp,rtd", mgcpstat_init); } } diff --git a/tap-protocolinfo.c b/tap-protocolinfo.c index 8c66866b52..19d4cb0379 100644 --- a/tap-protocolinfo.c +++ b/tap-protocolinfo.c @@ -39,6 +39,7 @@ #include "epan/column-utils.h" #include "epan/proto.h" #include +#include "stat.h" #include "register.h" typedef struct _pci_t { @@ -142,6 +143,6 @@ protocolinfo_init(const char *optarg) void register_tap_listener_protocolinfo(void) { - register_tap_listener_cmd_arg("proto,colinfo,", protocolinfo_init); + register_stat_cmd_arg("proto,colinfo,", protocolinfo_init); } diff --git a/tap-protohierstat.c b/tap-protohierstat.c index ac3721a66d..81f1eda94f 100644 --- a/tap-protohierstat.c +++ b/tap-protohierstat.c @@ -39,6 +39,7 @@ #include "epan/epan_dissect.h" #include "epan/proto.h" #include +#include "stat.h" #include "register.h" typedef struct _phs_t { @@ -216,6 +217,6 @@ protohierstat_init(const char *optarg) void register_tap_listener_protohierstat(void) { - register_tap_listener_cmd_arg("io,phs", protohierstat_init); + register_stat_cmd_arg("io,phs", protohierstat_init); } diff --git a/tap-rpcprogs.c b/tap-rpcprogs.c index 9a1980e170..a7dc8d9dda 100644 --- a/tap-rpcprogs.c +++ b/tap-rpcprogs.c @@ -40,6 +40,7 @@ #include "epan/packet_info.h" #include #include +#include "stat.h" #include "register.h" /* used to keep track of statistics for a specific program/version */ @@ -242,7 +243,7 @@ rpcprogs_init(const char *optarg _U_) void register_tap_listener_rpcprogs(void) { - register_tap_listener_cmd_arg("rpc,programs", rpcprogs_init); + register_stat_cmd_arg("rpc,programs", rpcprogs_init); } diff --git a/tap-rpcstat.c b/tap-rpcstat.c index cfd4cc3827..171dc64f7e 100644 --- a/tap-rpcstat.c +++ b/tap-rpcstat.c @@ -42,6 +42,7 @@ #include "epan/packet_info.h" #include #include +#include "stat.h" #include "register.h" /* used to keep track of statistics for a specific procedure */ @@ -360,6 +361,6 @@ rpcstat_init(const char *optarg) void register_tap_listener_rpcstat(void) { - register_tap_listener_cmd_arg("rpc,rtt,", rpcstat_init); + register_stat_cmd_arg("rpc,rtt,", rpcstat_init); } diff --git a/tap-sctpchunkstat.c b/tap-sctpchunkstat.c index 5d60ccbab9..9fb7d114ae 100644 --- a/tap-sctpchunkstat.c +++ b/tap-sctpchunkstat.c @@ -38,6 +38,7 @@ #include "epan/addr_resolv.h" #include #include "epan/value_string.h" +#include "stat.h" #include "register.h" #include @@ -256,5 +257,5 @@ sctpstat_init(const char *optarg) void register_tap_listener_sctpstat(void) { - register_tap_listener_cmd_arg("sctp,stat", sctpstat_init); + register_stat_cmd_arg("sctp,stat", sctpstat_init); } diff --git a/tap-sipstat.c b/tap-sipstat.c index 190506a099..65f008502f 100644 --- a/tap-sipstat.c +++ b/tap-sipstat.c @@ -37,6 +37,7 @@ #include "epan/packet_info.h" #include #include "epan/value_string.h" +#include "stat.h" #include "register.h" #include @@ -390,5 +391,5 @@ sipstat_init(const char *optarg) void register_tap_listener_sipstat(void) { - register_tap_listener_cmd_arg("sip,stat", sipstat_init); + register_stat_cmd_arg("sip,stat", sipstat_init); } diff --git a/tap-smbsids.c b/tap-smbsids.c index 641140bffe..8da279bb55 100644 --- a/tap-smbsids.c +++ b/tap-smbsids.c @@ -35,6 +35,7 @@ #include #include "epan/packet_info.h" #include +#include "stat.h" #include "register.h" #include #include "epan/value_string.h" @@ -95,6 +96,6 @@ smbsids_init(const char *optarg _U_) void register_tap_listener_smbsids(void) { - register_tap_listener_cmd_arg("smb,sids", smbsids_init); + register_stat_cmd_arg("smb,sids", smbsids_init); } diff --git a/tap-smbstat.c b/tap-smbstat.c index 2c5aae3ddb..d63b9fb991 100644 --- a/tap-smbstat.c +++ b/tap-smbstat.c @@ -36,6 +36,7 @@ #include "epan/packet_info.h" #include #include "epan/value_string.h" +#include "stat.h" #include "smb.h" #include "register.h" #include "timestats.h" @@ -279,6 +280,6 @@ smbstat_init(const char *optarg) void register_tap_listener_smbstat(void) { - register_tap_listener_cmd_arg("smb,rtt", smbstat_init); + register_stat_cmd_arg("smb,rtt", smbstat_init); } diff --git a/tap-stats_tree.c b/tap-stats_tree.c index 9533ac533a..f126a38e82 100644 --- a/tap-stats_tree.c +++ b/tap-stats_tree.c @@ -31,6 +31,7 @@ #include #include #include +#include "stat.h" /* actually unused */ struct _st_node_pres { @@ -113,7 +114,7 @@ void register_stats_tree_tap (gpointer k _U_, gpointer v, gpointer p _U_) { cfg->pr = g_malloc(sizeof(tree_cfg_pres)); cfg->pr->init_string = g_strdup_printf("%s,tree",cfg->abbr); - register_tap_listener_cmd_arg(cfg->pr->init_string, init_stats_tree); + register_stat_cmd_arg(cfg->pr->init_string, init_stats_tree); } diff --git a/tap-wspstat.c b/tap-wspstat.c index d22610b35b..a5d744e9c9 100644 --- a/tap-wspstat.c +++ b/tap-wspstat.c @@ -40,6 +40,7 @@ #include #include "epan/packet_info.h" #include +#include "stat.h" #include "register.h" #include "epan/value_string.h" #include @@ -280,5 +281,5 @@ wspstat_init(const char *optarg) void register_tap_listener_wspstat(void) { - register_tap_listener_cmd_arg("wsp,stat,", wspstat_init); + register_stat_cmd_arg("wsp,stat,", wspstat_init); } diff --git a/tap_dfilter_dlg.h b/tap_dfilter_dlg.h index afd7e47c03..a4f0166c84 100644 --- a/tap_dfilter_dlg.h +++ b/tap_dfilter_dlg.h @@ -36,7 +36,7 @@ * on the start button in the display filter dialog. * 4) the index with "-1" * - * Within register_tap_menu_yourtap(void), call register_tap_menu_item() with gtk_tap_dfilter_dlg_cb as callback and a pointer + * Within register_tap_menu_yourtap(void), call register_stat_menu_item() with gtk_tap_dfilter_dlg_cb as callback and a pointer * to the global tap_dfilter_dlg structure . * * Usage: @@ -44,7 +44,7 @@ * tap_dfilter_dlg my_tap_dfilter_dlg = {"My Title", "myproto,mytap", gtk_mytap_init, -1}; * * register_tap_menu_mytap(void) { - * register_tap_menu_item(char *menu_string, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(my_tap_dfilter_dlg)); + * register_stat_menu_item(char *menu_string, gtk_tap_dfilter_dlg_cb, NULL, NULL, &(my_tap_dfilter_dlg)); * } * * See also: h225_ras_srt.c or h225_counter.c diff --git a/tethereal.c b/tethereal.c index ec69777f28..028d85479b 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1009,15 +1009,15 @@ main(int argc, char *argv[]) print_hex = TRUE; break; case 'z': - /* We won't call the init function for the tap this soon + /* We won't call the init function for the stat this soon as it would disallow MATE's fields (which are registered by the preferences set callback) from being used as part of a tap filter. Instead, we just add the argument - to a list of tap arguments. */ - if (!process_tap_cmd_arg(optarg)) { + to a list of stat arguments. */ + if (!process_stat_cmd_arg(optarg)) { fprintf(stderr,"tethereal: invalid -z argument.\n"); fprintf(stderr," -z argument must be one of :\n"); - list_tap_cmd_args(); + list_stat_cmd_args(); exit(1); } break; @@ -1196,9 +1196,9 @@ main(int argc, char *argv[]) prefs_apply_all(); /* At this point MATE will have registered its field array so we can - have a filter with one of MATE's late-registered fields as part - of the tap's filter. We can now process all the "-z" arguments. */ - start_requested_taps(); + have a tap filter with one of MATE's late-registered fields as part + of the filter. We can now process all the "-z" arguments. */ + start_requested_stats(); /* disabled protocols as per configuration file */ if (gdp_path == NULL && dp_path == NULL) { -- cgit v1.2.3