]> rtime.felk.cvut.cz Git - can-utils.git/commitdiff
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)
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>

No differences found