]> rtime.felk.cvut.cz Git - can-utils.git/commit
candump: support new raw socket option to join the given CAN filters
authorOliver Hartkopp <socketcan@hartkopp.net>
Tue, 17 Mar 2015 19:30:54 +0000 (20:30 +0100)
committerOliver Hartkopp <socketcan@hartkopp.net>
Tue, 17 Mar 2015 19:30:54 +0000 (20:30 +0100)
commit1a2467ed29302149d4d1253888ac1f1dfcc11d3f
treea5b63d76858c73cd28513d10ea2ffd84eb969588
parent0eb1e3db2e20b0d895468363dbe6030cd8afa61c
candump: support new raw socket option to join the given CAN filters

The CAN_RAW socket can set multiple CAN identifier specific filters that lead
to multiple filters in the af_can.c filter processing. These filters are
indenpendent from each other which leads to logical OR'ed filters when applied.

This socket option joines the given CAN filters in the way that only CAN frames
are passed to user space that matched *all* given CAN filters. The semantic for
the applied filters is therefore changed to a logical AND.

This is useful especially when the filterset is a combination of filters where
the CAN_INV_FILTER flag is set in order to notch single CAN IDs or CAN ID
ranges from the incoming traffic.

Example:
candump can0,100~7FF,200~7FF,400~7FF (logical OR'ed filters)
candump can0,100~7FF,200~7FF,400~7FF,J (logical AND'ed filters)

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
candump.c
include/linux/can/raw.h