summaryrefslogtreecommitdiff
path: root/wiretap/wtap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-08-18 18:39:43 -0700
committerGuy Harris <guy@alum.mit.edu>2016-08-19 01:42:06 +0000
commit95c4c432c43a07d8a43eae33591616145cabc57a (patch)
tree3954bb1fad7d06ea0299dd8044ba373900dc9965 /wiretap/wtap.c
parent2a4d6f1b3caccc015a1d18ea3267233a5503c703 (diff)
downloadwireshark-95c4c432c43a07d8a43eae33591616145cabc57a.tar.gz
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>
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r--wiretap/wtap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 01dfee42d3..213ab867a5 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -751,8 +751,8 @@ static struct encap_type_info encap_table_base[] = {
/* WTAP_ENCAP_IPNET */
{ "Solaris IPNET", "ipnet" },
- /* WTAP_ENCAP_SOCKETCAN */
- { "SocketCAN", "socketcan" },
+ /* WTAP_ENCAP_SOCKETCAN_BIGENDIAN */
+ { "SocketCAN with big-endian CAN ID", "socketcan-bigendian" },
/* WTAP_ENCAP_IEEE_802_11_NETMON */
{ "IEEE 802.11 plus Network Monitor radio header", "ieee-802-11-netmon" },
@@ -921,6 +921,9 @@ static struct encap_type_info encap_table_base[] = {
/* WTAP_ENCAP_JUNIPER_VN */
{ "Juniper VN", "juniper-vn" },
+
+ /* WTAP_ENCAP_SOCKETCAN_HOSTENDIAN */
+ { "SocketCAN with host-endian CAN ID", "socketcan-hostendian" },
};
WS_DLL_LOCAL