aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
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
parentce9a4b212ec7b75985cef3b9ab362808e6fd25c5 (diff)
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')
-rw-r--r--wiretap/pcap-common.c43
-rw-r--r--wiretap/wtap.h3
2 files changed, 3 insertions, 43 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;
}
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index fc73ebe5c9..20a3b188f3 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -212,7 +212,7 @@ extern "C" {
#define WTAP_ENCAP_FIBRE_CHANNEL_FC2_WITH_FRAME_DELIMS 122
#define WTAP_ENCAP_JPEG_JFIF 123 /* obsoleted by WTAP_ENCAP_MIME*/
#define WTAP_ENCAP_IPNET 124
-#define WTAP_ENCAP_SOCKETCAN_BIGENDIAN 125
+#define WTAP_ENCAP_SOCKETCAN 125
#define WTAP_ENCAP_IEEE_802_11_NETMON 126
#define WTAP_ENCAP_IEEE802_15_4_NOFCS 127
#define WTAP_ENCAP_RAW_IPFIX 128
@@ -269,7 +269,6 @@ extern "C" {
#define WTAP_ENCAP_GFP_F 179
#define WTAP_ENCAP_IP_OVER_IB_PCAP 180
#define WTAP_ENCAP_JUNIPER_VN 181
-#define WTAP_ENCAP_SOCKETCAN_HOSTENDIAN 182
/* After adding new item here, please also add new item to encap_table_base array */
#define WTAP_NUM_ENCAP_TYPES wtap_get_num_encap_types()