File: ingext

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 (122 lines) | stat: -rw-r--r-- 2,125 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# ingress also works with "all" -----------------------------------------------
tcc -xif:err -Xx,all 2>&1 | grep -v '^#'
ingress {
    class (1) if 1;
}
EOF
block eth0 ingress
qdisc 65535 = ingress
class 1 =
action 1 = class 65535:1
match action 1
# multiple egress and ingress on multiple interfaces work ---------------------
tcc -xif:err -Xx,all 2>&1 | grep -v '^#'
dev "itfI" {
    ingress {
	class (1) if raw[0] == 1;
    }
}

dev "itfE" {
    prio {
	class (2) if 1;
    }
}

dev "itfIE" {
    ingress {
	class (3) if raw[0] == 42;
	class (4) if 1;
    }
    prio {
	class (5) if 1;
    }
}
EOF
block itfI ingress
qdisc 65535 = ingress
class 1 =
action 0 = unspec
action 1 = class 65535:1
match 0:0:8=0x01 action 1
match action 0
block itfE egress
qdisc 1 = prio bands 3
class 2 =
action 2 = class 1:2
match action 2
block itfIE ingress
qdisc 65535 = ingress
class 3 =
class 4 =
action 4 = class 65535:4
action 3 = class 65535:3
match 0:0:8=0x2A action 3
match action 4
block itfIE egress
qdisc 1 = prio bands 5
class 5 =
action 5 = class 1:5
match action 5
# idem, via tcc-ext-echo ------------------------------------------------------
PATH=$PATH:tcc/ext tcc -xif:echo -Xx,all 2>&1
dev "itfI" {
    ingress {
	class (1) if raw[0] == 1;
    }
}

dev "itfE" {
    prio {
	class (2) if 1;
    }
}

dev "itfIE" {
    ingress {
	class (3) if raw[0] == 42;
	class (4) if 1;
    }
    prio {
	class (5) if 1;
    }
}
EOF
block itfIE egress
qdisc 1 = prio bands 5
class 5 =
action 5 = class 1:5
match action 5
block itfIE ingress
qdisc 65535 = ingress
class 3 =
class 4 =
action 3 = class 65535:3
action 4 = class 65535:4
match 0:0:8=0x2a action 3
match action 4
block itfE egress
qdisc 1 = prio bands 3
class 2 =
action 2 = class 1:2
match action 2
block itfI ingress
qdisc 65535 = ingress
class 1 =
action 1 = class 65535:1
action 0 = unspec
match 0:0:8=0x1 action 1
match action 0
# there can be only one ingress qdisc per interface ---------------------------
tcc -c 2>&1
dev "foo" {
    ingress {
	class (10) if 1;
    }
    ingress {
	class (20) if 2;
    }
}
EOF
ERROR
<stdin>:8: ingress qdisc is already set near "}"