aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2012-04-25 20:50:38 +0000
committerMichael Tüxen <tuexen@fh-muenster.de>2012-04-25 20:50:38 +0000
commit8ea1984ddc0620525dd1cafc60074755237eee31 (patch)
treedf75b00749abbfff6b07e052042dd392fc428d9b /dumpcap.c
parent1cd8ca08a6495a8a1ecb86fcdac36e7cc78d2997 (diff)
Allow writing ISB with given recv/drop counters.
No functional change by this commit. svn path=/trunk/; revision=42242
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 89a1754de0..ebbf7f949b 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -2749,13 +2749,24 @@ capture_loop_close_output(capture_options *capture_opts, loop_data *ld, int *err
for (i = 0; i < global_ld.pcaps->len; i++) {
pcap_opts = g_array_index(global_ld.pcaps, pcap_options *, i);
if (!pcap_opts->from_cap_pipe) {
+ guint64 isb_ifrecv, isb_ifdrop;
+ struct pcap_stat stats;
+
+ if (pcap_stats(pcap_opts->pcap_h, &stats) >= 0) {
+ isb_ifrecv = stats.ps_recv;
+ isb_ifdrop = stats.ps_drop;
+ } else {
+ isb_ifrecv = G_MAXUINT64;
+ isb_ifdrop = G_MAXUINT64;
+ }
libpcap_write_interface_statistics_block(ld->pdh,
i,
- pcap_opts->pcap_h,
&ld->bytes_written,
"Counters provided by libpcap",
start_time,
end_time,
+ isb_ifrecv,
+ isb_ifdrop,
err_close);
}
}