can-utils
can-utils copied to clipboard
More flags for logging.
Hi,
The SocketCAN API is a great initiative for standardizing the CAN interface API. This request tries to extend this initiative for more use cases.
Context
The SocketCAN was adopted by libpcap and tcpdump as the standard format for logging CAN Frames in PCAP and PCAP-NG. See:
- https://www.tcpdump.org/linktypes/LINKTYPE_CAN_SOCKETCAN.html
- https://github.com/wireshark/wireshark/blob/master/epan/dissectors/packet-socketcan.c
- https://www.wireshark.org/docs/dfref/c/can.html
Problem
- Applications that perform logging, usually need more details that normal applications, for the sake of debugging later on.
- Flags needs to be reserved/allocated in the SocketCAN API, so that logging applications can make use of them in the PCAP format.
- The flags does not need necessary need to be implemented by SocketCAN, they just need to be marked as reserved for such use case.
Needed Flags
FDF Flag
- Since CAN Frames and CAN-FD frames can co-exist in the same bus, logging application needs to know if a normal CAN Frame was transmitted on a CAN-FD bus, namely was the
FDFbit set or not.
ACK bit in data frame
- Some logging hardware can act as a "spy", meaning that it records CAN Frames, but does not set the ACK bit
- A way to know for a given frame (FD or not), was the ACK bit set or not.
- Current API allow detecting missing ACK, but it does not report what Frame had a missing ACK.
Sounds interesting! Let's move the discussion to the linux-can mailinglist. https://lore.kernel.org/linux-can/[email protected]/T/#u