aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2012-02-23 21:29:13 +0000
committerAnders Broman <anders.broman@ericsson.com>2012-02-23 21:29:13 +0000
commitb5a2ba98be35a97398f54d9fbb54d4ae8b4a6a84 (patch)
tree9e31a8282a1c5336a4ddc1f49f927f708bdf0beb
parenta062fb34bd2262dc0f1510f66c4500b2e531ece9 (diff)
Add SHB info to Summary
svn path=/trunk/; revision=41167
-rw-r--r--summary.c12
-rw-r--r--summary.h5
-rw-r--r--ui/gtk/summary_dlg.c16
3 files changed, 33 insertions, 0 deletions
diff --git a/summary.c b/summary.c
index d988817556..4b051d757b 100644
--- a/summary.c
+++ b/summary.c
@@ -93,6 +93,7 @@ summary_fill_in(capture_file *cf, summary_tally *st)
frame_data *first_frame, *cur_frame;
guint32 framenum;
+ wtapng_section_t* shb_inf;
st->start_time = 0;
st->stop_time = 0;
@@ -132,6 +133,16 @@ summary_fill_in(capture_file *cf, summary_tally *st)
st->drops = cf->drops;
st->dfilter = cf->dfilter;
+ /* Get info from SHB */
+ shb_inf = wtap_file_get_shb_info(cf->wth);
+
+ shb_inf = wtap_file_get_shb_info(cf->wth);
+ st->opt_comment = shb_inf->opt_comment;
+ st->shb_hardware = shb_inf->shb_hardware;
+ st->shb_os = shb_inf->shb_os;
+ st->shb_user_appl = shb_inf->shb_user_appl;
+ g_free(shb_inf);
+
st->ifaces = g_array_new(FALSE, FALSE, sizeof(iface_options));
}
@@ -180,6 +191,7 @@ summary_fill_in_capture(capture_file *cf,capture_options *capture_opts, summary_
iface.linktype = wtapng_if_descr.link_type;
g_array_append_val(st->ifaces, iface);
}
+ g_free(idb_info);
}
}
#endif
diff --git a/summary.h b/summary.h
index acba531b6f..ec7062aaa2 100644
--- a/summary.h
+++ b/summary.h
@@ -67,6 +67,11 @@ typedef struct _summary_tally {
guint64 drops; /**< number of packet drops */
const char *dfilter; /**< display filter */
gboolean is_tempfile;
+ /* from SHB, use summary_fill_shb_inf() to get values */
+ gchar *opt_comment; /**< comment from SHB block */
+ gchar *shb_hardware; /**< Capture HW from SHB block */
+ gchar *shb_os; /**< The OS the capture was made on from SHB block */
+ gchar *shb_user_appl; /**< The application that made the capture from SHB block */
/* capture related, use summary_fill_in_capture() to get values */
GArray *ifaces;
gboolean legacy;
diff --git a/ui/gtk/summary_dlg.c b/ui/gtk/summary_dlg.c
index 961f984441..012a23a238 100644
--- a/ui/gtk/summary_dlg.c
+++ b/ui/gtk/summary_dlg.c
@@ -55,6 +55,7 @@
#define SUM_STR_MAX 1024
#define FILTER_SNIP_LEN 50
+#define SHB_STR_SNIP_LEN 50
static void
@@ -241,6 +242,21 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
/* Capture */
add_string_to_table(table, &row, "", "");
add_string_to_table_sensitive(table, &row, "Capture", "", (summary.ifaces->len > 0));
+ if(summary.shb_hardware){
+ /* 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);
+ }
+ if(summary.shb_os){
+ /* 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);
+ }
+ if(summary.shb_user_appl){
+ /* 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);
+ }
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),