]>
Commit | Line | Data |
---|---|---|
0e581146 BP |
1 | AT_BANNER([ovs-ofctl]) |
2 | ||
340c7bb2 BP |
3 | AT_SETUP([ovs-ofctl parse-flows choice of protocol]) |
4 | # This doesn't cover some potential vlan_tci test cases. | |
5 | for test_case in \ | |
aa233d57 BP |
6 | 'tun_id=0 NXM,OXM' \ |
7 | 'tun_id=0/0x1 NXM,OXM' \ | |
8 | 'tun_src=1.2.3.4 NXM,OXM' \ | |
9 | 'tun_src=1.2.3.4/0.0.0.1 NXM,OXM' \ | |
10 | 'tun_dst=1.2.3.4 NXM,OXM' \ | |
11 | 'tun_dst=1.2.3.4/0.0.0.1 NXM,OXM' \ | |
340c7bb2 | 12 | 'tun_flags=0 none' \ |
af69bf19 | 13 | 'tun_flags=1/1 none' \ |
340c7bb2 BP |
14 | 'tun_tos=0 none' \ |
15 | 'tun_ttl=0 none' \ | |
aa233d57 BP |
16 | 'metadata=0 NXM,OXM,OpenFlow11' \ |
17 | 'metadata=1/1 NXM,OXM,OpenFlow11' \ | |
18 | 'in_port=1 any' \ | |
340c7bb2 | 19 | 'skb_priority=0 none' \ |
aa233d57 BP |
20 | 'pkt_mark=1 NXM,OXM' \ |
21 | 'pkt_mark=1/1 NXM,OXM' \ | |
22 | 'reg0=0 NXM,OXM' \ | |
23 | 'reg0=0/1 NXM,OXM' \ | |
24 | 'reg1=1 NXM,OXM' \ | |
25 | 'reg1=1/1 NXM,OXM' \ | |
26 | 'reg2=2 NXM,OXM' \ | |
27 | 'reg2=2/1 NXM,OXM' \ | |
28 | 'reg3=3 NXM,OXM' \ | |
29 | 'reg3=3/1 NXM,OXM' \ | |
30 | 'reg4=4 NXM,OXM' \ | |
31 | 'reg4=4/1 NXM,OXM' \ | |
32 | 'reg5=5 NXM,OXM' \ | |
33 | 'reg5=5/1 NXM,OXM' \ | |
34 | 'reg6=6 NXM,OXM' \ | |
35 | 'reg6=6/1 NXM,OXM' \ | |
36 | 'reg7=7 NXM,OXM' \ | |
37 | 'reg7=7/1 NXM,OXM' \ | |
79fe0f46 BP |
38 | 'xreg0=0 NXM,OXM' \ |
39 | 'xreg0=0/1 NXM,OXM' \ | |
40 | 'xreg1=1 NXM,OXM' \ | |
41 | 'xreg1=1/1 NXM,OXM' \ | |
42 | 'xreg2=2 NXM,OXM' \ | |
43 | 'xreg2=2/3 NXM,OXM' \ | |
44 | 'xreg3=3 NXM,OXM' \ | |
45 | 'xreg3=3/5 NXM,OXM' \ | |
aa233d57 BP |
46 | 'dl_src=00:11:22:33:44:55 any' \ |
47 | 'dl_src=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \ | |
48 | 'dl_dst=00:11:22:33:44:55 any' \ | |
49 | 'dl_dst=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \ | |
50 | 'dl_type=0x1234 any' \ | |
51 | 'dl_type=0x0800 any' \ | |
52 | 'dl_type=0x0806 any' \ | |
53 | 'dl_type=0x86dd any' \ | |
54 | 'vlan_tci=0 any' \ | |
55 | 'vlan_tci=0x1009 any' \ | |
56 | 'vlan_tci=0x1009/0x1 NXM,OXM' \ | |
57 | 'dl_vlan=9 any' \ | |
58 | 'vlan_vid=11 any' \ | |
59 | 'vlan_vid=11/0x1 NXM,OXM' \ | |
60 | 'dl_vlan_pcp=6 any' \ | |
61 | 'vlan_pcp=5 any' \ | |
62 | 'mpls,mpls_label=5 NXM,OXM,OpenFlow11' \ | |
63 | 'mpls,mpls_tc=1 NXM,OXM,OpenFlow11' \ | |
64 | 'mpls,mpls_bos=0 NXM,OXM' \ | |
65 | 'ip,ip_src=1.2.3.4 any' \ | |
66 | 'ip,ip_src=192.168.0.0/24 any' \ | |
67 | 'ip,ip_src=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \ | |
68 | 'ip,ip_dst=1.2.3.4 any' \ | |
69 | 'ip,ip_dst=192.168.0.0/24 any' \ | |
70 | 'ip,ip_dst=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \ | |
71 | 'ipv6,ipv6_src=::1 NXM,OXM' \ | |
ccad219b | 72 | 'ipv6,ipv6_src=0:0:0:0:0:0:0:1/::1 NXM,OXM' \ |
aa233d57 | 73 | 'ipv6,ipv6_dst=::1 NXM,OXM' \ |
ccad219b | 74 | 'ipv6,ipv6_dst=0:0:0:0:0:0:0:1/::1 NXM,OXM' \ |
aa233d57 BP |
75 | 'ipv6,ipv6_label=5 NXM,OXM' \ |
76 | 'ipv6,ipv6_label=5/1 NXM,OXM' \ | |
77 | 'ip,nw_proto=1 any' \ | |
78 | 'ipv6,nw_proto=1 NXM,OXM' \ | |
79 | 'ip,nw_tos=0xf0 any' \ | |
80 | 'ipv6,nw_tos=0xf0 NXM,OXM' \ | |
81 | 'ip,ip_dscp=0x3c any' \ | |
82 | 'ipv6,ip_dscp=0x3c NXM,OXM' \ | |
83 | 'ip,nw_ecn=1 NXM,OXM' \ | |
84 | 'ipv6,nw_ecn=1 NXM,OXM' \ | |
85 | 'ip,nw_ttl=5 NXM,OXM' \ | |
86 | 'ipv6,nw_ttl=5 NXM,OXM' \ | |
87 | 'ip,ip_frag=no NXM,OXM' \ | |
88 | 'ipv6,ip_frag=no NXM,OXM' \ | |
89 | 'arp,arp_op=0 any' \ | |
90 | 'arp,arp_spa=1.2.3.4 any' \ | |
91 | 'arp,arp_spa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \ | |
92 | 'arp,arp_tpa=1.2.3.4 any' \ | |
93 | 'arp,arp_tpa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \ | |
94 | 'arp,arp_sha=00:11:22:33:44:55 NXM,OXM' \ | |
95 | 'arp,arp_sha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \ | |
96 | 'arp,arp_tha=00:11:22:33:44:55 NXM,OXM' \ | |
97 | 'arp,arp_tha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \ | |
98 | 'tcp,tcp_src=80 any' \ | |
99 | 'tcp,tcp_src=0x1000/0x1000 NXM,OXM' \ | |
100 | 'tcp6,tcp_src=80 NXM,OXM' \ | |
101 | 'tcp6,tcp_src=0x1000/0x1000 NXM,OXM' \ | |
102 | 'tcp,tcp_dst=80 any' \ | |
103 | 'tcp,tcp_dst=0x1000/0x1000 NXM,OXM' \ | |
104 | 'tcp6,tcp_dst=80 NXM,OXM' \ | |
105 | 'tcp6,tcp_dst=0x1000/0x1000 NXM,OXM' \ | |
106 | 'udp,udp_src=80 any' \ | |
107 | 'udp,udp_src=0x1000/0x1000 NXM,OXM' \ | |
108 | 'udp6,udp_src=80 NXM,OXM' \ | |
109 | 'udp6,udp_src=0x1000/0x1000 NXM,OXM' \ | |
110 | 'udp,udp_dst=80 any' \ | |
111 | 'udp,udp_dst=0x1000/0x1000 NXM,OXM' \ | |
112 | 'udp6,udp_dst=80 NXM,OXM' \ | |
113 | 'udp6,udp_dst=0x1000/0x1000 NXM,OXM' \ | |
114 | 'icmp,icmp_type=1 any' \ | |
115 | 'icmp,icmp_code=2 any' \ | |
116 | 'icmp6,icmpv6_type=1 NXM,OXM' \ | |
117 | 'icmp6,icmpv6_code=2 NXM,OXM' | |
340c7bb2 BP |
118 | do |
119 | set $test_case | |
120 | echo | |
121 | echo "### test case: '$1' should have usable protocols '$2'" | |
122 | if test "$2" = none; then | |
123 | AT_CHECK([ovs-ofctl parse-flow "$1,actions=drop"], [1], | |
124 | [usable protocols: none | |
125 | ], | |
126 | [ovs-ofctl: no usable protocol | |
127 | ]) | |
128 | else | |
129 | AT_CHECK_UNQUOTED([ovs-ofctl parse-flow "$1,actions=drop" | sed 1q], [0], | |
130 | [usable protocols: $2 | |
131 | ]) | |
132 | fi | |
133 | done | |
134 | AT_CLEANUP | |
135 | ||
27527aa0 BP |
136 | AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.0)]) |
137 | AT_DATA([flows.txt], [[ | |
138 | # comment | |
be3f512a | 139 | tcp,tp_src=123,out_port=5,actions=flood |
27527aa0 BP |
140 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop |
141 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 | |
142 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
143 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
144 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller | |
145 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
b019d34d | 146 | ip,actions=set_field:10.4.3.77->ip_src |
db0b6c29 JR |
147 | sctp actions=drop |
148 | sctp actions=drop | |
e3432ee9 | 149 | in_port=0 actions=resubmit:0 |
29089a54 | 150 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
27527aa0 BP |
151 | ]]) |
152 | ||
153 | AT_CHECK([ovs-ofctl parse-flows flows.txt | |
154 | ], [0], [stdout]) | |
155 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], | |
aa233d57 | 156 | [[usable protocols: any |
27527aa0 | 157 | chosen protocol: OpenFlow10-table_id |
be3f512a | 158 | OFPT_FLOW_MOD: ADD tcp,tp_src=123 out_port:5 actions=FLOOD |
576ec803 | 159 | OFPT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop |
27527aa0 BP |
160 | OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 |
161 | OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
162 | OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
163 | OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 | |
164 | OFPT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 | |
a6fd70bb | 165 | OFPT_FLOW_MOD: ADD ip actions=mod_nw_src:10.4.3.77 |
db0b6c29 JR |
166 | OFPT_FLOW_MOD: ADD sctp actions=drop |
167 | OFPT_FLOW_MOD: ADD sctp actions=drop | |
e3432ee9 | 168 | OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0 |
29089a54 | 169 | OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
f0992bed SH |
170 | ]]) |
171 | AT_CLEANUP | |
172 | ||
ff14eb7a JR |
173 | AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.1)]) |
174 | AT_DATA([flows.txt], [[ | |
175 | # comment | |
176 | tcp,tp_src=123,out_port=5,actions=flood | |
177 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop | |
178 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 | |
179 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
180 | udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1 | |
181 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller | |
182 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
0c20dbe4 | 183 | ip,actions=mod_nw_ttl:1,set_field:10.4.3.77->ip_src |
ff14eb7a JR |
184 | sctp actions=drop |
185 | sctp actions=drop | |
186 | in_port=0 actions=resubmit:0 | |
187 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) | |
188 | ]]) | |
189 | ||
190 | AT_CHECK([ovs-ofctl --protocols OpenFlow11 parse-flows flows.txt | |
191 | ], [0], [stdout]) | |
192 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], | |
aa233d57 | 193 | [[usable protocols: any |
ff14eb7a | 194 | chosen protocol: OpenFlow11 |
0e197060 BP |
195 | OFPT_FLOW_MOD (OF1.1): ADD tcp,tp_src=123 out_port:5 actions=FLOOD |
196 | OFPT_FLOW_MOD (OF1.1): ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop | |
197 | OFPT_FLOW_MOD (OF1.1): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0 | |
198 | OFPT_FLOW_MOD (OF1.1): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
199 | OFPT_FLOW_MOD (OF1.1): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1 | |
200 | OFPT_FLOW_MOD (OF1.1): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 | |
201 | OFPT_FLOW_MOD (OF1.1): ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 | |
202 | OFPT_FLOW_MOD (OF1.1): ADD ip actions=mod_nw_ttl:1,mod_nw_src:10.4.3.77 | |
203 | OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop | |
204 | OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop | |
205 | OFPT_FLOW_MOD (OF1.1): ADD in_port=0 actions=resubmit:0 | |
206 | OFPT_FLOW_MOD (OF1.1): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) | |
ff14eb7a JR |
207 | ]]) |
208 | AT_CLEANUP | |
209 | ||
f0992bed SH |
210 | AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.2)]) |
211 | AT_DATA([flows.txt], [[ | |
212 | # comment | |
213 | tcp,tp_src=123,actions=flood | |
1e7db674 | 214 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=mod_vlan_vid:7,mod_vlan_pcp:2 |
f0992bed SH |
215 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 |
216 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
217 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
218 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller | |
219 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
b019d34d | 220 | ipv6,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src |
0d56eaf2 JS |
221 | sctp actions=set_field:3334->sctp_src |
222 | sctp actions=set_field:4445->sctp_dst | |
1e7db674 JR |
223 | tcp actions=mod_tp_dst:1234 |
224 | udp actions=mod_tp_src:1111 | |
225 | ip actions=mod_nw_src:10.1.1.2,mod_nw_dst:192.168.10.1,mod_nw_ttl:1,mod_nw_tos:16,mod_nw_ecn:2 | |
226 | in_port=0 actions=mod_dl_src:11:22:33:44:55:66,mod_dl_dst:10:20:30:40:50:60 | |
f0992bed | 227 | in_port=0 actions=resubmit:0 |
29089a54 | 228 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
f0992bed SH |
229 | ]]) |
230 | ||
231 | AT_CHECK([ovs-ofctl --protocols OpenFlow12 parse-flows flows.txt | |
232 | ], [0], [stdout]) | |
233 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], | |
aa233d57 | 234 | [[usable protocols: NXM,OXM |
f0992bed | 235 | chosen protocol: OXM-OpenFlow12 |
0e197060 BP |
236 | OFPT_FLOW_MOD (OF1.2): ADD tcp,tp_src=123 actions=FLOOD |
237 | OFPT_FLOW_MOD (OF1.2): ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=set_field:4103->vlan_vid,set_field:2->vlan_pcp | |
238 | OFPT_FLOW_MOD (OF1.2): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0 | |
239 | OFPT_FLOW_MOD (OF1.2): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
240 | OFPT_FLOW_MOD (OF1.2): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
241 | OFPT_FLOW_MOD (OF1.2): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 | |
242 | OFPT_FLOW_MOD (OF1.2): ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 | |
243 | OFPT_FLOW_MOD (OF1.2): ADD ipv6 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src | |
244 | OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:3334->sctp_src | |
245 | OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:4445->sctp_dst | |
246 | OFPT_FLOW_MOD (OF1.2): ADD tcp actions=set_field:1234->tcp_dst | |
247 | OFPT_FLOW_MOD (OF1.2): ADD udp actions=set_field:1111->udp_src | |
248 | OFPT_FLOW_MOD (OF1.2): ADD ip actions=set_field:10.1.1.2->ip_src,set_field:192.168.10.1->ip_dst,mod_nw_ttl:1,set_field:4->ip_dscp,set_field:2->nw_ecn | |
249 | OFPT_FLOW_MOD (OF1.2): ADD in_port=0 actions=set_field:11:22:33:44:55:66->eth_src,set_field:10:20:30:40:50:60->eth_dst | |
250 | OFPT_FLOW_MOD (OF1.2): ADD in_port=0 actions=resubmit:0 | |
251 | OFPT_FLOW_MOD (OF1.2): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) | |
27527aa0 BP |
252 | ]]) |
253 | AT_CLEANUP | |
254 | ||
3634dff8 BP |
255 | AT_SETUP([ovs-ofctl parse-flow with invalid mask]) |
256 | for test_case in \ | |
257 | 'tun_tos 1/1' \ | |
258 | 'tun_ttl 1/1' \ | |
259 | 'skb_priority 1/1' \ | |
260 | 'eth_type 0x1234/0x1' \ | |
261 | 'dl_vlan 9/0x1' \ | |
262 | 'dl_vlan_pcp 6/0x1' \ | |
263 | 'vlan_pcp 5/0x1' \ | |
264 | 'mpls mpls_label 5/0x1' \ | |
265 | 'mpls mpls_tc 1/0x1' \ | |
266 | 'mpls mpls_bos 1/0x1' \ | |
267 | 'ip nw_proto 1/1' \ | |
268 | 'ipv6 nw_proto 1/1' \ | |
269 | 'ip nw_tos 0xf0/0xf0' \ | |
270 | 'ipv6 nw_tos 0xf0/0xf0' \ | |
44a7e26d JR |
271 | 'ip ip_dscp 0x3c/0xf0' \ |
272 | 'ipv6 ip_dscp 0x3c/0xf0' \ | |
3634dff8 BP |
273 | 'ip nw_ecn 1/1' \ |
274 | 'ipv6 nw_ecn 1/1' \ | |
275 | 'ip nw_ttl 5/1' \ | |
276 | 'ipv6 nw_ttl 5/1' \ | |
277 | 'arp arp_op 0/1' \ | |
278 | 'icmp icmp_type 1/1' \ | |
279 | 'icmp icmp_code 2/1' \ | |
280 | 'icmp6 icmpv6_code 2/1' | |
281 | do | |
282 | set $test_case | |
283 | if test $# = 3; then | |
284 | prereq=$1, field=$2 value=$3 | |
285 | else | |
286 | prereq= field=$1 value=$2 | |
287 | fi | |
288 | AT_CHECK_UNQUOTED([ovs-ofctl parse-flow "$prereq$field=$value,actions=drop"], [1], [], | |
289 | [ovs-ofctl: $value: invalid mask for field $field | |
290 | ]) | |
291 | done | |
292 | AT_CLEANUP | |
293 | ||
8621547c JR |
294 | AT_SETUP([ovs-ofctl action inconsistency (OpenFlow 1.1)]) |
295 | AT_CHECK([ovs-ofctl --protocols OpenFlow11 add-flow br0 'ip actions=mod_tp_dst:1234' | |
ba2fe8e9 | 296 | ], [1], [stdout], [ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM) is among the allowed flow formats (OpenFlow11) |
8621547c JR |
297 | ]) |
298 | AT_CLEANUP | |
299 | ||
4fe3445a PS |
300 | AT_SETUP([ovs-ofctl parse-flows (With Tunnel-Parameters)]) |
301 | AT_DATA([flows.txt], [[ | |
302 | tun_id=0x1234000056780000/0xffff0000ffff0000,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=0x3,tun_ttl=20,tun_flags=key|csum actions=drop | |
303 | ]]) | |
304 | ||
305 | AT_CHECK([ovs-ofctl parse-flows flows.txt | |
306 | ], [1], [usable protocols: none | |
307 | ], [stderr]) | |
308 | ||
309 | AT_CLEANUP | |
310 | ||
311 | ||
ac923e91 | 312 | AT_SETUP([ovs-ofctl parse-flows (skb_priority)]) |
1b567fb9 | 313 | AT_DATA([flows.txt], [[ |
ac923e91 | 314 | skb_priority=0x12341234,tcp,tp_src=123,actions=flood |
1b567fb9 AA |
315 | ]]) |
316 | ||
317 | AT_CHECK([ovs-ofctl parse-flows flows.txt | |
318 | ], [1], [usable protocols: none | |
319 | ], [stderr]) | |
320 | ||
321 | AT_CLEANUP | |
322 | ||
323 | ||
27527aa0 | 324 | AT_SETUP([ovs-ofctl parse-flows (NXM)]) |
53ddd40a | 325 | AT_DATA([flows.txt], [[ |
0e581146 BP |
326 | # comment |
327 | tcp,tp_src=123,actions=flood | |
328 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop | |
ac923e91 | 329 | pkt_mark=0xbb,actions=set_field:0xaa->pkt_mark |
0e581146 | 330 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 |
eedc0097 JP |
331 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 |
332 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
0e581146 | 333 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller |
96fc46e8 | 334 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note |
73f33563 | 335 | tcp,tp_src=0x1230/0xfff0,tun_id=0x1234,cookie=0x5678,actions=flood |
b9298d3f | 336 | actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789 |
53ddd40a | 337 | actions=multipath(eth_src, 50, hrw, 12, 0, NXM_NX_REG0[0..3]),multipath(symmetric_l4, 1024, iter_hash, 5000, 5050, NXM_NX_REG0[0..12]) |
6c1491fb | 338 | table=1,actions=drop |
8368c090 | 339 | tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop |
7525e578 | 340 | metadata=0x1234ffff5678ffff/0xffff0000ffff0000,actions=drop |
daff3353 EJ |
341 | actions=bundle(eth_src,50,active_backup,ofport,slaves:1) |
342 | actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3) | |
343 | actions=bundle(symmetric_l4,60,hrw,ofport,slaves:) | |
344 | actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2 | |
a368bb53 EJ |
345 | actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1) |
346 | actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) | |
db968317 | 347 | actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:[2,3]) |
a368bb53 EJ |
348 | actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:) |
349 | actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2 | |
29901626 | 350 | actions=resubmit:1,resubmit(2),resubmit(,3),resubmit(2,3) |
a993007b BP |
351 | send_flow_rem,actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3 |
352 | check_overlap,actions=output:1,exit,output:2 | |
8621547c | 353 | tcp,actions=fin_timeout(idle_timeout=5,hard_timeout=15) |
a7349929 | 354 | actions=controller(max_len=123,reason=invalid_ttl,id=555) |
29089a54 | 355 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
53ddd40a | 356 | ]]) |
29901626 | 357 | |
53ddd40a | 358 | AT_CHECK([ovs-ofctl parse-flows flows.txt |
f1f41fb6 | 359 | ], [0], [stdout]) |
27527aa0 | 360 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], |
aa233d57 | 361 | [[usable protocols: OXM,NXM+table_id |
27527aa0 BP |
362 | chosen protocol: NXM+table_id |
363 | NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD | |
576ec803 | 364 | NXT_FLOW_MOD: ADD table:255 in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop |
ac923e91 | 365 | NXT_FLOW_MOD: ADD table:255 pkt_mark=0xbb actions=load:0xaa->NXM_NX_PKT_MARK[] |
27527aa0 BP |
366 | NXT_FLOW_MOD: ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 |
367 | NXT_FLOW_MOD: ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
368 | NXT_FLOW_MOD: ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
369 | NXT_FLOW_MOD: ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 | |
370 | NXT_FLOW_MOD: ADD table:255 actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 | |
371 | NXT_FLOW_MOD: ADD table:255 tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD | |
372 | NXT_FLOW_MOD: ADD table:255 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789 | |
373 | NXT_FLOW_MOD: ADD table:255 actions=multipath(eth_src,50,hrw,12,0,NXM_NX_REG0[0..3]),multipath(symmetric_l4,1024,iter_hash,5000,5050,NXM_NX_REG0[0..12]) | |
e896c2d4 BP |
374 | NXT_FLOW_MOD: ADD table:1 actions=drop |
375 | NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop | |
7525e578 | 376 | NXT_FLOW_MOD: ADD table:255 metadata=0x1234000056780000/0xffff0000ffff0000 actions=drop |
daff3353 EJ |
377 | NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1) |
378 | NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3) | |
379 | NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:) | |
380 | NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2 | |
a368bb53 EJ |
381 | NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1) |
382 | NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) | |
db968317 | 383 | NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) |
a368bb53 EJ |
384 | NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:) |
385 | NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2 | |
29901626 | 386 | NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3) |
a993007b BP |
387 | NXT_FLOW_MOD: ADD table:255 send_flow_rem actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3 |
388 | NXT_FLOW_MOD: ADD table:255 check_overlap actions=output:1,exit,output:2 | |
8621547c | 389 | NXT_FLOW_MOD: ADD table:255 tcp actions=fin_timeout(idle_timeout=5,hard_timeout=15) |
a7349929 | 390 | NXT_FLOW_MOD: ADD table:255 actions=controller(reason=invalid_ttl,max_len=123,id=555) |
29089a54 | 391 | NXT_FLOW_MOD: ADD table:255 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
53ddd40a | 392 | ]]) |
88ca35ee BP |
393 | AT_CLEANUP |
394 | ||
395 | AT_SETUP([ovs-ofctl -F nxm parse-flows]) | |
396 | AT_DATA([flows.txt], [ | |
397 | # comment | |
398 | tcp,tp_src=123,actions=flood | |
399 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop | |
bad68a99 | 400 | arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop |
fa8223b7 | 401 | ipv6,ipv6_label=0x12345 actions=2 |
d31f1109 JP |
402 | ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3 |
403 | ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4 | |
404 | ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5 | |
405 | tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop | |
406 | udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop | |
407 | in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop | |
88ca35ee BP |
408 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 |
409 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
410 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
685a51a5 | 411 | icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop |
47284b1f | 412 | icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4F:0571/112 actions=drop |
685a51a5 JP |
413 | icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop |
414 | icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop | |
47284b1f | 415 | icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE00:0000/96,nd_tll=00:0A:E4:25:6B:B1 actions=drop |
88ca35ee BP |
416 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller |
417 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
418 | tun_id=0x1234,cookie=0x5678,actions=flood | |
419 | actions=drop | |
8368c090 | 420 | tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop |
cb8ca532 BP |
421 | dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop |
422 | dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop | |
423 | dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop | |
424 | dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop | |
29089a54 | 425 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
88ca35ee BP |
426 | ]) |
427 | AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout]) | |
428 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl | |
aa233d57 | 429 | usable protocols: NXM,OXM |
27527aa0 | 430 | chosen protocol: NXM-table_id |
88ca35ee | 431 | NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD |
576ec803 | 432 | NXT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop |
bad68a99 | 433 | NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop |
fa8223b7 | 434 | NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2 |
d31f1109 JP |
435 | NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3 |
436 | NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4 | |
437 | NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5 | |
438 | NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop | |
439 | NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop | |
440 | NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop | |
88ca35ee BP |
441 | NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 |
442 | NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
443 | NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
685a51a5 | 444 | NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571 actions=drop |
47284b1f | 445 | NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4f:0/112 actions=drop |
685a51a5 JP |
446 | NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop |
447 | NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571,nd_tll=00:0a:e4:25:6b:b1 actions=drop | |
47284b1f | 448 | NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0:0:1234:f045:8fff:1111::/96,nd_tll=00:0a:e4:25:6b:b1 actions=drop |
88ca35ee BP |
449 | NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 |
450 | NXT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 | |
451 | NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD | |
452 | NXT_FLOW_MOD: ADD actions=drop | |
8368c090 | 453 | NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop |
cb8ca532 BP |
454 | NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop |
455 | NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop | |
456 | NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop | |
457 | NXT_FLOW_MOD: ADD actions=drop | |
29089a54 | 458 | NXT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
0e581146 BP |
459 | ]) |
460 | AT_CLEANUP | |
09246b99 | 461 | |
4f564f8d | 462 | AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows]) |
f393f81e | 463 | AT_DATA([flows.txt], [[ |
4f564f8d BP |
464 | # comment |
465 | tcp,tp_src=123,actions=flood | |
466 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop | |
bad68a99 | 467 | arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop |
fa8223b7 | 468 | ipv6,ipv6_label=0x12345 actions=2 |
d31f1109 JP |
469 | ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3 |
470 | ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4 | |
471 | ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5 | |
0d56eaf2 JS |
472 | tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop |
473 | udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop | |
474 | sctp6,ipv6_src=2001:db8:3c4d:1::5,tp_dst=309 actions=drop | |
d31f1109 | 475 | in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop |
4f564f8d BP |
476 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 |
477 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
478 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
0d56eaf2 | 479 | sctp,nw_src=192.168.0.3,tp_dst=309 actions=pop_queue,output:1 |
685a51a5 JP |
480 | icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop |
481 | icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop | |
482 | icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop | |
4f564f8d BP |
483 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller |
484 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
485 | tun_id=0x1234,cookie=0x5678,actions=flood | |
486 | actions=drop | |
f393f81e | 487 | reg0=123,actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:55->NXM_NX_REG2[0..31],move:NXM_NX_REG0[0..31]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[] |
b5e5143b | 488 | actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[] |
bd85dac1 | 489 | actions=push:NXM_NX_REG0[0..31],pop:NXM_NX_REG0[] |
33d8c6b4 | 490 | vlan_tci=0x1123/0x1fff,actions=drop |
29089a54 | 491 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
f393f81e | 492 | ]]) |
ad7c0437 | 493 | AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout], [stderr]) |
f393f81e | 494 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], |
aa233d57 | 495 | [[usable protocols: NXM,OXM |
27527aa0 BP |
496 | chosen protocol: NXM-table_id |
497 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD | |
4f564f8d | 498 | NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop |
bad68a99 | 499 | NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop |
fa8223b7 | 500 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2 |
d31f1109 JP |
501 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3 |
502 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4 | |
503 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5 | |
504 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000001), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(0050) actions=drop | |
505 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000003), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(0035) actions=drop | |
0d56eaf2 | 506 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000005), NXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(0135) actions=drop |
d31f1109 | 507 | NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(0003), NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000001), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(86) actions=drop |
4f564f8d BP |
508 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_VLAN_TCI_W(f000/f000), NXM_OF_IP_PROTO(11) idle:5 actions=strip_vlan,output:0 |
509 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80003), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(0050) actions=set_queue:37,output:1 | |
510 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80003), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(0035) actions=pop_queue,output:1 | |
0d56eaf2 | 511 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80003), NXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(0135) actions=pop_queue,output:1 |
685a51a5 JP |
512 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(fec000001234f0458fff1111fe4e0571) actions=drop |
513 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_SLL(000ae4256bb0) actions=drop | |
514 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(fec000001234f0458fff1111fe4e0571), NXM_NX_ND_TLL(000ae4256bb1) actions=drop | |
4f564f8d BP |
515 | NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535 |
516 | NXT_FLOW_MOD: ADD <any> actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 | |
517 | NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD | |
518 | NXT_FLOW_MOD: ADD <any> actions=drop | |
d90611f1 | 519 | NXT_FLOW_MOD: ADD NXM_NX_REG0(0000007b) actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:0x37->NXM_NX_REG2[],move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[] |
b5e5143b | 520 | NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[] |
bd85dac1 | 521 | NXT_FLOW_MOD: ADD <any> actions=push:NXM_NX_REG0[],pop:NXM_NX_REG0[] |
33d8c6b4 | 522 | NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop |
29089a54 | 523 | NXT_FLOW_MOD: ADD <any> actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
f393f81e | 524 | ]]) |
4f564f8d BP |
525 | AT_CLEANUP |
526 | ||
09246b99 BP |
527 | AT_SETUP([ovs-ofctl parse-nx-match]) |
528 | AT_KEYWORDS([nx-match]) | |
529 | AT_DATA([nx-match.txt], [dnl | |
530 | <any> | |
531 | ||
532 | # in port | |
533 | NXM_OF_IN_PORT(0000) | |
534 | NXM_OF_IN_PORT(fffe) | |
535 | ||
536 | # eth dst | |
537 | NXM_OF_ETH_DST(0002e30f80a4) | |
1e37a2d7 BP |
538 | NXM_OF_ETH_DST_W(010000000000/010000000000) |
539 | NXM_OF_ETH_DST_W(000000000000/010000000000) | |
06da29ee | 540 | NXM_OF_ETH_DST_W(ffffffffffff/010000000000) |
1e37a2d7 | 541 | NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff) |
fbcbc814 | 542 | NXM_OF_ETH_DST_W(60175619848f/000000000000) |
1e37a2d7 | 543 | NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) |
73c0ce34 | 544 | NXM_OF_ETH_DST_W(60175619848f/5a5a5a5a5a5a) |
09246b99 BP |
545 | |
546 | # eth src | |
547 | NXM_OF_ETH_SRC(020898456ddb) | |
73c0ce34 JS |
548 | NXM_OF_ETH_SRC_W(012345abcdef/ffffff555555) |
549 | NXM_OF_ETH_SRC_W(020898456ddb/ffffffffffff) | |
fbcbc814 | 550 | NXM_OF_ETH_SRC_W(020898456ddb/000000000000) |
09246b99 BP |
551 | |
552 | # eth type | |
553 | NXM_OF_ETH_TYPE(0800) | |
554 | NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012) | |
555 | ||
556 | # vlan tci | |
557 | NXM_OF_VLAN_TCI(f009) | |
558 | NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009) | |
559 | NXM_OF_VLAN_TCI(0000) # Packets without 802.1Q header. | |
560 | NXM_OF_VLAN_TCI(3123) # Packets with VID=123, PCP=1. | |
66642cb4 | 561 | NXM_OF_VLAN_TCI(0123) # Does not make sense (but supported anyway) |
09246b99 | 562 | NXM_OF_VLAN_TCI_W(1123/1fff) # Packets with VID=123, any PCP. |
fbcbc814 SH |
563 | NXM_OF_VLAN_TCI_W(1123/ffff) # Packets with VID=123, PCP=0 |
564 | NXM_OF_VLAN_TCI_W(1123/0000) # Packets with or without 802.1Q header | |
09246b99 | 565 | NXM_OF_VLAN_TCI_W(f000/f000) # Packets with any VID, PCP=7. |
66642cb4 | 566 | NXM_OF_VLAN_TCI_W(0000/e000) # No 802.1Q or with VID=0 |
09246b99 BP |
567 | |
568 | # IP TOS | |
569 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0) | |
530180fd | 570 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41) |
09246b99 BP |
571 | NXM_OF_IP_TOS(f0) |
572 | ||
530180fd JP |
573 | # IP ECN |
574 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03) | |
575 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06) | |
576 | NXM_NX_IP_ECN(03) | |
577 | ||
09246b99 BP |
578 | # IP protocol |
579 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) | |
580 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05) | |
581 | NXM_OF_IP_PROTO(05) | |
582 | ||
a61680c6 JP |
583 | # IP TTL |
584 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80) | |
585 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff) | |
586 | NXM_NX_IP_TTL(80) | |
587 | ||
09246b99 BP |
588 | # IP source |
589 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014) | |
590 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000) | |
c08201d6 | 591 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/5a5a5a5a) |
fbcbc814 | 592 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/ffffffff) |
09246b99 BP |
593 | NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014) |
594 | NXM_OF_IP_SRC_W(C0D80000/FFFF0000) | |
595 | ||
596 | # IP destination | |
597 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014) | |
06da29ee | 598 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000) |
c08201d6 | 599 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/5a5a5a5a) |
fbcbc814 | 600 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/ffffffff) |
09246b99 BP |
601 | NXM_OF_IP_DST(ac100014) |
602 | NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000) | |
603 | ||
604 | # TCP source port | |
605 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231) | |
73f33563 | 606 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0) |
fbcbc814 | 607 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/ffff) |
09246b99 BP |
608 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231) |
609 | ||
610 | # TCP destination port | |
611 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231) | |
73f33563 | 612 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0) |
fbcbc814 | 613 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/ffff) |
09246b99 BP |
614 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231) |
615 | ||
dc235f7f JR |
616 | # TCP flags |
617 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS(0131) | |
618 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(00F0/0FF0) | |
619 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(01E2/ffff) | |
178742f9 | 620 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_NX_TCP_FLAGS(0fff) |
dc235f7f | 621 | |
09246b99 BP |
622 | # UDP source port |
623 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732) | |
73f33563 | 624 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF) |
fbcbc814 | 625 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/ffff) |
09246b99 BP |
626 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823) |
627 | ||
628 | # UDP destination port | |
629 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782) | |
73f33563 | 630 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F) |
fbcbc814 | 631 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/FFFF) |
09246b99 BP |
632 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293) |
633 | ||
634 | # ICMP type | |
635 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12) | |
636 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10) | |
637 | ||
638 | # ICMP code | |
639 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12) | |
640 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10) | |
641 | NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10) | |
642 | NXM_OF_ICMP_CODE(00) | |
643 | ||
644 | # ARP opcode | |
645 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) | |
646 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111) | |
647 | NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001) | |
648 | NXM_OF_ARP_OP(0001) | |
649 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001) | |
650 | ||
bad68a99 | 651 | # ARP source protocol address |
09246b99 | 652 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014) |
06da29ee | 653 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00) |
c08201d6 | 654 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00) |
fbcbc814 | 655 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/ffffffff) |
09246b99 | 656 | NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014) |
178742f9 | 657 | NXM_OF_ARP_SPA_W(C0D80000/FFFF0000) |
09246b99 | 658 | |
bad68a99 | 659 | # ARP destination protocol address |
09246b99 | 660 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014) |
06da29ee | 661 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00) |
c08201d6 | 662 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/77777777) |
fbcbc814 | 663 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/ffffffff) |
09246b99 BP |
664 | NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014) |
665 | NXM_OF_ARP_TPA_W(C0D80000/FFFF0000) | |
666 | ||
bad68a99 JP |
667 | # ARP source hardware address |
668 | NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4) | |
669 | NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4) | |
670 | NXM_NX_ARP_SHA(0002e30f80a4) | |
671 | ||
672 | # ARP destination hardware address | |
673 | NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4) | |
674 | NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4) | |
675 | NXM_NX_ARP_THA(0002e30f80a4) | |
676 | ||
8087f5ff MM |
677 | # RARP opcode |
678 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003) | |
679 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(1111) | |
680 | NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0003) | |
681 | NXM_OF_ARP_OP(0003) | |
682 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003) NXM_OF_ARP_OP(0003) | |
683 | ||
684 | # RARP source protocol address | |
685 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA(ac100014) | |
3947cc76 | 686 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81200/FFFFFF00) |
8087f5ff MM |
687 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00) |
688 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/ffffffff) | |
8087f5ff | 689 | NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014) |
178742f9 | 690 | NXM_OF_ARP_SPA_W(C0D80000/FFFF0000) |
8087f5ff MM |
691 | |
692 | # RARP destination protocol address | |
693 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA(ac100014) | |
3947cc76 | 694 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81200/FFFFFF00) |
8087f5ff MM |
695 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/77777777) |
696 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/ffffffff) | |
8087f5ff MM |
697 | NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014) |
698 | NXM_OF_ARP_TPA_W(C0D80000/FFFF0000) | |
699 | ||
700 | # RARP source hardware address | |
701 | NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_SHA(0002e30f80a4) | |
702 | NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4) | |
703 | NXM_NX_ARP_SHA(0002e30f80a4) | |
704 | ||
705 | # RARP destination hardware address | |
706 | NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_THA(0002e30f80a4) | |
707 | NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4) | |
708 | NXM_NX_ARP_THA(0002e30f80a4) | |
709 | ||
d31f1109 JP |
710 | # IPv6 source |
711 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) | |
712 | NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) | |
713 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
ff0b06ee | 714 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/5a5a5a5a5a5a5a5a0000000000000000) |
fbcbc814 SH |
715 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) |
716 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) | |
178742f9 | 717 | NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffff000000000000) |
d31f1109 JP |
718 | |
719 | # IPv6 destination | |
720 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) | |
721 | NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) | |
ff0b06ee | 722 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/77777777777777777777777777777777) |
fbcbc814 | 723 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) |
3947cc76 | 724 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000) |
d31f1109 JP |
725 | NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) |
726 | ||
626186c3 SH |
727 | # IPv6 Flow Label |
728 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(1000000f) | |
729 | NXM_NX_IPV6_LABEL(0000000f) | |
730 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(0000000f) | |
731 | ||
ff0b06ee BP |
732 | # ND target address |
733 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) | |
734 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) | |
735 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/0123456789abcdeffedcba9876543210) | |
fbcbc814 | 736 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/ffffffffffffffffffffffffffffffff) |
3947cc76 | 737 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(00000000000000000000000000000000/00000000000000000000000000000000) |
ff0b06ee BP |
738 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/fedcba98765432100123456789abcdef) |
739 | ||
685a51a5 JP |
740 | # ND source hardware address |
741 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4) | |
742 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4) | |
743 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3b) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4) | |
744 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4) | |
745 | ||
746 | # ND destination hardware address | |
747 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4) | |
748 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4) | |
749 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3b) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4) | |
750 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4) | |
751 | ||
7257b535 BP |
752 | # IPv4 fragments. |
753 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00) | |
754 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01) | |
755 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02) | |
756 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03) | |
757 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03) | |
758 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd) | |
759 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02) | |
760 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01) | |
761 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02) | |
762 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03) | |
fbcbc814 SH |
763 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/ff) |
764 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/00) | |
7257b535 BP |
765 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3) |
766 | ||
767 | # IPv6 fragments. | |
768 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00) | |
769 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01) | |
770 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02) | |
771 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03) | |
772 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03) | |
773 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01) | |
774 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02) | |
775 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01) | |
776 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02) | |
777 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03) | |
fbcbc814 SH |
778 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/00) |
779 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/ff) | |
7257b535 BP |
780 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3) |
781 | ||
e729e793 JP |
782 | # Flow cookie. |
783 | NXM_NX_COOKIE(00000000abcdef01) | |
784 | NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF) | |
fbcbc814 | 785 | NXM_NX_COOKIE_W(84200000abcdef01/ffffffffffffffff) |
178742f9 | 786 | NXM_NX_COOKIE_W(0000000000000000/0000000000000000) |
e729e793 | 787 | |
09246b99 BP |
788 | # Tunnel ID. |
789 | NXM_NX_TUN_ID(00000000abcdef01) | |
8368c090 | 790 | NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF) |
fbcbc814 | 791 | NXM_NX_TUN_ID_W(84200000abcdef01/FFFFFFFFFFFFFFFF) |
3947cc76 | 792 | NXM_NX_TUN_ID_W(0000000000000000/0000000000000000) |
b6c9e612 BP |
793 | |
794 | # Register 0. | |
795 | NXM_NX_REG0(acebdf56) | |
796 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
fbcbc814 | 797 | NXM_NX_REG0_W(a0e0d050/ffffffff) |
3947cc76 | 798 | NXM_NX_REG0_W(00000000/00000000) |
558d80cb | 799 | |
508a9338 BP |
800 | # dp_hash (testing experimenter OXM). |
801 | NXM_NX_DP_HASH(01234567) | |
802 | NXOXM_ET_DP_HASH(01234567) | |
803 | ||
558d80cb | 804 | # Invalid field number. |
178742f9 | 805 | 01020304(1111/3333) |
558d80cb | 806 | |
508a9338 BP |
807 | # Invalid field numbers (experimenter OXM). |
808 | ffff020800002320(11112222) | |
809 | ffff030800002320(1111/3333) | |
810 | ||
558d80cb BP |
811 | # Unimplemented registers. |
812 | # | |
813 | # This test assumes that at least two registers, but fewer than 16, | |
814 | # registers are implemented. | |
815 | 00010004(12345678) | |
816 | 00010108(12345678/12345678) | |
817 | 00011e04(12345678) | |
818 | 00011f08(12345678/12345678) | |
09246b99 | 819 | ]) |
e1cfc4e4 | 820 | AT_CHECK([ovs-ofctl -vPATTERN:'console:%c|%p|%m' --strict parse-nx-match < nx-match.txt], [0], [dnl |
09246b99 BP |
821 | <any> |
822 | ||
823 | # in port | |
abe529af | 824 | NXM_OF_IN_PORT(0000) |
09246b99 BP |
825 | NXM_OF_IN_PORT(fffe) |
826 | ||
827 | # eth dst | |
828 | NXM_OF_ETH_DST(0002e30f80a4) | |
1e37a2d7 BP |
829 | NXM_OF_ETH_DST_W(010000000000/010000000000) |
830 | NXM_OF_ETH_DST_W(000000000000/010000000000) | |
3947cc76 | 831 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
1e37a2d7 | 832 | NXM_OF_ETH_DST(0002e30f80a4) |
3947cc76 | 833 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
1e37a2d7 | 834 | NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) |
3947cc76 | 835 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
09246b99 BP |
836 | |
837 | # eth src | |
838 | NXM_OF_ETH_SRC(020898456ddb) | |
3947cc76 | 839 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
73c0ce34 | 840 | NXM_OF_ETH_SRC(020898456ddb) |
3947cc76 | 841 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
09246b99 BP |
842 | |
843 | # eth type | |
844 | NXM_OF_ETH_TYPE(0800) | |
845 | NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800) | |
846 | ||
847 | # vlan tci | |
848 | NXM_OF_VLAN_TCI(f009) | |
2e0525bc | 849 | nx_pull_match() returned error OFPBMC_DUP_FIELD |
09246b99 BP |
850 | NXM_OF_VLAN_TCI(0000) |
851 | NXM_OF_VLAN_TCI(3123) | |
66642cb4 | 852 | NXM_OF_VLAN_TCI(0123) |
09246b99 | 853 | NXM_OF_VLAN_TCI_W(1123/1fff) |
fbcbc814 | 854 | NXM_OF_VLAN_TCI(1123) |
3947cc76 | 855 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
09246b99 | 856 | NXM_OF_VLAN_TCI_W(f000/f000) |
66642cb4 | 857 | NXM_OF_VLAN_TCI_W(0000/e000) |
09246b99 BP |
858 | |
859 | # IP TOS | |
860 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0) | |
2e0525bc SH |
861 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
862 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
530180fd JP |
863 | |
864 | # IP ECN | |
865 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03) | |
2e0525bc SH |
866 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
867 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 BP |
868 | |
869 | # IP protocol | |
870 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01) | |
871 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05) | |
2e0525bc | 872 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
a61680c6 JP |
873 | |
874 | # IP TTL | |
875 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80) | |
876 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff) | |
2e0525bc | 877 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
878 | |
879 | # IP source | |
880 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014) | |
881 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000) | |
3947cc76 | 882 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 | 883 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80000) |
2e0525bc SH |
884 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
885 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 BP |
886 | |
887 | # IP destination | |
888 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014) | |
3947cc76 BP |
889 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
890 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS | |
fbcbc814 | 891 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(c0a80000) |
2e0525bc SH |
892 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
893 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 BP |
894 | |
895 | # TCP source port | |
896 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231) | |
73f33563 | 897 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0) |
fbcbc814 | 898 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(5050) |
2e0525bc | 899 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
900 | |
901 | # TCP destination port | |
902 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231) | |
73f33563 | 903 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0) |
fbcbc814 | 904 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(fde0) |
2e0525bc | 905 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 | 906 | |
dc235f7f JR |
907 | # TCP flags |
908 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0131) | |
909 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS_W(00f0/0ff0) | |
910 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(01e2) | |
dc235f7f JR |
911 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
912 | ||
09246b99 BP |
913 | # UDP source port |
914 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732) | |
73f33563 | 915 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff) |
fbcbc814 | 916 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(0132) |
2e0525bc | 917 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
918 | |
919 | # UDP destination port | |
920 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782) | |
73f33563 | 921 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f) |
fbcbc814 | 922 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(5005) |
2e0525bc | 923 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
924 | |
925 | # ICMP type | |
926 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12) | |
2e0525bc | 927 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
928 | |
929 | # ICMP code | |
930 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12) | |
2e0525bc SH |
931 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
932 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
933 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 BP |
934 | |
935 | # ARP opcode | |
936 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001) | |
2e0525bc SH |
937 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
938 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
939 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
940 | nx_pull_match() returned error OFPBMC_DUP_FIELD | |
09246b99 | 941 | |
bad68a99 | 942 | # ARP source protocol address |
09246b99 | 943 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014) |
3947cc76 BP |
944 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
945 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS | |
fbcbc814 | 946 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(c0a81234) |
2e0525bc SH |
947 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
948 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 | 949 | |
bad68a99 | 950 | # ARP destination protocol address |
09246b99 | 951 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014) |
3947cc76 BP |
952 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
953 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS | |
fbcbc814 | 954 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(c0a81234) |
2e0525bc SH |
955 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
956 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 | 957 | |
bad68a99 JP |
958 | # ARP source hardware address |
959 | NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4) | |
2e0525bc SH |
960 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
961 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
bad68a99 JP |
962 | |
963 | # ARP destination hardware address | |
964 | NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4) | |
2e0525bc | 965 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
8087f5ff MM |
966 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
967 | ||
968 | # RARP opcode | |
969 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_OP(0003) | |
970 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
971 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
972 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
973 | nx_pull_match() returned error OFPBMC_DUP_FIELD | |
974 | ||
975 | # RARP source protocol address | |
976 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(ac100014) | |
977 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(c0a81200/ffffff00) | |
3947cc76 | 978 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
8087f5ff | 979 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(c0a81234) |
8087f5ff MM |
980 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
981 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
982 | ||
983 | # RARP destination protocol address | |
984 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(ac100014) | |
985 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(c0a81200/ffffff00) | |
3947cc76 | 986 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
8087f5ff | 987 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(c0a81234) |
8087f5ff MM |
988 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
989 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
990 | ||
991 | # RARP source hardware address | |
992 | NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_SHA(0002e30f80a4) | |
993 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
994 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
995 | ||
996 | # RARP destination hardware address | |
997 | NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_THA(0002e30f80a4) | |
998 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2e0525bc | 999 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
bad68a99 | 1000 | |
d31f1109 JP |
1001 | # IPv6 source |
1002 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) | |
2e0525bc | 1003 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
d31f1109 | 1004 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) |
3947cc76 | 1005 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 | 1006 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000000) |
3947cc76 | 1007 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
2e0525bc | 1008 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
d31f1109 JP |
1009 | |
1010 | # IPv6 destination | |
1011 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) | |
2e0525bc | 1012 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
3947cc76 | 1013 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 SH |
1014 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010000000000000000) |
1015 | NXM_OF_ETH_TYPE(86dd) | |
2e0525bc | 1016 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
d31f1109 | 1017 | |
626186c3 SH |
1018 | # IPv6 Flow Label |
1019 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
1020 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1021 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(0000000f) | |
1022 | ||
ff0b06ee BP |
1023 | # ND target address |
1024 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) | |
1025 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) | |
3947cc76 | 1026 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 SH |
1027 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) |
1028 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87) | |
3947cc76 | 1029 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
ff0b06ee | 1030 | |
685a51a5 JP |
1031 | # ND source hardware address |
1032 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005), NXM_NX_ND_SLL(0002e30f80a4) | |
2e0525bc SH |
1033 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1034 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1035 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
685a51a5 JP |
1036 | |
1037 | # ND destination hardware address | |
1038 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005), NXM_NX_ND_TLL(0002e30f80a4) | |
2e0525bc SH |
1039 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1040 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1041 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
685a51a5 | 1042 | |
7257b535 BP |
1043 | # IPv4 fragments. |
1044 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00) | |
1045 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01) | |
1046 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02) | |
1047 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) | |
1048 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00) | |
1049 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01) | |
1050 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02) | |
1051 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01) | |
1052 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02) | |
1053 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) | |
fbcbc814 | 1054 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) |
3947cc76 | 1055 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
2e0525bc | 1056 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
7257b535 BP |
1057 | |
1058 | # IPv6 fragments. | |
1059 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00) | |
1060 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01) | |
1061 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02) | |
1062 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) | |
1063 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00) | |
1064 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01) | |
1065 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02) | |
1066 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01) | |
1067 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02) | |
1068 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) | |
3947cc76 | 1069 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 | 1070 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) |
2e0525bc | 1071 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
7257b535 | 1072 | |
e729e793 JP |
1073 | # Flow cookie. |
1074 | NXM_NX_COOKIE(00000000abcdef01) | |
1075 | NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff) | |
fbcbc814 SH |
1076 | NXM_NX_COOKIE(84200000abcdef01) |
1077 | <any> | |
e729e793 | 1078 | |
09246b99 BP |
1079 | # Tunnel ID. |
1080 | NXM_NX_TUN_ID(00000000abcdef01) | |
8368c090 | 1081 | NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff) |
fbcbc814 SH |
1082 | NXM_NX_TUN_ID(84200000abcdef01) |
1083 | <any> | |
b6c9e612 BP |
1084 | |
1085 | # Register 0. | |
1086 | NXM_NX_REG0(acebdf56) | |
1087 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
fbcbc814 SH |
1088 | NXM_NX_REG0(a0e0d050) |
1089 | <any> | |
558d80cb | 1090 | |
508a9338 BP |
1091 | # dp_hash (testing experimenter OXM). |
1092 | NXM_NX_DP_HASH(01234567) | |
1093 | NXM_NX_DP_HASH(01234567) | |
1094 | ||
558d80cb | 1095 | # Invalid field number. |
2e0525bc | 1096 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
558d80cb | 1097 | |
508a9338 BP |
1098 | # Invalid field numbers (experimenter OXM). |
1099 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
1100 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
1101 | ||
558d80cb BP |
1102 | # Unimplemented registers. |
1103 | # | |
1104 | # This test assumes that at least two registers, but fewer than 16, | |
1105 | # registers are implemented. | |
1106 | NXM_NX_REG0(12345678) | |
1107 | NXM_NX_REG0_W(12345678/12345678) | |
2e0525bc SH |
1108 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
1109 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
e1cfc4e4 BP |
1110 | ], [stderr]) |
1111 | ||
1112 | # Check that at least the first warning made it. (It's rate-limited | |
1113 | # so a variable number could show up, especially under valgrind etc.) | |
3947cc76 | 1114 | AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl |
508a9338 | 1115 | nx_match|WARN|Rejecting NXM/OXM entry 0:0:1:1:12 with 1-bits in value for bits wildcarded by the mask. |
09246b99 | 1116 | ]) |
e1cfc4e4 BP |
1117 | |
1118 | # Check that there wasn't any other stderr output. | |
3947cc76 | 1119 | AT_CHECK([grep -v '1-bits in value' stderr], [1]) |
09246b99 | 1120 | AT_CLEANUP |
0fbc9f11 | 1121 | |
96628ae8 BP |
1122 | AT_SETUP([ovs-ofctl parse-ofp10-match]) |
1123 | AT_KEYWORDS([OF1.0]) | |
1124 | AT_DATA([test-data], [dnl | |
576ec803 | 1125 | # in_port=LOCAL |
8812ec2c BP |
1126 | 003820fe fffe xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl |
1127 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1128 | |
1129 | # dl_src=00:01:02:03:04:05 | |
8812ec2c BP |
1130 | 003820fb xxxx 000102030405 xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl |
1131 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1132 | |
1133 | # dl_dst=10:20:30:40:50:60 | |
8812ec2c BP |
1134 | 003820f7 xxxx xxxxxxxxxxxx 102030405060 xxxx xx xx xxxx xx xx xxxx dnl |
1135 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1136 | |
1137 | # dl_vlan=291 | |
8812ec2c BP |
1138 | 003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 xx xx xxxx xx xx xxxx dnl |
1139 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1140 | |
1141 | # dl_vlan_pcp=5 | |
8812ec2c BP |
1142 | 002820ff xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx 05 xx xxxx xx xx xxxx dnl |
1143 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1144 | |
1145 | # dl_vlan=291,dl_vlan_pcp=4 | |
8812ec2c BP |
1146 | 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 04 xx xxxx xx xx xxxx dnl |
1147 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1148 | |
1149 | # vlan_tci=0x0000 | |
8812ec2c BP |
1150 | 003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff xx xx xxxx xx xx xxxx dnl |
1151 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1152 | |
1153 | dnl dl_vlan_pcp doesn't make sense when dl_vlan is "none", so | |
1154 | dnl OVS ignores it and drops it on output. | |
1155 | # vlan_tci=0x0000 | |
1156 | # 1: 28 -> 38 | |
1157 | # 20: 05 -> 00 | |
8812ec2c BP |
1158 | 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff 05 xx xxxx xx xx xxxx dnl |
1159 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1160 | |
1161 | dnl Invalid VID and PCP discards out-of-range bits: | |
1162 | # dl_vlan=256,dl_vlan_pcp=7 | |
1163 | # 18: f1 -> 01 | |
1164 | # 20: ff -> 07 | |
8812ec2c BP |
1165 | 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx f100 ff xx xxxx xx xx xxxx dnl |
1166 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1167 | |
1168 | # dl_type=0x1234 | |
8812ec2c BP |
1169 | 003820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl |
1170 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1171 | |
1172 | # ip,nw_proto=5 | |
8812ec2c BP |
1173 | 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 05 xxxx dnl |
1174 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1175 | |
1176 | dnl Ignore nw_proto if not IP or ARP: | |
1177 | # dl_type=0x1234,nw_proto=5 | |
1178 | # normal: 3: cf -> ef | |
1179 | # normal: 25: 05 -> 00 | |
1180 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1181 | & ofp_util|INFO| pre: dl_type=0x1234,nw_proto=5 | |
1182 | & ofp_util|INFO|post: dl_type=0x1234 | |
8812ec2c BP |
1183 | 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx 05 xxxx dnl |
1184 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1185 | |
1186 | # ip,nw_tos=252 | |
8812ec2c BP |
1187 | 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 fc xx xxxx dnl |
1188 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1189 | |
1190 | dnl Ignore nw_tos if not IP: | |
1191 | # arp,nw_tos=4 | |
1192 | # 24: 05 -> 04 | |
1193 | # normal: 1: 18 -> 38 | |
1194 | # normal: 24: 04 -> 00 | |
1195 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1196 | & ofp_util|INFO| pre: arp,nw_tos=4 | |
1197 | & ofp_util|INFO|post: arp | |
8812ec2c BP |
1198 | 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 05 xx xxxx dnl |
1199 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1200 | |
1201 | dnl Low 2 bits of invalid TOS are forced to 0: | |
1202 | # ip,nw_tos=48 | |
1203 | # 24: 31 -> 30 | |
8812ec2c BP |
1204 | 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 31 xx xxxx dnl |
1205 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1206 | |
1207 | # arp,arp_op=2 | |
8812ec2c BP |
1208 | 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx 02 xxxx dnl |
1209 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1210 | |
1211 | # ip,nw_src=192.168.128.85 | |
8812ec2c BP |
1212 | 003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl |
1213 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1214 | |
1215 | # ip,nw_src=192.168.128.0/24 | |
1216 | # 31: 55 -> 00 | |
8812ec2c BP |
1217 | 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl |
1218 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1219 | |
1220 | # ip,nw_dst=192.168.128.85 | |
8812ec2c BP |
1221 | 003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl |
1222 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 BP |
1223 | |
1224 | # ip,nw_dst=192.168.128.0/24 | |
1225 | # 35: 55 -> 00 | |
8812ec2c BP |
1226 | 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl |
1227 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 | 1228 | |
666d0863 | 1229 | # arp,arp_spa=192.168.128.85 |
8812ec2c BP |
1230 | 003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl |
1231 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 | 1232 | |
666d0863 | 1233 | # arp,arp_spa=192.168.128.0/24 |
96628ae8 | 1234 | # 31: 55 -> 00 |
8812ec2c BP |
1235 | 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl |
1236 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 | 1237 | |
666d0863 | 1238 | # arp,arp_tpa=192.168.128.85 |
8812ec2c BP |
1239 | 003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl |
1240 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 | 1241 | |
666d0863 | 1242 | # arp,arp_tpa=192.168.128.0/24 |
96628ae8 | 1243 | # 35: 55 -> 00 |
8812ec2c BP |
1244 | 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl |
1245 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 BP |
1246 | |
1247 | dnl Ignore nw_src if not IP or ARP: | |
1248 | # dl_type=0x1234,nw_src=192.168.128.0/24 | |
1249 | # 31: 55 -> 00 | |
1250 | # normal: 2: 08 -> 20 | |
1251 | # normal: 28: c0 -> 00 | |
1252 | # normal: 29: a8 -> 00 | |
1253 | # normal: 30: 80 -> 00 | |
1254 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1255 | & ofp_util|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24 | |
1256 | & ofp_util|INFO|post: dl_type=0x1234 | |
8812ec2c BP |
1257 | 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl |
1258 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1259 | |
1260 | dnl Ignore nw_dst if not IP or ARP: | |
1261 | # dl_type=0x1234,nw_dst=192.168.128.0/24 | |
1262 | # 35: 55 -> 00 | |
1263 | # normal: 1: 32 -> 38 | |
1264 | # normal: 32: c0 -> 00 | |
1265 | # normal: 33: a8 -> 00 | |
1266 | # normal: 34: 80 -> 00 | |
1267 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1268 | & ofp_util|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24 | |
1269 | & ofp_util|INFO|post: dl_type=0x1234 | |
8812ec2c BP |
1270 | 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl |
1271 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 BP |
1272 | |
1273 | # tcp,tp_src=443 | |
8812ec2c BP |
1274 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl |
1275 | xxxxxxxx xxxxxxxx 01bb xxxx | |
96628ae8 BP |
1276 | |
1277 | # tcp,tp_dst=443 | |
8812ec2c BP |
1278 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl |
1279 | xxxxxxxx xxxxxxxx xxxx 01bb | |
96628ae8 BP |
1280 | |
1281 | # udp,tp_src=443 | |
8812ec2c BP |
1282 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl |
1283 | xxxxxxxx xxxxxxxx 01bb xxxx | |
96628ae8 BP |
1284 | |
1285 | # udp,tp_dst=443 | |
8812ec2c BP |
1286 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl |
1287 | xxxxxxxx xxxxxxxx xxxx 01bb | |
96628ae8 | 1288 | |
0d56eaf2 JS |
1289 | # sctp,tp_src=443 |
1290 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx dnl | |
1291 | xxxxxxxx xxxxxxxx 01bb xxxx | |
1292 | ||
1293 | # sctp,tp_dst=443 | |
1294 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx dnl | |
1295 | xxxxxxxx xxxxxxxx xxxx 01bb | |
1296 | ||
96628ae8 | 1297 | # icmp,icmp_type=5 |
8812ec2c BP |
1298 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl |
1299 | xxxxxxxx xxxxxxxx 0005 xxxx | |
96628ae8 BP |
1300 | |
1301 | # icmp,icmp_code=8 | |
8812ec2c BP |
1302 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl |
1303 | xxxxxxxx xxxxxxxx xxxx 0008 | |
96628ae8 | 1304 | |
0d56eaf2 | 1305 | dnl Ignore tp_src if not TCP/UDP/SCTP: |
96628ae8 BP |
1306 | # ip,nw_proto=21,tp_src=443 |
1307 | # normal: 3: 8f -> cf | |
1308 | # normal: 36: 01 -> 00 | |
1309 | # normal: 37: bb -> 00 | |
1310 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1311 | & ofp_util|INFO| pre: ip,nw_proto=21,tp_src=443 | |
1312 | & ofp_util|INFO|post: ip,nw_proto=21 | |
8812ec2c BP |
1313 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl |
1314 | xxxxxxxx xxxxxxxx 01bb xxxx | |
96628ae8 | 1315 | |
0d56eaf2 | 1316 | dnl Ignore tp_dst if not TCP/UDP/SCTP: |
96628ae8 BP |
1317 | # ip,nw_proto=21,tp_dst=443 |
1318 | # normal: 3: 4f -> cf | |
1319 | # normal: 38: 01 -> 00 | |
1320 | # normal: 39: bb -> 00 | |
1321 | dnl The normalization details are suppressed here due to rate-limiting. | |
8812ec2c BP |
1322 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl |
1323 | xxxxxxxx xxxxxxxx xxxx 01bb | |
96628ae8 BP |
1324 | |
1325 | ]) | |
1326 | sed '/^[[#&]]/d' < test-data > input.txt | |
1327 | sed -n 's/^# //p; /^$/p' < test-data > expout | |
1328 | sed -n 's/^& //p' < test-data > experr | |
1329 | AT_CAPTURE_FILE([input.txt]) | |
1330 | AT_CAPTURE_FILE([expout]) | |
1331 | AT_CAPTURE_FILE([experr]) | |
1332 | AT_CHECK( | |
1333 | [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-match < input.txt], | |
1334 | [0], [expout], [experr]) | |
1335 | AT_CLEANUP | |
1336 | ||
410698cf BP |
1337 | AT_SETUP([ovs-ofctl parse-ofp11-match]) |
1338 | AT_KEYWORDS([OF1.1]) | |
1339 | AT_DATA([test-data], [dnl | |
576ec803 | 1340 | # in_port=LOCAL |
410698cf BP |
1341 | 0000 0058 fffffffe 000003fe dnl |
1342 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1343 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1344 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1345 | ||
1346 | # bad ofp11_match: OFPBMC_BAD_VALUE | |
1347 | & ofp_util|WARN|port 305419896 is outside the supported range 0 through 65279 or 0xffffff00 through 0xffffffff | |
1348 | 0000 0058 12345678 000003fe dnl | |
1349 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1350 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1351 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1352 | ||
1353 | # dl_src=00:01:02:03:04:05 | |
1354 | 0000 0058 00000000 000003ff dnl | |
1355 | 000102030405000000000000 000000000000ffffffffffff dnl | |
1356 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1357 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1358 | ||
1359 | # dl_src=55:55:55:55:55:55/55:55:55:55:55:55 | |
1360 | 0000 0058 00000000 000003ff dnl | |
1361 | 555555555555aaaaaaaaaaaa 000000000000ffffffffffff dnl | |
1362 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1363 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1364 | ||
1365 | # dl_dst=00:01:02:03:04:05 | |
1366 | 0000 0058 00000000 000003ff dnl | |
1367 | 000000000000ffffffffffff 000102030405000000000000 dnl | |
1368 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1369 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1370 | ||
1371 | # dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 | |
1372 | 0000 0058 00000000 000003ff dnl | |
1373 | 000000000000ffffffffffff 010000000000feffffffffff dnl | |
1374 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1375 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1376 | ||
1377 | # dl_dst=00:01:02:03:04:05/fe:ff:ff:ff:ff:ff | |
1378 | 0000 0058 00000000 000003ff dnl | |
1379 | 000000000000ffffffffffff 000102030405010000000000 dnl | |
1380 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1381 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1382 | ||
1383 | # dl_dst=55:55:55:55:55:55/55:55:55:55:55:55 | |
1384 | 0000 0058 00000000 000003ff dnl | |
1385 | 000000000000ffffffffffff 555555555555aaaaaaaaaaaa dnl | |
1386 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1387 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1388 | ||
1389 | dnl dl_vlan_pcp is ignored if dl_vlan is wildcarded, which causes the | |
1390 | dnl the wildcard bit and the dl_vlan_pcp to be dropped for output: | |
1391 | # in_port=1 | |
1392 | # 11: fa -> fe | |
1393 | # 38: 03 -> 00 | |
1394 | 0000 0058 00000001 000003fa dnl | |
1395 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1396 | 0000 03 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1397 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1398 | ||
1399 | # dl_vlan=291 | |
1400 | 0000 0058 00000000 000003fd dnl | |
1401 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1402 | 0123 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1403 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1404 | ||
1405 | dnl OFPVID_NONE: | |
1406 | # vlan_tci=0x0000 | |
1407 | 0000 0058 00000000 000003fd dnl | |
1408 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1409 | ffff 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1410 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1411 | ||
1412 | dnl OFPVID_NONE ignores dl_vlan_pcp even if not wildcarded, which causes | |
1413 | dnl the wildcard bit and the dl_vlan_pcp to be dropped for output: | |
1414 | # vlan_tci=0x0000 | |
1415 | # 11: f9 -> fd | |
1416 | # 38: 05 -> 00 | |
1417 | 0000 0058 00000000 000003f9 dnl | |
1418 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1419 | ffff 05 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1420 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1421 | ||
1422 | # vlan_tci=0x1000/0x1000 | |
1423 | 0000 0058 00000000 000003fd dnl | |
1424 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1425 | fffe 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1426 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1427 | ||
1428 | dnl Try invalid VID: | |
1429 | # bad ofp11_match: OFPBMC_BAD_VALUE | |
1430 | 0000 0058 00000000 000003fd dnl | |
1431 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1432 | 1234 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1433 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1434 | ||
1435 | # dl_vlan_pcp=4 | |
1436 | 0000 0058 00000000 000003f9 dnl | |
1437 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1438 | fffe 04 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1439 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1440 | ||
1441 | # dl_vlan=10,dl_vlan_pcp=6 | |
1442 | 0000 0058 00000000 000003f9 dnl | |
1443 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1444 | 000a 06 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1445 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1446 | ||
1447 | # dl_type=0x1234 | |
1448 | 0000 0058 00000000 000003f7 dnl | |
1449 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1450 | 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1451 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1452 | ||
1453 | # ip,nw_tos=252 | |
1454 | 0000 0058 00000000 000003e7 dnl | |
1455 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1456 | 0000 00 00 0800 fc 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1457 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1458 | ||
1459 | dnl Try invalid TOS: | |
1460 | # bad ofp11_match: OFPBMC_BAD_VALUE | |
1461 | 0000 0058 00000000 000003e7 dnl | |
1462 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1463 | 0000 00 00 0800 01 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1464 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1465 | ||
1466 | # ip,nw_proto=5 | |
1467 | 0000 0058 00000000 000003d7 dnl | |
1468 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1469 | 0000 00 00 0800 00 05 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1470 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1471 | ||
1472 | # arp,arp_op=2 | |
1473 | 0000 0058 00000000 000003d7 dnl | |
1474 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1475 | 0000 00 00 0806 00 02 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1476 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1477 | ||
1478 | # ip,nw_src=192.168.128.0/24 | |
1479 | 0000 0058 00000000 000003f7 dnl | |
1480 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1481 | 0000 00 00 0800 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl | |
1482 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1483 | ||
c08201d6 BP |
1484 | # ip,nw_src=128.160.128.0/165.165.165.165 |
1485 | # 44: c0 -> 80 | |
1486 | # 45: a8 -> a0 | |
410698cf BP |
1487 | 0000 0058 00000000 000003f7 dnl |
1488 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1489 | 0000 00 00 0800 00 00 c0a880005a5a5a5a 00000000ffffffff 0000 0000 dnl | |
1490 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1491 | ||
1492 | # ip,nw_dst=192.168.128.0/24 | |
1493 | 0000 0058 00000000 000003f7 dnl | |
1494 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1495 | 0000 00 00 0800 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl | |
1496 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1497 | ||
c08201d6 BP |
1498 | # ip,nw_dst=128.160.128.0/165.165.165.165 |
1499 | # 52: c0 -> 80 | |
1500 | # 53: a8 -> a0 | |
410698cf BP |
1501 | 0000 0058 00000000 000003f7 dnl |
1502 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1503 | 0000 00 00 0800 00 00 00000000ffffffff c0a880005a5a5a5a 0000 0000 dnl | |
1504 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1505 | ||
666d0863 | 1506 | # arp,arp_spa=192.168.128.0/24 |
410698cf BP |
1507 | 0000 0058 00000000 000003f7 dnl |
1508 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1509 | 0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl | |
1510 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1511 | ||
666d0863 | 1512 | # arp,arp_tpa=192.168.128.0/24 |
410698cf BP |
1513 | 0000 0058 00000000 000003f7 dnl |
1514 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1515 | 0000 00 00 0806 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl | |
1516 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1517 | ||
1518 | # tcp,tp_src=443 | |
1519 | 0000 0058 00000000 00000397 dnl | |
1520 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1521 | 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1522 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1523 | ||
1524 | # tcp,tp_dst=443 | |
1525 | 0000 0058 00000000 00000357 dnl | |
1526 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1527 | 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 0000 01bb dnl | |
1528 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1529 | ||
1530 | # udp,tp_src=443 | |
1531 | 0000 0058 00000000 00000397 dnl | |
1532 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1533 | 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1534 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1535 | ||
1536 | # icmp,icmp_type=5 | |
1537 | 0000 0058 00000000 00000397 dnl | |
1538 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1539 | 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0005 0000 dnl | |
1540 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1541 | ||
1542 | # icmp,icmp_code=8 | |
1543 | 0000 0058 00000000 00000357 dnl | |
1544 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1545 | 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0000 0008 dnl | |
1546 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1547 | ||
1548 | # udp,tp_src=443 | |
1549 | 0000 0058 00000000 00000397 dnl | |
1550 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1551 | 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1552 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1553 | ||
1554 | # udp,tp_dst=443 | |
1555 | 0000 0058 00000000 00000357 dnl | |
1556 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1557 | 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 0000 01bb dnl | |
1558 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1559 | ||
0d56eaf2 | 1560 | # sctp |
410698cf BP |
1561 | 0000 0058 00000000 000003d7 dnl |
1562 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1563 | 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1564 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1565 | ||
0d56eaf2 | 1566 | # sctp,tp_src=443 |
410698cf BP |
1567 | 0000 0058 00000000 00000397 dnl |
1568 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1569 | 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1570 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1571 | ||
0d56eaf2 | 1572 | # sctp,tp_dst=443 |
410698cf BP |
1573 | 0000 0058 00000000 00000357 dnl |
1574 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1575 | 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 01bb dnl | |
1576 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1577 | ||
0d56eaf2 | 1578 | dnl Ignore tp_src if not TCP/UDP/SCTP: |
410698cf BP |
1579 | # ip,nw_proto=21 |
1580 | # 11: 97 -> d7 | |
1581 | # 60: 01 -> 00 | |
1582 | # 61: bb -> 00 | |
1583 | 0000 0058 00000000 00000397 dnl | |
1584 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1585 | 0000 00 00 0800 00 15 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1586 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1587 | ||
0d56eaf2 | 1588 | dnl Ignore tp_dst if not TCP/UDP/SCTP: |
410698cf BP |
1589 | # ip,nw_proto=22 |
1590 | # 11: 57 -> d7 | |
1591 | # 62: 01 -> 00 | |
1592 | # 63: bb -> 00 | |
1593 | 0000 0058 00000000 00000357 dnl | |
1594 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1595 | 0000 00 00 0800 00 16 00000000ffffffff 00000000ffffffff 0000 01bb dnl | |
1596 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1597 | ||
097d4939 JR |
1598 | # mpls,mpls_label=284280 |
1599 | # 64: 12 -> 00 | |
1600 | # 65: 34 -> 04 | |
410698cf BP |
1601 | 0000 0058 00000000 000002f7 dnl |
1602 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1603 | 0000 00 00 8847 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1604 | 12345678 00 000000 0000000000000000ffffffffffffffff | |
1605 | ||
097d4939 JR |
1606 | # mplsm,mpls_tc=2 |
1607 | # 68: 5a -> 02 | |
410698cf BP |
1608 | 0000 0058 00000000 000001f7 dnl |
1609 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1610 | 0000 00 00 8848 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1611 | 00000000 5a 000000 0000000000000000ffffffffffffffff | |
1612 | ||
1613 | dnl mpls_label and mpls_tc must be ignored if dl_type is not MPLS: | |
1614 | # dl_type=0x1234 | |
1615 | # 10: 00 -> 03 | |
1616 | # 64: 12 -> 00 | |
1617 | # 65: 34 -> 00 | |
1618 | # 66: 56 -> 00 | |
1619 | # 67: 78 -> 00 | |
1620 | # 68: 5a -> 00 | |
1621 | 0000 0058 00000000 000000f7 dnl | |
1622 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1623 | 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1624 | 12345678 5a 000000 0000000000000000ffffffffffffffff | |
1625 | ||
969fc56c JS |
1626 | dnl metadata match: |
1627 | # metadata=0x1234567890abcdef | |
1628 | 0000 0058 00000000 000003ff dnl | |
1629 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1630 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1631 | 00000000 00 000000 1234567890abcdef0000000000000000 | |
1632 | ||
1633 | dnl metadata match: | |
1634 | # metadata=0x5555555555555555/0x5555555555555555 | |
410698cf BP |
1635 | 0000 0058 00000000 000003ff dnl |
1636 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1637 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
969fc56c JS |
1638 | 00000000 00 000000 5555555555555555aaaaaaaaaaaaaaaa |
1639 | ||
1640 | dnl metadata match: | |
1641 | # metadata=0x1234000090ab0000/0xffff0000ffff0000 | |
1642 | # 74: 56 -> 00 | |
1643 | # 75: 78 -> 00 | |
1644 | # 78: cd -> 00 | |
1645 | # 79: ef -> 00 | |
1646 | 0000 0058 00000000 000003ff dnl | |
1647 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1648 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1649 | 00000000 00 000000 1234567890abcdef0000ffff0000ffff | |
410698cf BP |
1650 | |
1651 | ]) | |
1652 | sed '/^[[#&]]/d' < test-data > input.txt | |
1653 | sed -n 's/^# //p; /^$/p' < test-data > expout | |
1654 | sed -n 's/^& //p' < test-data > experr | |
1655 | AT_CAPTURE_FILE([input.txt]) | |
1656 | AT_CAPTURE_FILE([expout]) | |
1657 | AT_CAPTURE_FILE([experr]) | |
1658 | AT_CHECK( | |
1659 | [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-match < input.txt], | |
1660 | [0], [expout], [experr]) | |
1661 | AT_CLEANUP | |
1662 | ||
102ce766 EJ |
1663 | AT_SETUP([ovs-ofctl parse-nx-match loose]) |
1664 | AT_KEYWORDS([nx-match]) | |
1665 | AT_DATA([nx-match.txt], [dnl | |
178742f9 | 1666 | NXM_OF_IN_PORT(0001), 01020304(1111/3333), NXM_OF_ETH_TYPE(0800) |
508a9338 BP |
1667 | NXM_OF_IN_PORT(0001), ffff020800002320(11112222), NXM_OF_ETH_TYPE(0800) |
1668 | NXM_OF_IN_PORT(0001), ffff030800002320(1111/3333), NXM_OF_ETH_TYPE(0800) | |
102ce766 EJ |
1669 | ]) |
1670 | ||
1671 | AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl | |
2e0525bc | 1672 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
508a9338 BP |
1673 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
1674 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
102ce766 EJ |
1675 | ]) |
1676 | ||
508a9338 BP |
1677 | AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl |
1678 | NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) | |
1679 | NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) | |
102ce766 EJ |
1680 | NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) |
1681 | ]) | |
1682 | AT_CLEANUP | |
1683 | ||
c61f3870 | 1684 | AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.2)]) |
b5ae8913 SH |
1685 | AT_KEYWORDS([oxm]) |
1686 | AT_DATA([oxm.txt], [dnl | |
1687 | <any> | |
1688 | ||
1689 | # in port | |
1690 | OXM_OF_IN_PORT(00000000) | |
1691 | OXM_OF_IN_PORT(fffffffe) | |
1692 | ||
969fc56c JS |
1693 | # metadata |
1694 | OXM_OF_METADATA(5a5a5a5a5a5a5a5a) | |
1695 | OXM_OF_METADATA_W(0000000000000000/00000000ffffffff) | |
1696 | OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000) | |
1697 | OXM_OF_METADATA_W(1234567890abcdef/ffffffffffffffff) | |
fbcbc814 | 1698 | OXM_OF_METADATA_W(1234567890abcdef/0000000000000000) |
969fc56c | 1699 | |
b5ae8913 SH |
1700 | # eth dst |
1701 | OXM_OF_ETH_DST(0002e30f80a4) | |
1702 | OXM_OF_ETH_DST_W(010000000000/010000000000) | |
1703 | OXM_OF_ETH_DST_W(000000000000/010000000000) | |
1704 | OXM_OF_ETH_DST_W(ffffffffffff/010000000000) | |
1705 | OXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff) | |
fbcbc814 | 1706 | OXM_OF_ETH_DST_W(0002e30f80a4/000000000000) |
b5ae8913 SH |
1707 | OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) |
1708 | ||
1709 | # eth src | |
1710 | OXM_OF_ETH_SRC(020898456ddb) | |
1711 | ||
1712 | # eth type | |
1713 | OXM_OF_ETH_TYPE(0800) | |
1714 | OXM_OF_ETH_TYPE(0800) OXM_OF_IN_PORT(00000012) | |
1715 | ||
95f61ba8 SH |
1716 | # vlan |
1717 | OXM_OF_VLAN_VID(1009) OXM_OF_VLAN_VID(1009) # Duplicate Field | |
1718 | OXM_OF_VLAN_VID(f009) # Bad Value | |
8069b0da | 1719 | OXM_OF_VLAN_PCP(00) # Bad Pre-Requisite |
95f61ba8 SH |
1720 | OXM_OF_VLAN_VID(0000) # Packets without 802.1Q header or with VID=0 |
1721 | OXM_OF_VLAN_VID(1123) # Packets with VID=123, any PCP | |
1722 | OXM_OF_VLAN_VID(1123) OXM_OF_VLAN_PCP(01) # Packets with VID=123, PCP=1. | |
1723 | OXM_OF_VLAN_VID(0123) # Does not make sense (but supported anyway) | |
4b9f9232 SH |
1724 | OXM_OF_VLAN_VID_W(0123/0123) # Does not make sense (but supported anyway) |
1725 | OXM_OF_VLAN_VID_W(1123/0123) # Does not make sense (but supported anyway) | |
1726 | OXM_OF_VLAN_VID_W(0123/1123) # Does not make sense (but supported anyway) | |
8069b0da | 1727 | OXM_OF_VLAN_VID(0123) OXM_OF_VLAN_PCP(01) #Bad Pre-Requisite |
4b9f9232 SH |
1728 | OXM_OF_VLAN_VID_W(1123/1fff) # Packets with VID=123, any PCP. |
1729 | OXM_OF_VLAN_VID_W(1123/ffff) # Packets with VID=123, any PCP. | |
3947cc76 BP |
1730 | OXM_OF_VLAN_VID_W(0000/0000) # Packets with or without 802.1Q header |
1731 | OXM_OF_VLAN_VID_W(1103/1f0f), # Packets with # VID=123 (masked) | |
1732 | OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01) # Packets with VID=123 (masked), any PCP. | |
4b9f9232 SH |
1733 | OXM_OF_VLAN_VID_W(1000/1000) # Packets with any VID, any PCP |
1734 | OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) # Packets with any VID, PCP=1. | |
95f61ba8 | 1735 | |
1638b906 BP |
1736 | # IP TOS |
1737 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(f0) | |
1738 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(41) | |
1739 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(3f) | |
178742f9 | 1740 | OXM_OF_IP_DSCP(3f) |
1638b906 | 1741 | |
b5ae8913 SH |
1742 | # IP ECN |
1743 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(03) | |
1744 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(06) | |
1745 | OXM_OF_IP_ECN(03) | |
1746 | ||
1747 | # IP protocol | |
1748 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) | |
1749 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(05) | |
1750 | OXM_OF_IP_PROTO(05) | |
1751 | ||
1752 | # IP source | |
1753 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC(ac100014) | |
1754 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFF0000) | |
fbcbc814 | 1755 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFFFFFF) |
3947cc76 | 1756 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(00000000/00000000) |
b5ae8913 SH |
1757 | OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_SRC(ac100014) |
1758 | OXM_OF_IPV4_SRC_W(C0D80000/FFFF0000) | |
1759 | ||
1760 | # IP destination | |
1761 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST(ac100014) | |
3947cc76 | 1762 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a80000/FFFF0000) |
fbcbc814 | 1763 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFFFFFF) |
3947cc76 | 1764 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(00000000/00000000) |
b5ae8913 SH |
1765 | OXM_OF_IPV4_DST(ac100014) |
1766 | OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_DST_W(C0D80000/FFFF0000) | |
1767 | ||
1768 | # TCP source port | |
1769 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC(4231) | |
1770 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/F0F0) | |
fbcbc814 | 1771 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/FFFF) |
3947cc76 | 1772 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(0000/0000) |
b5ae8913 SH |
1773 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_SRC(4231) |
1774 | ||
1775 | # TCP destination port | |
1776 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST(4231) | |
1777 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFF0) | |
fbcbc814 | 1778 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFFF) |
3947cc76 | 1779 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(0000/0000) |
b5ae8913 SH |
1780 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_DST(4231) |
1781 | ||
1782 | # UDP source port | |
1783 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC(8732) | |
1784 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/01FF) | |
fbcbc814 | 1785 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/FFFF) |
3947cc76 | 1786 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0000/0000) |
b5ae8913 SH |
1787 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_UDP_SRC(7823) |
1788 | ||
1789 | # UDP destination port | |
1790 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST(1782) | |
1791 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/F00F) | |
fbcbc814 | 1792 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/FFFF) |
3947cc76 | 1793 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(0000/0000) |
b5ae8913 SH |
1794 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_UDP_DST(1293) |
1795 | ||
0d56eaf2 JS |
1796 | # SCTP source port |
1797 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC(8732) | |
1798 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/01FF) | |
1799 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/FFFF) | |
3947cc76 | 1800 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0000/0000) |
0d56eaf2 JS |
1801 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_SCTP_SRC(7823) |
1802 | ||
1803 | # SCTP destination port | |
1804 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST(1782) | |
1805 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/F00F) | |
1806 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/FFFF) | |
3947cc76 | 1807 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(0000/0000) |
0d56eaf2 JS |
1808 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_SCTP_DST(1293) |
1809 | ||
b5ae8913 SH |
1810 | # ICMP type |
1811 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_TYPE(12) | |
1812 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_TYPE(10) | |
1813 | ||
1814 | # ICMP code | |
1815 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_CODE(12) | |
1816 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_CODE(10) | |
1817 | OXM_OF_ETH_TYPE(0800) OXM_OF_ICMPV4_CODE(10) | |
1818 | OXM_OF_ICMPV4_CODE(00) | |
1819 | ||
1820 | # ARP opcode | |
1821 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) | |
1822 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(1111) | |
1823 | OXM_OF_ETH_TYPE(0000) OXM_OF_ARP_OP(0001) | |
1824 | OXM_OF_ARP_OP(0001) | |
1825 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) OXM_OF_ARP_OP(0001) | |
1826 | ||
1827 | # ARP source protocol address | |
1828 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA(ac100014) | |
3947cc76 | 1829 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81200/FFFFFF00) |
fbcbc814 | 1830 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFFFF) |
3947cc76 | 1831 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(00000000/00000000) |
b5ae8913 | 1832 | OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SPA(ac100014) |
178742f9 | 1833 | OXM_OF_ARP_SPA_W(C0D80000/FFFF0000) |
b5ae8913 SH |
1834 | |
1835 | # ARP destination protocol address | |
1836 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA(ac100014) | |
3947cc76 | 1837 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a81200/FFFFFF00) |
fbcbc814 | 1838 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFFFF) |
3947cc76 | 1839 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(00000000/00000000) |
b5ae8913 SH |
1840 | OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_TPA(ac100014) |
1841 | OXM_OF_ARP_TPA_W(C0D80000/FFFF0000) | |
1842 | ||
1843 | # ARP source hardware address | |
1844 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA(0002e30f80a4) | |
1845 | OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SHA(0002e30f80a4) | |
1846 | OXM_OF_ARP_SHA(0002e30f80a4) | |
e878338b | 1847 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/ffffffffffff) |
3947cc76 BP |
1848 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000000/000000000000) |
1849 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000004/00000000000f) | |
b5ae8913 SH |
1850 | |
1851 | # ARP destination hardware address | |
1852 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA(0002e30f80a4) | |
1853 | OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_THA(0002e30f80a4) | |
1854 | OXM_OF_ARP_THA(0002e30f80a4) | |
e878338b | 1855 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/ffffffffffff) |
3947cc76 BP |
1856 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000000/000000000000) |
1857 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000004/00000000000f) | |
b5ae8913 SH |
1858 | |
1859 | # IPv6 source | |
1860 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) | |
1861 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) | |
1862 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
fbcbc814 | 1863 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) |
3947cc76 | 1864 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(00000000000000000000000000000000/00000000000000000000000000000000) |
b5ae8913 SH |
1865 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) |
1866 | ||
1867 | # IPv6 destination | |
1868 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) | |
1869 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) | |
1870 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
fbcbc814 | 1871 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) |
3947cc76 | 1872 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000) |
b5ae8913 SH |
1873 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) |
1874 | ||
626186c3 SH |
1875 | # IPv6 Flow Label |
1876 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(1000000f) | |
1877 | OXM_OF_IPV6_FLABEL(0000000f) | |
1878 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(0000000f) | |
32455024 SH |
1879 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/0000000f) |
1880 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000fffff) | |
3947cc76 | 1881 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/000ffff0) |
32455024 SH |
1882 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/100fffff) |
1883 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/ffffffff) | |
3947cc76 | 1884 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/00000000) |
626186c3 | 1885 | |
b5ae8913 SH |
1886 | # ND source hardware address |
1887 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4) | |
1888 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4) | |
1889 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3b) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4) | |
1890 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4) | |
1891 | ||
1892 | # ND destination hardware address | |
1893 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) | |
1894 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) | |
1895 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3b) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) | |
1896 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4) | |
1897 | ||
a678b23e BP |
1898 | # Registers 0, 1, and 2. |
1899 | NXM_NX_REG0(acebdf56) | |
1900 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
1901 | NXM_NX_REG0(a0e0d050) | |
1902 | NXM_NX_REG1(acebdf56) | |
1903 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) | |
1904 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) | |
1905 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) | |
1906 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) | |
1907 | ||
1908 | # Extended registers 0, 1, and 2. | |
1909 | # (For OpenFlow 1.2, OVS transforms these into its extension registers.) | |
1910 | OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) | |
1911 | OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) | |
1912 | OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) | |
1913 | OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) | |
1914 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) | |
1915 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) | |
1916 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) | |
1917 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) | |
1918 | ||
b5ae8913 | 1919 | # Invalid field number. |
178742f9 | 1920 | 01020304(1111/3333) |
508a9338 BP |
1921 | |
1922 | # Invalid field numbers (experimenter OXM). | |
1923 | ffff020800002320(11112222) | |
1924 | ffff030800002320(1111/3333) | |
b5ae8913 | 1925 | ]) |
9d84066c | 1926 | AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow12 < oxm.txt], |
e1cfc4e4 | 1927 | [0], [dnl |
b5ae8913 SH |
1928 | <any> |
1929 | ||
1930 | # in port | |
1931 | OXM_OF_IN_PORT(00000000) | |
1932 | OXM_OF_IN_PORT(fffffffe) | |
1933 | ||
969fc56c JS |
1934 | # metadata |
1935 | OXM_OF_METADATA(5a5a5a5a5a5a5a5a) | |
1936 | OXM_OF_METADATA_W(0000000000000000/00000000ffffffff) | |
3947cc76 | 1937 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
969fc56c | 1938 | OXM_OF_METADATA(1234567890abcdef) |
3947cc76 | 1939 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
969fc56c | 1940 | |
b5ae8913 SH |
1941 | # eth dst |
1942 | OXM_OF_ETH_DST(0002e30f80a4) | |
1943 | OXM_OF_ETH_DST_W(010000000000/010000000000) | |
1944 | OXM_OF_ETH_DST_W(000000000000/010000000000) | |
3947cc76 | 1945 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
b5ae8913 | 1946 | OXM_OF_ETH_DST(0002e30f80a4) |
3947cc76 | 1947 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
b5ae8913 SH |
1948 | OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) |
1949 | ||
1950 | # eth src | |
1951 | OXM_OF_ETH_SRC(020898456ddb) | |
1952 | ||
1953 | # eth type | |
1954 | OXM_OF_ETH_TYPE(0800) | |
1955 | OXM_OF_IN_PORT(00000012), OXM_OF_ETH_TYPE(0800) | |
1956 | ||
95f61ba8 SH |
1957 | # vlan |
1958 | nx_pull_match() returned error OFPBMC_DUP_FIELD | |
1959 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
8069b0da | 1960 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
95f61ba8 SH |
1961 | OXM_OF_VLAN_VID(0000) |
1962 | OXM_OF_VLAN_VID(1123) | |
1963 | OXM_OF_VLAN_VID(1123), OXM_OF_VLAN_PCP(01) | |
1964 | OXM_OF_VLAN_VID(0123) | |
4b9f9232 | 1965 | OXM_OF_VLAN_VID_W(0123/0123) |
3947cc76 | 1966 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
4b9f9232 | 1967 | OXM_OF_VLAN_VID_W(0123/1123) |
8069b0da | 1968 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
4b9f9232 SH |
1969 | OXM_OF_VLAN_VID(1123) |
1970 | OXM_OF_VLAN_VID(1123) | |
1971 | <any> | |
1972 | OXM_OF_VLAN_VID_W(1103/1f0f) | |
1973 | OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01) | |
1974 | OXM_OF_VLAN_VID_W(1000/1000) | |
1975 | OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) | |
95f61ba8 | 1976 | |
1638b906 BP |
1977 | # IP TOS |
1978 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
1979 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
1980 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_DSCP(3f) | |
1981 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1982 | ||
b5ae8913 SH |
1983 | # IP ECN |
1984 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_ECN(03) | |
1985 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
1986 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1987 | ||
1988 | # IP protocol | |
1989 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01) | |
1990 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(05) | |
1991 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1992 | ||
1993 | # IP source | |
1994 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(ac100014) | |
1995 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC_W(c0a80000/ffff0000) | |
fbcbc814 SH |
1996 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(c0a80000) |
1997 | OXM_OF_ETH_TYPE(0800) | |
b5ae8913 SH |
1998 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1999 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2000 | ||
2001 | # IP destination | |
2002 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(ac100014) | |
2003 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST_W(c0a80000/ffff0000) | |
fbcbc814 SH |
2004 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(c0a88012) |
2005 | OXM_OF_ETH_TYPE(0800) | |
b5ae8913 SH |
2006 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2007 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2008 | ||
2009 | # TCP source port | |
2010 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(4231) | |
2011 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC_W(5050/f0f0) | |
fbcbc814 SH |
2012 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(5050) |
2013 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06) | |
b5ae8913 SH |
2014 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2015 | ||
2016 | # TCP destination port | |
2017 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(4231) | |
2018 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST_W(fde0/fff0) | |
fbcbc814 SH |
2019 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(fde0) |
2020 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06) | |
b5ae8913 SH |
2021 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2022 | ||
2023 | # UDP source port | |
2024 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(8732) | |
2025 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC_W(0132/01ff) | |
fbcbc814 SH |
2026 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(0132) |
2027 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11) | |
b5ae8913 SH |
2028 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2029 | ||
2030 | # UDP destination port | |
2031 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(1782) | |
2032 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST_W(5005/f00f) | |
fbcbc814 SH |
2033 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(5005) |
2034 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11) | |
b5ae8913 SH |
2035 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2036 | ||
0d56eaf2 JS |
2037 | # SCTP source port |
2038 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(8732) | |
2039 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC_W(0132/01ff) | |
2040 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(0132) | |
2041 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84) | |
2042 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2043 | ||
2044 | # SCTP destination port | |
2045 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(1782) | |
2046 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST_W(5005/f00f) | |
2047 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(5005) | |
2048 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84) | |
2049 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2050 | ||
b5ae8913 SH |
2051 | # ICMP type |
2052 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_TYPE(12) | |
2053 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2054 | ||
2055 | # ICMP code | |
2056 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_CODE(12) | |
2057 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2058 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2059 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2060 | ||
2061 | # ARP opcode | |
2062 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_OP(0001) | |
2063 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
2064 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2065 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2066 | nx_pull_match() returned error OFPBMC_DUP_FIELD | |
2067 | ||
2068 | # ARP source protocol address | |
2069 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(ac100014) | |
2070 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA_W(c0a81200/ffffff00) | |
fbcbc814 SH |
2071 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(c0a81234) |
2072 | OXM_OF_ETH_TYPE(0806) | |
b5ae8913 SH |
2073 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2074 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2075 | ||
2076 | # ARP destination protocol address | |
2077 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(ac100014) | |
2078 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA_W(c0a81200/ffffff00) | |
fbcbc814 SH |
2079 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(c0a812fe) |
2080 | OXM_OF_ETH_TYPE(0806) | |
b5ae8913 SH |
2081 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2082 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2083 | ||
2084 | # ARP source hardware address | |
2085 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4) | |
2086 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2087 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
e878338b SH |
2088 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4) |
2089 | OXM_OF_ETH_TYPE(0806) | |
2090 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA_W(000000000004/00000000000f) | |
b5ae8913 SH |
2091 | |
2092 | # ARP destination hardware address | |
2093 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4) | |
2094 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2095 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
e878338b SH |
2096 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4) |
2097 | OXM_OF_ETH_TYPE(0806) | |
2098 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA_W(000000000004/00000000000f) | |
b5ae8913 SH |
2099 | |
2100 | # IPv6 source | |
2101 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) | |
2102 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2103 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
fbcbc814 SH |
2104 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010000000000000000) |
2105 | OXM_OF_ETH_TYPE(86dd) | |
b5ae8913 SH |
2106 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2107 | ||
2108 | # IPv6 destination | |
2109 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) | |
2110 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2111 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
fbcbc814 SH |
2112 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010000000000000000) |
2113 | OXM_OF_ETH_TYPE(86dd) | |
b5ae8913 SH |
2114 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2115 | ||
626186c3 SH |
2116 | # IPv6 Flow Label |
2117 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
2118 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2119 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) | |
32455024 SH |
2120 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(0000000f/0000000f) |
2121 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) | |
2122 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(00000000/000ffff0) | |
2123 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) | |
2124 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) | |
2125 | OXM_OF_ETH_TYPE(86dd) | |
626186c3 | 2126 | |
b5ae8913 SH |
2127 | # ND source hardware address |
2128 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IP_PROTO(3a), OXM_OF_ICMPV6_TYPE(87), OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005), OXM_OF_IPV6_ND_SLL(0002e30f80a4) | |
2129 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2130 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2131 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2132 | ||
2133 | # ND destination hardware address | |
2134 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IP_PROTO(3a), OXM_OF_ICMPV6_TYPE(88), OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005), OXM_OF_IPV6_ND_TLL(0002e30f80a4) | |
2135 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2136 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2137 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2138 | ||
a678b23e BP |
2139 | # Registers 0, 1, and 2. |
2140 | NXM_NX_REG0(acebdf56) | |
2141 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
2142 | NXM_NX_REG0(a0e0d050) | |
2143 | NXM_NX_REG1(acebdf56) | |
2144 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) | |
2145 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) | |
2146 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) | |
2147 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) | |
2148 | ||
2149 | # Extended registers 0, 1, and 2. | |
2150 | # (For OpenFlow 1.2, OVS transforms these into its extension registers.) | |
2151 | NXM_NX_REG0(acebdf56) | |
2152 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
2153 | NXM_NX_REG0(a0e0d050) | |
2154 | NXM_NX_REG1(acebdf56) | |
2155 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) | |
2156 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) | |
2157 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) | |
2158 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) | |
2159 | ||
b5ae8913 SH |
2160 | # Invalid field number. |
2161 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
508a9338 BP |
2162 | |
2163 | # Invalid field numbers (experimenter OXM). | |
2164 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
2165 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
e1cfc4e4 BP |
2166 | ], [stderr]) |
2167 | ||
2168 | # Check that at least the first warning made it. (It's rate-limited | |
2169 | # so a variable number could show up, especially under valgrind etc.) | |
3947cc76 | 2170 | AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl |
508a9338 | 2171 | nx_match|WARN|Rejecting NXM/OXM entry 0:32768:2:1:16 with 1-bits in value for bits wildcarded by the mask. |
b5ae8913 | 2172 | ]) |
e1cfc4e4 BP |
2173 | |
2174 | # Check that there wasn't any other stderr output. | |
3947cc76 | 2175 | AT_CHECK([grep -v '1-bits in value' stderr], [1]) |
b5ae8913 SH |
2176 | AT_CLEANUP |
2177 | ||
c61f3870 BP |
2178 | AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.3)]) |
2179 | AT_KEYWORDS([oxm]) | |
2180 | AT_DATA([oxm.txt], [dnl | |
2181 | # actset_output | |
2182 | ONFOXM_ET_ACTSET_OUTPUT(00000000) | |
2183 | ONFOXM_ET_ACTSET_OUTPUT(fffffffe) | |
2184 | ONFOXM_ET_ACTSET_OUTPUT(fffffff7) | |
2185 | OXM_OF_ACTSET_OUTPUT(00000000) | |
2186 | OXM_OF_ACTSET_OUTPUT(fffffffe) | |
2187 | OXM_OF_ACTSET_OUTPUT(fffffff7) | |
2188 | ]) | |
2189 | AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow13 < oxm.txt], | |
2190 | [0], [dnl | |
2191 | # actset_output | |
2192 | ONFOXM_ET_ACTSET_OUTPUT(00000000) | |
2193 | ONFOXM_ET_ACTSET_OUTPUT(fffffffe) | |
2194 | ONFOXM_ET_ACTSET_OUTPUT(fffffff7) | |
2195 | ONFOXM_ET_ACTSET_OUTPUT(00000000) | |
2196 | ONFOXM_ET_ACTSET_OUTPUT(fffffffe) | |
2197 | ONFOXM_ET_ACTSET_OUTPUT(fffffff7) | |
2198 | ], []) | |
2199 | AT_CLEANUP | |
2200 | ||
a678b23e BP |
2201 | AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.5)]) |
2202 | AT_KEYWORDS([oxm]) | |
2203 | AT_DATA([oxm.txt], [dnl | |
2204 | # Extended registers 0 and 1. | |
2205 | OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) | |
2206 | OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) | |
2207 | OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) | |
2208 | OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) | |
2209 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) | |
2210 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) | |
2211 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) | |
2212 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) | |
2213 | ||
2214 | # Registers 0, 1, and 2. | |
2215 | # (OpenFlow 1.5 transforms these into the standard "xregs".) | |
2216 | NXM_NX_REG0(acebdf56) | |
2217 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
2218 | NXM_NX_REG0(a0e0d050) | |
2219 | NXM_NX_REG1(acebdf56) | |
2220 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) | |
2221 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) | |
2222 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) | |
2223 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) | |
c61f3870 BP |
2224 | |
2225 | # actset_output | |
2226 | ONFOXM_ET_ACTSET_OUTPUT(00000000) | |
2227 | ONFOXM_ET_ACTSET_OUTPUT(fffffffe) | |
2228 | ONFOXM_ET_ACTSET_OUTPUT(fffffff7) | |
2229 | OXM_OF_ACTSET_OUTPUT(00000000) | |
2230 | OXM_OF_ACTSET_OUTPUT(fffffffe) | |
2231 | OXM_OF_ACTSET_OUTPUT(fffffff7) | |
a678b23e BP |
2232 | ]) |
2233 | AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow15 < oxm.txt], | |
2234 | [0], [dnl | |
2235 | # Extended registers 0 and 1. | |
2236 | OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) | |
2237 | OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) | |
2238 | OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) | |
2239 | OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) | |
2240 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) | |
2241 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) | |
2242 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) | |
2243 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) | |
2244 | ||
2245 | # Registers 0, 1, and 2. | |
2246 | # (OpenFlow 1.5 transforms these into the standard "xregs".) | |
2247 | OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) | |
2248 | OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) | |
2249 | OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) | |
2250 | OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) | |
2251 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) | |
2252 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) | |
2253 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) | |
2254 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) | |
c61f3870 BP |
2255 | |
2256 | # actset_output | |
2257 | OXM_OF_ACTSET_OUTPUT(00000000) | |
2258 | OXM_OF_ACTSET_OUTPUT(fffffffe) | |
2259 | OXM_OF_ACTSET_OUTPUT(fffffff7) | |
2260 | OXM_OF_ACTSET_OUTPUT(00000000) | |
2261 | OXM_OF_ACTSET_OUTPUT(fffffffe) | |
2262 | OXM_OF_ACTSET_OUTPUT(fffffff7) | |
a678b23e BP |
2263 | ], []) |
2264 | AT_CLEANUP | |
2265 | ||
b5ae8913 SH |
2266 | AT_SETUP([ovs-ofctl parse-oxm loose]) |
2267 | AT_KEYWORDS([oxm]) | |
2268 | AT_DATA([oxm.txt], [dnl | |
178742f9 | 2269 | OXM_OF_IN_PORT(00000001), 01020304(1111/3333), OXM_OF_ETH_TYPE(0800) |
508a9338 BP |
2270 | OXM_OF_IN_PORT(00000001), ffff020800002320(11112222), OXM_OF_ETH_TYPE(0800) |
2271 | OXM_OF_IN_PORT(00000001), ffff030800002320(1111/3333), OXM_OF_ETH_TYPE(0800) | |
b5ae8913 SH |
2272 | ]) |
2273 | ||
9d84066c | 2274 | AT_CHECK([ovs-ofctl --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl |
b5ae8913 | 2275 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
508a9338 BP |
2276 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
2277 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
b5ae8913 SH |
2278 | ]) |
2279 | ||
9d84066c | 2280 | AT_CHECK([ovs-ofctl parse-oxm OpenFlow12 < oxm.txt], [0], [dnl |
b5ae8913 | 2281 | OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) |
508a9338 BP |
2282 | OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) |
2283 | OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) | |
2284 | ]) | |
2285 | AT_CLEANUP | |
2286 | ||
2287 | AT_SETUP([experimenter OXM encoding]) | |
2288 | AT_DATA([oxm.txt], [dnl | |
2289 | NXM_NX_DP_HASH(01234567) | |
2290 | NXOXM_ET_DP_HASH(01234567) | |
2291 | ||
2292 | NXM_NX_DP_HASH_W(01234567/0fffffff) | |
2293 | NXOXM_ET_DP_HASH_W(01234567/0fffffff) | |
2294 | ]) | |
2295 | ||
2296 | # To allow for testing experimenter OXM, which doesn't really have many | |
2297 | # examples in the wild, we've defined a variant of NXM_NX_DP_HASH that uses | |
2298 | # the experimenter OXM mechanism, called NXOXM_ET_DP_HASH. We've defined | |
2299 | # it as if it were introduced with OpenFlow 1.5, which gives us the | |
2300 | # opportunity to see that both forms are accepted in all OpenFlow versions | |
2301 | # but the experimenter form is used for encoding in OF1.5+. | |
2302 | # | |
2303 | # First verify that both forms are accepted and NXOXM_ET_DP_HASH is encoded | |
2304 | # in OF1.5. | |
2305 | AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow15 < oxm.txt], [0], [dnl | |
2306 | NXOXM_ET_DP_HASH(01234567) | |
2307 | 00000000 00 01 00 10 ff ff 00 08-00 00 23 20 01 23 45 67 @&t@ | |
2308 | NXOXM_ET_DP_HASH(01234567) | |
2309 | 00000000 00 01 00 10 ff ff 00 08-00 00 23 20 01 23 45 67 @&t@ | |
2310 | ||
2311 | NXOXM_ET_DP_HASH_W(01234567/0fffffff) | |
2312 | 00000000 00 01 00 14 ff ff 01 0c-00 00 23 20 01 23 45 67 @&t@ | |
2313 | 00000010 0f ff ff ff 00 00 00 00- | |
2314 | NXOXM_ET_DP_HASH_W(01234567/0fffffff) | |
2315 | 00000000 00 01 00 14 ff ff 01 0c-00 00 23 20 01 23 45 67 @&t@ | |
2316 | 00000010 0f ff ff ff 00 00 00 00- | |
2317 | ]) | |
2318 | ||
2319 | # Then verify that both forms are accepted and NXM_NX_DP_HASH is encoded | |
2320 | # in OF1.2. | |
2321 | AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl | |
2322 | NXM_NX_DP_HASH(01234567) | |
2323 | 00000000 00 01 00 0c 00 01 46 04-01 23 45 67 00 00 00 00 @&t@ | |
2324 | NXM_NX_DP_HASH(01234567) | |
2325 | 00000000 00 01 00 0c 00 01 46 04-01 23 45 67 00 00 00 00 @&t@ | |
2326 | ||
2327 | NXM_NX_DP_HASH_W(01234567/0fffffff) | |
2328 | 00000000 00 01 00 10 00 01 47 08-01 23 45 67 0f ff ff ff @&t@ | |
2329 | NXM_NX_DP_HASH_W(01234567/0fffffff) | |
2330 | 00000000 00 01 00 10 00 01 47 08-01 23 45 67 0f ff ff ff @&t@ | |
b5ae8913 SH |
2331 | ]) |
2332 | AT_CLEANUP | |
2333 | ||
52ca734e BP |
2334 | AT_SETUP([check TCP flags expression in OXM and NXM]) |
2335 | # NXM/OXM input for matching on TCP flags. | |
2336 | tcp_flags='OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)' | |
2337 | ||
2338 | # Check that marshaling into NXM gives all NXM headers. | |
2339 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-nxm], [0], | |
2340 | [NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff) | |
2341 | ]) | |
2342 | ||
ff057509 BP |
2343 | # Check that marshaling in OXM for OF1.2 gives OXM headers except for |
2344 | # TCP flags, which didn't have an OXM definition. | |
2345 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow12], [0], | |
2346 | [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff) | |
2347 | ]) | |
2348 | ||
2349 | # Check that marshaling in OXM for OF1.3 and OF1.4 gives OXM headers, | |
2350 | # including the ONF extension for TCP flags introduced in OF1.3. | |
2351 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow13], [0], | |
2352 | [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff) | |
2353 | ]) | |
2354 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow14], [0], | |
2355 | [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff) | |
52ca734e | 2356 | ]) |
52ca734e BP |
2357 | |
2358 | # OpenFlow 1.5 added an OXM header for TCP flags: | |
2359 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow15], [0], | |
2360 | [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff) | |
2361 | ]) | |
2362 | AT_CLEANUP | |
2363 | ||
df778240 BP |
2364 | dnl Check all of the patterns mentioned in the "VLAN Matching" section |
2365 | dnl in the DESIGN file at top level. | |
2366 | AT_SETUP([ovs-ofctl check-vlan]) | |
2367 | AT_KEYWORDS([VLAN]) | |
2368 | ||
2369 | dnl [1] | |
2370 | AT_CHECK([ovs-ofctl check-vlan 0000 0000], [0], [dnl | |
2371 | -> 0000/0000 | |
2372 | NXM: <any> -> 0000/0000 | |
476a0e9e | 2373 | OXM: <any> -> 0000/0000,-- |
df778240 BP |
2374 | OF1.0: 0000/1,00/1 -> 0000/0000 |
2375 | OF1.1: 0000/1,00/1 -> 0000/0000 | |
2376 | ]) | |
2377 | ||
2378 | dnl [2] | |
2379 | AT_CHECK([ovs-ofctl check-vlan 0000 ffff], [0], [dnl | |
2380 | vlan_tci=0x0000 -> 0000/ffff | |
2381 | NXM: NXM_OF_VLAN_TCI(0000) -> 0000/ffff | |
476a0e9e | 2382 | OXM: OXM_OF_VLAN_VID(0000) -> 0000/1fff,-- |
df778240 BP |
2383 | OF1.0: ffff/0,00/1 -> 0000/ffff |
2384 | OF1.1: ffff/0,00/1 -> 0000/ffff | |
2385 | ]) | |
2386 | ||
2387 | dnl [3] | |
2388 | AT_CHECK([ovs-ofctl check-vlan 1abc 1fff], [0], [dnl | |
2389 | dl_vlan=2748 -> 1abc/1fff | |
2390 | NXM: NXM_OF_VLAN_TCI_W(1abc/1fff) -> 1abc/1fff | |
476a0e9e | 2391 | OXM: OXM_OF_VLAN_VID(1abc) -> 1abc/1fff,-- |
df778240 BP |
2392 | OF1.0: 0abc/0,00/1 -> 1abc/1fff |
2393 | OF1.1: 0abc/0,00/1 -> 1abc/1fff | |
2394 | ]) | |
2395 | ||
2396 | dnl [4] | |
2397 | AT_CHECK([ovs-ofctl check-vlan b000 f000], [0], [dnl | |
2398 | dl_vlan_pcp=5 -> b000/f000 | |
2399 | NXM: NXM_OF_VLAN_TCI_W(b000/f000) -> b000/f000 | |
476a0e9e | 2400 | OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(05) -> 1000/1000,05 |
df778240 BP |
2401 | OF1.0: 0000/1,05/0 -> b000/f000 |
2402 | OF1.1: fffe/0,05/0 -> b000/f000 | |
2403 | ]) | |
2404 | ||
2405 | dnl [5] | |
2406 | AT_CHECK([ovs-ofctl check-vlan babc ffff], [0], [dnl | |
2407 | dl_vlan=2748,dl_vlan_pcp=5 -> babc/ffff | |
2408 | NXM: NXM_OF_VLAN_TCI(babc) -> babc/ffff | |
476a0e9e | 2409 | OXM: OXM_OF_VLAN_VID(1abc), OXM_OF_VLAN_PCP(05) -> 1abc/1fff,05 |
df778240 BP |
2410 | OF1.0: 0abc/0,05/0 -> babc/ffff |
2411 | OF1.1: 0abc/0,05/0 -> babc/ffff | |
2412 | ]) | |
2413 | ||
2414 | dnl [6] | |
2415 | AT_CHECK([ovs-ofctl check-vlan 0000 0fff], [0], [dnl | |
2416 | vlan_tci=0x0000/0x0fff -> 0000/0fff | |
2417 | NXM: NXM_OF_VLAN_TCI_W(0000/0fff) -> 0000/0fff | |
476a0e9e | 2418 | OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,-- |
df778240 BP |
2419 | OF1.0: 0000/0,00/1 -> 1000/1fff |
2420 | OF1.1: 0000/0,00/1 -> 1000/1fff | |
2421 | ]) | |
2422 | ||
2423 | dnl [7] | |
2424 | AT_CHECK([ovs-ofctl check-vlan 0000 f000], [0], [dnl | |
2425 | vlan_tci=0x0000/0xf000 -> 0000/f000 | |
2426 | NXM: NXM_OF_VLAN_TCI_W(0000/f000) -> 0000/f000 | |
476a0e9e | 2427 | OXM: OXM_OF_VLAN_VID_W(0000/1000) -> 0000/1000,-- |
df778240 BP |
2428 | OF1.0: ffff/0,00/1 -> 0000/ffff |
2429 | OF1.1: ffff/0,00/1 -> 0000/ffff | |
2430 | ]) | |
2431 | ||
2432 | dnl [8] | |
2433 | AT_CHECK([ovs-ofctl check-vlan 0000 efff], [0], [dnl | |
2434 | vlan_tci=0x0000/0xefff -> 0000/efff | |
2435 | NXM: NXM_OF_VLAN_TCI_W(0000/efff) -> 0000/efff | |
476a0e9e | 2436 | OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,-- |
df778240 BP |
2437 | OF1.0: 0000/0,00/0 -> 1000/ffff |
2438 | OF1.1: 0000/0,00/0 -> 1000/ffff | |
2439 | ]) | |
2440 | ||
2441 | dnl [9] | |
2442 | AT_CHECK([ovs-ofctl check-vlan 1001 1001], [0], [dnl | |
2443 | vlan_tci=0x1001/0x1001 -> 1001/1001 | |
2444 | NXM: NXM_OF_VLAN_TCI_W(1001/1001) -> 1001/1001 | |
476a0e9e | 2445 | OXM: OXM_OF_VLAN_VID_W(1001/1001) -> 1001/1001,-- |
df778240 BP |
2446 | OF1.0: 0001/0,00/1 -> 1001/1fff |
2447 | OF1.1: 0001/0,00/1 -> 1001/1fff | |
2448 | ]) | |
2449 | ||
2450 | dnl [10] | |
2451 | AT_CHECK([ovs-ofctl check-vlan 3000 3000], [0], [dnl | |
2452 | vlan_tci=0x3000/0x3000 -> 3000/3000 | |
2453 | NXM: NXM_OF_VLAN_TCI_W(3000/3000) -> 3000/3000 | |
476a0e9e | 2454 | OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) -> 1000/1000,01 |
df778240 BP |
2455 | OF1.0: 0000/1,01/0 -> 3000/f000 |
2456 | OF1.1: fffe/0,01/0 -> 3000/f000 | |
2457 | ]) | |
2458 | AT_CHECK | |
2459 | AT_CLEANUP | |
2460 | ||
7525e578 JS |
2461 | dnl Check that "-F openflow10" rejects a flow_mod with unsupported features, |
2462 | dnl such as tunnels and metadata. | |
2463 | AT_SETUP([ovs-ofctl -F option and NXM features]) | |
0fbc9f11 | 2464 | AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop], |
aa233d57 | 2465 | [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10) |
0fbc9f11 | 2466 | ]) |
7525e578 | 2467 | AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop], |
aa233d57 | 2468 | [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10) |
7525e578 | 2469 | ]) |
0fbc9f11 BP |
2470 | AT_CLEANUP |
2471 | ||
2472 | dnl Check that "-F nxm" really forces add-flow to use the NXM flow format. | |
2473 | dnl (If it doesn't, then either the tun_id won't show up at all, or it will | |
2474 | dnl additionally show up as the top 32 bits of the cookie.) This checks | |
2475 | dnl for regression against bug #4566. | |
2476 | AT_SETUP([ovs-ofctl -F option with flow_mods]) | |
023e1e0a | 2477 | OVS_VSWITCHD_START |
0fbc9f11 | 2478 | AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop]) |
ef0ce8ae | 2479 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl |
0fbc9f11 | 2480 | NXST_FLOW reply: |
ef0ce8ae | 2481 | tun_id=0x12345678 actions=drop |
0fbc9f11 | 2482 | ]) |
023e1e0a | 2483 | OVS_VSWITCHD_STOP |
0fbc9f11 | 2484 | AT_CLEANUP |
f9cbfbe4 BP |
2485 | |
2486 | dnl Check that "-F openflow10" is really honored on dump-flows. | |
2487 | dnl (If it isn't, then dump-flows will show the register match.) | |
2488 | AT_SETUP([ovs-ofctl dump-flows honors -F option]) | |
023e1e0a | 2489 | OVS_VSWITCHD_START |
f9cbfbe4 | 2490 | AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop]) |
ef0ce8ae | 2491 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl |
f9cbfbe4 | 2492 | OFPST_FLOW reply: |
ef0ce8ae | 2493 | actions=drop |
f9cbfbe4 | 2494 | ]) |
023e1e0a | 2495 | OVS_VSWITCHD_STOP |
f9cbfbe4 BP |
2496 | AT_CLEANUP |
2497 | ||
2498 | dnl Check that "-F openflow10" fails on dump-flows if the requested match | |
2499 | dnl can't be represented in OpenFlow 1.0. | |
2500 | AT_SETUP([ovs-ofctl dump-flows rejects bad -F option]) | |
023e1e0a | 2501 | OVS_VSWITCHD_START |
f9cbfbe4 | 2502 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [], |
aa233d57 | 2503 | [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10) |
f9cbfbe4 | 2504 | ]) |
023e1e0a | 2505 | OVS_VSWITCHD_STOP |
f9cbfbe4 | 2506 | AT_CLEANUP |
01b389b1 BP |
2507 | |
2508 | dnl Check that add-flow reports non-normalized flows (feature #5029). | |
2509 | AT_SETUP([ovs-ofctl add-flow reports non-normalized flows]) | |
023e1e0a | 2510 | OVS_VSWITCHD_START |
01b389b1 BP |
2511 | AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5], |
2512 | [0], [], [dnl | |
2513 | ofp_util|INFO|normalization changed ofp_match, details: | |
2514 | ofp_util|INFO| pre: nw_src=1.2.3.4 | |
2515 | ofp_util|INFO|post: @&t@ | |
2516 | ]) | |
023e1e0a | 2517 | OVS_VSWITCHD_STOP |
01b389b1 | 2518 | AT_CLEANUP |
410698cf | 2519 | |
bdcc5925 BP |
2520 | dnl Check that --sort and --rsort works with dump-flows |
2521 | dnl Default field is 'priority'. Flow entries are displayed based | |
2522 | dnl on field to sort. | |
2523 | AT_SETUP([ovs-ofctl dump-flows with sorting]) | |
2524 | OVS_VSWITCHD_START | |
2525 | AT_KEYWORDS([sort]) | |
2526 | AT_DATA([allflows.txt], [[ | |
2527 | priority=4,in_port=23213 actions=output:42 | |
2528 | priority=5,in_port=1029 actions=output:43 | |
2529 | priority=7,in_port=1029 actions=output:43 | |
2530 | priority=3,in_port=1028 actions=output:44 | |
2531 | priority=1,in_port=1026 actions=output:45 | |
2532 | priority=6,in_port=1027 actions=output:64 | |
2533 | priority=2,in_port=1025 actions=output:47 | |
2534 | priority=8,tcp,tp_src=5 actions=drop | |
2535 | priority=9,tcp,tp_src=6 actions=drop | |
2536 | ]]) | |
2537 | ||
2538 | AT_CHECK([ovs-ofctl add-flows br0 allflows.txt | |
2539 | ], [0], [ignore]) | |
2540 | AT_CHECK([ovs-ofctl --sort dump-flows br0 | ofctl_strip], [0], [dnl | |
2541 | priority=1,in_port=1026 actions=output:45 | |
2542 | priority=2,in_port=1025 actions=output:47 | |
2543 | priority=3,in_port=1028 actions=output:44 | |
2544 | priority=4,in_port=23213 actions=output:42 | |
2545 | priority=5,in_port=1029 actions=output:43 | |
2546 | priority=6,in_port=1027 actions=output:64 | |
2547 | priority=7,in_port=1029 actions=output:43 | |
2548 | priority=8,tcp,tp_src=5 actions=drop | |
2549 | priority=9,tcp,tp_src=6 actions=drop | |
2550 | ]) | |
2551 | AT_CHECK([ovs-ofctl --rsort dump-flows br0 | ofctl_strip], [0], [dnl | |
2552 | priority=9,tcp,tp_src=6 actions=drop | |
2553 | priority=8,tcp,tp_src=5 actions=drop | |
2554 | priority=7,in_port=1029 actions=output:43 | |
2555 | priority=6,in_port=1027 actions=output:64 | |
2556 | priority=5,in_port=1029 actions=output:43 | |
2557 | priority=4,in_port=23213 actions=output:42 | |
2558 | priority=3,in_port=1028 actions=output:44 | |
2559 | priority=2,in_port=1025 actions=output:47 | |
2560 | priority=1,in_port=1026 actions=output:45 | |
2561 | ]) | |
2562 | AT_CHECK([ovs-ofctl --sort=in_port dump-flows br0 | ofctl_strip], [0], [dnl | |
2563 | priority=2,in_port=1025 actions=output:47 | |
2564 | priority=1,in_port=1026 actions=output:45 | |
2565 | priority=6,in_port=1027 actions=output:64 | |
2566 | priority=3,in_port=1028 actions=output:44 | |
2567 | priority=7,in_port=1029 actions=output:43 | |
2568 | priority=5,in_port=1029 actions=output:43 | |
2569 | priority=4,in_port=23213 actions=output:42 | |
2570 | priority=9,tcp,tp_src=6 actions=drop | |
2571 | priority=8,tcp,tp_src=5 actions=drop | |
2572 | ]) | |
2573 | AT_CHECK([ovs-ofctl --rsort=in_port dump-flows br0 | ofctl_strip], [0], [dnl | |
2574 | priority=4,in_port=23213 actions=output:42 | |
2575 | priority=7,in_port=1029 actions=output:43 | |
2576 | priority=5,in_port=1029 actions=output:43 | |
2577 | priority=3,in_port=1028 actions=output:44 | |
2578 | priority=6,in_port=1027 actions=output:64 | |
2579 | priority=1,in_port=1026 actions=output:45 | |
2580 | priority=2,in_port=1025 actions=output:47 | |
2581 | priority=9,tcp,tp_src=6 actions=drop | |
2582 | priority=8,tcp,tp_src=5 actions=drop | |
2583 | ]) | |
2584 | AT_CHECK([ovs-ofctl --sort=tcp_src dump-flows br0 | ofctl_strip], [0], [dnl | |
2585 | priority=8,tcp,tp_src=5 actions=drop | |
2586 | priority=9,tcp,tp_src=6 actions=drop | |
2587 | priority=7,in_port=1029 actions=output:43 | |
2588 | priority=6,in_port=1027 actions=output:64 | |
2589 | priority=5,in_port=1029 actions=output:43 | |
2590 | priority=4,in_port=23213 actions=output:42 | |
2591 | priority=3,in_port=1028 actions=output:44 | |
2592 | priority=2,in_port=1025 actions=output:47 | |
2593 | priority=1,in_port=1026 actions=output:45 | |
2594 | ]) | |
2595 | AT_CHECK( | |
2596 | [ovs-ofctl --sort=in_port --sort=tcp_src dump-flows br0 | ofctl_strip], [0], | |
2597 | [ priority=2,in_port=1025 actions=output:47 | |
2598 | priority=1,in_port=1026 actions=output:45 | |
2599 | priority=6,in_port=1027 actions=output:64 | |
2600 | priority=3,in_port=1028 actions=output:44 | |
2601 | priority=7,in_port=1029 actions=output:43 | |
2602 | priority=5,in_port=1029 actions=output:43 | |
2603 | priority=4,in_port=23213 actions=output:42 | |
2604 | priority=8,tcp,tp_src=5 actions=drop | |
2605 | priority=9,tcp,tp_src=6 actions=drop | |
2606 | ]) | |
2607 | OVS_VSWITCHD_STOP | |
2608 | AT_CLEANUP | |
296ed880 BP |
2609 | |
2610 | AT_SETUP([ovs-ofctl diff-flows]) | |
2611 | OVS_VSWITCHD_START | |
2612 | ||
296ed880 BP |
2613 | # Add tons of flows to br0. |
2614 | for i in `seq 0 1023`; do echo "dl_vlan=$i,actions=drop"; done > add-flows.txt | |
2615 | AT_CHECK([ovs-ofctl add-flows br0 add-flows.txt]) | |
2616 | ||
2617 | # Dump them and compare against what we expect by hand, then with diff-flows. | |
2618 | for i in `seq 0 1023`; do echo " dl_vlan=$i actions=drop"; done | sort > expout | |
2619 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/NXST_FLOW/d' | sort], | |
2620 | [0], [expout]) | |
2621 | AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt]) | |
2622 | ||
2623 | # Remove even-numbered flows, compare again. | |
2624 | for i in `seq 0 1023 2`; do echo "dl_vlan=$i"; done > del-flows.txt | |
2625 | AT_CHECK([ovs-ofctl del-flows br0 - < del-flows.txt]) | |
2626 | for i in `seq 0 1023 2`; do echo "+dl_vlan=$i actions=drop"; done | sort > expout | |
2627 | AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt | sort], [0], [expout]) | |
2628 | for i in `seq 0 1023 2`; do echo "-dl_vlan=$i actions=drop"; done | sort > expout | |
2629 | AT_CHECK([ovs-ofctl diff-flows add-flows.txt br0 | sort], [0], [expout]) | |
2630 | ||
2631 | OVS_VSWITCHD_STOP | |
2632 | AT_CLEANUP | |
98f7f427 BP |
2633 | |
2634 | dnl ofpacts that differ bytewise don't necessarily differ when | |
2635 | dnl converted to another representation, such as OpenFlow 1.0 | |
2636 | dnl or to a string. "resubmit(,1)" is an example of an action | |
2637 | dnl of this type: "ofpact_resubmit"s can differ in their "compat" | |
2638 | dnl values even though this doesn't affect the string format. | |
2639 | dnl | |
2640 | dnl This test checks that "ovs-ofctl diff-flows" doesn't report | |
2641 | dnl false ofpacts differences. | |
2642 | AT_SETUP([ovs-ofctl diff-flows - suppress false differences]) | |
2643 | OVS_VSWITCHD_START | |
2644 | AT_DATA([flows.txt], [actions=resubmit(,1) | |
2645 | ]) | |
2646 | AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) | |
2647 | AT_CHECK([ovs-ofctl diff-flows br0 flows.txt]) | |
2648 | AT_CHECK([ovs-ofctl add-flow br0 idle_timeout=60,dl_vlan=9,actions=output:1]) | |
2649 | AT_CHECK([ovs-ofctl diff-flows br0 flows.txt], [2], [dnl | |
2650 | -dl_vlan=9 idle_timeout=60 actions=output:1 | |
2651 | ]) | |
2652 | AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=120,cookie=1234,dl_vlan=9,actions=output:1]) | |
2653 | AT_CHECK([ovs-ofctl diff-flows flows.txt br0], [2], [dnl | |
2654 | +dl_vlan=9 cookie=0x4d2 hard_timeout=120 actions=output:1 | |
2655 | ]) | |
2656 | OVS_VSWITCHD_STOP | |
2657 | AT_CLEANUP | |
37923ac7 BP |
2658 | |
2659 | AT_SETUP([ovs-ofctl -F and -O interaction]) | |
2660 | AT_CHECK([ovs-ofctl -F oxm -O openflow10], [1], [], | |
2661 | [ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow10) supports any of the enabled flow formats (OXM). (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.) | |
2662 | ]) | |
2663 | AT_CHECK([ovs-ofctl -F oxm -O openflow11], [1], [], | |
2664 | [ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow11) supports any of the enabled flow formats (OXM). (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.) | |
2665 | ]) | |
2666 | AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow11], [1], [], | |
2667 | [ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow10, OpenFlow11) supports any of the enabled flow formats (OXM). (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.) | |
2668 | ]) | |
2669 | AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow12], [1], [], | |
2670 | [ovs-ofctl: missing command name; use --help for help | |
2671 | ]) | |
2672 | AT_CHECK([ovs-ofctl -F oxm -O openflow12], [1], [], | |
2673 | [ovs-ofctl: missing command name; use --help for help | |
2674 | ]) | |
2675 | AT_CHECK([ovs-ofctl -F oxm -O openflow13], [1], [], | |
2676 | [ovs-ofctl: missing command name; use --help for help | |
2677 | ]) | |
2678 | AT_CLEANUP | |
1ac0e975 BP |
2679 | |
2680 | AT_SETUP([ovs-ofctl ofp-parse]) | |
2681 | # Test the echo request/reply messages (0 payload). | |
2682 | AT_CHECK([printf '\1\2\0\10\0\0\0\0\1\3\0\10\0\0\0\0' > binary_ofp_msg]) | |
2683 | AT_CHECK([ovs-ofctl ofp-parse binary_ofp_msg], [0], [dnl | |
2684 | OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload | |
2685 | OFPT_ECHO_REPLY (xid=0x0): 0 bytes of payload | |
2686 | ]) | |
2687 | ||
2688 | # Test the hello (xid:1 3-byte payload). | |
2689 | AT_CHECK([printf '\1\0\0\13\0\0\0\1\101\102\103' > binary_ofp_msg]) | |
2690 | AT_CHECK([ovs-ofctl ofp-parse - < binary_ofp_msg], [0], [dnl | |
2691 | OFPT_HELLO (xid=0x1): | |
2692 | version bitmap: 0x01 | |
2693 | unknown data in hello: | |
2694 | 00000000 01 00 00 0b 00 00 00 01-41 42 43 |........ABC | | |
2695 | ]) | |
2696 | AT_CLEANUP | |
dc235f7f JR |
2697 | |
2698 | AT_SETUP([tcp flags - filtering]) | |
2699 | OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ | |
2700 | -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2]) | |
2701 | AT_DATA([flows.txt], [dnl | |
61bf6666 JR |
2702 | in_port=1,tcp,tp_dst=80,tcp_flags=+syn-rst-ack-fin,action=2 # Allow outbound web traffic bare-SYN |
2703 | in_port=1,tcp,tp_dst=80,tcp_flags=+ack,action=2 # Allow outbound web traffic with ACK bit | |
2704 | in_port=1,tcp,tp_dst=80,tcp_flags=+rst,action=2 # Allow outbound web traffic with RST bit | |
2705 | in_port=2,tcp,tp_src=80,tcp_flags=+ack,action=1 # Allow inbound web traffic with ACK bit | |
2706 | in_port=2,tcp,tp_src=80,tcp_flags=+rst,action=1 # Allow inbound web traffic with RST bit | |
dc235f7f JR |
2707 | priority=0,in_port=1,action=drop # Default drop outbound |
2708 | priority=0,in_port=2,action=drop # Default drop inbound | |
2709 | ]) | |
2710 | ||
2711 | AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) | |
2712 | ||
61bf6666 JR |
2713 | AT_CHECK([ovs-ofctl add-flow br0 "tcp,tcp_flags=+ack-ack,action="], [1], [], |
2714 | [ovs-ofctl: ack: Each TCP flag can be specified only once | |
2715 | ]) | |
2716 | ||
e79a6c83 | 2717 | AT_CHECK([ovs-appctl dpif/show | tail -n +4], [0], [dnl |
dc235f7f JR |
2718 | p1 1/1: (dummy) |
2719 | p2 2/2: (dummy) | |
2720 | ]) | |
2721 | ||
61bf6666 | 2722 | dnl Outbound web traffic with bare-SYN |
dc235f7f JR |
2723 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x002)'], [0], [stdout]) |
2724 | AT_CHECK([tail -1 stdout], [0], | |
2725 | [Datapath actions: 2 | |
2726 | ]) | |
2727 | ||
2728 | dnl Outbopund web traffic with ACK bit | |
2729 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x110)'], [0], [stdout]) | |
2730 | AT_CHECK([tail -1 stdout], [0], | |
2731 | [Datapath actions: 2 | |
2732 | ]) | |
2733 | ||
2734 | dnl Outbound web traffic with RST bit | |
2735 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x104)'], [0], [stdout]) | |
2736 | AT_CHECK([tail -1 stdout], [0], | |
2737 | [Datapath actions: 2 | |
2738 | ]) | |
2739 | ||
2740 | dnl Inbound web traffic with ACK bit | |
2741 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0x010)'], [0], [stdout]) | |
2742 | AT_CHECK([tail -1 stdout], [0], | |
2743 | [Datapath actions: 1 | |
2744 | ]) | |
2745 | ||
2746 | dnl Inbound web traffic with RST bit | |
2747 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0x014)'], [0], [stdout]) | |
2748 | AT_CHECK([tail -1 stdout], [0], | |
2749 | [Datapath actions: 1 | |
2750 | ]) | |
2751 | ||
2752 | dnl Inbound web traffic with SYN bit without ACK or RST bits | |
2753 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0xfeb)'], [0], [stdout]) | |
2754 | AT_CHECK([tail -1 stdout], [0], | |
2755 | [Datapath actions: drop | |
2756 | ]) | |
2757 | ||
2758 | OVS_VSWITCHD_STOP | |
2759 | AT_CLEANUP | |
ca26eb44 RB |
2760 | |
2761 | dnl Check importance parameter added in OF1.4. | |
2762 | dnl It validates whether importance set via add-flow via OpenFlow1.4+ gets | |
2763 | dnl set or not by validating it againt the dump-flows output via OpenFlow1.4+ | |
2764 | dnl If add-flow or dump-flows is used with later version of OpenFlow prior to 1.4+ | |
2765 | dnl then the importance will be considered zero whether provided as an argument. | |
2766 | ||
2767 | AT_SETUP([ovs-ofctl rule with importance]) | |
2768 | OVS_VSWITCHD_START | |
2769 | dnl Flow with importance parameter added via OF1.4+ and later version | |
2770 | AT_CHECK([ovs-ofctl -O OpenFlow14 add-flow br0 priority=21,importance=21,actions=normal]) | |
2771 | AT_CHECK([ovs-ofctl add-flow br0 priority=22,importance=22,actions=normal]) | |
2772 | ||
2773 | dnl Importance parameter will only be visible of flows that are added via OF1.4+ if dumped via OF1.4+ | |
a56dd713 | 2774 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl |
ca26eb44 | 2775 | importance=21, priority=21 actions=NORMAL |
a56dd713 | 2776 | priority=22 actions=NORMAL |
ca26eb44 RB |
2777 | ]) |
2778 | ||
2779 | dnl Importance parameter will not be visible if flow is dumped with previous version prior to OF1.4+ whether added via OF1.4+ | |
a56dd713 | 2780 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl |
ca26eb44 | 2781 | priority=21 actions=NORMAL |
a56dd713 | 2782 | priority=22 actions=NORMAL |
ca26eb44 RB |
2783 | ]) |
2784 | ||
2785 | OVS_VSWITCHD_STOP | |
2786 | AT_CLEANUP | |
2787 | ||
2788 | ||
2789 | dnl Importance parameter added in OF1.4. | |
2790 | dnl This validates whether flows with importance | |
2791 | dnl parameter are getting replaced with "replace-flows" or | |
2792 | dnl not by validating dump-flows output after replace with the expected output. | |
2793 | ||
2794 | AT_SETUP([ovs-ofctl replace-flows with importance]) | |
2795 | OVS_VSWITCHD_START | |
2796 | ||
2797 | dnl Add flows to br0 with importance via OF1.4+. For more details refer "ovs-ofctl rule with importance" test case. | |
c453c5af | 2798 | for i in 1 2 3 4 5 6 7 8; do echo "dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt |
ca26eb44 RB |
2799 | AT_CHECK([ovs-ofctl -O OpenFlow14 add-flows br0 add-flows.txt]) |
2800 | ||
2801 | dnl Replace some flows in the bridge. | |
c453c5af | 2802 | for i in 1 3 5 7; do echo "dl_vlan=$i,importance=`expr $i + 10`,actions=drop"; done > replace-flows.txt |
ca26eb44 RB |
2803 | AT_CHECK([ovs-ofctl -O OpenFlow14 replace-flows br0 replace-flows.txt]) |
2804 | ||
2805 | dnl Dump them and compare the dump flows output against the expected output. | |
c453c5af | 2806 | for i in 1 2 3 4 5 6 7 8; do if [[ `expr $i % 2` -eq 1 ]]; then importance=`expr $i + 10`; else importance=$i; fi; echo " importance=$importance, dl_vlan=$i actions=drop"; done | sort > expout |
ca26eb44 RB |
2807 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort], |
2808 | [0], [expout]) | |
2809 | ||
2810 | OVS_VSWITCHD_STOP | |
2811 | AT_CLEANUP |