Oliver Hartkopp
d3468d907f
Fix datatype issue in sscanf() on 64bit systems.
...
On 64bit systems a 'long' is a 64bit value but the target values of scanf()
are always 32bit in the affected code - which means just an 'unsigned int'.
Unsigned int is fine on 32 and 64 bit systems.
Thanks to Andre Naujoks for reporting this issue.
2010-09-25 10:24:37 +00:00
Oliver Hartkopp
1463ee4ce4
Added support for inverted CAN ID filters.
2010-09-24 18:23:42 +00:00
Oliver Hartkopp
d7fe33eb4b
Fixed calculation of needed bits on the physical wire according Ken Tindells
...
*worst* case calculation for stuff-bits.
(see "Guaranteeing Message Latencies on Controller Area Network" 1st ICC'94)
Due to the bitstuffing estimation the calculated busload may exceed 100%.
2010-09-24 17:56:53 +00:00
Oliver Hartkopp
5655d53acb
Remove compiler warning :
...
warning: suggest explicit braces to avoid ambiguous ‘else’
2010-05-14 12:50:17 +00:00
Oliver Hartkopp
62c030b21f
Added isotpserver in autotool config file and gitignore
2010-05-14 12:43:42 +00:00
Oliver Hartkopp
b68a79ebde
Added tiny ip server to send ISO 15765-2 PDUs via internetsockets to the CAN bus and vice versa.
2010-05-14 12:03:32 +00:00
Oliver Hartkopp
c8247c8a57
Allow to have 4, 5 or 6 decimal places instead of only 4 & 6.
2010-05-11 10:01:49 +00:00
Oliver Hartkopp
c6b3ceff83
Added CRC8 profiles to handle additional data for checksum generation.
2010-04-16 08:46:17 +00:00
Oliver Hartkopp
9e8f9200fb
Added checksum functionality and some documentation in gw.h
2010-04-12 14:41:14 +00:00
Oliver Hartkopp
a784e1e46f
Complete rework of CAN netlink gateway.
...
Major changes:
- rework internal structures to prepare routings and modifications of CAN traffic also to non-CAN interfaces
- fix reading of netlink messages in cangw.c (added RTCAN_RTA / RTCAN_PAYLOAD macros)
- rework reading of gw-job lists in cgw_dump_jobs()
- rename of functions and API definitions to have a common namespace cgw_
- added infrastructure to perform crc8 and xor checksums in CAN frame data[]
TODO:
- add and test functionality for crc8 and xor checksums in CAN frame data[]
- add help text for crc8 and xor checksums in CAN frame data[]
2010-04-10 16:38:48 +00:00
Oliver Hartkopp
ee562a9724
Some binaries in can-utils depend on features in the socket-can svn
...
repository. Building with exported headers from an unpatched kernel will
fail due to missing symbols or headers.
This patch adds two make variables to optionally disable building such
binaries, like this:
make PROGRAMS_ISOTP= PROGRAMS_CANGW= PROGRAMS_SLCAN= all
Signed-off-by: Olaf Hering <olaf@aepfle.de >
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net >
2010-03-17 19:21:38 +00:00
Oliver Hartkopp
f731bbe2a2
To simplify packaging of can-utils, add DESTDIR and PREFIX support to
...
the can-utils Makefile.
Signed-off-by: Olaf Hering <olaf@aepfle.de >
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net >
2010-03-17 19:12:26 +00:00
Oliver Hartkopp
3765e1d25b
Initialize packet counters when printing each routing entry.
2010-03-04 10:59:24 +00:00
Oliver Hartkopp
d81a13866b
Rework of help text.
2010-02-27 16:07:58 +00:00
Oliver Hartkopp
afa14f102d
When sending a sequence, we need to resend the same frame when poll() returns.
...
Fixed that to be a valid data source e.g. for ptx cansequence.
2010-02-26 08:38:47 +00:00
Oliver Hartkopp
e089e5d0ba
Added commandline option '-p <timeout>' to enable polling on the writing socket.
...
Inspired by Marc Kleine-Budde :-)
2010-02-25 20:53:19 +00:00
Oliver Hartkopp
3a0612c14a
Added funtionality to flush all GW jobs in one netlink message.
2010-02-23 19:13:17 +00:00
Oliver Hartkopp
37744ac503
Beautify the listing of registered gwjobs (cangw -L).
2010-02-22 18:57:45 +00:00
Oliver Hartkopp
a48038d82b
Added feature to list created gateway jobs.
...
Also added some fixes and removed debug printf's.
2010-02-22 09:57:12 +00:00
Oliver Hartkopp
bd1ebaaf28
Added netlink error message support to be able to provide return values.
...
Renamed some structure elements. Updated usage text.
2010-02-21 12:34:34 +00:00
Oliver Hartkopp
0dc9fcc98e
Moved kernel parsing of netlink attributes into can_can_parse_attr().
...
Added functionalitiy to remove formerly created CAN GW jobs.
2010-02-20 20:41:24 +00:00
Oliver Hartkopp
67b604e53b
Added cangw netlink gateway configuration tool.
...
TODO (in both cangw and can-gw.ko) : Support removal and listing of rules.
So far the gateway jobs are only removed on can-gw.ko module unload or when
the used CAN netdevices disappear.
2010-02-19 13:33:59 +00:00
Oliver Hartkopp
9327499121
Try to ignore the usual value restrictions of sockopt SO_RCVBUF when running
...
as root (with CAP_NET_ADMIN) by using SO_RCVBUFFORCE if possible.
2010-01-15 19:15:08 +00:00
Oliver Hartkopp
3c019ea611
Added '-d' option to support the receive packet drop counting introduced in
...
http://git.kernel.org/?p=linux/kernel/git/davem/net-next-2.6.git;a=commitdiff;h=3b885787ea4112eaa80945999ea0901bf742707f
This is done by using recvmsg() instead of recvfrom() to allow the timestamp
and the dropcounter to be received within one syscall.
When the application (here 'candump') ist not fast enough to process the
incomming CAN frames the frames are dropped in the socket receive queue.
When this happens and '-d' is set, we get this info now:
DROPCOUNT: dropped 1 CAN frame on 'xxx' socket (total drops 1)
2010-01-15 18:35:37 +00:00
Oliver Hartkopp
c11220e9c9
fflush the new configurable stdout output to allow proper pipe/netcat setups.
2009-11-25 18:51:31 +00:00
Oliver Hartkopp
f135ce3d47
Allow to specify the name of the IP tunnel netdevice via commandline option '-n <name>'
2009-11-25 17:15:09 +00:00
Oliver Hartkopp
d68d6132da
Remove feature to quit the isotptun by keypress (from stdin) as it was not possible to run it from a start-script.
...
Added a signal handler to gracefully leave the isotptun.
2009-11-25 16:43:17 +00:00
Oliver Hartkopp
0b4d143113
Added hook to print selected logfile lines on stdout for further processing.
2009-11-06 08:07:45 +00:00
Oliver Hartkopp
bbb3d7eb10
Introduce KERNELDIR variable to allow override when invoking make on commandline.
2009-09-10 08:01:00 +00:00
Oliver Hartkopp
40edca27a2
Move BCM server into can-utils as it is not test application anymore.
2009-09-10 07:39:33 +00:00
Oliver Hartkopp
0740b53016
Remove obsolete 'vcan' tool.
2009-09-10 07:34:06 +00:00
Oliver Hartkopp
64603859fb
Added slcand daemon contributed by Robert Haddon <robert.haddon@verari.com>
2009-05-05 09:40:10 +00:00
Oliver Hartkopp
e765683c9b
Added commandline option '-r' to set the per-socket receive buffer size.
2009-04-16 08:05:42 +00:00
Oliver Hartkopp
bc9fb643a3
Removed the limitation for the number of CAN filters for each interface.
...
Updated Copyright notice.
And finally: Yeah! I did something with malloc :-)
2009-04-06 11:15:27 +00:00
Oliver Hartkopp
3e65a4e564
Add functionality to
...
terminate after receiption of <count> CAN frames.
2009-04-06 08:41:17 +00:00
Oliver Hartkopp
8975dcb574
Spagetti code cleanup:
...
Moved conversions into separate functions can2pty() and pty2can().
Updated and enhanced some comments.
Variable name cleanups inside the separate functions.
Fix handling on wrong pty commands (was a wrong 'continue' statement).
2009-02-15 17:40:32 +00:00
Oliver Hartkopp
c588f0d0b2
Allow SLCAN RTR frames without data length code field.
2009-02-04 16:51:04 +00:00
Oliver Hartkopp
6cc05e08f0
Some more implementation to make it work with a certain application.
2009-02-04 13:18:44 +00:00
Oliver Hartkopp
4cf2b0f931
Use rxbuf[] for acknowledges.
2009-02-03 20:12:34 +00:00
Oliver Hartkopp
afae11f1c8
Implemented ACK/NACK replies for ASCII commands.
...
Added 'O'pen and 'C'lose functionality.
2009-02-03 13:59:17 +00:00
Oliver Hartkopp
af858087e6
Added timestamp handling with Z0 or Z1 command.
2009-02-03 11:59:53 +00:00
Oliver Hartkopp
baa90a135a
Add can_id/can_mask filter handling which is defined in the slcan protocol (m/M).
2009-01-21 09:17:20 +00:00
Oliver Hartkopp
c8be6085a4
Removed sanity check for received slcan ASCII data
...
as this is done with ASCII comparision three lines above.
2009-01-21 07:38:18 +00:00
Oliver Hartkopp
9862da595d
Added a proof of concept tool 'slcanpty' which
...
creates a pty for applications using the slcan ASCII protocol and
converts the data to a CAN network interface (and vice versa).
This can be used for existing applications to run on SocketCAN.
2009-01-20 23:06:01 +00:00
Oliver Hartkopp
4369ac1c55
Consistencely allow '-?' to get a help text.
2009-01-13 09:32:45 +00:00
Oliver Hartkopp
278ba6377d
disable default receive filter on the write-only bridge socket.
2009-01-06 09:04:34 +00:00
Oliver Hartkopp
6104197c6a
Fix sloppy CAN_(EFF|RTR)_FLAG handling in can_filter.can_mask .
...
Due to a wrong safety check in af_can.c it was not possible to filter
for SFF frames with a specific CAN identifier without getting the
same selected CAN identifier from a received EFF frame also.
This fix has a minimum impact on the CAN filter API as the 'sloppy'
handling is still a correct (and possibly wanted?) use-case.
Please update the can-utils (especially candump) whose filter definition
on the commandline made assumptions to correct the user input that are
probably unwanted now.
Thanks to Kurt van Dijck for pointing at this issue!
Signed-Off-by: Oliver Hartkopp <oliver@hartkopp.net >
2008-12-01 07:24:18 +00:00
Oliver Hartkopp
450a058072
Fixed parse_canframe() with reordering the checks for the can_id
...
delimiter. Before this fix the function may have found delimiters in the
string behind the terminating zero.
2008-11-28 21:50:24 +00:00
Oliver Hartkopp
e7046e7fca
Added interface name to parameter list in first line.
2008-11-17 10:23:42 +00:00
Oliver Hartkopp
4e41082935
Added Id keyword propertiy on new files.
2008-11-05 14:20:52 +00:00
Oliver Hartkopp
f1d4ebbbba
Added ISO 15765-2 CAN transport protocol for protocol family CAN.
...
Including some tools and coarse documentation README.isotp
2008-11-05 11:34:23 +00:00
Oliver Hartkopp
9b717158c6
Reworked slcan_attach to give slcan setup values directly on the commandline.
2008-11-04 10:47:09 +00:00
Oliver Hartkopp
265021e323
Print non-data stuff (errors, warnings, hints) on stderr.
2008-10-29 09:41:40 +00:00
Oliver Hartkopp
1be68bcc64
Added support for swapped byte order representation.
2008-10-29 09:23:48 +00:00
Oliver Hartkopp
b5bc6349a9
Start candump in silent mode, when logging into a file.
2008-10-02 13:47:43 +00:00
Oliver Hartkopp
afcac3462a
The number for the SLCAN line discipline can not be found in
...
<linux/tty.h> anyway but needs to be written as module alias
tty-ldisc-17 slcan
So we remove the annoying #error output and use the correctly defined
'17' from Kernel 2.6.25+ as default.
2008-09-17 13:02:49 +00:00
Oliver Hartkopp
4455308aa0
Added support for comments in logfiles.
...
Added some sanity checks and error messages.
2008-09-09 12:56:05 +00:00
Oliver Hartkopp
6c0ca36ab2
Create an informative error message when detecting a wrong line format.
2008-07-25 06:32:20 +00:00
Oliver Hartkopp
15ce202e60
Changed comment line recognition:
...
Everything without a '(' at the beginning of an input line is treated as comment.
Changed buffer size to allow long comment lines & added overflow handling.
2008-07-24 19:12:19 +00:00
Oliver Hartkopp
ba037dcffa
Support for comment lines in the logfile:
...
'#' at the beginning of a line marks comment lines.
2008-07-24 13:03:18 +00:00
Oliver Hartkopp
5621884558
Added missing help test.
2008-07-10 11:01:37 +00:00
Oliver Hartkopp
f33075946d
Added -f option to filter only on the CAN-ID and not on the content.
...
This can be useful when the timestamp cyle needs to be displayed.
2008-07-10 10:59:37 +00:00
Oliver Hartkopp
af472581eb
Do not allow to create error frame filters via standard filter sets.
2008-07-02 04:19:07 +00:00
Oliver Hartkopp
f1c095d801
Added automatic extended frame format recognition.
...
Most SocketCAN userspace tools (like cansend) recognize the EFF by the
stringlength of the given CAN-ID: 3 -> SFF , 8 -> EFF.
This was missing in the candump filter definition and therefore the
values had to be specified with the CAN_EFF_FLAG set in the value, e.g.
92345678 for the extended CAN-ID 12345678 - this was not really nice.
Now the filtersets for extended frames can be specified as expected:
12345678:1FFFFFFF to filter for only 12345678 extended CAN-ID
000000AA:1FFFFFFF to filter for only AA extended CAN-ID.
2008-07-02 04:05:11 +00:00
Oliver Hartkopp
6410c22fd5
Added silent correction for can_dlc out of range.
2008-07-01 11:31:59 +00:00
Oliver Hartkopp
34703ac659
Fixed condition pointed out by Uwe Bonnes:
...
https://lists.berlios.de/pipermail/socketcan-core/2008-June/001625.html
2008-06-26 14:35:46 +00:00
Oliver Hartkopp
e7d0db9f21
Fix typo.
2008-06-20 09:19:13 +00:00
Oliver Hartkopp
7a2544a169
Fix commandline parameter handling for fixed canframe.data[] .
2008-06-20 09:16:06 +00:00
Oliver Hartkopp
ddbe7d9575
Introduced new functions:
...
unsigned char asc2nibble(char c);
int hexstring2candata(char *arg, struct can_frame *cf);
(see documentation in lib.h)
As prerequsite to fix the commandline interface of cangen.
2008-06-20 09:15:13 +00:00
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
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