File: bucket

package info (click to toggle)
tcng 10b-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,636 kB
  • ctags: 2,515
  • sloc: ansic: 19,040; pascal: 4,640; yacc: 2,619; sh: 1,914; perl: 1,546; lex: 772; makefile: 756
file content (60 lines) | stat: -rw-r--r-- 1,709 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
# bucket: can define variables ------------------------------------------------
tcc -c -Wnounused
$b1 = bucket(rate 1Mbps,burst 10kB);

prio {
    $b2 = bucket(rate 1.5Mbps,burst 10kB);
}
EOF
# bucket: can use with conform, count -----------------------------------------
tcc -c
$b = bucket(rate 1Mbps,burst 10kB);

prio {
    class if conform $b;
    class if conform bucket $b && count bucket(rate 1kbps,burst 1GB);
}
EOF
# bucket: policer parameters are refused --------------------------------------
tcc -c 2>&1
$b = bucket(rate 1Mbps,burst 10kB,mtu 2kB);
EOF
ERROR
<stdin>:1: unrecognized parameter "mtu"
# bucket: "bucket" is no synonym for "police" after filters -------------------
tcc -c 2>&1
prio {
    class on fw element (0) police(rate 1kbps,burst 1kB,mtu 100B);
    class on fw element (1) bucket(rate 1kbps,burst 1kB);
}
EOF
ERROR
<stdin>:3: syntax error near "bucket"
# bucket: tc does not dump buckets --------------------------------------------
tcc 2>&1
$b = bucket(rate 1Mbps,burst 10kB);

dsmark {
    class (0) on fw element (0) police $b;
}
EOF
ERROR
<stdin>:4: invalid type conversion (expected policer instead of bucket) near ";"
# bucket: tc does not dump buckets (sneaky) -----------------------------------
tcc 2>&1 >/dev/null
$b = bucket(rate 1Mbps,burst 10kB);
$p = police $b; /* "cast" */

dsmark {
    class (0) on fw element (0) police $p;
}
EOF
ERROR
<stdin>:2: invalid type conversion (expected policer instead of bucket) near ";"
# bucket: can't "cast" from policer -------------------------------------------
tcc -c 2>&1
$p = police(rate 1kbps,burst 1kB,mtu 100B);
$b = bucket $p;
EOF
ERROR
<stdin>:2: invalid type conversion (expected bucket instead of policer) near ";"