Add SHB info to Summary
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 23 Feb 2012 21:29:13 +0000 (21:29 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 23 Feb 2012 21:29:13 +0000 (21:29 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@41167 f5534014-38df-0310-8fa8-9805f1628bb7

summary.c
summary.h
ui/gtk/summary_dlg.c

index d98881755655f87c532514455c5727540970885a..4b051d757bcd73f59a84450c213ba8fd59582bca 100644 (file)
--- 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
index acba531b6f2d58470dfc4c8f58ef528150b2e048..ec7062aaa21f39a97614008f6a39d01a6aa6ea9a 100644 (file)
--- 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;
index 961f9844412b4eb788e729cad0473d297d6e76ab..012a23a23805a2a9885141043bc5fd811a8f0c93 100644 (file)
@@ -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),