tshark: endpoints statistics are not supported for now, do not list them in -z
authorPascal Quantin <pascal.quantin@gmail.com>
Tue, 30 Dec 2014 22:46:24 +0000 (23:46 +0100)
committerMichael Mann <mmann78@netscape.net>
Wed, 31 Dec 2014 04:24:18 +0000 (04:24 +0000)
Move statistics registration to "GUI" callback registration

Change-Id: Id27c049dc8f91d311e9231342ae40749ca0ff5fc
Reviewed-on: https://code.wireshark.org/review/6151
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
epan/conversation_table.c
tshark.c

index ddcd9940b90cbaaa082d18f9e184dfc99355f720..bdc5247bcfeb4289dd4d5f9cf8c540e57062915f 100644 (file)
@@ -146,9 +146,6 @@ void
 register_conversation_table(const int proto_id, gboolean hide_ports, tap_packet_cb conv_packet_func, tap_packet_cb hostlist_func, host_tap_prefix prefix_func)
 {
     register_ct_t *table;
-    GString *conv_cmd_str = g_string_new("conv,");
-    GString *host_cmd_str = g_string_new("");
-    stat_tap_ui ui_info;
 
     table = g_new(register_ct_t,1);
 
@@ -161,6 +158,17 @@ register_conversation_table(const int proto_id, gboolean hide_ports, tap_packet_
     table->prefix_func   = prefix_func;
 
     registered_ct_tables = g_slist_insert_sorted(registered_ct_tables, table, insert_sorted_by_table_name);
+}
+
+/* Set GUI fields for register_ct list */
+static void
+set_conv_gui_data(gpointer data, gpointer user_data)
+{
+    GString *conv_cmd_str = g_string_new("conv,");
+    stat_tap_ui ui_info;
+    register_ct_t *table = (register_ct_t*)data;
+
+    table->conv_gui_init = (conv_gui_init_cb)user_data;
 
     g_string_append(conv_cmd_str, proto_get_protocol_filter_name(table->proto_id));
     cmd_string_list_ = g_list_append(cmd_string_list_, conv_cmd_str->str);
@@ -173,26 +181,6 @@ register_conversation_table(const int proto_id, gboolean hide_ports, tap_packet_
     ui_info.params = NULL;
     register_stat_tap_ui(&ui_info, table);
     g_string_free(conv_cmd_str, FALSE);
-
-    g_string_printf(host_cmd_str, "%s,%s", (get_hostlist_prefix_func(table) != NULL) ? get_hostlist_prefix_func(table)() : "host",
-                    proto_get_protocol_filter_name(table->proto_id));
-    ui_info.group = REGISTER_STAT_GROUP_ENDPOINT_LIST;
-    ui_info.title = NULL;      /* construct this from the protocol info? */
-    ui_info.cli_string = host_cmd_str->str;
-    ui_info.tap_init_cb = dissector_hostlist_init;
-    ui_info.index = -1;
-    ui_info.nparams = 0;
-    ui_info.params = NULL;
-    register_stat_tap_ui(&ui_info, table);
-    g_string_free(host_cmd_str, FALSE);
-}
-
-/* Set GUI fields for register_ct list */
-static void
-set_conv_gui_data(gpointer data, gpointer user_data)
-{
-    register_ct_t *table = (register_ct_t*)data;
-    table->conv_gui_init = (conv_gui_init_cb)user_data;
 }
 
 void conversation_table_set_gui_info(conv_gui_init_cb init_cb)
@@ -203,8 +191,23 @@ void conversation_table_set_gui_info(conv_gui_init_cb init_cb)
 static void
 set_host_gui_data(gpointer data, gpointer user_data)
 {
+    GString *host_cmd_str = g_string_new("");
+    stat_tap_ui ui_info;
     register_ct_t *table = (register_ct_t*)data;
+
     table->host_gui_init = (host_gui_init_cb)user_data;
+
+    g_string_printf(host_cmd_str, "%s,%s", (get_hostlist_prefix_func(table) != NULL) ? get_hostlist_prefix_func(table)() : "host",
+                    proto_get_protocol_filter_name(table->proto_id));
+    ui_info.group = REGISTER_STAT_GROUP_ENDPOINT_LIST;
+    ui_info.title = NULL;      /* construct this from the protocol info? */
+    ui_info.cli_string = host_cmd_str->str;
+    ui_info.tap_init_cb = dissector_hostlist_init;
+    ui_info.index = -1;
+    ui_info.nparams = 0;
+    ui_info.params = NULL;
+    register_stat_tap_ui(&ui_info, table);
+    g_string_free(host_cmd_str, FALSE);
 }
 
 void hostlist_table_set_gui_info(host_gui_init_cb init_cb)
index a63a2585d33a5238eeffe452cfbc1c647aeae61c..c928ec0ef36524522d7c75e1f3b764a96e477255 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -1202,7 +1202,7 @@ main(int argc, char *argv[])
 #endif
   register_all_tap_listeners();
   conversation_table_set_gui_info(init_iousers);
-  hostlist_table_set_gui_info(NULL);  /* XXX - TODO: Provide "GUI" function for TShark */
+  /* hostlist_table_set_gui_info(NULL); XXX - TODO: Provide "GUI" function for TShark */
 
   /* If invoked with the "-G" flag, we dump out information based on
      the argument to the "-G" flag; if no argument is specified,