[iproute2,3/3] CAN Filter/Classifier -- Documentation

Message ID 1337937106-7640-4-git-send-email-lisovy@gmail.com
State Deferred, archived
Delegated to: stephen hemminger
Headers show

Commit Message

Rostislav Lisovy May 25, 2012, 9:11 a.m.
Added manpage describing usage of CAN Filter.

Signed-off-by: Rostislav Lisovy <lisovy@gmail.com>
 man/man8/tc-can.8 |   97 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 97 insertions(+)
 create mode 100644 man/man8/tc-can.8


diff --git a/man/man8/tc-can.8 b/man/man8/tc-can.8
new file mode 100644
index 0000000..54ee96a
--- /dev/null
+++ b/man/man8/tc-can.8
@@ -0,0 +1,97 @@ 
+.TH CAN 8 "8 May 2012" "iproute2" "Linux"
+CAN \- Controller Area Network classifier
+.B tc filter ... dev
+.B parent
+.B [ prio
+.B ] [ protocol can ] [ handle 
+.B ] can [ 
+.B ] [ flowid 
+.B ]
+.B CLASSID := major:minor
+.B FLOWID := major:minor
+.B MATCHSPEC := { sffid 
+.B | effid 
+.B | MATCHSPEC ... }
+.B FILTERID := canid[:mask]
+.BR canid
+.B mask
+are parsed as hexadecimal input.
+The CAN classifier may be used with any available
+.B qdisc
+on Controller Area Network (CAN) frames passed through AF_CAN
+networking subsystem. The classifier classifies CAN frames according
+to their identifiers. It can be used on CAN frames with both SFF or
+EFF identifiers.
+It is possible to add CAN classifier to any qdisc configured on any networking
+device, however it will ignore non-CAN packets.
+The filtering rules for EFF frames are stored in an array, which is traversed
+during classification. This means that the worst-case time needed for
+classification of EFF frames increases with the number of configured rules.
+The filter implements an optimization for matching SFF frames using a bitmap
+with one bit for every ID. With this optimization, the classification time
+for SFF frames is nearly constant independently of the number of rules.
+This example shows how to set
+.B prio qdisc
+tc qdisc add dev can0 root handle 1: prio
+tc filter add dev can0 parent 1:0 prio 1 handle 0xa \\
+    can sffid 0x7ff:0xf flowid 1:1
+tc filter add dev can0 parent 1:0 prio 2 handle 0xb \\
+    can sffid 0xC0:0x7ff effid 0x80:0x7ff flowid 1:2
+tc filter add dev can0 parent 1:0 prio 3 \\
+    can sffid 0x80:0x7ff flowid 1:2
+tc filter add dev can0 parent 1:0 prio 4 \\
+    can sffid 0x0:0x0 effid 0x0:0x0 flowid 1:3
+The maximum number or rules passed from
+.BR tc(8)
+utility to CAN classifier is fixed. The limit is set at compilation time
+(default is 128).
+.BR tc(8)
+Michal Sojka <sojkam1@fel.cvut.cz>, Pavel Pisa <pisa@cmp.felk.cvut.cz>,
+Rostislav Lisovy <lisovy@gmail.cz>.
+This manpage maintained by Rostislav Lisovy <lisovy@gmail.com>