File: fastpath

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 (47 lines) | stat: -rw-r--r-- 1,201 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
# tcc handles self-contained policing expression optimally --------------------
tcc -xif:err -Xx,all 2>&1 | grep match
$p = police(rate 1Mbps,burst 10kB);

prio {
    class (1)
	if (raw[0] == 1 || raw[0] == 2) &&
	  ((conform($p) && count($p)) || drop);
}
EOF
match 0:0:8=0x01 action 4
match 0:0:8=0x02 action 4
match action 0
# tcc handles self-contained multi-color marker optimally (srTCM) -------------
tcc -xif:err -Xx,all 2>&1 | grep match
#include "meters.tc"

set_srTCM($x,cir 1 kbps,cbs 1kB,ebs 500B);

#define C (raw[0] == 1 || raw[0] == 2)

prio {
    class (1) if C && __srTCM_green($x);
    class (2) if C && __srTCM_yellow($x);
    class (3) if C && __srTCM_red($x);
}
EOF
match 0:0:8=0x01 action 7
match 0:0:8=0x02 action 7
match action 0
# tcc handles self-contained multi-color marker optimally (trTCM) -------------
tcc -xif:err -Xx,all 2>&1 | grep match
#include "meters.tc"

set_trTCM($x,cir 1 kbps,cbs 1kB,pir 2kbps,pbs 500B,mtu 1000B);

#define C (raw[0] == 1 || raw[0] == 2)

prio {
    class (1) if C && __trTCM_green($x);
    class (2) if C && __trTCM_yellow($x);
    class (3) if C && __trTCM_red($x);
}
EOF
match 0:0:8=0x01 action 9
match 0:0:8=0x02 action 9
match action 0