summaryrefslogtreecommitdiff
path: root/wiretap/pcap-common.c
diff options
context:
space:
mode:
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;
}