1999-12-10 04:21:04 +00:00
|
|
|
/* summary_dlg.c
|
|
|
|
* Routines for capture file summary window
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-12-10 04:21:04 +00:00
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1999-12-10 04:21:04 +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
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2007-08-30 00:24:40 +00:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
2004-02-02 22:51:30 +00:00
|
|
|
#include <string.h>
|
2008-04-13 03:32:24 +00:00
|
|
|
#include <time.h>
|
2004-02-02 22:51:30 +00:00
|
|
|
|
1999-12-10 04:21:04 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2008-04-13 03:32:24 +00:00
|
|
|
#include <epan/strutil.h>
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2008-04-13 03:32:24 +00:00
|
|
|
#include <wiretap/wtap.h>
|
|
|
|
|
|
|
|
#include "../globals.h"
|
|
|
|
#include "../file.h"
|
|
|
|
#include "../summary.h"
|
2011-07-05 20:34:03 +00:00
|
|
|
#include "../capture-pcap-util.h"
|
2005-02-06 21:20:35 +00:00
|
|
|
#ifdef HAVE_LIBPCAP
|
2008-04-13 03:32:24 +00:00
|
|
|
#include "../capture.h"
|
2012-01-15 21:59:11 +00:00
|
|
|
#include "ui/gtk/main.h"
|
|
|
|
#include "ui/gtk/capture_globals.h"
|
2005-02-06 21:20:35 +00:00
|
|
|
#endif
|
2008-04-13 03:32:24 +00:00
|
|
|
|
2012-01-15 21:59:11 +00:00
|
|
|
#include "ui/gtk/summary_dlg.h"
|
|
|
|
#include "ui/gtk/dlg_utils.h"
|
|
|
|
#include "ui/gtk/gui_utils.h"
|
|
|
|
#include "ui/gtk/help_dlg.h"
|
2012-03-07 22:19:06 +00:00
|
|
|
#include "ui/gtk/menus.h"
|
2008-04-13 03:32:24 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
#define SUM_STR_MAX 1024
|
|
|
|
#define FILTER_SNIP_LEN 50
|
2012-02-23 21:29:13 +00:00
|
|
|
#define SHB_STR_SNIP_LEN 50
|
1999-12-10 04:21:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
2007-05-25 19:13:49 +00:00
|
|
|
add_string_to_table_sensitive(GtkWidget *list, guint *row, const gchar *title, const gchar *value, gboolean sensitive)
|
1999-12-10 04:21:04 +00:00
|
|
|
{
|
2004-05-20 23:01:53 +00:00
|
|
|
GtkWidget *label;
|
|
|
|
gchar *indent;
|
|
|
|
|
|
|
|
if(strlen(value) != 0) {
|
|
|
|
indent = g_strdup_printf(" %s", title);
|
|
|
|
} else {
|
|
|
|
indent = g_strdup(title);
|
|
|
|
}
|
|
|
|
label = gtk_label_new(indent);
|
2009-02-23 17:28:31 +00:00
|
|
|
if (strlen(value) == 0) {
|
|
|
|
gchar *message = g_strdup_printf("<span weight=\"bold\">%s</span>", title);
|
|
|
|
gtk_label_set_markup(GTK_LABEL(label), message);
|
|
|
|
g_free (message);
|
|
|
|
}
|
2004-05-20 23:01:53 +00:00
|
|
|
g_free(indent);
|
2009-04-21 16:57:52 +00:00
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
|
2004-05-20 23:01:53 +00:00
|
|
|
gtk_widget_set_sensitive(label, sensitive);
|
|
|
|
gtk_table_attach_defaults(GTK_TABLE(list), label, 0, 1, *row, *row+1);
|
|
|
|
|
|
|
|
label = gtk_label_new(value);
|
2009-04-21 16:57:52 +00:00
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
|
2004-05-20 23:01:53 +00:00
|
|
|
gtk_widget_set_sensitive(label, sensitive);
|
|
|
|
gtk_table_attach_defaults(GTK_TABLE(list), label, 1, 2, *row, *row+1);
|
|
|
|
|
|
|
|
*row = *row + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-04-10 10:20:20 +00:00
|
|
|
add_string_to_table(GtkWidget *list, guint *row, const gchar *title, const gchar *value)
|
2004-05-20 23:01:53 +00:00
|
|
|
{
|
|
|
|
add_string_to_table_sensitive(list, row, title, value, TRUE);
|
1999-12-10 04:21:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
static void
|
2007-11-30 13:28:12 +00:00
|
|
|
add_string_to_list(GtkWidget *list, gchar *title, gchar *captured, gchar *displayed, gchar *marked)
|
2004-05-20 23:01:53 +00:00
|
|
|
{
|
2007-11-30 13:28:12 +00:00
|
|
|
simple_list_append(list, 0, title, 1, captured, 2, displayed, 3, marked, -1);
|
2004-05-20 23:01:53 +00:00
|
|
|
}
|
|
|
|
|
2011-11-16 03:13:02 +00:00
|
|
|
static void
|
|
|
|
time_to_string(char *string_buff, gulong string_buff_size, time_t ti_time)
|
|
|
|
{
|
|
|
|
struct tm *ti_tm;
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
/* calling localtime() on MSVC 2005 with huge values causes it to crash */
|
|
|
|
/* XXX - find the exact value that still does work */
|
|
|
|
/* XXX - using _USE_32BIT_TIME_T might be another way to circumvent this problem */
|
|
|
|
if (ti_time > 2000000000) {
|
|
|
|
ti_tm = NULL;
|
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
ti_tm = localtime(&ti_time);
|
|
|
|
if (ti_tm == NULL) {
|
|
|
|
g_snprintf(string_buff, string_buff_size, "Not representable");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
g_snprintf(string_buff, string_buff_size,
|
|
|
|
"%04d-%02d-%02d %02d:%02d:%02d",
|
|
|
|
ti_tm->tm_year + 1900,
|
|
|
|
ti_tm->tm_mon + 1,
|
|
|
|
ti_tm->tm_mday,
|
|
|
|
ti_tm->tm_hour,
|
|
|
|
ti_tm->tm_min,
|
|
|
|
ti_tm->tm_sec);
|
|
|
|
}
|
|
|
|
|
2012-02-26 17:04:28 +00:00
|
|
|
static void
|
|
|
|
summary_comment_text_buff_save_cb(GtkWidget *w _U_, GtkWidget *view)
|
|
|
|
{
|
|
|
|
GtkTextBuffer *buffer;
|
|
|
|
GtkTextIter start_iter;
|
|
|
|
GtkTextIter end_iter;
|
|
|
|
gchar *new_comment = NULL;
|
|
|
|
|
|
|
|
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
|
|
|
|
gtk_text_buffer_get_start_iter (buffer, &start_iter);
|
|
|
|
gtk_text_buffer_get_end_iter (buffer, &end_iter);
|
|
|
|
|
2012-03-07 22:19:06 +00:00
|
|
|
new_comment = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE /* whether to include invisible text */);
|
2012-02-26 17:04:28 +00:00
|
|
|
|
|
|
|
/*g_warning("The new comment is '%s'",new_packet_comment);*/
|
|
|
|
|
|
|
|
summary_update_comment(&cfile, new_comment);
|
2012-02-26 19:54:58 +00:00
|
|
|
/* Mark the file as unsaved, caues a popup asking to save the file if we quit the file */
|
|
|
|
cfile.user_saved = FALSE;
|
2012-03-07 22:19:06 +00:00
|
|
|
set_menus_for_capture_file(&cfile);
|
2012-02-26 17:04:28 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
summary_comment_text_buff_clear_cb(GtkWidget *w _U_, GtkWidget *view)
|
|
|
|
{
|
|
|
|
GtkTextBuffer *buffer;
|
|
|
|
|
|
|
|
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
|
|
|
|
gtk_text_buffer_set_text (buffer, "", -1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
1999-12-10 04:21:04 +00:00
|
|
|
void
|
2002-03-05 11:56:00 +00:00
|
|
|
summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
|
1999-12-10 04:21:04 +00:00
|
|
|
{
|
|
|
|
summary_tally summary;
|
|
|
|
GtkWidget *sum_open_w,
|
2005-01-20 23:17:23 +00:00
|
|
|
*main_vb, *bbox, *close_bt, *help_bt;
|
2011-07-05 20:34:03 +00:00
|
|
|
GtkWidget *table, *scrolled_window;
|
|
|
|
GtkWidget *list, *treeview;
|
|
|
|
GtkListStore *store;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkCellRenderer *renderer;
|
|
|
|
GtkTreeViewColumn *column;
|
2011-07-06 04:45:50 +00:00
|
|
|
const char *dl_description;
|
2007-11-30 13:28:12 +00:00
|
|
|
static const char *titles[] = { "Traffic", "Captured", "Displayed", "Marked" };
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2004-02-01 13:13:33 +00:00
|
|
|
gchar string_buff[SUM_STR_MAX];
|
2007-11-30 13:28:12 +00:00
|
|
|
gchar string_buff2[SUM_STR_MAX];
|
|
|
|
gchar string_buff3[SUM_STR_MAX];
|
2011-07-05 20:34:03 +00:00
|
|
|
gchar string_buff4[SUM_STR_MAX];
|
|
|
|
gchar string_buff5[SUM_STR_MAX];
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2004-02-01 13:13:33 +00:00
|
|
|
double seconds;
|
2004-05-20 23:01:53 +00:00
|
|
|
double disp_seconds;
|
2007-11-28 01:09:02 +00:00
|
|
|
double marked_seconds;
|
2004-02-01 13:13:33 +00:00
|
|
|
guint offset;
|
2004-05-20 23:01:53 +00:00
|
|
|
guint snip;
|
|
|
|
guint row;
|
2004-02-01 13:13:33 +00:00
|
|
|
gchar *str_dup;
|
|
|
|
gchar *str_work;
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2004-06-18 20:23:10 +00:00
|
|
|
unsigned int elapsed_time;
|
2011-07-05 20:34:03 +00:00
|
|
|
iface_options iface;
|
|
|
|
unsigned int i;
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2004-02-01 13:13:33 +00:00
|
|
|
/* initial computations */
|
2005-02-04 19:29:27 +00:00
|
|
|
summary_fill_in(&cfile, &summary);
|
2005-02-06 21:20:35 +00:00
|
|
|
#ifdef HAVE_LIBPCAP
|
2012-02-23 15:40:31 +00:00
|
|
|
summary_fill_in_capture(&cfile, &global_capture_opts, &summary);
|
2005-02-06 21:20:35 +00:00
|
|
|
#endif
|
2012-02-26 08:02:02 +00:00
|
|
|
/*
|
|
|
|
* Note: the start and stop times are initialized to 0, so if we
|
|
|
|
* have zero or one packets of the type in question that have
|
|
|
|
* time stamps, the elapsed times will be zero, just as if we
|
|
|
|
* have both start and stop time stamps but they're the same.
|
|
|
|
* That means we can avoid some checks for whether we have more
|
|
|
|
* than one packet of the type in question with time stamps.
|
|
|
|
*/
|
1999-12-10 04:21:04 +00:00
|
|
|
seconds = summary.stop_time - summary.start_time;
|
2004-05-20 23:01:53 +00:00
|
|
|
disp_seconds = summary.filtered_stop - summary.filtered_start;
|
2007-11-28 01:09:02 +00:00
|
|
|
marked_seconds = summary.marked_stop - summary.marked_start;
|
2004-05-20 23:01:53 +00:00
|
|
|
|
2006-05-22 07:29:40 +00:00
|
|
|
sum_open_w = window_new(GTK_WINDOW_TOPLEVEL, "Wireshark: Summary");
|
1999-12-10 04:21:04 +00:00
|
|
|
|
|
|
|
/* Container for each row of widgets */
|
2004-05-20 23:01:53 +00:00
|
|
|
main_vb = gtk_vbox_new(FALSE, 12);
|
2008-06-29 15:51:43 +00:00
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 12);
|
1999-12-10 04:21:04 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(sum_open_w), main_vb);
|
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* table */
|
|
|
|
table = gtk_table_new(1, 2, FALSE);
|
|
|
|
gtk_table_set_col_spacings(GTK_TABLE(table), 6);
|
|
|
|
gtk_table_set_row_spacings(GTK_TABLE(table), 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), table);
|
|
|
|
row = 0;
|
|
|
|
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* File */
|
|
|
|
add_string_to_table(table, &row, "File", "");
|
1999-12-10 04:21:04 +00:00
|
|
|
|
|
|
|
/* filename */
|
2004-05-20 23:01:53 +00:00
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%s", summary.filename);
|
|
|
|
add_string_to_table(table, &row, "Name:", string_buff);
|
1999-12-10 04:21:04 +00:00
|
|
|
|
|
|
|
/* length */
|
2007-05-29 06:56:07 +00:00
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%" G_GINT64_MODIFIER "d bytes", summary.file_length);
|
2004-05-20 23:01:53 +00:00
|
|
|
add_string_to_table(table, &row, "Length:", string_buff);
|
|
|
|
|
1999-12-10 04:21:04 +00:00
|
|
|
/* format */
|
2008-10-14 22:55:16 +00:00
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_file_type_string(summary.file_type));
|
2004-05-20 23:01:53 +00:00
|
|
|
add_string_to_table(table, &row, "Format:", string_buff);
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2008-10-14 22:55:16 +00:00
|
|
|
/* encapsulation */
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_encap_string(summary.encap_type));
|
|
|
|
add_string_to_table(table, &row, "Encapsulation:", string_buff);
|
|
|
|
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
if (summary.has_snap) {
|
|
|
|
/* snapshot length */
|
2004-05-20 23:01:53 +00:00
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%u bytes", summary.snap);
|
|
|
|
add_string_to_table(table, &row, "Packet size limit:", string_buff);
|
Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file. Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).
If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.
Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").
Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping. Also add units to the capture count option.
Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.
Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.
svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
|
|
|
}
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2012-02-26 17:04:28 +00:00
|
|
|
/* Only allow editing of comment if filetype is PCAPNG */
|
|
|
|
if(summary.file_type == WTAP_FILE_PCAPNG){
|
2012-03-10 09:01:48 +00:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *comment_vbox;
|
|
|
|
GtkWidget *view;
|
|
|
|
GtkTextBuffer *buffer = NULL;
|
|
|
|
const gchar *buf_str;
|
|
|
|
GtkWidget *ok_bt, *clear_bt;
|
|
|
|
|
|
|
|
frame = gtk_frame_new ("Capture comments");
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
|
|
|
|
gtk_container_add (GTK_CONTAINER (main_vb), frame);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
comment_vbox = gtk_vbox_new (FALSE, 0);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), comment_vbox);
|
|
|
|
gtk_widget_show (comment_vbox);
|
|
|
|
|
|
|
|
view = gtk_text_view_new ();
|
|
|
|
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
|
|
|
|
if(summary.opt_comment == NULL){
|
|
|
|
buf_str = g_strdup_printf("[None]");
|
|
|
|
}else{
|
|
|
|
buf_str = g_strdup_printf("%s", summary.opt_comment);
|
|
|
|
}
|
|
|
|
gtk_text_buffer_set_text (buffer, buf_str, -1);
|
|
|
|
gtk_container_add(GTK_CONTAINER(comment_vbox), view);
|
|
|
|
gtk_widget_show (view);
|
|
|
|
|
|
|
|
/* Button row. */
|
|
|
|
bbox = dlg_button_row_new (GTK_STOCK_OK, GTK_STOCK_CLEAR, NULL);
|
|
|
|
gtk_box_pack_end (GTK_BOX(comment_vbox), bbox, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
ok_bt = g_object_get_data (G_OBJECT(bbox), GTK_STOCK_OK);
|
|
|
|
g_signal_connect (ok_bt, "clicked", G_CALLBACK(summary_comment_text_buff_save_cb), view);
|
|
|
|
gtk_widget_set_sensitive (ok_bt, TRUE);
|
|
|
|
gtk_widget_set_tooltip_text(ok_bt,
|
|
|
|
"Updates the comment, you need to save the the capture file as well to save the updated comment");
|
|
|
|
|
|
|
|
|
|
|
|
clear_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLEAR);
|
|
|
|
g_signal_connect(clear_bt, "clicked", G_CALLBACK(summary_comment_text_buff_clear_cb), view);
|
|
|
|
gtk_widget_set_tooltip_text(clear_bt,
|
|
|
|
"Clears the text from the box, not the capture");
|
|
|
|
|
|
|
|
gtk_widget_grab_default (ok_bt);
|
2012-02-26 17:04:28 +00:00
|
|
|
|
|
|
|
}else{
|
2012-03-10 09:01:48 +00:00
|
|
|
if (summary.opt_comment != NULL) {
|
|
|
|
/* comment */
|
|
|
|
add_string_to_table(table, &row, "Comment:", summary.opt_comment);
|
|
|
|
}
|
2012-02-26 17:04:28 +00:00
|
|
|
}
|
2012-02-26 10:20:40 +00:00
|
|
|
|
2012-02-26 08:02:02 +00:00
|
|
|
/*
|
|
|
|
* We must have no un-time-stamped packets (i.e., the number of
|
|
|
|
* time-stamped packets must be the same as the number of packets),
|
|
|
|
* and at least one time-stamped packet, in order for the start
|
|
|
|
* and stop times to be valid.
|
|
|
|
*/
|
|
|
|
if (summary.packet_count_ts == summary.packet_count &&
|
|
|
|
summary.packet_count >= 1) {
|
|
|
|
/* Time */
|
|
|
|
add_string_to_table(table, &row, "", "");
|
|
|
|
add_string_to_table(table, &row, "Time", "");
|
|
|
|
|
|
|
|
/* start time */
|
|
|
|
time_to_string(string_buff, SUM_STR_MAX, (time_t)summary.start_time);
|
|
|
|
add_string_to_table(table, &row, "First packet:", string_buff);
|
|
|
|
|
|
|
|
/* stop time */
|
|
|
|
time_to_string(string_buff, SUM_STR_MAX, (time_t)summary.stop_time);
|
|
|
|
add_string_to_table(table, &row, "Last packet:", string_buff);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We must have at least two time-stamped packets for the elapsed time
|
|
|
|
* to be valid.
|
|
|
|
*/
|
|
|
|
if (summary.packet_count_ts >= 2) {
|
|
|
|
/* elapsed seconds */
|
|
|
|
elapsed_time = (unsigned int)summary.elapsed_time;
|
|
|
|
if(elapsed_time/86400) {
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%02u days %02u:%02u:%02u",
|
|
|
|
elapsed_time/86400, elapsed_time%86400/3600, elapsed_time%3600/60, elapsed_time%60);
|
|
|
|
} else {
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%02u:%02u:%02u",
|
|
|
|
elapsed_time%86400/3600, elapsed_time%3600/60, elapsed_time%60);
|
|
|
|
}
|
|
|
|
add_string_to_table(table, &row, "Elapsed:", string_buff);
|
|
|
|
}
|
2004-06-18 14:11:09 +00:00
|
|
|
}
|
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* Capture */
|
|
|
|
add_string_to_table(table, &row, "", "");
|
2011-07-05 21:11:24 +00:00
|
|
|
add_string_to_table_sensitive(table, &row, "Capture", "", (summary.ifaces->len > 0));
|
2012-02-23 21:29:13 +00:00
|
|
|
if(summary.shb_hardware){
|
2012-03-10 09:01:48 +00:00
|
|
|
/* trucate the string to a reasonable length */
|
|
|
|
g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s",summary.shb_hardware);
|
|
|
|
add_string_to_table(table, &row, "Capture HW:",string_buff);
|
2012-02-23 21:29:13 +00:00
|
|
|
}
|
|
|
|
if(summary.shb_os){
|
2012-03-10 09:01:48 +00:00
|
|
|
/* trucate the strings to a reasonable length */
|
|
|
|
g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s",summary.shb_os);
|
|
|
|
add_string_to_table(table, &row, "OS:", string_buff);
|
2012-02-23 21:29:13 +00:00
|
|
|
}
|
|
|
|
if(summary.shb_user_appl){
|
2012-03-10 09:01:48 +00:00
|
|
|
/* trucate the string to a reasonable length */
|
|
|
|
g_snprintf(string_buff, SHB_STR_SNIP_LEN, "%s",summary.shb_user_appl);
|
|
|
|
add_string_to_table(table, &row, "Capture application:", string_buff);
|
2012-02-23 21:29:13 +00:00
|
|
|
}
|
2011-07-05 20:34:03 +00:00
|
|
|
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 5);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
|
|
|
|
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
|
|
|
gtk_widget_set_size_request(scrolled_window, -1, 120);
|
|
|
|
|
|
|
|
treeview = gtk_tree_view_new();
|
|
|
|
renderer = gtk_cell_renderer_text_new();
|
|
|
|
column = gtk_tree_view_column_new_with_attributes("Interface", renderer, "text", 0, NULL);
|
|
|
|
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
|
|
|
|
renderer = gtk_cell_renderer_text_new();
|
|
|
|
column = gtk_tree_view_column_new_with_attributes("Dropped Packets", renderer, "text", 1, NULL);
|
|
|
|
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
|
|
|
|
renderer = gtk_cell_renderer_text_new();
|
|
|
|
column = gtk_tree_view_column_new_with_attributes("Capture Filter", renderer, "text", 2, NULL);
|
|
|
|
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
|
|
|
|
renderer = gtk_cell_renderer_text_new();
|
|
|
|
column = gtk_tree_view_column_new_with_attributes("Link type", renderer, "text", 3, NULL);
|
|
|
|
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
|
|
|
|
renderer = gtk_cell_renderer_text_new();
|
|
|
|
column = gtk_tree_view_column_new_with_attributes("Packet size limit", renderer, "text", 4, NULL);
|
|
|
|
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column);
|
2012-03-07 22:19:06 +00:00
|
|
|
|
2011-07-05 20:34:03 +00:00
|
|
|
store = gtk_list_store_new(5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
|
|
|
|
for (i = 0; i < summary.ifaces->len; i++) {
|
|
|
|
iface = g_array_index(summary.ifaces, iface_options, i);
|
|
|
|
/* interface */
|
|
|
|
if (iface.descr) {
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%s", iface.descr);
|
|
|
|
} else if (iface.name) {
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%s", iface.name);
|
2004-06-18 14:11:09 +00:00
|
|
|
} else {
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "unknown");
|
|
|
|
}
|
2011-07-05 20:34:03 +00:00
|
|
|
/* Dropped count */
|
|
|
|
if (iface.drops_known) {
|
|
|
|
g_snprintf(string_buff2, SUM_STR_MAX, "%" G_GINT64_MODIFIER "u", iface.drops);
|
|
|
|
} else {
|
|
|
|
g_snprintf(string_buff2, SUM_STR_MAX, "unknown");
|
|
|
|
}
|
|
|
|
/* Capture filter */
|
|
|
|
if (iface.cfilter && iface.cfilter[0] != '\0') {
|
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "%s", iface.cfilter);
|
|
|
|
} else {
|
2011-07-05 21:11:24 +00:00
|
|
|
if (iface.name) {
|
2011-07-05 20:34:03 +00:00
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "none");
|
|
|
|
} else {
|
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "unknown");
|
|
|
|
}
|
|
|
|
}
|
2012-03-08 07:28:26 +00:00
|
|
|
dl_description = wtap_encap_string(iface.linktype);
|
2011-07-06 04:09:49 +00:00
|
|
|
if (dl_description != NULL)
|
|
|
|
g_snprintf(string_buff4, SUM_STR_MAX, "%s", dl_description);
|
|
|
|
else
|
|
|
|
g_snprintf(string_buff4, SUM_STR_MAX, "DLT %d", iface.linktype);
|
2012-03-08 07:28:26 +00:00
|
|
|
|
2012-03-10 09:01:48 +00:00
|
|
|
g_snprintf(string_buff5, SUM_STR_MAX, "%u bytes", iface.snap);
|
2011-07-05 20:34:03 +00:00
|
|
|
gtk_list_store_append(store, &iter);
|
|
|
|
gtk_list_store_set(store, &iter, 0, string_buff, 1, string_buff2, 2, string_buff3, 3, string_buff4, 4, string_buff5,-1);
|
|
|
|
}
|
|
|
|
gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(store));
|
|
|
|
g_object_unref (store);
|
|
|
|
gtk_container_add(GTK_CONTAINER(scrolled_window), treeview);
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb),scrolled_window);
|
|
|
|
gtk_widget_show_all (scrolled_window);
|
|
|
|
table = gtk_table_new(1, 2, FALSE);
|
|
|
|
gtk_table_set_col_spacings(GTK_TABLE(table), 6);
|
|
|
|
gtk_table_set_row_spacings(GTK_TABLE(table), 3);
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), table);
|
|
|
|
row = 0;
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2003-09-02 22:10:32 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* Data */
|
|
|
|
add_string_to_table(table, &row, "", "");
|
|
|
|
add_string_to_table(table, &row, "Display", "");
|
2003-09-02 22:10:32 +00:00
|
|
|
|
2003-12-20 12:03:35 +00:00
|
|
|
if (summary.dfilter) {
|
|
|
|
/* Display filter */
|
2004-02-01 13:13:33 +00:00
|
|
|
/* limit each row to some reasonable length */
|
2004-05-20 23:01:53 +00:00
|
|
|
str_dup = g_strdup_printf("%s", summary.dfilter);
|
2004-02-01 13:13:33 +00:00
|
|
|
str_work = g_strdup(str_dup);
|
|
|
|
offset = 0;
|
2004-05-20 23:01:53 +00:00
|
|
|
snip = 0;
|
|
|
|
while(strlen(str_work) > FILTER_SNIP_LEN) {
|
|
|
|
str_work[FILTER_SNIP_LEN] = '\0';
|
|
|
|
add_string_to_table(table, &row, (snip == 0) ? "Display filter:" : "", str_work);
|
2004-02-01 13:13:33 +00:00
|
|
|
g_free(str_work);
|
2004-05-20 23:01:53 +00:00
|
|
|
offset+=FILTER_SNIP_LEN;
|
2004-02-01 13:13:33 +00:00
|
|
|
str_work = g_strdup(&str_dup[offset]);
|
2004-05-20 23:01:53 +00:00
|
|
|
snip++;
|
2004-02-01 13:13:33 +00:00
|
|
|
}
|
2007-08-30 00:24:40 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
add_string_to_table(table, &row, (snip == 0) ? "Display filter:" : "", str_work);
|
2004-02-01 13:13:33 +00:00
|
|
|
g_free(str_work);
|
|
|
|
g_free(str_dup);
|
2004-05-20 23:01:53 +00:00
|
|
|
} else {
|
|
|
|
/* Display filter */
|
|
|
|
add_string_to_table(table, &row, "Display filter:", "none");
|
|
|
|
}
|
2003-09-02 22:10:32 +00:00
|
|
|
|
2009-12-17 12:05:13 +00:00
|
|
|
/* Ignored packet count */
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%i", summary.ignored_count);
|
|
|
|
add_string_to_table(table, &row, "Ignored packets:", string_buff);
|
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* Traffic */
|
2007-11-30 13:28:12 +00:00
|
|
|
list = simple_list_new(4, titles);
|
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), list);
|
2003-09-02 22:10:32 +00:00
|
|
|
|
2007-11-30 13:28:12 +00:00
|
|
|
/* Packet count */
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%i", summary.packet_count);
|
2007-11-28 01:09:02 +00:00
|
|
|
if (summary.dfilter) {
|
2007-11-30 13:28:12 +00:00
|
|
|
g_snprintf(string_buff2, SUM_STR_MAX, "%i", summary.filtered_count);
|
2004-05-20 23:01:53 +00:00
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
g_strlcpy(string_buff2, string_buff, SUM_STR_MAX);
|
2004-05-20 23:01:53 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "%i", summary.marked_count);
|
|
|
|
add_string_to_list(list, "Packets", string_buff, string_buff2, string_buff3);
|
2007-11-28 01:09:02 +00:00
|
|
|
|
|
|
|
/* Time between first and last */
|
2007-11-30 13:28:12 +00:00
|
|
|
if (seconds > 0) {
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%.3f sec", seconds);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff[0] = '\0';
|
2007-11-28 01:09:02 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if (summary.dfilter && disp_seconds > 0) {
|
|
|
|
g_snprintf(string_buff2, SUM_STR_MAX, "%.3f sec", disp_seconds);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff2[0] = '\0';
|
2007-11-28 01:09:02 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if (summary.marked_count && marked_seconds > 0) {
|
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "%.3f sec", marked_seconds);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff3[0] = '\0';
|
2004-05-20 23:01:53 +00:00
|
|
|
}
|
2012-02-26 08:02:02 +00:00
|
|
|
if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
|
|
|
|
add_string_to_list(list, "Between first and last packet", string_buff, string_buff2, string_buff3);
|
2003-09-02 22:10:32 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* Packets per second */
|
2007-11-28 01:09:02 +00:00
|
|
|
if (seconds > 0) {
|
2007-11-30 13:28:12 +00:00
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%.3f", summary.packet_count/seconds);
|
2003-12-20 12:03:35 +00:00
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff[0] = '\0';
|
2004-05-20 23:01:53 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if(summary.dfilter && disp_seconds > 0) {
|
|
|
|
g_snprintf(string_buff2, SUM_STR_MAX, "%.3f", summary.filtered_count/disp_seconds);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff2[0] = '\0';
|
2003-09-02 22:10:32 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if(summary.marked_count && marked_seconds > 0) {
|
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "%.3f", summary.marked_count/marked_seconds);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff3[0] = '\0';
|
2007-11-28 01:09:02 +00:00
|
|
|
}
|
2012-02-26 08:02:02 +00:00
|
|
|
if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
|
2007-11-30 13:28:12 +00:00
|
|
|
add_string_to_list(list, "Avg. packets/sec", string_buff, string_buff2, string_buff3);
|
2003-09-02 22:10:32 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* Packet size */
|
2007-11-30 13:28:12 +00:00
|
|
|
if (summary.packet_count > 1) {
|
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%.3f bytes",
|
2007-11-28 01:09:02 +00:00
|
|
|
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
|
|
|
|
(float) ((gint64) summary.bytes)/summary.packet_count);
|
2004-05-20 23:01:53 +00:00
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff[0] = '\0';
|
2004-05-20 23:01:53 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if (summary.dfilter && summary.filtered_count > 1) {
|
|
|
|
g_snprintf(string_buff2, SUM_STR_MAX, "%.3f bytes",
|
|
|
|
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
|
|
|
|
(float) ((gint64) summary.filtered_bytes)/summary.filtered_count);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff2[0] = '\0';
|
2004-05-20 23:01:53 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if (summary.marked_count > 1) {
|
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "%.3f bytes",
|
2007-11-28 01:09:02 +00:00
|
|
|
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
|
|
|
|
(float) ((gint64) summary.marked_bytes)/summary.marked_count);
|
2007-11-30 13:28:12 +00:00
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff3[0] = '\0';
|
2007-11-28 01:09:02 +00:00
|
|
|
}
|
2012-02-26 08:02:02 +00:00
|
|
|
if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
|
|
|
|
add_string_to_list(list, "Avg. packet size", string_buff, string_buff2, string_buff3);
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* Byte count */
|
2007-11-30 13:28:12 +00:00
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%" G_GINT64_MODIFIER "u", summary.bytes);
|
|
|
|
if (summary.dfilter && summary.filtered_count > 0) {
|
|
|
|
g_snprintf(string_buff2, SUM_STR_MAX, "%" G_GINT64_MODIFIER "u", summary.filtered_bytes);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff2[0] = '\0';
|
2004-05-20 23:01:53 +00:00
|
|
|
}
|
2007-11-28 01:09:02 +00:00
|
|
|
if (summary.marked_count) {
|
2007-11-30 13:28:12 +00:00
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "%" G_GINT64_MODIFIER "u", summary.marked_bytes);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff3[0] = '\0';
|
2007-11-28 01:09:02 +00:00
|
|
|
}
|
2012-02-26 08:02:02 +00:00
|
|
|
if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
|
|
|
|
add_string_to_list(list, "Bytes", string_buff, string_buff2, string_buff3);
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* Bytes per second */
|
|
|
|
if (seconds > 0){
|
2005-07-09 11:28:13 +00:00
|
|
|
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
|
2007-11-30 13:28:12 +00:00
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%.3f", ((gint64) summary.bytes)/seconds);
|
2004-05-20 23:01:53 +00:00
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff[0] = '\0';
|
2004-05-20 23:01:53 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if (summary.dfilter && disp_seconds > 0) {
|
|
|
|
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
|
|
|
|
g_snprintf(string_buff2, SUM_STR_MAX, "%.3f", ((gint64) summary.filtered_bytes)/disp_seconds);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff2[0] = '\0';
|
1999-12-10 04:21:04 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if (summary.marked_count && marked_seconds > 0) {
|
|
|
|
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
|
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "%.3f", ((gint64) summary.marked_bytes)/marked_seconds);
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff3[0] = '\0';
|
2007-11-28 01:09:02 +00:00
|
|
|
}
|
2012-02-26 08:02:02 +00:00
|
|
|
if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
|
|
|
|
add_string_to_list(list, "Avg. bytes/sec", string_buff, string_buff2, string_buff3);
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
/* MBit per second */
|
2007-11-28 01:09:02 +00:00
|
|
|
if (seconds > 0) {
|
2008-10-14 22:55:16 +00:00
|
|
|
g_snprintf(string_buff, SUM_STR_MAX, "%.3f",
|
2007-11-28 01:09:02 +00:00
|
|
|
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
|
|
|
|
((gint64) summary.bytes) * 8.0 / (seconds * 1000.0 * 1000.0));
|
1999-12-10 04:21:04 +00:00
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff[0] = '\0';
|
1999-12-10 04:21:04 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if (summary.dfilter && disp_seconds > 0) {
|
|
|
|
g_snprintf(string_buff2, SUM_STR_MAX, "%.3f",
|
|
|
|
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
|
|
|
|
((gint64) summary.filtered_bytes) * 8.0 / (disp_seconds * 1000.0 * 1000.0));
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff2[0] = '\0';
|
2007-11-28 01:09:02 +00:00
|
|
|
}
|
2007-11-30 13:28:12 +00:00
|
|
|
if (summary.marked_count && marked_seconds > 0) {
|
|
|
|
g_snprintf(string_buff3, SUM_STR_MAX, "%.3f",
|
|
|
|
/* MSVC cannot convert from unsigned __int64 to float, so first convert to signed __int64 */
|
|
|
|
((gint64) summary.marked_bytes) * 8.0 / (marked_seconds * 1000.0 * 1000.0));
|
|
|
|
} else {
|
2008-02-29 13:33:37 +00:00
|
|
|
string_buff3[0] = '\0';
|
2004-05-20 23:01:53 +00:00
|
|
|
}
|
2012-02-26 08:02:02 +00:00
|
|
|
if (string_buff[0] != '\0' || string_buff2[0] != '\0' || string_buff3[0] != '\0')
|
|
|
|
add_string_to_list(list, "Avg. MBit/sec", string_buff, string_buff2, string_buff3);
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2007-08-30 00:24:40 +00:00
|
|
|
|
2004-01-21 21:19:34 +00:00
|
|
|
/* Button row. */
|
2008-06-21 13:36:31 +00:00
|
|
|
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, GTK_STOCK_HELP, NULL);
|
2000-07-05 06:19:27 +00:00
|
|
|
gtk_container_add(GTK_CONTAINER(main_vb), bbox);
|
|
|
|
|
2008-04-11 17:26:09 +00:00
|
|
|
close_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
|
2004-05-23 23:24:07 +00:00
|
|
|
window_set_cancel_button(sum_open_w, close_bt, window_cancel_button_cb);
|
|
|
|
|
2008-06-21 13:36:31 +00:00
|
|
|
help_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_HELP);
|
|
|
|
g_signal_connect(help_bt, "clicked", G_CALLBACK(topic_cb), (gpointer)HELP_STATS_SUMMARY_DIALOG);
|
2005-01-20 23:17:23 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
gtk_widget_grab_focus(close_bt);
|
2000-05-03 07:44:12 +00:00
|
|
|
|
2008-04-11 23:16:06 +00:00
|
|
|
g_signal_connect(sum_open_w, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
|
1999-12-10 04:21:04 +00:00
|
|
|
|
2004-05-20 23:01:53 +00:00
|
|
|
gtk_widget_show_all(sum_open_w);
|
2004-05-23 23:24:07 +00:00
|
|
|
window_present(sum_open_w);
|
1999-12-10 04:21:04 +00:00
|
|
|
}
|