Commit Graph

23 Commits (7b7331976a05b21ac39246b6878f781020086ded)

Author SHA1 Message Date
Yegor Yefremov 7b7331976a Add SPDX identifiers
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-06-19 12:24:24 +02:00
Tomasz Wasilczyk f6e07960d3 Silence false positive unaligned pointer access warning
This is a warning coming up on Android (ARM) platform.
Clang 4.x creates a false positive here: the can_id is the first
(and aligned) value in the packed struct modattr, so it's always
aligned if the struct itself is aligned.
2019-01-10 10:04:37 -08:00
Oliver Hartkopp 8af831f377 cangw: introduce uid command line option
Similar to referencing iptables rules by their line number this UID allows to
reference created routing jobs, e.g. to alter configured data modifications.

The UID is an optional non-zero value which can be provided at routing job
creation time. When the UID is set the UID replaces the data modification
configuration as job identification attribute e.g. at job removal time.

The UID option is provided by mainline Linux 4.2+

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2015-06-11 20:48:43 +02:00
Oliver Hartkopp ad7f44095a cangw: add an option for the per rule limitation of frame hops
Usually the received CAN frames can be processed/routed as much as 'max_hops'
times (which is given at module load time of the can-gw module).
Introduce a new configuration option ( -l <hops> ) to reduce the number of
possible hops for a specific gateway rule to a value smaller then max_hops.

Mainline upstream commit:

http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=391ac1282dd7ff1cb8245cccc5262e8e4173edc4

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2013-09-04 20:30:34 +02:00
Oliver Hartkopp 29c3e344a5 cangw: fix inverse filter display when printing the configured rules
A configured inverse filter e.g.

cangw -A -s can0 -d can1 -e -f 123~7FF

has been displayed with 'cangw -L' like this:

cangw -A -s can0 -d can1 -e -f 20000123:7FF # 0 handled 0 dropped 0 deleted

While 0x20000000 was the value of CAN_INV_FILTER.

This patch fixes the output to the expected display:

cangw -A -s can0 -d can1 -e -f 123~7FF # 0 handled 0 dropped 0 deleted

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2013-01-29 20:50:46 +01:00
Oliver Hartkopp 9dad9f7354 cangw: support new can-gw features for Linux 3.9+
Added new option '-i' for can-gw rules to allow to route CAN frames back to the
originating/incoming CAN interface (which is disabled by default).

CAN frames that are deleted due to the violation of the max_hops limit are now
printed when displaying the configured rules with 'cangw -L'.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2013-01-29 20:17:52 +01:00
Oliver Hartkopp 836d3cc012 remove obsolete SVN ID tags
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2012-11-14 20:57:16 +01:00
Oliver Hartkopp f123d73d9a cangw: add semantic check for checksum options
The options to for adding checksums (-c or -x) can only be used in conjunction
with modifications (-m) applied to the routed CAN frames.

Signed-off-by: Andre Naujoks <nautsch2@googlemail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2012-11-14 20:20:38 +01:00
Marc Kleine-Budde 722a09116d treewide: replace berlios contact email by linux-can@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-01-11 12:14:15 +01:00
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
Marc Kleine-Budde f7be786e9a cangw: replace obsolete bzero by memset
uclibc for example doesn't implement bzero

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-04-19 12:11: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 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 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