2003-12-12 19:55:28 +00:00
|
|
|
/* ansi_map_stat.c
|
|
|
|
*
|
|
|
|
* Copyright 2003, Michael Lum <mlum [AT] telostech.com>
|
|
|
|
* In association with Telos Technology Inc.
|
|
|
|
*
|
|
|
|
* MUCH code modified from service_response_time_table.c.
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2003-12-12 19:55:28 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2003-12-12 19:55:28 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2003-12-12 19:55:28 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This TAP provides statistics for ANSI MAP:
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2008-04-13 00:55:59 +00:00
|
|
|
#include <epan/packet_info.h>
|
|
|
|
#include <epan/epan.h>
|
|
|
|
#include <epan/value_string.h>
|
2005-08-20 20:06:05 +00:00
|
|
|
#include <epan/stat_cmd_args.h>
|
2004-09-29 00:06:36 +00:00
|
|
|
#include <epan/tap.h>
|
2008-04-13 00:55:59 +00:00
|
|
|
#include <epan/dissectors/packet-ansi_map.h>
|
|
|
|
|
|
|
|
#include "../stat_menu.h"
|
2012-01-16 01:07:52 +00:00
|
|
|
|
|
|
|
#include "ui/simple_dialog.h"
|
2008-04-13 00:55:59 +00:00
|
|
|
|
2012-01-15 21:59:11 +00:00
|
|
|
#include "ui/gtk/gui_stat_menu.h"
|
|
|
|
#include "ui/gtk/dlg_utils.h"
|
|
|
|
#include "ui/gtk/filter_dlg.h"
|
|
|
|
#include "ui/gtk/gui_utils.h"
|
2008-04-13 00:55:59 +00:00
|
|
|
|
2012-01-15 21:59:11 +00:00
|
|
|
#include "ui/gtk/old-gtk-compat.h"
|
2011-07-21 20:12:08 +00:00
|
|
|
|
2009-03-16 18:01:25 +00:00
|
|
|
enum
|
|
|
|
{
|
2010-07-26 16:11:56 +00:00
|
|
|
OP_CODE_COLUMN,
|
|
|
|
OP_CODE_NAME_COLUMN,
|
|
|
|
COUNT_COLUMN,
|
|
|
|
TOT_BYTES_COLUMN,
|
|
|
|
AVG_BYTES_COLUMN,
|
|
|
|
N_COLUMN /* The number of columns */
|
2004-04-21 05:53:59 +00:00
|
|
|
};
|
|
|
|
|
2003-12-12 19:55:28 +00:00
|
|
|
typedef struct _ansi_map_stat_dlg_t {
|
2010-07-26 16:11:56 +00:00
|
|
|
GtkWidget *win;
|
|
|
|
GtkWidget *scrolled_win;
|
|
|
|
GtkWidget *table;
|
2003-12-12 19:55:28 +00:00
|
|
|
} ansi_map_stat_dlg_t;
|
|
|
|
|
|
|
|
typedef struct _ansi_map_stat_t {
|
2010-07-26 16:11:56 +00:00
|
|
|
int message_type[ANSI_MAP_MAX_NUM_MESSAGE_TYPES];
|
|
|
|
double size[ANSI_MAP_MAX_NUM_MESSAGE_TYPES];
|
2003-12-12 19:55:28 +00:00
|
|
|
} ansi_map_stat_t;
|
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
static ansi_map_stat_dlg_t dlg;
|
|
|
|
static ansi_map_stat_t ansi_a_stat;
|
2003-12-12 19:55:28 +00:00
|
|
|
|
2009-03-16 18:01:25 +00:00
|
|
|
/* Create list */
|
|
|
|
static
|
2009-05-08 15:16:07 +00:00
|
|
|
GtkWidget* create_list(void)
|
2009-03-16 18:01:25 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
GtkListStore *list_store;
|
|
|
|
GtkWidget *list;
|
|
|
|
GtkTreeViewColumn *column;
|
|
|
|
GtkCellRenderer *renderer;
|
|
|
|
GtkTreeSortable *sortable;
|
2010-07-26 16:11:56 +00:00
|
|
|
GtkTreeView *list_view;
|
|
|
|
GtkTreeSelection *selection;
|
2009-03-16 18:01:25 +00:00
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
/* Create the store */
|
|
|
|
list_store = gtk_list_store_new(N_COLUMN, /* Total number of columns XXX*/
|
|
|
|
G_TYPE_UINT, /* Op Code */
|
|
|
|
G_TYPE_STRING, /* Operation Name */
|
|
|
|
G_TYPE_UINT, /* Count */
|
|
|
|
G_TYPE_UINT, /* Total Bytes */
|
|
|
|
G_TYPE_FLOAT); /* Avg Bytes */
|
2009-03-16 18:01:25 +00:00
|
|
|
|
|
|
|
/* Create a view */
|
|
|
|
list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
|
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
list_view = GTK_TREE_VIEW(list);
|
|
|
|
sortable = GTK_TREE_SORTABLE(list_store);
|
2009-03-16 18:01:25 +00:00
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
/* Speed up the list display */
|
|
|
|
gtk_tree_view_set_fixed_height_mode(list_view, TRUE);
|
2009-03-16 18:01:25 +00:00
|
|
|
|
|
|
|
/* Setup the sortable columns */
|
|
|
|
gtk_tree_sortable_set_sort_column_id(sortable, OP_CODE_COLUMN, GTK_SORT_ASCENDING);
|
|
|
|
gtk_tree_view_set_headers_clickable(list_view, FALSE);
|
|
|
|
|
|
|
|
/* The view now holds a reference. We can get rid of our own reference */
|
|
|
|
g_object_unref (G_OBJECT (list_store));
|
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
/*
|
|
|
|
* Create the first column packet, associating the "text" attribute of the
|
|
|
|
* cell_renderer to the first column of the model
|
|
|
|
*/
|
|
|
|
/* 1:st column */
|
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
|
|
|
column = gtk_tree_view_column_new_with_attributes ("Op Code", renderer,
|
|
|
|
"text", OP_CODE_COLUMN,
|
|
|
|
NULL);
|
2009-03-16 18:01:25 +00:00
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
gtk_tree_view_column_set_cell_data_func(column, renderer, present_as_hex_func,
|
|
|
|
GINT_TO_POINTER(OP_CODE_COLUMN), NULL);
|
2009-03-16 18:01:25 +00:00
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
gtk_tree_view_column_set_sort_column_id(column, OP_CODE_COLUMN);
|
2009-03-16 18:01:25 +00:00
|
|
|
gtk_tree_view_column_set_resizable(column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
|
|
|
|
gtk_tree_view_column_set_min_width(column, 60);
|
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
/* Add the column to the view. */
|
2009-03-16 18:01:25 +00:00
|
|
|
gtk_tree_view_append_column (list_view, column);
|
|
|
|
|
|
|
|
/* 2:nd column... */
|
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2010-07-26 16:11:56 +00:00
|
|
|
column = gtk_tree_view_column_new_with_attributes ("Operation Name", renderer,
|
|
|
|
"text", OP_CODE_NAME_COLUMN,
|
|
|
|
NULL);
|
2009-03-16 18:01:25 +00:00
|
|
|
gtk_tree_view_column_set_sort_column_id(column, OP_CODE_NAME_COLUMN);
|
|
|
|
gtk_tree_view_column_set_resizable(column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
|
|
|
|
gtk_tree_view_column_set_min_width(column, 290);
|
|
|
|
gtk_tree_view_append_column (list_view, column);
|
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
/* 3:d column... */
|
2009-03-16 18:01:25 +00:00
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2010-07-26 16:11:56 +00:00
|
|
|
column = gtk_tree_view_column_new_with_attributes ("Count", renderer,
|
|
|
|
"text", COUNT_COLUMN,
|
|
|
|
NULL);
|
2009-03-16 18:01:25 +00:00
|
|
|
gtk_tree_view_column_set_sort_column_id(column, COUNT_COLUMN);
|
|
|
|
gtk_tree_view_column_set_resizable(column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
|
|
|
|
gtk_tree_view_column_set_min_width(column, 50);
|
|
|
|
gtk_tree_view_append_column (list_view, column);
|
|
|
|
|
|
|
|
/* 4:th column... */
|
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2010-07-26 16:11:56 +00:00
|
|
|
column = gtk_tree_view_column_new_with_attributes ("Total Bytes", renderer,
|
|
|
|
"text", TOT_BYTES_COLUMN,
|
|
|
|
NULL);
|
|
|
|
|
2009-03-16 18:01:25 +00:00
|
|
|
|
|
|
|
gtk_tree_view_column_set_sort_column_id(column, TOT_BYTES_COLUMN);
|
|
|
|
gtk_tree_view_column_set_resizable(column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
|
|
|
|
gtk_tree_view_column_set_min_width(column, 100);
|
|
|
|
gtk_tree_view_append_column (list_view, column);
|
|
|
|
|
|
|
|
/* 10:th column.. Avg Bytes. */
|
|
|
|
renderer = gtk_cell_renderer_text_new ();
|
2010-07-26 16:11:56 +00:00
|
|
|
column = gtk_tree_view_column_new_with_attributes ("Avg Bytes", renderer,
|
|
|
|
"text", AVG_BYTES_COLUMN,
|
|
|
|
NULL);
|
|
|
|
gtk_tree_view_column_set_cell_data_func(column, renderer, float_data_func,
|
|
|
|
GINT_TO_POINTER(AVG_BYTES_COLUMN), NULL);
|
2009-03-16 18:01:25 +00:00
|
|
|
|
|
|
|
gtk_tree_view_column_set_sort_column_id(column, AVG_BYTES_COLUMN);
|
|
|
|
gtk_tree_view_column_set_resizable(column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
|
|
|
|
gtk_tree_view_column_set_min_width(column, 50);
|
|
|
|
gtk_tree_view_append_column (list_view, column);
|
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
/* Now enable the sorting of each column */
|
2009-03-16 18:01:25 +00:00
|
|
|
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(list_view), TRUE);
|
|
|
|
gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(list_view), TRUE);
|
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
/* Setup the selection handler */
|
|
|
|
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
|
|
|
|
gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
|
2009-03-16 18:01:25 +00:00
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
return list;
|
2009-03-16 18:01:25 +00:00
|
|
|
|
|
|
|
}
|
2003-12-12 19:55:28 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
ansi_map_stat_reset(
|
2010-07-26 16:11:56 +00:00
|
|
|
void *tapdata)
|
2003-12-12 19:55:28 +00:00
|
|
|
{
|
2010-07-26 16:11:56 +00:00
|
|
|
ansi_map_stat_t *stat_p = tapdata;
|
2003-12-12 19:55:28 +00:00
|
|
|
|
2005-01-01 02:57:02 +00:00
|
|
|
memset(stat_p, 0, sizeof(ansi_map_stat_t));
|
2003-12-12 19:55:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
static gboolean
|
2003-12-12 19:55:28 +00:00
|
|
|
ansi_map_stat_packet(
|
2010-07-26 16:11:56 +00:00
|
|
|
void *tapdata,
|
|
|
|
packet_info *pinfo _U_,
|
|
|
|
epan_dissect_t *edt _U_,
|
|
|
|
const void *data)
|
2003-12-12 19:55:28 +00:00
|
|
|
{
|
2010-07-26 16:11:56 +00:00
|
|
|
ansi_map_stat_t *stat_p = tapdata;
|
|
|
|
const ansi_map_tap_rec_t *data_p = data;
|
2003-12-12 19:55:28 +00:00
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
#if 0 /* always false because message_type is 8 bit value */
|
2004-04-21 05:53:59 +00:00
|
|
|
if (data_p->message_type >= ANSI_MAP_MAX_NUM_MESSAGE_TYPES)
|
2003-12-12 19:55:28 +00:00
|
|
|
{
|
2010-07-26 16:11:56 +00:00
|
|
|
/*
|
|
|
|
* unknown PDU type !!!
|
|
|
|
*/
|
|
|
|
return(FALSE);
|
2003-12-12 19:55:28 +00:00
|
|
|
}
|
2004-01-11 10:02:39 +00:00
|
|
|
#endif
|
2003-12-12 19:55:28 +00:00
|
|
|
|
2005-01-01 02:57:02 +00:00
|
|
|
stat_p->message_type[data_p->message_type]++;
|
|
|
|
stat_p->size[data_p->message_type] += data_p->size;
|
2003-12-12 19:55:28 +00:00
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
return(TRUE);
|
2003-12-12 19:55:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
ansi_map_stat_draw(
|
2010-07-26 16:11:56 +00:00
|
|
|
void *tapdata)
|
2003-12-12 19:55:28 +00:00
|
|
|
{
|
2010-07-26 16:11:56 +00:00
|
|
|
ansi_map_stat_t *stat_p = tapdata;
|
|
|
|
int i;
|
|
|
|
float avg;
|
2009-03-16 18:01:25 +00:00
|
|
|
GtkListStore *list_store;
|
2010-07-26 16:11:56 +00:00
|
|
|
GtkTreeIter iter;
|
2003-12-12 19:55:28 +00:00
|
|
|
|
2009-03-16 18:01:25 +00:00
|
|
|
if (dlg.win && tapdata)
|
2003-12-12 19:55:28 +00:00
|
|
|
{
|
2010-07-26 16:11:56 +00:00
|
|
|
i = 0;
|
|
|
|
list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW (dlg.table))); /* Get store */
|
|
|
|
while (ansi_map_opr_code_strings[i].strptr)
|
|
|
|
{
|
|
|
|
avg = 0.0f;
|
|
|
|
if (stat_p->message_type[ansi_map_opr_code_strings[i].value] !=0 ){
|
|
|
|
avg = (float)stat_p->size[ansi_map_opr_code_strings[i].value]/(float)stat_p->message_type[ansi_map_opr_code_strings[i].value];
|
|
|
|
}
|
|
|
|
/* Creates a new row at position. iter will be changed to point to this new row.
|
|
|
|
* If position is larger than the number of rows on the list, then the new row will be appended to the list.
|
|
|
|
* The row will be filled with the values given to this function.
|
|
|
|
* :
|
|
|
|
* should generally be preferred when inserting rows in a sorted list store.
|
|
|
|
*/
|
|
|
|
gtk_list_store_insert_with_values( list_store , &iter, G_MAXINT,
|
|
|
|
OP_CODE_COLUMN, ansi_map_opr_code_strings[i].value,
|
|
|
|
OP_CODE_NAME_COLUMN, ansi_map_opr_code_strings[i].strptr,
|
|
|
|
COUNT_COLUMN, (guint)stat_p->message_type[ansi_map_opr_code_strings[i].value],
|
|
|
|
TOT_BYTES_COLUMN, (guint)stat_p->size[ansi_map_opr_code_strings[i].value],
|
|
|
|
AVG_BYTES_COLUMN, avg,
|
|
|
|
-1);
|
|
|
|
i++;
|
|
|
|
}
|
2003-12-12 19:55:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
ansi_map_stat_gtk_win_destroy_cb(
|
2010-07-26 16:11:56 +00:00
|
|
|
GtkWindow *win _U_,
|
2010-08-23 19:29:08 +00:00
|
|
|
gpointer user_data)
|
2003-12-12 19:55:28 +00:00
|
|
|
{
|
|
|
|
memset((void *) user_data, 0, sizeof(ansi_map_stat_dlg_t));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
ansi_map_stat_gtk_win_create(
|
2010-07-26 16:11:56 +00:00
|
|
|
ansi_map_stat_dlg_t *dlg_p,
|
|
|
|
const char *title)
|
2003-12-12 19:55:28 +00:00
|
|
|
{
|
2010-07-26 16:11:56 +00:00
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *bt_close;
|
|
|
|
GtkWidget *bbox;
|
2003-12-12 19:55:28 +00:00
|
|
|
|
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
dlg_p->win= dlg_window_new(title); /* transient_for top_level */
|
|
|
|
gtk_window_set_destroy_with_parent (GTK_WINDOW(dlg_p->win), TRUE);
|
2009-06-21 20:42:07 +00:00
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
gtk_window_set_default_size(GTK_WINDOW(dlg_p->win), 500, 450);
|
2003-12-12 19:55:28 +00:00
|
|
|
|
2012-04-21 17:06:30 +00:00
|
|
|
vbox = ws_gtk_box_new(GTK_ORIENTATION_VERTICAL, 3, FALSE);
|
2010-07-26 16:11:56 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(dlg_p->win), vbox);
|
2004-04-12 08:53:02 +00:00
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
|
2003-12-12 19:55:28 +00:00
|
|
|
|
2004-02-06 19:19:12 +00:00
|
|
|
dlg_p->scrolled_win = scrolled_window_new(NULL, NULL);
|
2003-12-12 19:55:28 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), dlg_p->scrolled_win, TRUE, TRUE, 0);
|
|
|
|
|
2009-03-16 18:01:25 +00:00
|
|
|
dlg_p->table = create_list();
|
2003-12-12 19:55:28 +00:00
|
|
|
|
|
|
|
gtk_container_add(GTK_CONTAINER(dlg_p->scrolled_win), dlg_p->table);
|
|
|
|
|
2004-04-21 05:53:59 +00:00
|
|
|
/* Button row. */
|
2004-04-12 08:53:02 +00:00
|
|
|
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
|
2010-07-26 16:11:56 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
|
2004-04-12 08:53:02 +00:00
|
|
|
|
2008-04-09 05:37:53 +00:00
|
|
|
bt_close = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
|
2004-04-12 08:53:02 +00:00
|
|
|
|
2004-05-23 23:24:07 +00:00
|
|
|
window_set_cancel_button(dlg_p->win, bt_close, window_cancel_button_cb);
|
|
|
|
|
2008-04-09 05:37:53 +00:00
|
|
|
g_signal_connect(dlg_p->win, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
|
|
|
|
g_signal_connect(dlg_p->win, "destroy", G_CALLBACK(ansi_map_stat_gtk_win_destroy_cb), dlg_p);
|
2004-04-12 08:53:02 +00:00
|
|
|
|
|
|
|
gtk_widget_show_all(dlg_p->win);
|
2004-05-23 23:24:07 +00:00
|
|
|
window_present(dlg_p->win);
|
2003-12-12 19:55:28 +00:00
|
|
|
}
|
|
|
|
|
2011-05-12 15:17:28 +00:00
|
|
|
void
|
|
|
|
ansi_map_stat_gtk_cb(GtkAction *action _U_, gpointer user_data _U_)
|
2003-12-12 19:55:28 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* if the window is already open, bring it to front
|
|
|
|
*/
|
2009-03-16 18:01:25 +00:00
|
|
|
if (dlg.win){
|
2011-07-21 20:12:08 +00:00
|
|
|
gdk_window_raise(gtk_widget_get_window(dlg.win));
|
2010-07-26 16:11:56 +00:00
|
|
|
return;
|
2003-12-12 19:55:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ansi_map_stat_gtk_win_create(&dlg, "ANSI MAP Operation Statistics");
|
2008-02-09 01:09:05 +00:00
|
|
|
ansi_map_stat_draw(&ansi_a_stat);
|
2003-12-12 19:55:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-08-20 22:28:49 +00:00
|
|
|
static void
|
|
|
|
ansi_map_stat_gtk_init(
|
2010-07-26 16:11:56 +00:00
|
|
|
const char *optarg _U_,
|
2006-02-11 13:05:24 +00:00
|
|
|
void* userdata _U_ )
|
2005-08-20 22:28:49 +00:00
|
|
|
{
|
|
|
|
ansi_map_stat_gtk_cb(NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-12-12 19:55:28 +00:00
|
|
|
void
|
|
|
|
register_tap_listener_gtkansi_map_stat(void)
|
|
|
|
{
|
2010-07-26 16:11:56 +00:00
|
|
|
GString *err_p;
|
2003-12-12 19:55:28 +00:00
|
|
|
|
|
|
|
|
2008-02-09 01:09:05 +00:00
|
|
|
memset((void *) &ansi_a_stat, 0, sizeof(ansi_map_stat_t));
|
2003-12-12 19:55:28 +00:00
|
|
|
|
|
|
|
err_p =
|
2010-07-26 16:11:56 +00:00
|
|
|
register_tap_listener("ansi_map", &ansi_a_stat, NULL, 0,
|
|
|
|
ansi_map_stat_reset,
|
|
|
|
ansi_map_stat_packet,
|
|
|
|
ansi_map_stat_draw);
|
2003-12-12 19:55:28 +00:00
|
|
|
|
|
|
|
if (err_p != NULL)
|
|
|
|
{
|
2010-07-26 16:11:56 +00:00
|
|
|
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p->str);
|
|
|
|
g_string_free(err_p, TRUE);
|
2003-12-12 19:55:28 +00:00
|
|
|
|
2010-07-26 16:11:56 +00:00
|
|
|
exit(1);
|
2003-12-12 19:55:28 +00:00
|
|
|
}
|
2006-02-11 13:05:24 +00:00
|
|
|
register_stat_cmd_arg("ansi_map", ansi_map_stat_gtk_init,NULL);
|
2003-12-12 19:55:28 +00:00
|
|
|
}
|