File: extend

package info (click to toggle)
tcng 10b-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,632 kB
  • ctags: 2,515
  • sloc: ansic: 19,038; pascal: 4,640; yacc: 2,619; sh: 1,908; perl: 1,546; lex: 772; makefile: 755
file content (46 lines) | stat: -rw-r--r-- 966 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# qdisc can be extended -------------------------------------------------------
tcc -xif:err -Xx,all 2>&1 | grep class
dev "eth0" {
    $q = prio {
	class (1);
    }
    qdisc $q {
	class (2);
    }
}
EOF
class 1 =
class 2 =
# classes can be extended -----------------------------------------------------
tcc | sed 's/ cbq.*//'
#include "tcngreg.def"

cbq (CBQ_PARAMS) {
    $c = class (1,rate 4Mbps) {
	class (2,rate 1Mbps);
    }
    class $c {
	class (3,rate 1Mbps);
    }
}
EOF
tc qdisc add dev eth0 handle 1:0 root
tc class add dev eth0 parent 1:0 classid 1:1
tc class add dev eth0 parent 1:1 classid 1:2
tc class add dev eth0 parent 1:1 classid 1:3
# filters can be extended -----------------------------------------------------
tcc | sed '/fw/s/.*prio 1 //p;d'
prio {
    $f = fw {
	class (1) on (10);
    }
    class (2) on $f(20);
    filter $f {
	class (3) on (30);
    }
}
EOF
fw
handle 10 fw classid 1:1
handle 20 fw classid 1:2
handle 30 fw classid 1:3