File: cbqzero

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 (77 lines) | stat: -rw-r--r-- 2,351 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# do not select CBQ class 0 ---------------------------------------------------
sh -c 'ulimit -t 10; exec tcsim/tcsim -q 2>/dev/null'
#include "packet.def"

dev eth0 
{       
    cbq (bandwidth 100Mbps, maxburst 5p, avpkt 1000B, allot 1500B) {
	class (2, rate 10kbps, bounded)
	    if ip_dst == 10.0.0.0 && ip_tos!=0x10;
    }
}

send IP_PCK($ip_src=10.0.0.0 $ip_tos=0x10)
EOF
# CBQ class 0 is substituted with "if" ----------------------------------------
tcc | sed '/.*classid /s///p;d'
cbq (bandwidth 100Mbps, maxburst 5p, avpkt 1000B, allot 1500B) {
    class (0, rate 100Mbps, bounded)
	if 1;
}
EOF
1:ffff
# CBQ class 0 is substituted with "if" (collision) ----------------------------
tcc | sed '/.*filter.*classid /s///p;d'
cbq (bandwidth 100Mbps, maxburst 5p, avpkt 1000B, allot 1500B) {
    class (0, rate 100Mbps, bounded)
	if 1
    {
	class (0xffff,rate 10Mbps);
    }
}
EOF
1:fffe
# CBQ class 0 cannot be used with "fw" ----------------------------------------
tcc 2>&1 >/dev/null
cbq (bandwidth 100Mbps, maxburst 5p, avpkt 1000B, allot 1500B) {
    class (0, rate 100Mbps, bounded)
	on fw element (1);
}
EOF
ERROR
<stdin>:2: cannot substitute class ID 0 with this filter
# CBQ class 0 cannot be used with "route" -------------------------------------
tcc 2>&1 >/dev/null
cbq (bandwidth 100Mbps, maxburst 5p, avpkt 1000B, allot 1500B) {
    class (0, rate 100Mbps, bounded)
	on route element;
}
EOF
ERROR
<stdin>:2: cannot substitute class ID 0 with this filter
# CBQ class 0 cannot be used with "rsvp" -------------------------------------
tcc 2>&1 >/dev/null
cbq (bandwidth 100Mbps, maxburst 5p, avpkt 1000B, allot 1500B) {
    class (0, rate 100Mbps, bounded)
	on rsvp element (src 1.2.3.4,dst 5.6.7.8,ipproto "tcp");
}
EOF
ERROR
<stdin>:2: cannot substitute class ID 0 with this filter
# CBQ class 0 cannot be used with "tcindex" -----------------------------------
tcc 2>&1 >/dev/null
cbq (bandwidth 100Mbps, maxburst 5p, avpkt 1000B, allot 1500B) {
    class (0, rate 100Mbps, bounded)
	on tcindex element (0);
}
EOF
ERROR
<stdin>:2: cannot substitute class ID 0 with this filter
# non-zero CBQ classes are not substituted ------------------------------------
tcc | sed '/.*filter.*classid /s///p;d'
cbq (bandwidth 100Mbps, maxburst 5p, avpkt 1000B, allot 1500B) {
    class (1, rate 100Mbps, bounded)
	on fw element (1);
}
EOF
1:1