Handle the new LINKTYPE_CAN_SOCKETCAN_HOSTENDIAN.
authorGuy Harris <guy@alum.mit.edu>
Fri, 19 Aug 2016 01:39:43 +0000 (18:39 -0700)
committerGuy Harris <guy@alum.mit.edu>
Fri, 19 Aug 2016 01:42:06 +0000 (01:42 +0000)
commit95c4c432c43a07d8a43eae33591616145cabc57a
tree3954bb1fad7d06ea0299dd8044ba373900dc9965
parent2a4d6f1b3caccc015a1d18ea3267233a5503c703
Handle the new LINKTYPE_CAN_SOCKETCAN_HOSTENDIAN.

Unfortunately, only one libpcap code path puts the CAN ID in the
SocketCAN header in network byte order; the others leave it in host byte
order.  Therefore, a new LINKTYPE_/DLT_ value was introduced, and
libpcap was changed to use that for the cases where the CAN ID is in
host byte order.  Support them both.

This means we need to, when reading pcap and pcapng files, fix up the
CAN ID if the host that wrote the file has a different byte order from
ours (as libpcap also now does).  This includes Linux "cooked" captures,
which can include CAN packets.

Change-Id: I75ff2d68d1fbdb42753ce85d18f04166f21736dd
Reviewed-on: https://code.wireshark.org/review/17155
Reviewed-by: Guy Harris <guy@alum.mit.edu>
epan/dissectors/packet-socketcan.c
wiretap/pcap-common.c
wiretap/wtap.c
wiretap/wtap.h