aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--summary.c8
-rw-r--r--summary.h2
-rw-r--r--ui/gtk/summary_dlg.c8
3 files changed, 6 insertions, 12 deletions
diff --git a/summary.c b/summary.c
index 8b6512719a..3f6af4539c 100644
--- a/summary.c
+++ b/summary.c
@@ -26,6 +26,8 @@
# include "config.h"
#endif
+#include <wiretap/pcap-encap.h>
+
#include <epan/packet.h>
#include "cfile.h"
#include "summary.h"
@@ -171,7 +173,6 @@ summary_fill_in(capture_file *cf, summary_tally *st)
}
-#ifdef HAVE_LIBPCAP
void
summary_fill_in_capture(capture_file *cf,capture_options *capture_opts, summary_tally *st)
{
@@ -202,7 +203,7 @@ summary_fill_in_capture(capture_file *cf,capture_options *capture_opts, summary_
iface.drops = cf->drops;
iface.has_snap = device.has_snaplen;
iface.snap = device.snaplen;
- iface.linktype = device.active_dlt;
+ iface.encap_type = wtap_pcap_encap_to_wtap_encap(device.active_dlt);
g_array_append_val(st->ifaces, iface);
}
} else {
@@ -216,7 +217,7 @@ summary_fill_in_capture(capture_file *cf,capture_options *capture_opts, summary_
iface.drops = 0;
iface.snap = wtapng_if_descr.snap_len;
iface.has_snap = (iface.snap != 65535);
- iface.linktype = wtapng_if_descr.link_type;
+ iface.encap_type = wtapng_if_descr.wtap_encap;
if(wtapng_if_descr.num_stat_entries == 1){
/* dumpcap only writes one ISB, only handle that for now */
if_stats = &g_array_index(wtapng_if_descr.interface_statistics, wtapng_if_stats_t, 0);
@@ -229,4 +230,3 @@ summary_fill_in_capture(capture_file *cf,capture_options *capture_opts, summary_
g_free(idb_info);
}
}
-#endif
diff --git a/summary.h b/summary.h
index a26704b921..21df0c0de8 100644
--- a/summary.h
+++ b/summary.h
@@ -38,7 +38,7 @@ typedef struct iface_options_tag {
gboolean drops_known; /**< TRUE if number of packet drops is known */
gboolean has_snap; /**< TRUE if maximum capture packet length is known */
int snap; /**< Maximum captured packet length */
- int linktype; /**< wiretap encapsulation type */
+ int encap_type; /**< wiretap encapsulation type */
} iface_options;
typedef struct _summary_tally {
diff --git a/ui/gtk/summary_dlg.c b/ui/gtk/summary_dlg.c
index c23f239314..02febe2253 100644
--- a/ui/gtk/summary_dlg.c
+++ b/ui/gtk/summary_dlg.c
@@ -171,7 +171,6 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
GtkTreeIter iter;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
- const char *dl_description;
static const char *titles[] = { "Traffic", "Captured", "Displayed", "Marked" };
gchar string_buff[SUM_STR_MAX];
@@ -388,12 +387,7 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
g_snprintf(string_buff3, SUM_STR_MAX, "unknown");
}
}
- dl_description = wtap_encap_string(iface.linktype);
- 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);
-
+ g_snprintf(string_buff4, SUM_STR_MAX, "%s", wtap_encap_string(iface.encap_type));
g_snprintf(string_buff5, SUM_STR_MAX, "%u bytes", iface.snap);
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);