aboutsummaryrefslogtreecommitdiffstats
path: root/ui/cli/tap-stats_tree.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-10-14 19:15:07 -0700
committerGuy Harris <gharris@sonic.net>2021-10-14 19:15:07 -0700
commit39604740898f01fbed0777d3f9b8948bf23ec34a (patch)
tree21064347c0c3c8f80e5ac1ed748a20de20030692 /ui/cli/tap-stats_tree.c
parent2d569e116ef9a634ad8eee939dd53e16af3c2a0f (diff)
socketcan: support the CANFD_FDF flag for identifying CAN FD frames.
The Linux SocketCAN header now uses the formerly-reserved byte in the SocketCAN header after the "payload length" field as an "FD flags" field, with a flag bit reserved to indicate whether the frame is a classic CAN frame or a CAN FD frame, with two other bits giving frame information for FD frames. For LINKTYPE_CAN_SOCKETCAN, use that flag bit to determine whether the frame is classic CAN or CAN FD. As some older LINKTYPE_CAN_SOCKETCAN captures have SocketCAN headers in which the fields after the "payload length" field were uninitialized, so trust that thge "FD flags" was filled in, rather than possibly randomly uninitialized, only if the only bits set in that field are the bits defined to be in that field and the two reserved bytes after it are zero. This will be needed when the current main-branch libpcap is released, as it uses LINKTYPE_CAN_SOCKETCAN rather than LINKTYPE_LINUX_SLL for ARPHRD_CAN devices; we add it now to future-proof the Wireshark releases to which this is being committed. It also handles what existing CAN FD captures using LINKTYPE_CAN_SOCKETCAN exist. For LINKTYPE_LINUX_SLL frames, we have the protocol field to distinguish between classic CAN and CAN FD, so we use that to determine the frame type, rather than looking at the CANFD_FDF flag. dissect_socketcan_common() now handles both classic CAN and CAN FD frames.
Diffstat (limited to 'ui/cli/tap-stats_tree.c')
0 files changed, 0 insertions, 0 deletions