summaryrefslogtreecommitdiff
path: root/wiretap/pcap-common.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-08-25 14:14:11 -0700
committerGuy Harris <guy@alum.mit.edu>2016-08-25 21:14:48 +0000
commitc8157aa6b4afdbc2f84779ffbeea4f8d3bdc8666 (patch)
treecec6da41eb0360dab67a9b9e7234db95975ad854 /wiretap/pcap-common.c
parentce9a4b212ec7b75985cef3b9ab362808e6fd25c5 (diff)
downloadwireshark-c8157aa6b4afdbc2f84779ffbeea4f8d3bdc8666.tar.gz
Go back to having only one SocketCAN LINKTYPE_ value.
Libpcap just backed out the "host-endian" SocketCAN LINKTYPE_ value; we don't need it any more. Change-Id: I33a7dc21207a0009e20b4abaefe1119eb649c39a Reviewed-on: https://code.wireshark.org/review/17327 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/pcap-common.c')
-rw-r--r--wiretap/pcap-common.c43
1 files changed, 2 insertions, 41 deletions
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c
index 57b2207dce..316e1a36c5 100644
--- a/wiretap/pcap-common.c
+++ b/wiretap/pcap-common.c
@@ -378,8 +378,8 @@ static const struct {
{ 225, WTAP_ENCAP_FIBRE_CHANNEL_FC2_WITH_FRAME_DELIMS },
/* Solaris IPNET */
{ 226, WTAP_ENCAP_IPNET },
- /* SocketCAN frame, with CAN ID in big-endian byte order */
- { 227, WTAP_ENCAP_SOCKETCAN_BIGENDIAN },
+ /* SocketCAN frame */
+ { 227, WTAP_ENCAP_SOCKETCAN },
/* Raw IPv4 */
{ 228, WTAP_ENCAP_RAW_IP4 },
/* Raw IPv6 */
@@ -437,9 +437,6 @@ static const struct {
/* ISO14443 contactless smartcard standards */
{ 264, WTAP_ENCAP_ISO14443 },
- /* SocketCAN frame, with CAN ID in host-endian byte order */
- { 265, WTAP_ENCAP_SOCKETCAN_HOSTENDIAN },
-
/*
* To repeat:
*
@@ -1387,37 +1384,6 @@ pcap_byteswap_nflog_pseudoheader(struct wtap_pkthdr *phdr, guint8 *pd)
}
}
-static void
-pcap_byteswap_can_socketcan_pseudoheader(struct wtap_pkthdr *phdr, guint8 *pd)
-{
- guint packet_size;
- struct can_socketcan_hdr *can_socketcan_phdr;
-
- /*
- * Minimum of captured and actual length (just in case the
- * actual length < the captured length, which Should Never
- * Happen).
- */
- packet_size = phdr->caplen;
- if (packet_size > phdr->len)
- packet_size = phdr->len;
-
- /*
- * Greasy hack, but we never directly dereference any of
- * the fields in *can_socketcan_phdr, we just get offsets
- * of and addresses of its members and byte-swap it with a
- * byte-at-a-time macro, so it's alignment-safe.
- */
- can_socketcan_phdr = (struct can_socketcan_hdr *)(void *)pd;
-
- if (packet_size < sizeof(can_socketcan_phdr->can_id)) {
- /* Not enough data to have the full CAN ID */
- return;
- }
-
- PBSWAP32((guint8 *)&can_socketcan_phdr->can_id);
-}
-
/*
* Pseudo-header at the beginning of DLT_BLUETOOTH_HCI_H4_WITH_PHDR frames.
* Values in network byte order.
@@ -2000,11 +1966,6 @@ pcap_read_post_process(int file_type, int wtap_encap,
phdr->caplen = MIN(phdr->len, phdr->caplen);
break;
- case WTAP_ENCAP_SOCKETCAN_HOSTENDIAN:
- if (bytes_swapped)
- pcap_byteswap_can_socketcan_pseudoheader(phdr, pd);
- break;
-
default:
break;
}