]> The Tcpdump Group git mirrors - libpcap/commit
Have separate DLTs for big-endian and host-endian SocketCAN headers.
authorGuy Harris <[email protected]>
Thu, 18 Aug 2016 18:44:32 +0000 (11:44 -0700)
committerGuy Harris <[email protected]>
Thu, 18 Aug 2016 18:44:32 +0000 (11:44 -0700)
commit6aa0f48883bf69a5c8fb09532ec47edfb9750ee7
tree6361ca880787655f10b8c64d3df93dd7b800aafb
parent18bf0f9560fcf0fdc331c8109990bf46d63941de
Have separate DLTs for big-endian and host-endian SocketCAN headers.

At least with some versions of the Linux kernel, you can capture on
SocketCAN interfaces with a PF_PACKET socket and get packets with
SocketCAN headers; that code doesn't special-case ARPHRD_CAN, so it
leaves the CAN ID field in host byte order.

In addition, the "capture CAN packets on a USB device" code wasn't
putting that field into host byte order, either.

So have separate DLT_/LINKTYPE_ types, one for packets with the CAN ID
in big-endian byte order and one for packets with the CAN ID in host
byte order.  When reading LINKTYPE_CAN_SOCKETCAN_HOSTENDIAN files, swap
the CAN ID field as necessary to put it into the byte order for the host
reading the file rather than the byte order for the host that wrote the
file.
Makefile.in
gencode.c
pcap-can-linux.c
pcap-canusb-linux.c
pcap-common.c
pcap-linux.c
pcap.c
pcap/can_socketcan.h [new file with mode: 0644]
pcap/dlt.h