forked from osmocom/wireshark
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>
This commit is contained in:
parent
1438d28768
commit
e53a1adf49
13
capinfos.c
13
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 */
|
||||
|
|
Loading…
Reference in New Issue