aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/summary_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-06-15 23:54:05 +0000
committerGuy Harris <guy@alum.mit.edu>2012-06-15 23:54:05 +0000
commitd1128f64332ff4f9553e16a7343796d896f7a07e (patch)
tree41b8f92cdb618c7b05812bb7676b0be90a3a8765 /ui/gtk/summary_dlg.c
parentc43b7b8b934a3eb6e864f697776603c89e1a6719 (diff)
For a capture file, keep an array of all encapsulation types seen.
Show all of them in the summary dialog; we will be using it in the future to figure out what capture file formats we can write to (just because a capture file format supports per-packet encapsulations, that doesn't mean that it supports *all possible* encapsulations). svn path=/trunk/; revision=43278
Diffstat (limited to 'ui/gtk/summary_dlg.c')
-rw-r--r--ui/gtk/summary_dlg.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/gtk/summary_dlg.c b/ui/gtk/summary_dlg.c
index b79776be16..175cab550f 100644
--- a/ui/gtk/summary_dlg.c
+++ b/ui/gtk/summary_dlg.c
@@ -247,9 +247,17 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
add_string_to_table(table, &row, "Format:", string_buff);
/* encapsulation */
- g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_encap_string(summary.encap_type));
- add_string_to_table(table, &row, "Encapsulation:", string_buff);
-
+ if (summary.file_encap_type == WTAP_ENCAP_PER_PACKET) {
+ for (i = 0; i < summary.packet_encap_types->len; i++) {
+ g_snprintf(string_buff, SUM_STR_MAX, "%s",
+ wtap_encap_string(g_array_index(summary.packet_encap_types, int, i)));
+ add_string_to_table(table, &row, (i == 0) ? "Encapsulation:" : "",
+ string_buff);
+ }
+ } else {
+ g_snprintf(string_buff, SUM_STR_MAX, "%s", wtap_encap_string(summary.file_encap_type));
+ add_string_to_table(table, &row, "Encapsulation:", string_buff);
+ }
if (summary.has_snap) {
/* snapshot length */
g_snprintf(string_buff, SUM_STR_MAX, "%u bytes", summary.snap);