forked from osmocom/wireshark
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>
This commit is contained in:
parent
c1f30471ca
commit
84110d2981
|
@ -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,6 +181,21 @@ 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);
|
||||
}
|
||||
|
||||
void conversation_table_set_gui_info(conv_gui_init_cb init_cb)
|
||||
{
|
||||
g_slist_foreach(registered_ct_tables, set_conv_gui_data, 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));
|
||||
|
@ -187,26 +210,6 @@ register_conversation_table(const int proto_id, gboolean hide_ports, tap_packet_
|
|||
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)
|
||||
{
|
||||
g_slist_foreach(registered_ct_tables, set_conv_gui_data, init_cb);
|
||||
}
|
||||
|
||||
static void
|
||||
set_host_gui_data(gpointer data, gpointer user_data)
|
||||
{
|
||||
register_ct_t *table = (register_ct_t*)data;
|
||||
table->host_gui_init = (host_gui_init_cb)user_data;
|
||||
}
|
||||
|
||||
void hostlist_table_set_gui_info(host_gui_init_cb init_cb)
|
||||
{
|
||||
g_slist_foreach(registered_ct_tables, set_host_gui_data, init_cb);
|
||||
|
|
2
tshark.c
2
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,
|
||||
|
|
Loading…
Reference in New Issue