]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blob - tc/setcanprio.sh
It is possible to pass multiple rules for one instance of a filter.
[lisovros/iproute2_canprio.git] / tc / setcanprio.sh
1 #!/bin/bash
2
3 if [ "$1" == "del" ]; then # delete all qdiscs & filters
4         sudo ./tc qdisc del dev can0 root 
5
6 elif [ "$1" =  "stat" ]; then # show statistics
7         ./tc -s class show dev can0
8
9 else # create Prio qdiscs and configure canprio filter
10         sudo ./tc qdisc add dev can0 root handle 1: prio
11         sudo ./tc filter add dev can0 parent 1:0 prio 1 canprio match 0x123:0xffff match 0x124:0xffff flowid 1:1
12         sudo ./tc filter add dev can0 parent 1:0 prio 2 canprio match 0x223:0xffff flowid 1:2
13         sudo ./tc filter add dev can0 parent 1:0 prio 3 canprio match 0x1:0x1 flowid 1:3
14
15         sudo ./tc qdisc show dev can0
16
17 fi
18