aboutsummaryrefslogtreecommitdiffstats
path: root/capinfos.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-06-10 00:40:18 -0700
committerGuy Harris <guy@alum.mit.edu>2016-06-10 07:41:04 +0000
commite53a1adf49c4b0f585b99f66c5a0ceb3653d840e (patch)
tree171f40a606dffea463a8fddbdb12b70f37a44296 /capinfos.c
parent1438d28768023cc185a3fa4237cb2842bbb5df31 (diff)
Always count packets per encapsulation.
Currently, for pcapng files, if all of the IDBs we've seen *so far* are the same, we report it as the file's encapsulation type; however, we may see IDBs of a different type in the future, so don't check for per-packet encapsulation before counting packets of the encapsulation type. Change-Id: I617ddcf2963aa16e7ba58855b3e5bf326ab7dc32 Reviewed-on: https://code.wireshark.org/review/15808 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'capinfos.c')
-rw-r--r--capinfos.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/capinfos.c b/capinfos.c
index f36e07a633..de38662c8b 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -1158,14 +1158,11 @@ process_cap_file(wtap *wth, const char *filename)
snaplen_max_inferred = phdr->caplen;
}
- /* Per-packet encapsulation */
- if (wtap_file_encap(wth) == WTAP_ENCAP_PER_PACKET) {
- if ((phdr->pkt_encap > 0) && (phdr->pkt_encap < WTAP_NUM_ENCAP_TYPES)) {
- cf_info.encap_counts[phdr->pkt_encap] += 1;
- } else {
- fprintf(stderr, "capinfos: Unknown per-packet encapsulation %d in frame %u of file \"%s\"\n",
- phdr->pkt_encap, packet, filename);
- }
+ if ((phdr->pkt_encap > 0) && (phdr->pkt_encap < WTAP_NUM_ENCAP_TYPES)) {
+ cf_info.encap_counts[phdr->pkt_encap] += 1;
+ } else {
+ fprintf(stderr, "capinfos: Unknown packet encapsulation %d in frame %u of file \"%s\"\n",
+ phdr->pkt_encap, packet, filename);
}
/* Packet interface_id info */