File: barrier

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 (103 lines) | stat: -rw-r--r-- 2,255 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# tccext handles barrier correctly --------------------------------------------
tcc/ext/tcc-ext-echo build 1234 2>&1
block eth0 egress
action 0 = unspec
match 0:0:8=0x02 action 0
barrier
match 0:0:8=0x01 action 0
barrier
match action 0
EOF
block eth0 egress
action 0 = unspec
match 0:0:8=0x2 action 0
barrier
match 0:0:8=0x1 action 0
barrier
match action 0
# barrier is generated by tcc -------------------------------------------------
tcc -xif:err -Xx,nocombine 2>&1 >/dev/null | grep -v '^#'
prio {
   class if raw[0];
   drop if 1;
}
EOF
block eth0 egress
action 0 = drop
action 1 = class 1:1
action 2 = unspec
match 0:0:8=0x00 action 2
match action 1
barrier
match action 0
# tcc-ext-test accepts "nounspec" ---------------------------------------------
tcc/ext/tcc-ext-test config nounspec
EOF
nounspec
nocontinue
# tcc-ext-test accepts "nocombine" --------------------------------------------
tcc/ext/tcc-ext-test  config nocombine
EOF
nocombine
nocontinue
# tcc-ext-test accepts "nocombine" and "nounspec" -----------------------------
tcc/ext/tcc-ext-test  config nocombine nounspec
EOF
nocombine
nounspec
nocontinue
# tcc-ext-test doesn't accept "foobar" ----------------------------------------
tcc/ext/tcc-ext-test config foobar 2>&1 | sed 1q
EOF
usage: tcc/ext/tcc-ext-test config [nounspec] [nocombine]
# barrier is understood by tcc-ext-match (class/drop) -------------------------
LD_LIBRARY_PATH=. PATH=$PATH:tcc/ext tcsim -Xc,-xif:test -Xx,nocombine | \
  awk '{ print $2 }'
dev eth0 100000 {
    dsmark {
       class if raw[0];
       drop if 1;
    }
}

send 0 0 x 19
send 1 0 x 19
end
EOF
E
*
E
D
# barrier is understood by tcc-ext-match (drop/class) -------------------------
LD_LIBRARY_PATH=. PATH=$PATH:tcc/ext tcsim -Xc,-xif:test -Xx,nocombine | \
  awk '{ print $2 }'
dev eth0 100000 {
    dsmark {
       drop if raw[0] == 1;
       class if 1;
    }
}

send 0 0 x 19
send 1 0 x 19
end
EOF
E
D
E
*
# barrier is understood by tcc-ext-match (class/unspec) -----------------------
LD_LIBRARY_PATH=. PATH=$PATH:tcc/ext tcsim -Xc,-xif:test -Xx,nocombine -v | \
  sed '/ at /s/.*returns //p;d'
dev eth0 100000 {
    dsmark {
       class (2) if raw[0] == 1;
    }
}

send 0 0 x 19
send 1 0 x 19
end
EOF
UNSPEC (-1)
OK (0) (1:2, 0x0)