/* insert a new link */ void links_catalog_insert(link_t *new_link) { g_assert(all_links); g_assert(new_link); g_tree_insert (all_links, &new_link->link_id, new_link); if (DEBUG_ENABLED) { gchar *str = link_id_node_names(&new_link->link_id); g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, _("New link: %s. Number of links %d"), str, links_catalog_size()); g_free(str); } }
void dump_stats(guint32 diff_msecs) { gchar *status_string; long ipc=ipcache_active_entries(); status_string = g_strdup_printf ( _("Nodes: %d (on canvas: %d, shown: %u), Links: %d, Conversations: %ld, " "names %ld, protocols %ld. Total Packets seen: %lu (in memory: %ld, " "on list %ld). IP cache entries %ld. Canvas objs: %ld. Refreshed: %u ms"), node_count(), g_tree_nnodes(canvas_nodes), displayed_nodes, links_catalog_size(), active_conversations(), active_names(), protocol_summary_size(), appdata.n_packets, appdata.total_mem_packets, packet_list_item_count(), ipc, canvas_obj_count, (unsigned int) diff_msecs); g_my_info ("%s", status_string); g_free(status_string); }
/* Calls update_link for every link. This is actually a function that shouldn't be called often, because it might take a very long time to complete */ void links_catalog_update_all(void) { GList *delete_list = NULL; if (!all_links) return; /* we can't delete links while traversing the catalog, so while updating links * we fill a list with the expired link_id's */ links_catalog_foreach((GTraverseFunc) update_link, &delete_list); /* after, remove all links on the list from catalog * WARNING: after this call, the list items are also destroyed */ g_list_foreach(delete_list, gfunc_remove_link, NULL); /* free the list - list items are already destroyed */ g_list_free(delete_list); g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, _("Updated links. Active links %d"), links_catalog_size()); }