3 if [ "$1" == "del" ]; then # delete all qdiscs & filters
4 sudo ./tc qdisc del dev can0 root
6 elif [ "$1" == "stat" ]; then # show statistics
7 ./tc -s class show dev can0
9 elif [ "$1" == "prio" ]; then # create Prio qdiscs and configure canprio filter
11 #For more information about priorities, bands, dequeuing etc. see manpage "tc-prio"
13 sudo ./tc qdisc add dev can0 root handle 1: prio
14 sudo ./tc filter add dev can0 parent 1:0 prio 1 canprio matchid 0x123:0xffff matchid 0x124:0xffff flowid 1:1
15 sudo ./tc filter add dev can0 parent 1:0 prio 2 canprio matchid 0x125:0xffff matcheid 0x125:0xffff flowid 1:1
16 sudo ./tc filter add dev can0 parent 1:0 prio 3 canprio matchid 0x223:0xffff flowid 1:2
17 sudo ./tc filter add dev can0 parent 1:0 prio 4 canprio matchid 0xa:0xf flowid 1:3
19 sudo ./tc qdisc show dev can0
21 echo -e "Usage: $0 [ del | stat | prio ]"