Linux-CAN / SocketCAN user space applications
 
 
 
 
Go to file
Oliver Hartkopp a4905ed7c8 fix timeval to ASCII unsigned value conversion
As reported by Oleksij Rempel here
https://github.com/linux-can/can-utils/issues/233#issuecomment-674818935
the representation of timeval timestamps are signed values which leads to
negative values on 32 bit machines addressing the year 2038 unix sec counter
overflow.

Fix the issue on 32 bit systems by converting the timeval values to unsigned
ASCII value representations.

Fixes: https://github.com/linux-can/can-utils/issues/234
Reported-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2020-08-18 12:51:35 +02:00
.github/workflows add github actions 2019-11-25 15:29:47 +01:00
LICENSES Add license texts as files 2019-09-26 15:45:43 +02:00
cmake CMake first pass (#90) 2018-08-17 09:50:30 +02:00
config/m4 add autotools infrastructure 2010-04-19 12:12:18 +00:00
include/linux Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
.gitignore Rename j* to j1939\1 2020-04-20 10:18:13 +03:00
.travis.yml CI: treat gcc warning as errors 2018-09-13 10:38:19 +02:00
Android.mk Update Android.mk 2020-07-06 08:47:35 +02:00
CMakeLists.txt CMakeLists.txt: update test for _GNU_SOURCE to fix warnings 2020-06-29 18:20:18 +02:00
GNUmakefile.am Rename j* to j1939\1 2020-04-20 10:18:13 +03:00
Makefile Rename j* to j1939\1 2020-04-20 10:18:13 +03:00
README.md README: cansniffer is now also 29 bit CAN ID capable 2020-05-11 15:26:05 +02:00
asc2log.c fix timeval to ASCII unsigned value conversion 2020-08-18 12:51:35 +02:00
autogen.sh do not use --symlink for autoreconf 2014-07-02 16:03:34 +02:00
bcmserver.c can-utils: fix unused variable warnings 2020-05-28 19:32:20 +02:00
can-calc-bit-timing.c can-calc-bit-timing: fix warning 2020-06-22 12:41:48 +02:00
can-j1939-kickstart.md can-j1939-kickstart.md: fix example in documentation 2020-05-30 19:32:32 +02:00
can-j1939.md Fix spelling in various files 2019-11-11 14:21:49 +01:00
canbusload.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
candump.c fix timeval to ASCII unsigned value conversion 2020-08-18 12:51:35 +02:00
canfdtest.c canfdtest: make number of frames in flight a command line option 2020-06-22 11:59:35 +02:00
canframelen.c Add SPDX identifiers 2019-06-19 12:24:24 +02:00
canframelen.h Add SPDX identifiers 2019-06-19 12:24:24 +02:00
cangen.c cangen: support ESI bit for CAN FD frame generation 2020-05-10 12:03:35 +02:00
cangw.c Fix arithmetic on a pointer warning 2020-05-28 20:54:37 +02:00
canlogserver.c fix timeval to ASCII unsigned value conversion 2020-08-18 12:51:35 +02:00
canplayer.c fix timeval to ASCII unsigned value conversion 2020-08-18 12:51:35 +02:00
cansend.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
cansniffer.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
configure.ac buildsystem: add SCM_TIMESTAMPING_OPT_STATS if not already defined 2019-05-09 14:40:16 +02:00
isotpdump.c fix timeval to ASCII unsigned value conversion 2020-08-18 12:51:35 +02:00
isotpperf.c fix timeval to ASCII unsigned value conversion 2020-08-18 12:51:35 +02:00
isotprecv.c isotprecv.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
isotpsend.c isotpsend.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
isotpserver.c isotpserver.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
isotpsniffer.c fix timeval to ASCII unsigned value conversion 2020-08-18 12:51:35 +02:00
isotptun.c isotptun.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
j1939acd.c Merge pull request #230 from marckleinebudde/j1939acd 2020-08-07 14:10:29 +02:00
j1939cat.c Merge pull request #231 from olerem/jcat-bam 2020-08-07 14:23:46 +02:00
j1939spy.c j1939: Fix comparison type mismatch warnings 2020-06-12 20:08:18 +02:00
j1939sr.c jsr.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
lib.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
lib.h Fix spelling in various files 2019-11-11 14:21:49 +01:00
libj1939.c j1939: Fix comparison type mismatch warnings 2020-06-12 20:08:18 +02:00
libj1939.h libj1939.h: add missing license and copyright header 2019-09-26 15:46:20 +02:00
log2asc.c fix timeval to ASCII unsigned value conversion 2020-08-18 12:51:35 +02:00
log2long.c can-utils: fix unused variable warnings 2020-05-28 19:32:20 +02:00
page.theme import sample program & help page 2013-11-20 11:14:44 +01:00
slcan_attach.c slcan_attach.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
slcand.c slcand.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
slcanpty.c slcanpty: add missing include sys/select.h 2020-06-29 18:20:18 +02:00
style.css import sample program & help page 2013-11-20 11:14:44 +01:00
terminal.h Add SPDX identifiers 2019-06-19 12:24:24 +02:00
testj1939.c testj1939: print proper offset in the data damp 2020-08-07 15:01:43 +02:00

README.md

SocketCAN logo

SocketCAN userspace utilities and tools

This repository contains some userspace utilities for Linux CAN subsystem (aka SocketCAN):

Basic tools to display, record, generate and replay CAN traffic

  • candump : display, filter and log CAN data to files
  • canplayer : replay CAN logfiles
  • cansend : send a single frame
  • cangen : generate (random) CAN traffic
  • cansniffer : display CAN data content differences

CAN access via IP sockets

  • canlogserver : log CAN frames from a remote/local host
  • bcmserver : interactive BCM configuration (remote/local)
  • socketcand : use RAW/BCM/ISO-TP sockets via TCP/IP sockets
  • cannelloni : UDP/SCTP based SocketCAN tunnel

CAN in-kernel gateway configuration

  • cangw : CAN gateway userspace tool for netlink configuration

CAN bus measurement and testing

  • canbusload : calculate and display the CAN busload
  • can-calc-bit-timing : userspace version of in-kernel bitrate calculation
  • canfdtest : Full-duplex test program (DUT and host part)

ISO-TP tools ISO15765-2:2016 for Linux

  • isotpsend : send a single ISO-TP PDU
  • isotprecv : receive ISO-TP PDU(s)
  • isotpsniffer : 'wiretap' ISO-TP PDU(s)
  • isotpdump : 'wiretap' and interpret CAN messages (CAN_RAW)
  • isotpserver : IP server for simple TCP/IP <-> ISO 15765-2 bridging (ASCII HEX)
  • isotpperf : ISO15765-2 protocol performance visualisation
  • isotptun : create a bi-directional IP tunnel on CAN via ISO-TP

Log file converters

  • asc2log : convert ASC logfile to compact CAN frame logfile
  • log2asc : convert compact CAN frame logfile to ASC logfile
  • log2long : convert compact CAN frame representation into user readable

Serial Line Discipline configuration (for slcan driver)

  • slcan_attach : userspace tool for serial line CAN interface configuration
  • slcand : daemon for serial line CAN interface configuration
  • slcanpty : creates a pty for applications using the slcan ASCII protocol

CMake Project Generator

  • Place your build folder anywhere, passing CMake the path. Relative or absolute.
  • Some examples using a build folder under the source tree root:
  • Android : cmake -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-21 -DANDROID_ABI=armeabi-v7a .. && make
  • Android Studio : Copy repo under your project's app folder, add add_subdirectory(can-utils) to your CMakeLists.txt file after cmake_minimum_required(). Generating project will build Debug/Release for all supported EABI types. ie. arm64-v8a, armeabi-v7a, x86, x86_64.
  • Raspberry Pi : cmake -DCMAKE_TOOLCHAIN_FILE=~/rpi/tools/build/cmake/rpi.toolchain.cmake .. && make
  • Linux : cmake -GNinja .. && ninja
  • Linux Eclipse Photon (Debug) : CC=clang cmake -G"Eclipse CDT4 - Unix Makefiles" ../can-utils/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_VERSION=4.8.0
  • To override the base installation directory use: CMAKE_INSTALL_PREFIX ie. CC=clang cmake -DCMAKE_INSTALL_PREFIX=./out .. && make install

Additional Information: