From 7d1a86d8c4023ba53ddf410e5820f22c8724d906 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Thu, 2 Jul 2015 00:02:16 -0400 Subject: Have RPC dissector use real dissector tables for its subdissectors instead of a "homegrown" method. Change-Id: I06d7d4e9747ed8593cf40506cae3a09ae237846b Reviewed-on: https://code.wireshark.org/review/9456 Petri-Dish: Michael Mann Reviewed-by: Anders Broman --- ui/gtk/rpc_stat.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/gtk/rpc_stat.c b/ui/gtk/rpc_stat.c index 386e9fbc28..316a1342d5 100644 --- a/ui/gtk/rpc_stat.c +++ b/ui/gtk/rpc_stat.c @@ -120,7 +120,7 @@ static gint32 rpc_min_proc=-1; static gint32 rpc_max_proc=-1; static void -rpcstat_find_procs(gpointer *key, gpointer *value _U_, gpointer *user_data _U_) +rpcstat_find_procs(const gchar *table_name _U_, ftenum_t selector_type _U_, gpointer key, gpointer value _U_, gpointer user_data _U_) { rpc_proc_info_key *k=(rpc_proc_info_key *)key; @@ -145,7 +145,7 @@ rpcstat_find_procs(gpointer *key, gpointer *value _U_, gpointer *user_data _U_) } static void -rpcstat_find_vers(gpointer *key, gpointer *value _U_, gpointer *user_data _U_) +rpcstat_find_vers(const gchar *table_name _U_, ftenum_t selector_type _U_, gpointer key, gpointer value _U_, gpointer user_data _U_) { rpc_proc_info_key *k=(rpc_proc_info_key *)key; @@ -235,7 +235,10 @@ gtk_rpcstat_init(const char *opt_arg, void* userdata _U_) rpc_min_proc=-1; rpc_max_proc=-1; - g_hash_table_foreach(rpc_procs, (GHFunc)rpcstat_find_procs, NULL); + + /* Need to run over both dissector tables */ + dissector_table_foreach ("rpc.call", rpcstat_find_procs, NULL); + dissector_table_foreach ("rpc.reply", rpcstat_find_procs, NULL); /* We must display TOP LEVEL Widget before calling init_gtk_srt_table() */ gtk_widget_show_all(rs->gtk_data.win); @@ -341,7 +344,8 @@ rpcstat_program_select(GtkWidget *prog_combo_box, gpointer user_data) ws_combo_box_clear_text_and_pointer(GTK_COMBO_BOX(vers_combo_box)); rpc_min_vers=-1; rpc_max_vers=-1; - g_hash_table_foreach(rpc_procs, (GHFunc)rpcstat_find_vers, NULL); + dissector_table_foreach ("rpc.call", rpcstat_find_vers, NULL); + dissector_table_foreach ("rpc.reply", rpcstat_find_vers, NULL); for(i=rpc_min_vers;i<=rpc_max_vers;i++){ char vs[5]; g_snprintf(vs, sizeof(vs), "%d",i); -- cgit v1.2.3