/* Walk all dissector tables calling a user supplied function on each table.  */
void dissector_all_tables_foreach_table(DATFunc_table func, gpointer user_data, GCompareFunc compare_key_func)
/* Walk all dissector tables calling a user supplied function on each table.  */
void dissector_all_tables_foreach_table(DATFunc_table func, gpointer user_data, GCompareFunc compare_key_func)
{
	dissector_foreach_table_info_t info;
	GList *list;
	info.caller_data = user_data;
	info.caller_func = func;
	if (compare_key_func != NULL)
	{
		list = g_hash_table_get_keys(dissector_tables);
		list = g_list_sort(list, compare_key_func);
		g_list_foreach(list, dissector_all_tables_foreach_list_func, &info);
		g_list_free(list);
	}
	else
	{
		g_hash_table_foreach(dissector_tables, dissector_all_tables_foreach_table_func, &info);
	}
}