aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-12-30 23:46:24 +0100
committerMichael Mann <mmann78@netscape.net>2014-12-31 04:24:18 +0000
commit84110d2981fbc017ef3771e8c051054b6546bc1f (patch)
tree3e5c71e9a10795434a108b98f5004ffceee6d774
parentc1f30471caebea3e7954cc4fbf876b2eae1045e4 (diff)
tshark: endpoints statistics are not supported for now, do not list them in -z
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>
-rw-r--r--epan/conversation_table.c49
-rw-r--r--tshark.c2
2 files changed, 27 insertions, 24 deletions
diff --git a/epan/conversation_table.c b/epan/conversation_table.c
index ddcd9940b9..bdc5247bcf 100644
--- a/epan/conversation_table.c
+++ b/epan/conversation_table.c
@@ -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)
diff --git a/tshark.c b/tshark.c
index a63a2585d3..c928ec0ef3 100644
--- 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,