]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blob - tc/setcanprio.sh
Instead of "match" keyword, there is "matchid" (for SFF) and "matcheid" (for EFF).
[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 elif [ "$1"  == "prio" ]; then  # create Prio qdiscs and configure canprio filter
10
11         #For more information about priorities, bands, dequeuing etc. see manpage "tc-prio"
12
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
18
19         sudo ./tc qdisc show dev can0
20 else
21         echo -e "Usage: $0 [ del | stat | prio ]"
22 fi
23