2005-02-16 14:16:40 +00:00
|
|
|
/* stats_tree_stat.c
|
|
|
|
* GTK Tap implementation of stats_tree
|
|
|
|
* 2005, Luis E. G. Ontanon
|
|
|
|
*
|
2005-02-20 17:43:38 +00:00
|
|
|
* $Id$
|
2005-02-16 14:16:40 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-02-16 14:16:40 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2008-08-05 17:33:14 +00:00
|
|
|
*
|
2005-02-16 14:16:40 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2008-08-05 17:33:14 +00:00
|
|
|
*
|
2005-02-16 14:16:40 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2008-08-05 17:33:14 +00:00
|
|
|
*
|
2005-02-16 14:16:40 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
#include <string.h>
|
2008-04-13 03:32:24 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include <epan/stats_tree_priv.h>
|
2005-08-25 15:48:28 +00:00
|
|
|
#include <epan/report_err.h>
|
2005-02-16 14:16:40 +00:00
|
|
|
|
2008-04-13 03:32:24 +00:00
|
|
|
#include "../simple_dialog.h"
|
|
|
|
#include "../globals.h"
|
2005-08-21 09:48:27 +00:00
|
|
|
#include "../stat_menu.h"
|
2008-04-13 03:32:24 +00:00
|
|
|
|
|
|
|
#include "gtk/gui_utils.h"
|
|
|
|
#include "gtk/dlg_utils.h"
|
|
|
|
#include "gtk/tap_dfilter_dlg.h"
|
2008-08-05 17:33:14 +00:00
|
|
|
#include "gtk/main.h"
|
2008-04-13 03:32:24 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
|
|
|
|
struct _st_node_pres {
|
|
|
|
GtkTreeIter* iter;
|
|
|
|
};
|
|
|
|
|
2005-03-20 00:19:15 +00:00
|
|
|
struct _tree_cfg_pres {
|
|
|
|
tap_dfilter_dlg* stat_dlg;
|
|
|
|
};
|
2005-02-16 14:16:40 +00:00
|
|
|
|
|
|
|
struct _tree_pres {
|
2005-03-20 11:39:14 +00:00
|
|
|
GString* text;
|
|
|
|
GtkWidget* win;
|
2005-02-16 14:16:40 +00:00
|
|
|
GtkTreeStore* store;
|
2005-03-20 11:39:14 +00:00
|
|
|
GtkWidget* tree;
|
2005-02-16 14:16:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* the columns of the tree pane */
|
|
|
|
enum _stat_tree_columns {
|
2005-03-20 11:39:14 +00:00
|
|
|
TITLE_COLUMN,
|
2005-02-16 14:16:40 +00:00
|
|
|
COUNT_COLUMN,
|
|
|
|
RATE_COLUMN,
|
|
|
|
PERCENT_COLUMN,
|
|
|
|
N_COLUMNS
|
|
|
|
};
|
|
|
|
|
|
|
|
/* used for converting numbers */
|
|
|
|
#define NUM_BUF_SIZE 32
|
|
|
|
|
|
|
|
/* creates the gtk representation for a stat_node
|
|
|
|
* node: the node
|
|
|
|
*/
|
2008-07-12 01:48:24 +00:00
|
|
|
static void
|
|
|
|
setup_gtk_node_pr(stat_node* node)
|
|
|
|
{
|
2005-02-16 14:16:40 +00:00
|
|
|
GtkTreeIter* parent = NULL;
|
2005-02-27 16:55:24 +00:00
|
|
|
|
2005-02-25 22:57:43 +00:00
|
|
|
node->pr = g_malloc(sizeof(st_node_pres));
|
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
if (node->st->pr->store) {
|
2005-02-27 16:55:24 +00:00
|
|
|
node->pr->iter = g_malloc0(sizeof(GtkTreeIter));
|
|
|
|
|
2005-03-20 11:39:14 +00:00
|
|
|
if ( node->parent && node->parent->pr ) {
|
|
|
|
parent = node->parent->pr->iter;
|
|
|
|
}
|
2005-02-16 14:16:40 +00:00
|
|
|
gtk_tree_store_append (node->st->pr->store, node->pr->iter, parent);
|
|
|
|
gtk_tree_store_set(node->st->pr->store, node->pr->iter, TITLE_COLUMN, node->name, RATE_COLUMN, "", COUNT_COLUMN, "", -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-12 01:48:24 +00:00
|
|
|
static void
|
|
|
|
draw_gtk_node(stat_node* node)
|
|
|
|
{
|
2005-02-16 14:16:40 +00:00
|
|
|
static gchar value[NUM_BUF_SIZE];
|
|
|
|
static gchar rate[NUM_BUF_SIZE];
|
|
|
|
static gchar percent[NUM_BUF_SIZE];
|
|
|
|
stat_node* child;
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2007-03-28 21:55:11 +00:00
|
|
|
stats_tree_get_strs_from_node(node, value, rate,
|
|
|
|
percent);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2006-03-30 20:29:36 +00:00
|
|
|
if (node->st->pr->store && node->pr->iter) {
|
2005-02-16 14:16:40 +00:00
|
|
|
gtk_tree_store_set(node->st->pr->store, node->pr->iter,
|
|
|
|
RATE_COLUMN, rate,
|
|
|
|
COUNT_COLUMN, value,
|
|
|
|
PERCENT_COLUMN, percent,
|
|
|
|
-1);
|
2005-02-20 17:43:38 +00:00
|
|
|
}
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
if (node->children) {
|
|
|
|
for (child = node->children; child; child = child->next )
|
|
|
|
draw_gtk_node(child);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-12 01:48:24 +00:00
|
|
|
static void
|
|
|
|
draw_gtk_tree(void *psp)
|
|
|
|
{
|
2005-02-16 14:16:40 +00:00
|
|
|
stats_tree *st = psp;
|
|
|
|
stat_node* child;
|
|
|
|
|
2005-02-27 16:55:24 +00:00
|
|
|
for (child = st->root.children; child; child = child->next ) {
|
2005-02-16 14:16:40 +00:00
|
|
|
draw_gtk_node(child);
|
2005-03-20 21:48:11 +00:00
|
|
|
|
2006-03-30 20:29:36 +00:00
|
|
|
if (child->pr->iter && st->pr->store) {
|
|
|
|
gtk_tree_view_expand_row(GTK_TREE_VIEW(st->pr->tree),
|
2005-03-20 21:48:11 +00:00
|
|
|
gtk_tree_model_get_path(GTK_TREE_MODEL(st->pr->store),
|
|
|
|
child->pr->iter),
|
|
|
|
FALSE);
|
2006-03-30 20:29:36 +00:00
|
|
|
}
|
2005-02-27 16:55:24 +00:00
|
|
|
}
|
2005-03-20 21:48:11 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|
|
|
|
|
2008-07-12 01:48:24 +00:00
|
|
|
static void
|
|
|
|
free_gtk_tree(GtkWindow *win _U_, stats_tree *st)
|
2005-02-16 14:16:40 +00:00
|
|
|
{
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
protect_thread_critical_region();
|
|
|
|
remove_tap_listener(st);
|
|
|
|
unprotect_thread_critical_region();
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-20 17:43:38 +00:00
|
|
|
if (st->root.pr)
|
|
|
|
st->root.pr->iter = NULL;
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2006-03-15 01:41:39 +00:00
|
|
|
st->cfg->in_use = FALSE;
|
2005-03-21 00:55:04 +00:00
|
|
|
stats_tree_free(st);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|
|
|
|
|
2008-07-12 01:48:24 +00:00
|
|
|
static void
|
|
|
|
clear_node_pr(stat_node* n)
|
|
|
|
{
|
2006-03-15 01:41:39 +00:00
|
|
|
stat_node* c;
|
|
|
|
for (c = n->children; c; c = c->next) {
|
|
|
|
clear_node_pr(c);
|
|
|
|
}
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2006-03-15 01:41:39 +00:00
|
|
|
if (n->pr->iter) {
|
|
|
|
gtk_tree_store_remove(n->st->pr->store, n->pr->iter);
|
|
|
|
n->pr->iter = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-12 01:48:24 +00:00
|
|
|
static void
|
|
|
|
reset_tap(void* p)
|
|
|
|
{
|
|
|
|
stats_tree* st = p;
|
2006-03-15 01:41:39 +00:00
|
|
|
stat_node* c;
|
|
|
|
for (c = st->root.children; c; c = c->next) {
|
|
|
|
clear_node_pr(c);
|
|
|
|
}
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2006-03-15 01:41:39 +00:00
|
|
|
st->cfg->init(st);
|
2005-09-22 17:01:06 +00:00
|
|
|
}
|
2005-02-16 14:16:40 +00:00
|
|
|
|
|
|
|
/* initializes the stats_tree window */
|
2008-07-12 01:48:24 +00:00
|
|
|
static void
|
|
|
|
init_gtk_tree(const char* optarg, void *userdata _U_)
|
|
|
|
{
|
|
|
|
gchar *abbr = stats_tree_get_abbr(optarg);
|
2005-02-16 14:16:40 +00:00
|
|
|
stats_tree* st = NULL;
|
2005-03-20 00:19:15 +00:00
|
|
|
stats_tree_cfg* cfg = NULL;
|
|
|
|
tree_pres* pr = g_malloc(sizeof(tree_pres));
|
2007-03-24 00:45:11 +00:00
|
|
|
gchar* title = NULL;
|
|
|
|
gchar* window_name = NULL;
|
2005-02-16 14:16:40 +00:00
|
|
|
GString* error_string;
|
2005-02-25 03:56:12 +00:00
|
|
|
GtkWidget *scr_win;
|
2009-04-16 03:18:10 +00:00
|
|
|
size_t init_strlen;
|
2005-03-20 11:39:14 +00:00
|
|
|
GtkWidget *main_vb, *bbox, *bt_close;
|
2005-02-16 14:16:40 +00:00
|
|
|
GtkTreeViewColumn* column;
|
|
|
|
GtkCellRenderer* renderer;
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
if (abbr) {
|
2005-03-21 00:55:04 +00:00
|
|
|
cfg = stats_tree_get_cfg_by_abbr(abbr);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2006-03-16 12:12:51 +00:00
|
|
|
if (cfg && cfg->in_use) {
|
2006-03-15 01:41:39 +00:00
|
|
|
/* XXX: ! */
|
|
|
|
report_failure("cannot open more than one tree of the same type at once");
|
|
|
|
return;
|
|
|
|
}
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-03-20 00:19:15 +00:00
|
|
|
if (cfg != NULL) {
|
|
|
|
init_strlen = strlen(cfg->pr->stat_dlg->init_string);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-03-20 00:19:15 +00:00
|
|
|
if (strncmp (optarg, cfg->pr->stat_dlg->init_string, init_strlen) == 0){
|
2005-02-27 16:55:24 +00:00
|
|
|
if (init_strlen == strlen(optarg)) {
|
2005-03-21 00:55:04 +00:00
|
|
|
st = stats_tree_new(cfg,pr,NULL);
|
2008-08-05 17:33:14 +00:00
|
|
|
} else {
|
2007-03-28 21:55:11 +00:00
|
|
|
st = stats_tree_new(cfg,pr,(char*)optarg+init_strlen+1);
|
2005-02-27 16:55:24 +00:00
|
|
|
}
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
} else {
|
2005-03-21 00:55:04 +00:00
|
|
|
st = stats_tree_new(cfg,pr,NULL);
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|
|
|
|
} else {
|
2005-09-15 19:26:05 +00:00
|
|
|
report_failure("no such stats_tree (%s) in stats_tree registry",abbr);
|
|
|
|
g_free(abbr);
|
|
|
|
return;
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|
2005-02-24 22:02:31 +00:00
|
|
|
g_free(abbr);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
} else {
|
2005-09-15 19:26:05 +00:00
|
|
|
report_failure("could not obtain stats_tree abbr from optarg");
|
|
|
|
g_free(pr);
|
|
|
|
return;
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|
2005-03-20 00:19:15 +00:00
|
|
|
|
2006-03-15 01:41:39 +00:00
|
|
|
cfg->in_use = TRUE;
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-03-20 00:19:15 +00:00
|
|
|
window_name = g_strdup_printf("%s Stats Tree", cfg->name);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
st->pr->win = window_new_with_geom(GTK_WINDOW_TOPLEVEL,window_name,window_name);
|
2005-03-19 16:43:30 +00:00
|
|
|
gtk_window_set_default_size(GTK_WINDOW(st->pr->win), 400, 400);
|
2005-02-16 14:16:40 +00:00
|
|
|
g_free(window_name);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
if(st->filter){
|
2005-03-20 00:19:15 +00:00
|
|
|
title=g_strdup_printf("%s with filter: %s",cfg->name,st->filter);
|
2005-02-16 14:16:40 +00:00
|
|
|
} else {
|
|
|
|
st->filter=NULL;
|
2005-03-20 00:19:15 +00:00
|
|
|
title=g_strdup_printf("%s", cfg->name);
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-03-20 11:39:14 +00:00
|
|
|
gtk_window_set_title(GTK_WINDOW(st->pr->win), title);
|
2005-02-16 14:16:40 +00:00
|
|
|
g_free(title);
|
2005-02-25 03:56:12 +00:00
|
|
|
|
2005-03-19 16:43:30 +00:00
|
|
|
main_vb = gtk_vbox_new(FALSE, 3);
|
2008-06-29 15:51:43 +00:00
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 12);
|
2005-03-19 16:43:30 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(st->pr->win), main_vb);
|
|
|
|
|
2005-03-20 11:39:14 +00:00
|
|
|
scr_win = scrolled_window_new(NULL, NULL);
|
2005-02-25 03:56:12 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
st->pr->store = gtk_tree_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
|
|
|
|
G_TYPE_STRING, G_TYPE_STRING);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
st->pr->tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (st->pr->store));
|
2008-01-31 16:37:56 +00:00
|
|
|
g_object_unref(G_OBJECT(st->pr->store));
|
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
gtk_container_add( GTK_CONTAINER(scr_win), st->pr->tree);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
/* the columns */
|
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2005-03-19 18:13:09 +00:00
|
|
|
column = gtk_tree_view_column_new_with_attributes ("Topic / Item", renderer,
|
2005-02-16 14:16:40 +00:00
|
|
|
"text", TITLE_COLUMN,
|
|
|
|
NULL);
|
|
|
|
gtk_tree_view_column_set_resizable (column,TRUE);
|
|
|
|
gtk_tree_view_column_set_sizing(column,GTK_TREE_VIEW_COLUMN_AUTOSIZE);
|
|
|
|
gtk_tree_view_append_column (GTK_TREE_VIEW (st->pr->tree), column);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2005-03-19 18:13:09 +00:00
|
|
|
column = gtk_tree_view_column_new_with_attributes ("Count", renderer,
|
2005-02-16 14:16:40 +00:00
|
|
|
"text", COUNT_COLUMN,
|
|
|
|
NULL);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
gtk_tree_view_column_set_resizable (column,TRUE);
|
|
|
|
gtk_tree_view_column_set_sizing(column,GTK_TREE_VIEW_COLUMN_AUTOSIZE);
|
|
|
|
gtk_tree_view_append_column (GTK_TREE_VIEW (st->pr->tree), column);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2005-03-19 18:13:09 +00:00
|
|
|
column = gtk_tree_view_column_new_with_attributes ("Rate", renderer,
|
2005-02-16 14:16:40 +00:00
|
|
|
"text", RATE_COLUMN,
|
|
|
|
NULL);
|
|
|
|
gtk_tree_view_column_set_resizable (column,TRUE);
|
|
|
|
gtk_tree_view_column_set_sizing(column,GTK_TREE_VIEW_COLUMN_AUTOSIZE);
|
|
|
|
gtk_tree_view_append_column (GTK_TREE_VIEW (st->pr->tree), column);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2005-03-19 18:13:09 +00:00
|
|
|
column = gtk_tree_view_column_new_with_attributes ("Percent", renderer,
|
2005-02-16 14:16:40 +00:00
|
|
|
"text", PERCENT_COLUMN,
|
|
|
|
NULL);
|
|
|
|
gtk_tree_view_column_set_resizable(column,TRUE);
|
|
|
|
gtk_tree_view_column_set_sizing(column,GTK_TREE_VIEW_COLUMN_AUTOSIZE);
|
|
|
|
gtk_tree_view_append_column (GTK_TREE_VIEW (st->pr->tree), column);
|
2005-03-20 11:39:14 +00:00
|
|
|
|
|
|
|
gtk_container_add( GTK_CONTAINER(main_vb), scr_win);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2007-03-28 21:55:11 +00:00
|
|
|
error_string = register_tap_listener( cfg->tapname,
|
2007-03-24 00:45:11 +00:00
|
|
|
st,
|
|
|
|
st->filter,
|
2009-06-05 22:42:47 +00:00
|
|
|
cfg->flags,
|
2007-03-24 00:45:11 +00:00
|
|
|
reset_tap,
|
|
|
|
stats_tree_packet,
|
|
|
|
draw_gtk_tree);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
if (error_string) {
|
|
|
|
/* error, we failed to attach to the tap. clean up */
|
2008-10-31 09:53:56 +00:00
|
|
|
simple_dialog( ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str );
|
2005-02-16 14:16:40 +00:00
|
|
|
/* destroy_stat_tree_window(st); */
|
2005-08-25 15:48:28 +00:00
|
|
|
report_failure("stats_tree for: %s failed to attach to the tap: %s",cfg->name,error_string->str);
|
2005-02-20 17:43:38 +00:00
|
|
|
g_string_free(error_string, TRUE);
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-03-19 16:43:30 +00:00
|
|
|
/* Button row. */
|
2005-03-20 11:39:14 +00:00
|
|
|
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
|
|
|
|
gtk_box_pack_start(GTK_BOX(main_vb), bbox, FALSE, FALSE, 0);
|
2005-03-19 16:43:30 +00:00
|
|
|
|
2008-04-11 17:26:09 +00:00
|
|
|
bt_close = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
|
2005-03-20 11:39:14 +00:00
|
|
|
window_set_cancel_button(st->pr->win, bt_close, window_cancel_button_cb);
|
2005-03-19 16:43:30 +00:00
|
|
|
|
2008-04-11 23:16:06 +00:00
|
|
|
g_signal_connect(GTK_WINDOW(st->pr->win), "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
|
|
|
|
g_signal_connect(GTK_WINDOW(st->pr->win), "destroy", G_CALLBACK(free_gtk_tree), st);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
gtk_widget_show_all(st->pr->win);
|
|
|
|
window_present(st->pr->win);
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2009-06-05 22:42:47 +00:00
|
|
|
cf_retap_packets(&cfile);
|
2008-10-13 17:38:28 +00:00
|
|
|
gdk_window_raise(st->pr->win->window);
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-12 01:48:24 +00:00
|
|
|
static void
|
|
|
|
register_gtk_stats_tree_tap (gpointer k _U_, gpointer v, gpointer p _U_)
|
|
|
|
{
|
2005-03-20 00:19:15 +00:00
|
|
|
stats_tree_cfg* cfg = v;
|
2005-02-16 14:16:40 +00:00
|
|
|
|
2005-03-20 00:19:15 +00:00
|
|
|
cfg->pr = g_malloc(sizeof(tree_pres));
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-03-20 00:19:15 +00:00
|
|
|
cfg->pr->stat_dlg = g_malloc(sizeof(tap_dfilter_dlg));
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-03-20 00:19:15 +00:00
|
|
|
cfg->pr->stat_dlg->win_title = g_strdup_printf("%s Stats Tree",cfg->name);
|
|
|
|
cfg->pr->stat_dlg->init_string = g_strdup_printf("%s,tree",cfg->abbr);
|
|
|
|
cfg->pr->stat_dlg->tap_init_cb = init_gtk_tree;
|
|
|
|
cfg->pr->stat_dlg->index = -1;
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2009-02-10 03:54:55 +00:00
|
|
|
register_dfilter_stat(cfg->pr->stat_dlg, cfg->name, cfg->stat_group);
|
2005-03-20 00:19:15 +00:00
|
|
|
}
|
|
|
|
|
2008-07-12 01:48:24 +00:00
|
|
|
static void
|
|
|
|
free_tree_presentation(stats_tree* st)
|
|
|
|
{
|
2005-03-20 00:19:15 +00:00
|
|
|
g_free(st->pr);
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
register_tap_listener_stats_tree_stat(void)
|
2005-02-28 01:20:52 +00:00
|
|
|
{
|
2008-08-05 17:33:14 +00:00
|
|
|
|
2005-02-16 14:16:40 +00:00
|
|
|
stats_tree_presentation(register_gtk_stats_tree_tap,
|
2005-09-22 17:01:06 +00:00
|
|
|
setup_gtk_node_pr,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2005-02-27 16:55:24 +00:00
|
|
|
NULL,
|
2005-09-22 17:01:06 +00:00
|
|
|
NULL,
|
|
|
|
free_tree_presentation,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL);
|
2005-02-16 14:16:40 +00:00
|
|
|
}
|