From 93ca5ff7030aaf1219e1de05ec89a68384bfc50b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 25 Aug 2016 13:26:43 -0700 Subject: On Linux, handle all CAN captures with pcap-linux.c, in cooked mode. There's no need to support capturing on PF_CAN sockets; CAN interfaces show up as regular interfaces on which you can capture with PF_PACKET sockets, so just let pcap-linux.c handle them, and get rid of pcap-can-linux.c. Capture on them in cooked mode, so we get the protocol field and can distinguish between "classic" CAN and CAN FD. The hardware for which pcap-canusb-linux.c was intended never reached production: https://github.com/axos88/libpcap/commit/f3edbb599b8cbcc7e4560000dcba8e992dc11a31#commitcomment-18716617 so we don't need pcap-canusb-linux.c, either. This all removes the need for the "host-endian" link-layer header type; it never made it into a libpcap release, so we just remove it. The "big-endian" link-layer header type is kept for the benefit of packets captured with the old pcap-can-linux.c code; we revert it to its old name. --- gencode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gencode.c') diff --git a/gencode.c b/gencode.c index d1326f70..b0cadc32 100644 --- a/gencode.c +++ b/gencode.c @@ -3397,8 +3397,7 @@ gen_linktype(compiler_state_t *cstate, int proto) bpf_error(cstate, "Bluetooth link-layer type filtering not implemented"); case DLT_CAN20B: - case DLT_CAN_SOCKETCAN_BIGENDIAN: - case DLT_CAN_SOCKETCAN_HOSTENDIAN: + case DLT_CAN_SOCKETCAN: bpf_error(cstate, "CAN link-layer type filtering not implemented"); case DLT_IEEE802_15_4: -- cgit v1.2.3