Provide recv stats when reading from file

This commit is contained in:
emanuele-f 2022-01-25 11:31:14 +01:00
parent f2f765dca5
commit 82831cae2d

View File

@ -839,6 +839,12 @@ static int read_pkt(pcapd_runtime_t *rt, pcapd_iface_t *iface, time_t now) {
printf("[%s:%d] %s (%u B) [%cX]\n", iface->name, iface->ifid, buf, phdr.len, is_tx ? 'T' : 'R');
}
if(iface->is_file) {
// libpcap does not provide stats for savefiles
// https://www.tcpdump.org/manpages/pcap_stats.3pcap.html
iface->stats.ps_recv++;
}
}
}
}