aboutsummaryrefslogtreecommitdiffstats
path: root/extcap.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2023-08-12 13:45:16 -0700
committerGuy Harris <gharris@sonic.net>2023-08-12 13:45:16 -0700
commitc3fe4c8fd86dec526e954f6d6613fe4b78c5c687 (patch)
tree979f481a1dcccc2c5c12b9331c53c64d5ba8b404 /extcap.c
parente755912ec92041f0636b7b20f150744dcde7ded3 (diff)
dumpcap: map DLT_ values from libpcap or piped pcap headers to LINKTYPE_s.
For most link-layer header types, the DLT_ value and the LINKTYPE_ value are the same. For some DLT_s for which the values are *not* the same on all OSes, or which weren't defined on some OSes, that's not the case, because, in order to have a *single* link-layer type value to use in capture files on *all* platforms, so that the link-layer type is the same no matter what OS it was captured on, new values were assigned for LINKTYPE_s. (That's why LINKTYPE_s were created in the first place.) Therefore, we should map DLT_ values obtained from libpcap to the corresponding LINKTYPE_ values before using the value in a pcap header or a pcapng Interface Description Block. Furthermore, since a pcap or pcapng file being piped to dumpcap might have been generated by a program that doesn't do DLT_ to LINKTYPE_ mapping (the libpcap from tcpdump.org has done so for many years now, but OpenBSD's libpcap doesn't), we map them for pcap files as well. (pcapng files require that we not just blindly copy the pcapng file. Other things, such as byte-swapped pcapng files, may also require that; this needs to be looked into.) Fixes #19230.
Diffstat (limited to 'extcap.c')
0 files changed, 0 insertions, 0 deletions