Commit Graph

450 Commits (bb2cc1140fafe799b20fd94996d8f10d17e888e4)

Author SHA1 Message Date
Oliver Hartkopp 278344e5d5 fixed comment. 2008-06-11 16:38:00 +00:00
Oliver Hartkopp 4c7d5e434f Removed bad hacks in vcan.c and slcan_attach.c.
Giving some hints for users of older kernels than 2.6.25 that a 
compilation error is a normal behaviour in these cases.
2008-06-11 16:35:19 +00:00
Oliver Hartkopp 9cb4775283 Added Id properties that gone lost. 2008-06-03 08:52:06 +00:00
Oliver Hartkopp adbe6f9bee Whitespace fixes. Indented the code following Linux styleguide to fix
the mess between tabs and spaces.
2008-06-03 08:46:57 +00:00
Oliver Hartkopp 8a5c0365e6 Added binary output option to candump.c and sprint_long_canframe() in lib.c . 2008-06-02 20:06:37 +00:00
Oliver Hartkopp 789a021bb9 Added tiny tool to measure CAN busload. 2008-05-27 13:47:20 +00:00
Oliver Hartkopp 0df736ca51 Added hint about hexadecimal data representation. 2008-05-11 11:46:00 +00:00
Oliver Hartkopp 5769d708e4 Updated new 'cangen' and 'candump' in the trunk. 2008-05-05 12:20:34 +00:00
Oliver Hartkopp 770eeeaf23 Allow commandline option '-?' to print the help text. 2008-03-13 21:52:20 +00:00
Oliver Hartkopp 8891e44d28 Updated help text for commandline options. 2008-03-13 21:44:20 +00:00
Oliver Hartkopp ec4a0bcd6d Fixed the temporary hack to run with 2.6.24-rc5 again. 2007-12-23 18:17:29 +00:00
Oliver Hartkopp 5f164d3414 - allow timout to be zero, which means timeout is off. 2007-12-10 15:47:01 +00:00
Oliver Hartkopp 64f6a9a6d4 Added canlogserver programmed by Andre Naujoks. 2007-11-30 13:35:01 +00:00
Oliver Hartkopp e47a1b4b26 Changed color order at colorized output.
Remove index cache zombies when unloading CAN drivers.
Modified index cache failure message.
2007-11-20 18:37:30 +00:00
Oliver Hartkopp 12f9170338 Fixed checking of CAN interface name commandline parameter.
Cosmetics.
2007-10-07 14:39:52 +00:00
Oliver Hartkopp d72681c442 Reverted most of the changes since r500 except the changes in
drivers/net/can/* after discussion with Urs.
TODO: Documentation & new Version.
2007-10-01 05:48:50 +00:00
Oliver Hartkopp 6689e9600d Changed loopback to echo in CAN RAW sockets. The binary interface does
not change through this renaming of CAN_RAW_LOOPBACK to CAN_RAW_ECHO.
2007-09-30 13:00:42 +00:00
Oliver Hartkopp d0b24ffc10 Fixed contradiction in Sourcecode discalimer.
See details at
http://marc.info/?l=linux-netdev&m=119074747913703&w=2
2007-09-27 12:29:32 +00:00
Oliver Hartkopp 44fb4089c3 Update outdated comment. 2007-09-21 07:21:24 +00:00
Oliver Hartkopp 592c916948 Updated the canplayer to accept logfile timestamps in the future (which
is very nice when you don't have a RTC and your systemtime is somewhere 
in the 1970's :)
Added a new commandline option to skip timestamp jumps greater than x 
seconds to allow to concatenate different logfiles that replay 
constantly and not waiting for the absolute timestamp offsets.
2007-09-07 11:15:22 +00:00
Oliver Hartkopp e5de3cbeeb Removed "unused variable i" warning for the dry-run testing. 2007-08-03 11:17:10 +00:00
Oliver Hartkopp 8d365bc5b0 Added the blanking of 'old' data when the can_dlc decreases between two
receiptions of the same can_id.
Thanks to Andre Naujoks for the bug report.
2007-07-16 09:52:43 +00:00
Oliver Hartkopp 01a8c5d32b Added -B option to display binary content with a gap after each data byte.
This option is similar to -b but may exceed the 80 char boundary.
2007-07-16 08:29:28 +00:00
Oliver Hartkopp 477c00752b Fixed compilation warning on 64bit architectures.
Thanks to Neal Probert for the hint.
2007-07-08 12:44:12 +00:00
Urs Thuermann e7d585a1c8 Add vcan config tool to Makefile. 2007-07-07 01:36:36 +00:00
Urs Thuermann d90f47ef9c Add a tool "vcan" to add/remove vcan interfaces. 2007-07-06 15:50:55 +00:00
Oliver Hartkopp 47ca8b7900 Updated LDISC number to 17 (16 is occupied in the Kernel) 2007-06-25 13:05:43 +00:00
Oliver Hartkopp 404bf3b1bd Added option '-x' to disable local loopback for sent CAN frames. 2007-06-22 08:33:18 +00:00
Oliver Hartkopp a121452698 Changed option name '-l' to '-x' as this option should also go into canplayer.
Cosmetics in print_help().
2007-06-22 08:25:34 +00:00
Oliver Hartkopp c2c6579bd6 Added option '-l' to disable local loopback for generated data. 2007-06-22 08:04:48 +00:00
Oliver Hartkopp f1e643f8f1 Added program exit on SIOCGIFINDEX error. 2007-06-18 20:04:23 +00:00
Oliver Hartkopp e49fb4c134 Disabled obsolte receive filter. Added error checking for SIOCGIFINDEX. 2007-06-18 19:59:20 +00:00
Oliver Hartkopp 5723c5ce86 Added new commandline option '-B' which acts like the bridging option '-b' but
disables the local loopback functionality (for ECU analysis and MITM-attacks :)
Fixed missing fflush().
2007-05-30 07:20:18 +00:00
Oliver Hartkopp 33e6337cde Added missing initialisation to prevent a gcc warning. 2007-05-09 07:33:34 +00:00
Oliver Hartkopp 60b77912ab Fixed Makefiles to compile test-apps and can-utils again.
Added new commandline parameter (linediscipline value) to slcan_attach.
2007-03-05 21:58:28 +00:00
Oliver Hartkopp 79cc51a867 Added CAN interface driver for low-cost CAN-Interfaces with ASCII protocol
via serial (or quasi serial via USB) lines.

This driver is partly derived from linux/net/driver/slip.c and uses a new
tty line discipline (N_SLCAN) analogue to N_SLIP to encapsulate can_frames
sent to a slc* netdevice for the serial line and vice versa.

As only the sending and receiving of can_frames is implemented, this driver
should work with the (serial/USB) CAN hardware from:
> www.canusb.com / www.can232.com / www.mictronic.com / www.canhack.de <

The sending and receiving frames format is pretty common. The other settings
and the 'open' command 'O' of the specific adapters may be set with a
terminal programm (like minicom) before switching the CAN data stream to
the slc* netdevice using the slcan_attach userspace tool.

Feel free to send patches / extensions to slcan.c / slcan_attach.c :)

ps. There had been no performances measurements until now. As long as the
data fit's through the 'serial' line it works obviously well. The slcan-driver
nor the Linux network layer will definitely have no problems to process
the received data. Remember the 'low-cost' hardware approach. We'll see ...
2007-02-22 12:47:37 +00:00
Oliver Hartkopp aca93c6867 Added Option -l ('l'oop) to make the canplayer replay a given file more than
one time. To replay a given file infinitely say '-l i'. Of course it is not
possible/reasonable to define '-l' when reading from stdin ...
2007-02-12 08:36:38 +00:00
Oliver Hartkopp 892c0d9e7d Removed possibility to terminate candump with an input from stdin.
Therefore it can be used in scripts now, e.g. for CAN-frame bridging:
   candump can1 -mFFF -v123 -b can3 -s 2 &
Use CTRL-C to terminate candump.
2007-02-09 09:53:16 +00:00
Oliver Hartkopp 30426b2647 Renamed can-sniffer to cansniffer. 2007-02-08 13:18:07 +00:00
Oliver Hartkopp 3d26e6f710 Fixed typo in log2asc.c
Added asc2log.c to convert existing CANoe/CANalyser logfiles into socketcan
logfiles (with absolute and full qualified timestamps).
The date and the other settings (dec/hex absolute/relative) are taken from
the head of the ASC files.
2007-01-10 17:18:01 +00:00
Oliver Hartkopp c2424910ac Some new ASC files support 6 digits in decimal place.
Added new option '-4' to generate 'old-style' ASC files.
2007-01-09 16:01:46 +00:00
Oliver Hartkopp f1284e83aa Added option '-L' to candump to create the compact logfile output on stdout.
Now you can forward CAN frames e.g. via netcat with candump and canplayer:

candump can0 can1 -L | canplayer vcan3=can0 vcan0=can1 -t

OK, maybe it would be reasonable to write a short program for this application.
But for some tests all this can be done with existing commandline tools.
In addition the filtering possibilities of candump can be used here.
2007-01-07 11:19:37 +00:00
Oliver Hartkopp 4d129ea348 Minor fix and cosmetics in color handling in candump.c .
Added new tool 'canplayer' to replay logfiles generated by candump -l .

Features of canplayer:

- Input from stdin or file.
- throttling of the replay to get nearly original timestamps / message gaps
- mapping and selection of CAN interfaces (assignment)
  e.g. canplay -I logfile vcan2=can2 vcan0=can1 can2=can3
  means: send frames received on can1 in the logfile to vcan0 and so on ...
- if no assignment is made the original interfaces are used for replay
- handling of multiple CAN interfaces simultaneously (if in logfile)
- option: throttle disable (do not look on timestamps => very FAST replay!)
- option: change the 'sleep time' in milli seconds

Remarks:
canplayer uses nanosleep() for throttling which means that the resolution of
the canplayer is about 1ms (Kernel HZ = 1000) or 10ms (Kernel HZ = 100).
After each nanosleep() all the CAN frames are send that had to be transmitted
until the timestamp at the current time. Giving e.g. the option '-g 500' for
500ms let's you see the behaviour. Using nanosleep() makes canplay a very
performant tool with minimum CPU load.

To transfer CAN frames over a TCP/IP network you may now say something like:
candump -> netcat -> netcat -> canplayer
2007-01-06 15:43:12 +00:00
Oliver Hartkopp f95fc47ec8 - added error frame support in lib.c
- added sprint_* functions for CAN-frame output in lib.c / lib.h
- added comments / cosmetics

candump.c:
- removed support for the output in ASC representation (moved to log2asc.c)
- added option '-l' for logfile creation e.g. 'candump-2007-01-01_164123.log'
- added funtionality to terminate candump by pressing [ENTER] (not only ^C)
- added error frame support
- added color support even when reading from 'any'
- three different color levels (e.g. -c -c -c)
- making use if lib.c

cangen.c:
-  CAN frames generator for testing purposes (e.g. on vcanx)
(nice when you're on vacancy at the baltic sea and have no real CAN source :)

log2long.c:
- convert compact CAN frame representation into user readable representation

log2asc.c:
- convert compact CAN frame logfile to ASC logfile for 3rd party CAN tools

Next step: Create a tool to replay candump logfiles.
2007-01-01 18:29:52 +00:00
Oliver Hartkopp 50e8c467af Added include <sys/socket.h> to lib.c after discussion on commit-mailing-list.
Fixed comments.
Fixed Makefile (remove all *.o files / added empty line at end of file).
2006-10-31 10:41:21 +00:00
Oliver Hartkopp 99a3bba852 Added tiny tool cansend and a library to parse ASCII CAN frames (e.g. from
the command line) that are defined in one concatenated string.
This is a requirement for the comming command line tool 'bcmsend' that allows
to send more than one CAN frame at a time.
2006-10-30 13:14:36 +00:00
Urs Thuermann 063c62c665 changed user space programs to use new include files.
added missing include file <net/if.h> in most programs.
added volatile modifier to "int running" in candump.c.
2006-10-24 13:55:43 +00:00
Urs Thuermann cee2fc2fd0 Remove remnants of the projects VW history (Email addresses, Makefile targets).
Move version.h to include/linux/can.
Fix Makefiles to include raw.ko and bcm.ko in compilation and to make
vcan compile again.
Change ioctl names in SJA1000 driver to make it compile again.
Add parenthesis around assignment in vcan.c to eliminate gcc warning.
2006-07-07 06:58:26 +00:00
Urs Thuermann 46cdac2554 add Id to svn:keywords property. 2006-05-11 07:59:37 +00:00
Urs Thuermann e7a59a9ea4 Initial import of llcf-2.0-pre2 2006-04-24 14:14:09 +00:00