3 AT_SETUP([ovs-ofctl parse-flows choice of protocol])
4 # This doesn't cover some potential vlan_tci test cases.
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' \
12 'tun_flags=1 NXM,OXM' \
13 'tun_flags=+oam NXM,OXM' \
16 'tun_gbp_id=0 NXM,OXM' \
17 'tun_gbp_id=0/0x1 NXM,OXM' \
18 'tun_gbp_flags=0 NXM,OXM' \
19 'tun_gbp_flags=0/0x1 NXM,OXM' \
20 'tun_metadata0=0 NXM,OXM' \
21 'tun_metadata0=0/0x1 NXM,OXM' \
22 'tun_metadata0 NXM,OXM' \
23 'metadata=0 NXM,OXM,OpenFlow11' \
24 'metadata=1/1 NXM,OXM,OpenFlow11' \
26 'skb_priority=0 none' \
27 'pkt_mark=1 NXM,OXM' \
28 'pkt_mark=1/1 NXM,OXM' \
49 'reg10=10/1 NXM,OXM' \
51 'reg11=11/1 NXM,OXM' \
53 'reg12=12/1 NXM,OXM' \
55 'reg13=13/1 NXM,OXM' \
57 'reg14=14/1 NXM,OXM' \
75 'xxreg0=0/1 NXM,OXM' \
77 'xxreg1=1/1 NXM,OXM' \
79 'xxreg2=2/1 NXM,OXM' \
81 'xxreg3=3/1 NXM,OXM' \
82 'xxreg3[[0..0]]=1 NXM,OXM' \
83 'xxreg3[[126..127]]=3 NXM,OXM' \
84 'reg3[[]]=3 NXM,OXM' \
85 'dl_src=00:11:22:33:44:55 any' \
86 'dl_src=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \
87 'dl_dst=00:11:22:33:44:55 any' \
88 'dl_dst=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \
89 'dl_type=0x1234 any' \
90 'dl_type=0x0800 any' \
91 'dl_type=0x0806 any' \
92 'dl_type=0x86dd any' \
94 'vlan_tci=0x1009 any' \
95 'vlan_tci=0x1009/0x1 NXM,OXM' \
98 'vlan_vid=11/0x1 NXM,OXM' \
101 'mpls,mpls_label=5 NXM,OXM,OpenFlow11' \
102 'mpls,mpls_tc=1 NXM,OXM,OpenFlow11' \
103 'mpls,mpls_bos=0 NXM,OXM' \
104 'ip,ip_src=1.2.3.4 any' \
105 'ip,ip_src=192.168.0.0/24 any' \
106 'ip,ip_src=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \
107 'ip,ip_dst=1.2.3.4 any' \
108 'ip,ip_dst=192.168.0.0/24 any' \
109 'ip,ip_dst=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \
110 'ipv6,ipv6_src=::1 NXM,OXM' \
111 'ipv6,ipv6_src=0:0:0:0:0:0:0:1/::1 NXM,OXM' \
112 'ipv6,ipv6_dst=::1 NXM,OXM' \
113 'ipv6,ipv6_dst=0:0:0:0:0:0:0:1/::1 NXM,OXM' \
114 'ipv6,ipv6_label=5 NXM,OXM' \
115 'ipv6,ipv6_label=5/1 NXM,OXM' \
116 'ip,nw_proto=1 any' \
117 'ipv6,nw_proto=1 NXM,OXM' \
118 'ip,nw_tos=0xf0 any' \
119 'ipv6,nw_tos=0xf0 NXM,OXM' \
120 'ip,ip_dscp=0x3c any' \
121 'ipv6,ip_dscp=0x3c NXM,OXM' \
122 'ip,nw_ecn=1 NXM,OXM' \
123 'ipv6,nw_ecn=1 NXM,OXM' \
124 'ip,nw_ttl=5 NXM,OXM' \
125 'ipv6,nw_ttl=5 NXM,OXM' \
126 'ip,ip_frag=no NXM,OXM' \
127 'ipv6,ip_frag=no NXM,OXM' \
129 'arp,arp_spa=1.2.3.4 any' \
130 'arp,arp_spa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \
131 'arp,arp_tpa=1.2.3.4 any' \
132 'arp,arp_tpa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \
133 'arp,arp_sha=00:11:22:33:44:55 NXM,OXM' \
134 'arp,arp_sha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \
135 'arp,arp_tha=00:11:22:33:44:55 NXM,OXM' \
136 'arp,arp_tha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \
137 'tcp,tcp_src=80 any' \
138 'tcp,tcp_src=0x1000/0x1000 NXM,OXM' \
139 'tcp6,tcp_src=80 NXM,OXM' \
140 'tcp6,tcp_src=0x1000/0x1000 NXM,OXM' \
141 'tcp,tcp_dst=80 any' \
142 'tcp,tcp_dst=0x1000/0x1000 NXM,OXM' \
143 'tcp6,tcp_dst=80 NXM,OXM' \
144 'tcp6,tcp_dst=0x1000/0x1000 NXM,OXM' \
145 'udp,udp_src=80 any' \
146 'udp,udp_src=0x1000/0x1000 NXM,OXM' \
147 'udp6,udp_src=80 NXM,OXM' \
148 'udp6,udp_src=0x1000/0x1000 NXM,OXM' \
149 'udp,udp_dst=80 any' \
150 'udp,udp_dst=0x1000/0x1000 NXM,OXM' \
151 'udp6,udp_dst=80 NXM,OXM' \
152 'udp6,udp_dst=0x1000/0x1000 NXM,OXM' \
153 'udp6,udp_dst[[12]]=1 NXM,OXM' \
154 'icmp,icmp_type=1 any' \
155 'icmp,icmp_code=2 any' \
156 'icmp6,icmpv6_type=1 NXM,OXM' \
157 'icmp6,icmpv6_code=2 NXM,OXM' \
158 'ct_state=+trk NXM,OXM' \
159 'ct_zone=0 NXM,OXM' \
160 'ct_mark=0 NXM,OXM' \
161 'ct_label=0 NXM,OXM' \
162 'ct_label=0x1234567890ABCDEF12345678 NXM,OXM'
166 echo "### test case: '$1' should have usable protocols '$2'"
167 if test "$2" = none; then
168 AT_CHECK([ovs-ofctl parse-flow "$1,actions=drop"], [1],
171 [ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
174 AT_CHECK_UNQUOTED([ovs-ofctl parse-flow "$1,actions=drop" | sed 1q], [0],
175 [usable protocols: $2
181 AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.0)])
182 AT_DATA([flows.txt], [[
184 tcp,tp_src=123,actions=flood
185 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
186 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
187 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
188 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
189 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
190 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
191 ip,actions=set_field:10.4.3.77->ip_src,mod_nw_ecn:2
194 in_port=0 actions=resubmit:0
195 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
196 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,ingress)
197 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
198 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789,egress)
200 ip,actions=ct(commit,nat(dst))
201 ip,actions=ct(commit,nat(src))
202 ip,actions=ct(commit,nat(src=10.0.0.240,random))
203 ip,actions=ct(commit,nat(src=10.0.0.240:32768-65535,random))
204 ip,actions=ct(commit,nat(dst=10.0.0.128-10.0.0.254,hash))
205 ip,actions=ct(commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent))
206 ipv6,actions=ct(commit,nat(src=fe80::20c:29ff:fe88:a18b,random))
207 ipv6,actions=ct(commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random))
208 ipv6,actions=ct(commit,nat(src=[fe80::20c:29ff:fe88:1]-[fe80::20c:29ff:fe88:a18b]:255-4096,random))
209 tcp,actions=ct(commit,nat(src=10.1.1.240-10.1.1.255),alg=ftp)
212 AT_CHECK([ovs-ofctl parse-flows flows.txt
214 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
215 [[usable protocols: any
216 chosen protocol: OpenFlow10-table_id
217 OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
218 OFPT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
219 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
220 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
221 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
222 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
223 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
224 OFPT_FLOW_MOD: ADD ip actions=mod_nw_src:10.4.3.77,load:0x2->NXM_NX_IP_ECN[]
225 OFPT_FLOW_MOD: ADD sctp actions=drop
226 OFPT_FLOW_MOD: ADD sctp actions=drop
227 OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0
228 OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
229 OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,ingress)
230 OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
231 OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789,egress)
232 OFPT_FLOW_MOD: ADD ip actions=ct(nat)
233 OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(dst))
234 OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(src))
235 OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(src=10.0.0.240,random))
236 OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(src=10.0.0.240:32768-65535,random))
237 OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(dst=10.0.0.128-10.0.0.254,hash))
238 OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent))
239 OFPT_FLOW_MOD: ADD ipv6 actions=ct(commit,nat(src=fe80::20c:29ff:fe88:a18b,random))
240 OFPT_FLOW_MOD: ADD ipv6 actions=ct(commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random))
241 OFPT_FLOW_MOD: ADD ipv6 actions=ct(commit,nat(src=[fe80::20c:29ff:fe88:1]-[fe80::20c:29ff:fe88:a18b]:255-4096,random))
242 OFPT_FLOW_MOD: ADD tcp actions=ct(commit,nat(src=10.1.1.240-10.1.1.255),alg=ftp)
246 AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.1)])
247 AT_DATA([flows.txt], [[
249 tcp,tp_src=123,actions=flood
250 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
251 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
252 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
253 udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1
254 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
255 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
256 ip,actions=mod_nw_ttl:1,set_field:10.4.3.77->ip_src
259 in_port=0 actions=resubmit:0
260 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
261 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
264 AT_CHECK([ovs-ofctl --protocols OpenFlow11 parse-flows flows.txt
266 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
267 [[usable protocols: any
268 chosen protocol: OpenFlow11
269 OFPT_FLOW_MOD (OF1.1): ADD tcp,tp_src=123 actions=FLOOD
270 OFPT_FLOW_MOD (OF1.1): ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
271 OFPT_FLOW_MOD (OF1.1): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0
272 OFPT_FLOW_MOD (OF1.1): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
273 OFPT_FLOW_MOD (OF1.1): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1
274 OFPT_FLOW_MOD (OF1.1): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
275 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
276 OFPT_FLOW_MOD (OF1.1): ADD ip actions=mod_nw_ttl:1,mod_nw_src:10.4.3.77
277 OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop
278 OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop
279 OFPT_FLOW_MOD (OF1.1): ADD in_port=0 actions=resubmit:0
280 OFPT_FLOW_MOD (OF1.1): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
281 OFPT_FLOW_MOD (OF1.1): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
285 AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.2)])
286 AT_DATA([flows.txt], [[
288 tcp,tp_src=123,actions=flood
289 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=mod_vlan_vid:7,mod_vlan_pcp:2
290 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
291 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
292 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
293 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
294 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
295 ipv6,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
296 sctp actions=set_field:3334->sctp_src
297 sctp actions=set_field:4445->sctp_dst
298 tcp actions=mod_tp_dst:1234
299 udp actions=mod_tp_src:1111
300 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
301 in_port=0 actions=mod_dl_src:11:22:33:44:55:66,mod_dl_dst:10:20:30:40:50:60
302 in_port=0 actions=resubmit:0
303 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
304 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
307 AT_CHECK([ovs-ofctl --protocols OpenFlow12 parse-flows flows.txt
309 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
310 [[usable protocols: NXM,OXM
311 chosen protocol: OXM-OpenFlow12
312 OFPT_FLOW_MOD (OF1.2): ADD tcp,tp_src=123 actions=FLOOD
313 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
314 OFPT_FLOW_MOD (OF1.2): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0
315 OFPT_FLOW_MOD (OF1.2): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
316 OFPT_FLOW_MOD (OF1.2): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
317 OFPT_FLOW_MOD (OF1.2): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
318 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
319 OFPT_FLOW_MOD (OF1.2): ADD ipv6 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
320 OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:3334->sctp_src
321 OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:4445->sctp_dst
322 OFPT_FLOW_MOD (OF1.2): ADD tcp actions=set_field:1234->tcp_dst
323 OFPT_FLOW_MOD (OF1.2): ADD udp actions=set_field:1111->udp_src
324 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
325 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
326 OFPT_FLOW_MOD (OF1.2): ADD in_port=0 actions=resubmit:0
327 OFPT_FLOW_MOD (OF1.2): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
328 OFPT_FLOW_MOD (OF1.2): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
332 AT_SETUP([ovs-ofctl parse-flow with invalid mask])
337 'eth_type 0x1234/0x1' \
339 'dl_vlan_pcp 6/0x1' \
341 'mpls mpls_label 5/0x1' \
342 'mpls mpls_tc 1/0x1' \
343 'mpls mpls_bos 1/0x1' \
345 'ipv6 nw_proto 1/1' \
346 'ip nw_tos 0xf0/0xf0' \
347 'ipv6 nw_tos 0xf0/0xf0' \
348 'ip ip_dscp 0x3c/0xf0' \
349 'ipv6 ip_dscp 0x3c/0xf0' \
355 'icmp icmp_type 1/1' \
356 'icmp icmp_code 2/1' \
357 'icmp6 icmpv6_code 2/1'
361 prereq=$1, field=$2 value=$3
363 prereq= field=$1 value=$2
365 AT_CHECK_UNQUOTED([ovs-ofctl parse-flow "$prereq$field=$value,actions=drop"], [1], [],
366 [ovs-ofctl: $value: invalid mask for field $field
371 AT_SETUP([ovs-ofctl action inconsistency (OpenFlow 1.1)])
372 AT_CHECK([ovs-ofctl --protocols OpenFlow11 add-flow br0 'ip actions=mod_tp_dst:1234'
373 ], [1], [stdout], [ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM) is among the allowed flow formats (OpenFlow11)
377 AT_SETUP([ovs-ofctl parse-flows (skb_priority)])
378 AT_DATA([flows.txt], [[
379 skb_priority=0x12341234,tcp,tp_src=123,actions=flood
382 AT_CHECK([ovs-ofctl parse-flows flows.txt
389 AT_SETUP([ovs-ofctl parse-flows (NXM)])
390 AT_DATA([flows.txt], [[
392 tcp,tp_src=123,actions=flood
393 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
394 pkt_mark=0xbb,actions=set_field:0xaa->pkt_mark
395 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
396 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
397 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
398 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
399 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
400 tcp,tp_src=0x1230/0xfff0,tun_id=0x1234,cookie=0x5678,actions=flood
401 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789
402 actions=multipath(eth_src, 50, hrw, 12, 0, NXM_NX_REG0[0..3]),multipath(symmetric_l4, 1024, iter_hash, 5000, 5050, reg0[0..12])
404 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
405 metadata=0x1234ffff5678ffff/0xffff0000ffff0000,actions=drop
406 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
407 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
408 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
409 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
410 actions=bundle_load(eth_src,50,active_backup,ofport,reg0,slaves:1)
411 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
412 actions=bundle_load(symmetric_l4,60,hrw,ofport,reg0[0..15],slaves:[2,3])
413 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
414 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2
415 actions=resubmit:1,resubmit(2),resubmit(,3),resubmit(2,3)
416 send_flow_rem,actions=output:1,output:NXM_NX_REG0,output:2,output:reg1[16..31],output:3
417 check_overlap,actions=output:1,exit,output:2
418 tcp,actions=fin_timeout(idle_timeout=5,hard_timeout=15)
419 actions=controller(max_len=123,reason=invalid_ttl,id=555)
420 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
421 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
422 ip,actions=ct(commit,zone=5)
423 ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[])))
424 ip,actions=ct(commit,exec(load(0x1->NXM_NX_CT_LABEL[])))
425 ip,actions=ct(commit,exec(load(0x1234567890ABCDEF->NXM_NX_CT_LABEL[32..95])))
426 ip,actions=ct(commit,exec(load(1->ct_mark)))
427 ip,actions=ct(commit,exec(load(0x1->ct_label[])))
428 ip,actions=ct(commit,exec(load(0x1234567890ABCDEF->ct_label[32..95])))
429 ip,actions=ct(commit,exec(set_field(0x1->ct_label)))
430 ip,ct_state=+trk,ct_label=0x1234567890abcdef12345678,actions=ct(commit)
431 actions=output(max_len=100,port=123)
432 actions=output(port=100,max_len=123)
433 actions=output(port=LOCAL,max_len=123)
434 actions=output(port=IN_PORT,max_len=123)
437 AT_CHECK([ovs-ofctl parse-flows flows.txt
439 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
440 [[usable protocols: OXM,NXM+table_id
441 chosen protocol: NXM+table_id
442 NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD
443 NXT_FLOW_MOD: ADD table:255 in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
444 NXT_FLOW_MOD: ADD table:255 pkt_mark=0xbb actions=load:0xaa->NXM_NX_PKT_MARK[]
445 NXT_FLOW_MOD: ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
446 NXT_FLOW_MOD: ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
447 NXT_FLOW_MOD: ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
448 NXT_FLOW_MOD: ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
449 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
450 NXT_FLOW_MOD: ADD table:255 tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD
451 NXT_FLOW_MOD: ADD table:255 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789
452 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])
453 NXT_FLOW_MOD: ADD table:1 actions=drop
454 NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
455 NXT_FLOW_MOD: ADD table:255 metadata=0x1234000056780000/0xffff0000ffff0000 actions=drop
456 NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
457 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
458 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
459 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
460 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
461 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
462 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
463 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
464 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
465 NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3)
466 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
467 NXT_FLOW_MOD: ADD table:255 check_overlap actions=output:1,exit,output:2
468 NXT_FLOW_MOD: ADD table:255 tcp actions=fin_timeout(idle_timeout=5,hard_timeout=15)
469 NXT_FLOW_MOD: ADD table:255 actions=controller(reason=invalid_ttl,max_len=123,id=555)
470 NXT_FLOW_MOD: ADD table:255 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
471 NXT_FLOW_MOD: ADD table:255 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
472 NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,zone=5)
473 NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[]))
474 NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127]))
475 NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1234567890abcdef->NXM_NX_CT_LABEL[32..95]))
476 NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[]))
477 NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127]))
478 NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1234567890abcdef->NXM_NX_CT_LABEL[32..95]))
479 NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127]))
480 NXT_FLOW_MOD: ADD table:255 ct_state=+trk,ct_label=0x1234567890abcdef12345678,ip actions=ct(commit)
481 NXT_FLOW_MOD: ADD table:255 actions=output(port=123,max_len=100)
482 NXT_FLOW_MOD: ADD table:255 actions=output(port=100,max_len=123)
483 NXT_FLOW_MOD: ADD table:255 actions=output(port=65534,max_len=123)
484 NXT_FLOW_MOD: ADD table:255 actions=output(port=65528,max_len=123)
488 AT_SETUP([ovs-ofctl -F nxm parse-flows])
489 AT_DATA([flows.txt], [
491 tcp,tp_src=123,actions=flood
492 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
493 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
494 ipv6,ipv6_label=0x12345 actions=2
495 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
496 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
497 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
498 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
499 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
500 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
501 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
502 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
503 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
504 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
505 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4F:0571/112 actions=drop
506 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
507 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
508 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE00:0000/96,nd_tll=00:0A:E4:25:6B:B1 actions=drop
509 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
510 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
511 tun_id=0x1234,cookie=0x5678,actions=flood
513 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
514 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop
515 dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop
516 dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop
517 dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop
518 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
519 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
520 ip,actions=ct(commit,zone=5)
521 ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[[]])))
522 ip,actions=ct(commit,exec(load(0x1->NXM_NX_CT_LABEL[[]])))
524 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
526 # The substitution for fec0:0: is because some libcs (e.g. MUSL)
527 # abbreviate a single zero and others (e.g. glibc) don't.
528 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//
529 s/fec0:0:/fec0::/g' stdout]], [0], [dnl
530 usable protocols: NXM,OXM
531 chosen protocol: NXM-table_id
532 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
533 NXT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
534 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
535 NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2
536 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
537 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4
538 NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5
539 NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
540 NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
541 NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
542 NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
543 NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
544 NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
545 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0::1234:f045:8fff:1111:fe4e:571 actions=drop
546 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0::1234:f045:8fff:1111:fe4f:0/112 actions=drop
547 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop
548 NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0::1234:f045:8fff:1111:fe4e:571,nd_tll=00:0a:e4:25:6b:b1 actions=drop
549 NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0::1234:f045:8fff:1111::/96,nd_tll=00:0a:e4:25:6b:b1 actions=drop
550 NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
551 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
552 NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
553 NXT_FLOW_MOD: ADD actions=drop
554 NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
555 NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
556 NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop
557 NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop
558 NXT_FLOW_MOD: ADD actions=drop
559 NXT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
560 NXT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
561 NXT_FLOW_MOD: ADD ip actions=ct(commit,zone=5)
562 NXT_FLOW_MOD: ADD ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[[]]))
563 NXT_FLOW_MOD: ADD ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[[0..63]],load:0->NXM_NX_CT_LABEL[[64..127]]))
567 AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows])
568 AT_DATA([flows.txt], [[
570 tcp,tp_src=123,actions=flood
571 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
572 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
573 ipv6,ipv6_label=0x12345 actions=2
574 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
575 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
576 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
577 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
578 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
579 sctp6,ipv6_src=2001:db8:3c4d:1::5,tp_dst=309 actions=drop
580 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
581 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
582 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
583 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
584 sctp,nw_src=192.168.0.3,tp_dst=309 actions=pop_queue,output:1
585 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
586 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
587 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
588 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
589 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
590 tun_id=0x1234,cookie=0x5678,actions=flood
592 reg0=123,actions=move:reg0[0..5]->reg1[26..31],load:55->reg2,move:reg0->tun_id[0..31],move:reg0[0..15]->vlan_tci
593 actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[]
594 actions=push:reg0[0..31],pop:NXM_NX_REG0[]
595 reg0=123,actions=move:reg0[0..5]->reg1[26..31],load:55->reg2,move:reg0->tun_id[0..31],move:reg0[0..15]->vlan_tci
596 actions=move:eth_dst->eth_src[]
597 actions=push:reg0[0..31],pop:reg0
598 vlan_tci=0x1123/0x1fff,actions=drop
599 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
600 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
601 ip,actions=ct(commit,zone=5)
602 ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[])))
603 ip,actions=ct(commit,exec(load(1->NXM_NX_CT_LABEL[])))
604 ip,actions=ct(commit,exec(set_field(1->ct_label)))
606 AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout], [stderr])
607 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
608 [[usable protocols: NXM,OXM
609 chosen protocol: NXM-table_id
610 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
611 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
612 NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop
613 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2
614 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3
615 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4
616 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5
617 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
618 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
619 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
620 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
621 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
622 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
623 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
624 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
625 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
626 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
627 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
628 NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535
629 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
630 NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
631 NXT_FLOW_MOD: ADD <any> actions=drop
632 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[]
633 NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[]
634 NXT_FLOW_MOD: ADD <any> actions=push:NXM_NX_REG0[],pop:NXM_NX_REG0[]
635 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[]
636 NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[]
637 NXT_FLOW_MOD: ADD <any> actions=push:NXM_NX_REG0[],pop:NXM_NX_REG0[]
638 NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
639 NXT_FLOW_MOD: ADD <any> actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
640 NXT_FLOW_MOD: ADD <any> actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
641 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,zone=5)
642 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[]))
643 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127]))
644 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127]))
648 AT_SETUP([ovs-ofctl parse-nx-match])
649 AT_KEYWORDS([nx-match])
650 AT_DATA([nx-match.txt], [dnl
658 NXM_OF_ETH_DST(0002e30f80a4)
659 NXM_OF_ETH_DST_W(010000000000/010000000000)
660 NXM_OF_ETH_DST_W(000000000000/010000000000)
661 NXM_OF_ETH_DST_W(ffffffffffff/010000000000)
662 NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
663 NXM_OF_ETH_DST_W(60175619848f/000000000000)
664 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
665 NXM_OF_ETH_DST_W(60175619848f/5a5a5a5a5a5a)
668 NXM_OF_ETH_SRC(020898456ddb)
669 NXM_OF_ETH_SRC_W(012345abcdef/ffffff555555)
670 NXM_OF_ETH_SRC_W(020898456ddb/ffffffffffff)
671 NXM_OF_ETH_SRC_W(020898456ddb/000000000000)
674 NXM_OF_ETH_TYPE(0800)
675 NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012)
678 NXM_OF_VLAN_TCI(f009)
679 NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009)
680 NXM_OF_VLAN_TCI(0000) # Packets without 802.1Q header.
681 NXM_OF_VLAN_TCI(3123) # Packets with VID=123, PCP=1.
682 NXM_OF_VLAN_TCI(0123) # Does not make sense (but supported anyway)
683 NXM_OF_VLAN_TCI_W(1123/1fff) # Packets with VID=123, any PCP.
684 NXM_OF_VLAN_TCI_W(1123/ffff) # Packets with VID=123, PCP=0
685 NXM_OF_VLAN_TCI_W(1123/0000) # Packets with or without 802.1Q header
686 NXM_OF_VLAN_TCI_W(f000/f000) # Packets with any VID, PCP=7.
687 NXM_OF_VLAN_TCI_W(0000/e000) # No 802.1Q or with VID=0
690 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0)
691 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41)
695 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03)
696 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06)
700 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01)
701 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05)
705 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80)
706 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff)
710 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014)
711 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000)
712 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/5a5a5a5a)
713 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/ffffffff)
714 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014)
715 NXM_OF_IP_SRC_W(C0D80000/FFFF0000)
718 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014)
719 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000)
720 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/5a5a5a5a)
721 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/ffffffff)
722 NXM_OF_IP_DST(ac100014)
723 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000)
726 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231)
727 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0)
728 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/ffff)
729 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231)
731 # TCP destination port
732 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231)
733 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0)
734 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/ffff)
735 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231)
738 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS(0131)
739 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(00F0/0FF0)
740 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(01E2/ffff)
741 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_NX_TCP_FLAGS(0fff)
744 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732)
745 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF)
746 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/ffff)
747 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823)
749 # UDP destination port
750 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782)
751 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F)
752 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/FFFF)
753 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293)
756 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12)
757 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10)
760 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12)
761 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10)
762 NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10)
766 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001)
767 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111)
768 NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001)
770 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001)
772 # ARP source protocol address
773 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014)
774 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
775 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00)
776 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/ffffffff)
777 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
778 NXM_OF_ARP_SPA_W(C0D80000/FFFF0000)
780 # ARP destination protocol address
781 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014)
782 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
783 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/77777777)
784 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/ffffffff)
785 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
786 NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
788 # ARP source hardware address
789 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4)
790 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
791 NXM_NX_ARP_SHA(0002e30f80a4)
793 # ARP destination hardware address
794 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
795 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
796 NXM_NX_ARP_THA(0002e30f80a4)
799 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003)
800 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(1111)
801 NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0003)
803 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003) NXM_OF_ARP_OP(0003)
805 # RARP source protocol address
806 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA(ac100014)
807 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81200/FFFFFF00)
808 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00)
809 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/ffffffff)
810 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
811 NXM_OF_ARP_SPA_W(C0D80000/FFFF0000)
813 # RARP destination protocol address
814 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA(ac100014)
815 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81200/FFFFFF00)
816 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/77777777)
817 NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/ffffffff)
818 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
819 NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
821 # RARP source hardware address
822 NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_SHA(0002e30f80a4)
823 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
824 NXM_NX_ARP_SHA(0002e30f80a4)
826 # RARP destination hardware address
827 NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_THA(0002e30f80a4)
828 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
829 NXM_NX_ARP_THA(0002e30f80a4)
832 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
833 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
834 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
835 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/5a5a5a5a5a5a5a5a0000000000000000)
836 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
837 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000)
838 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffff000000000000)
841 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
842 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
843 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/77777777777777777777777777777777)
844 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
845 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000)
846 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
849 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(1000000f)
850 NXM_NX_IPV6_LABEL(0000000f)
851 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(0000000f)
854 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
855 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
856 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/0123456789abcdeffedcba9876543210)
857 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/ffffffffffffffffffffffffffffffff)
858 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(00000000000000000000000000000000/00000000000000000000000000000000)
859 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/fedcba98765432100123456789abcdef)
861 # ND source hardware address
862 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)
863 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)
864 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)
865 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)
867 # ND destination hardware address
868 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)
869 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)
870 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)
871 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)
874 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00)
875 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01)
876 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02)
877 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03)
878 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03)
879 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd)
880 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02)
881 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01)
882 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02)
883 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03)
884 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/ff)
885 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/00)
886 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3)
889 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00)
890 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01)
891 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02)
892 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03)
893 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03)
894 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01)
895 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02)
896 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01)
897 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02)
898 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03)
899 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/00)
900 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/ff)
901 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3)
904 NXM_NX_COOKIE(00000000abcdef01)
905 NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF)
906 NXM_NX_COOKIE_W(84200000abcdef01/ffffffffffffffff)
907 NXM_NX_COOKIE_W(0000000000000000/0000000000000000)
910 NXM_NX_TUN_ID(00000000abcdef01)
911 NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF)
912 NXM_NX_TUN_ID_W(84200000abcdef01/FFFFFFFFFFFFFFFF)
913 NXM_NX_TUN_ID_W(0000000000000000/0000000000000000)
916 NXM_NX_REG0(acebdf56)
917 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
918 NXM_NX_REG0_W(a0e0d050/ffffffff)
919 NXM_NX_REG0_W(00000000/00000000)
921 # Connection tracking fields,
922 NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE(00000020)
923 NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE(00001080)
924 NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE_W(00000020/00000020)
925 NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE_W(00000020/000000F0)
926 NXM_OF_ETH_TYPE(0800) NXM_NX_CT_ZONE(5a5a)
927 NXM_OF_ETH_TYPE(0800) NXM_NX_CT_MARK(5a5a5a5a)
928 NXM_OF_ETH_TYPE(0800) NXM_NX_CT_MARK_W(5a5a5a5a/fefefefe)
929 NXM_OF_ETH_TYPE(0800) NXM_NX_CT_LABEL(1234567890abcdef1234567890abcdef)
930 NXM_OF_ETH_TYPE(0800) NXM_NX_CT_LABEL_W(10203040506070809000a0b0c0d0e0f0/f1f2f3f4f5f6f7f8f9f0fafbfcfdfeff)
932 # dp_hash (testing experimenter OXM).
933 NXM_NX_DP_HASH(01234567)
934 NXOXM_ET_DP_HASH(01234567)
936 # Invalid field number.
939 # Invalid field numbers (experimenter OXM).
940 ffff020800002320(11112222)
941 ffff030800002320(1111/3333)
943 AT_CHECK([ovs-ofctl -vPATTERN:'console:%c|%p|%m' --strict parse-nx-match < nx-match.txt], [0], [dnl
951 NXM_OF_ETH_DST(0002e30f80a4)
952 NXM_OF_ETH_DST_W(010000000000/010000000000)
953 NXM_OF_ETH_DST_W(000000000000/010000000000)
954 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
955 NXM_OF_ETH_DST(0002e30f80a4)
956 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
957 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
958 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
961 NXM_OF_ETH_SRC(020898456ddb)
962 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
963 NXM_OF_ETH_SRC(020898456ddb)
964 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
967 NXM_OF_ETH_TYPE(0800)
968 NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800)
971 NXM_OF_VLAN_TCI(f009)
972 nx_pull_match() returned error OFPBMC_DUP_FIELD
973 NXM_OF_VLAN_TCI(0000)
974 NXM_OF_VLAN_TCI(3123)
975 NXM_OF_VLAN_TCI(0123)
976 NXM_OF_VLAN_TCI_W(1123/1fff)
977 NXM_OF_VLAN_TCI(1123)
978 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
979 NXM_OF_VLAN_TCI_W(f000/f000)
980 NXM_OF_VLAN_TCI_W(0000/e000)
983 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0)
984 nx_pull_match() returned error OFPBMC_BAD_VALUE
985 nx_pull_match() returned error OFPBMC_BAD_PREREQ
988 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03)
989 nx_pull_match() returned error OFPBMC_BAD_VALUE
990 nx_pull_match() returned error OFPBMC_BAD_PREREQ
993 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01)
994 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05)
995 nx_pull_match() returned error OFPBMC_BAD_PREREQ
998 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80)
999 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff)
1000 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1003 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014)
1004 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000)
1005 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1006 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80000)
1007 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1008 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1011 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014)
1012 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1013 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1014 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(c0a80000)
1015 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1016 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1019 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231)
1020 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0)
1021 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(5050)
1022 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1024 # TCP destination port
1025 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231)
1026 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0)
1027 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(fde0)
1028 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1031 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0131)
1032 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS_W(00f0/0ff0)
1033 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(01e2)
1034 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1037 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732)
1038 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff)
1039 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(0132)
1040 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1042 # UDP destination port
1043 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782)
1044 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f)
1045 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(5005)
1046 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1049 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12)
1050 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1053 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12)
1054 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1055 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1056 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1059 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001)
1060 nx_pull_match() returned error OFPBMC_BAD_VALUE
1061 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1062 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1063 nx_pull_match() returned error OFPBMC_DUP_FIELD
1065 # ARP source protocol address
1066 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014)
1067 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1068 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1069 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(c0a81234)
1070 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1071 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1073 # ARP destination protocol address
1074 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014)
1075 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1076 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1077 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(c0a81234)
1078 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1079 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1081 # ARP source hardware address
1082 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4)
1083 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1084 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1086 # ARP destination hardware address
1087 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
1088 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1089 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1092 NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_OP(0003)
1093 nx_pull_match() returned error OFPBMC_BAD_VALUE
1094 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1095 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1096 nx_pull_match() returned error OFPBMC_DUP_FIELD
1098 # RARP source protocol address
1099 NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(ac100014)
1100 NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
1101 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1102 NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(c0a81234)
1103 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1104 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1106 # RARP destination protocol address
1107 NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(ac100014)
1108 NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
1109 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1110 NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(c0a81234)
1111 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1112 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1114 # RARP source hardware address
1115 NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_SHA(0002e30f80a4)
1116 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1117 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1119 # RARP destination hardware address
1120 NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_THA(0002e30f80a4)
1121 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1122 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1125 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
1126 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1127 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1128 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1129 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000000)
1130 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1131 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1134 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
1135 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1136 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1137 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010000000000000000)
1138 NXM_OF_ETH_TYPE(86dd)
1139 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1142 nx_pull_match() returned error OFPBMC_BAD_VALUE
1143 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1144 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(0000000f)
1147 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
1148 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
1149 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1150 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
1151 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87)
1152 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1154 # ND source hardware address
1155 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)
1156 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1157 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1158 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1160 # ND destination hardware address
1161 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)
1162 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1163 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1164 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1167 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
1168 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01)
1169 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02)
1170 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
1171 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
1172 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01)
1173 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02)
1174 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01)
1175 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02)
1176 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
1177 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
1178 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1179 nx_pull_match() returned error OFPBMC_BAD_VALUE
1182 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
1183 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01)
1184 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02)
1185 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
1186 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
1187 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01)
1188 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02)
1189 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01)
1190 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02)
1191 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
1192 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1193 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
1194 nx_pull_match() returned error OFPBMC_BAD_VALUE
1197 NXM_NX_COOKIE(00000000abcdef01)
1198 NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff)
1199 NXM_NX_COOKIE(84200000abcdef01)
1203 NXM_NX_TUN_ID(00000000abcdef01)
1204 NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff)
1205 NXM_NX_TUN_ID(84200000abcdef01)
1209 NXM_NX_REG0(acebdf56)
1210 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
1211 NXM_NX_REG0(a0e0d050)
1214 # Connection tracking fields,
1216 dnl When re-serialising, bits 16-31 are wildcarded, because current OVS userspace
1217 dnl doesn't understand (or store) those bits.
1218 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/0000ffff)
1219 nx_pull_match() returned error OFPBMC_BAD_VALUE
1220 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/00000020)
1221 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/000000f0)
1222 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_ZONE(5a5a)
1223 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_MARK(5a5a5a5a)
1224 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_MARK_W(5a5a5a5a/fefefefe)
1225 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_LABEL(1234567890abcdef1234567890abcdef)
1226 NXM_OF_ETH_TYPE(0800), NXM_NX_CT_LABEL_W(10203040506070809000a0b0c0d0e0f0/f1f2f3f4f5f6f7f8f9f0fafbfcfdfeff)
1228 # dp_hash (testing experimenter OXM).
1229 NXM_NX_DP_HASH(01234567)
1230 NXM_NX_DP_HASH(01234567)
1232 # Invalid field number.
1233 nx_pull_match() returned error OFPBMC_BAD_FIELD
1235 # Invalid field numbers (experimenter OXM).
1236 nx_pull_match() returned error OFPBMC_BAD_FIELD
1237 nx_pull_match() returned error OFPBMC_BAD_FIELD
1240 # Check that at least the first warning made it. (It's rate-limited
1241 # so a variable number could show up, especially under valgrind etc.)
1242 AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl
1243 nx_match|WARN|Rejecting NXM/OXM entry 0:0:1:1:12 with 1-bits in value for bits wildcarded by the mask.
1246 # Check that there wasn't any other stderr output.
1247 AT_CHECK([grep -v '1-bits in value' stderr], [1])
1250 AT_SETUP([ovs-ofctl parse-ofp10-match])
1251 AT_KEYWORDS([OF1.0])
1252 AT_DATA([test-data], [dnl
1254 003820fe fffe xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl
1255 xxxxxxxx xxxxxxxx xxxx xxxx
1257 # dl_src=00:01:02:03:04:05
1258 003820fb xxxx 000102030405 xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl
1259 xxxxxxxx xxxxxxxx xxxx xxxx
1261 # dl_dst=10:20:30:40:50:60
1262 003820f7 xxxx xxxxxxxxxxxx 102030405060 xxxx xx xx xxxx xx xx xxxx dnl
1263 xxxxxxxx xxxxxxxx xxxx xxxx
1266 003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 xx xx xxxx xx xx xxxx dnl
1267 xxxxxxxx xxxxxxxx xxxx xxxx
1270 002820ff xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx 05 xx xxxx xx xx xxxx dnl
1271 xxxxxxxx xxxxxxxx xxxx xxxx
1273 # dl_vlan=291,dl_vlan_pcp=4
1274 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 04 xx xxxx xx xx xxxx dnl
1275 xxxxxxxx xxxxxxxx xxxx xxxx
1277 dnl dl_vlan_pcp doesn't make sense when 802.1Q is not present, so
1278 dnl OVS ignores it and drops it on output.
1281 003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff xx xx xxxx xx xx xxxx dnl
1282 xxxxxxxx xxxxxxxx xxxx xxxx
1284 dnl dl_vlan_pcp doesn't make sense when 802.1Q is not present, so
1285 dnl OVS ignores it and drops it on output.
1288 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff 05 xx xxxx xx xx xxxx dnl
1289 xxxxxxxx xxxxxxxx xxxx xxxx
1291 dnl Invalid VID and PCP discards out-of-range bits:
1292 # dl_vlan=256,dl_vlan_pcp=7
1295 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx f100 ff xx xxxx xx xx xxxx dnl
1296 xxxxxxxx xxxxxxxx xxxx xxxx
1299 003820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
1300 xxxxxxxx xxxxxxxx xxxx xxxx
1303 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 05 xxxx dnl
1304 xxxxxxxx xxxxxxxx xxxx xxxx
1306 dnl Ignore nw_proto if not IP or ARP:
1307 # dl_type=0x1234,nw_proto=5
1308 # normal: 3: cf -> ef
1309 # normal: 25: 05 -> 00
1310 & ofp_util|INFO|normalization changed ofp_match, details:
1311 & ofp_util|INFO| pre: dl_type=0x1234,nw_proto=5
1312 & ofp_util|INFO|post: dl_type=0x1234
1313 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx 05 xxxx dnl
1314 xxxxxxxx xxxxxxxx xxxx xxxx
1317 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 fc xx xxxx dnl
1318 xxxxxxxx xxxxxxxx xxxx xxxx
1320 dnl Ignore nw_tos if not IP:
1323 # normal: 1: 18 -> 38
1324 # normal: 24: 04 -> 00
1325 & ofp_util|INFO|normalization changed ofp_match, details:
1326 & ofp_util|INFO| pre: arp,nw_tos=4
1327 & ofp_util|INFO|post: arp
1328 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 05 xx xxxx dnl
1329 xxxxxxxx xxxxxxxx xxxx xxxx
1331 dnl Low 2 bits of invalid TOS are forced to 0:
1334 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 31 xx xxxx dnl
1335 xxxxxxxx xxxxxxxx xxxx xxxx
1338 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx 02 xxxx dnl
1339 xxxxxxxx xxxxxxxx xxxx xxxx
1341 # ip,nw_src=192.168.128.85
1342 003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
1343 c0a88055 xxxxxxxx xxxx xxxx
1345 # ip,nw_src=192.168.128.0/24
1347 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
1348 c0a88055 xxxxxxxx xxxx xxxx
1350 # ip,nw_dst=192.168.128.85
1351 003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
1352 xxxxxxxx c0a88055 xxxx xxxx
1354 # ip,nw_dst=192.168.128.0/24
1356 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
1357 xxxxxxxx c0a88055 xxxx xxxx
1359 # arp,arp_spa=192.168.128.85
1360 003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
1361 c0a88055 xxxxxxxx xxxx xxxx
1363 # arp,arp_spa=192.168.128.0/24
1365 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
1366 c0a88055 xxxxxxxx xxxx xxxx
1368 # arp,arp_tpa=192.168.128.85
1369 003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
1370 xxxxxxxx c0a88055 xxxx xxxx
1372 # arp,arp_tpa=192.168.128.0/24
1374 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
1375 xxxxxxxx c0a88055 xxxx xxxx
1377 dnl Ignore nw_src if not IP or ARP:
1378 # dl_type=0x1234,nw_src=192.168.128.0/24
1380 # normal: 2: 08 -> 20
1381 # normal: 28: c0 -> 00
1382 # normal: 29: a8 -> 00
1383 # normal: 30: 80 -> 00
1384 & ofp_util|INFO|normalization changed ofp_match, details:
1385 & ofp_util|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24
1386 & ofp_util|INFO|post: dl_type=0x1234
1387 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
1388 c0a88055 xxxxxxxx xxxx xxxx
1390 dnl Ignore nw_dst if not IP or ARP:
1391 # dl_type=0x1234,nw_dst=192.168.128.0/24
1393 # normal: 1: 32 -> 38
1394 # normal: 32: c0 -> 00
1395 # normal: 33: a8 -> 00
1396 # normal: 34: 80 -> 00
1397 & ofp_util|INFO|normalization changed ofp_match, details:
1398 & ofp_util|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24
1399 & ofp_util|INFO|post: dl_type=0x1234
1400 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
1401 xxxxxxxx c0a88055 xxxx xxxx
1404 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl
1405 xxxxxxxx xxxxxxxx 01bb xxxx
1408 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl
1409 xxxxxxxx xxxxxxxx xxxx 01bb
1412 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl
1413 xxxxxxxx xxxxxxxx 01bb xxxx
1416 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl
1417 xxxxxxxx xxxxxxxx xxxx 01bb
1420 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx dnl
1421 xxxxxxxx xxxxxxxx 01bb xxxx
1424 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx dnl
1425 xxxxxxxx xxxxxxxx xxxx 01bb
1428 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl
1429 xxxxxxxx xxxxxxxx 0005 xxxx
1432 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl
1433 xxxxxxxx xxxxxxxx xxxx 0008
1435 dnl Ignore tp_src if not TCP/UDP/SCTP:
1436 # ip,nw_proto=21,tp_src=443
1437 # normal: 3: 8f -> cf
1438 # normal: 36: 01 -> 00
1439 # normal: 37: bb -> 00
1440 & ofp_util|INFO|normalization changed ofp_match, details:
1441 & ofp_util|INFO| pre: ip,nw_proto=21,tp_src=443
1442 & ofp_util|INFO|post: ip,nw_proto=21
1443 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl
1444 xxxxxxxx xxxxxxxx 01bb xxxx
1446 dnl Ignore tp_dst if not TCP/UDP/SCTP:
1447 # ip,nw_proto=21,tp_dst=443
1448 # normal: 3: 4f -> cf
1449 # normal: 38: 01 -> 00
1450 # normal: 39: bb -> 00
1451 dnl The normalization details are suppressed here due to rate-limiting.
1452 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl
1453 xxxxxxxx xxxxxxxx xxxx 01bb
1456 sed '/^[[#&]]/d' < test-data > input.txt
1457 sed -n 's/^# //p; /^$/p' < test-data > expout
1458 sed -n 's/^& //p' < test-data > experr
1459 AT_CAPTURE_FILE([input.txt])
1460 AT_CAPTURE_FILE([expout])
1461 AT_CAPTURE_FILE([experr])
1463 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-match < input.txt],
1464 [0], [expout], [experr])
1467 AT_SETUP([ovs-ofctl parse-ofp11-match])
1468 AT_KEYWORDS([OF1.1])
1469 AT_DATA([test-data], [dnl
1471 0000 0058 fffffffe 000003fe dnl
1472 000000000000ffffffffffff 000000000000ffffffffffff dnl
1473 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1474 00000000 00 000000 0000000000000000ffffffffffffffff
1476 # bad ofp11_match: OFPBMC_BAD_VALUE
1477 & ofp_util|WARN|port 305419896 is outside the supported range 0 through 65279 or 0xffffff00 through 0xffffffff
1478 0000 0058 12345678 000003fe dnl
1479 000000000000ffffffffffff 000000000000ffffffffffff dnl
1480 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1481 00000000 00 000000 0000000000000000ffffffffffffffff
1483 # dl_src=00:01:02:03:04:05
1484 0000 0058 00000000 000003ff dnl
1485 000102030405000000000000 000000000000ffffffffffff dnl
1486 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1487 00000000 00 000000 0000000000000000ffffffffffffffff
1489 # dl_src=55:55:55:55:55:55/55:55:55:55:55:55
1490 0000 0058 00000000 000003ff dnl
1491 555555555555aaaaaaaaaaaa 000000000000ffffffffffff dnl
1492 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1493 00000000 00 000000 0000000000000000ffffffffffffffff
1495 # dl_dst=00:01:02:03:04:05
1496 0000 0058 00000000 000003ff dnl
1497 000000000000ffffffffffff 000102030405000000000000 dnl
1498 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1499 00000000 00 000000 0000000000000000ffffffffffffffff
1501 # dl_dst=01:00:00:00:00:00/01:00:00:00:00:00
1502 0000 0058 00000000 000003ff dnl
1503 000000000000ffffffffffff 010000000000feffffffffff dnl
1504 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1505 00000000 00 000000 0000000000000000ffffffffffffffff
1507 # dl_dst=00:01:02:03:04:05/fe:ff:ff:ff:ff:ff
1508 0000 0058 00000000 000003ff dnl
1509 000000000000ffffffffffff 000102030405010000000000 dnl
1510 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1511 00000000 00 000000 0000000000000000ffffffffffffffff
1513 # dl_dst=55:55:55:55:55:55/55:55:55:55:55:55
1514 0000 0058 00000000 000003ff dnl
1515 000000000000ffffffffffff 555555555555aaaaaaaaaaaa dnl
1516 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1517 00000000 00 000000 0000000000000000ffffffffffffffff
1519 dnl dl_vlan_pcp is ignored if dl_vlan is wildcarded, which causes the
1520 dnl the wildcard bit and the dl_vlan_pcp to be dropped for output:
1524 0000 0058 00000001 000003fa dnl
1525 000000000000ffffffffffff 000000000000ffffffffffff dnl
1526 0000 03 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1527 00000000 00 000000 0000000000000000ffffffffffffffff
1530 0000 0058 00000000 000003fd dnl
1531 000000000000ffffffffffff 000000000000ffffffffffff dnl
1532 0123 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1533 00000000 00 000000 0000000000000000ffffffffffffffff
1537 0000 0058 00000000 000003fd dnl
1538 000000000000ffffffffffff 000000000000ffffffffffff dnl
1539 ffff 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1540 00000000 00 000000 0000000000000000ffffffffffffffff
1542 dnl OFPVID_NONE ignores dl_vlan_pcp even if not wildcarded, which causes
1543 dnl the wildcard bit and the dl_vlan_pcp to be dropped for output:
1547 0000 0058 00000000 000003f9 dnl
1548 000000000000ffffffffffff 000000000000ffffffffffff dnl
1549 ffff 05 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1550 00000000 00 000000 0000000000000000ffffffffffffffff
1552 # vlan_tci=0x1000/0x1000
1553 0000 0058 00000000 000003fd dnl
1554 000000000000ffffffffffff 000000000000ffffffffffff dnl
1555 fffe 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1556 00000000 00 000000 0000000000000000ffffffffffffffff
1558 dnl Try invalid VID:
1559 # bad ofp11_match: OFPBMC_BAD_VALUE
1560 0000 0058 00000000 000003fd dnl
1561 000000000000ffffffffffff 000000000000ffffffffffff dnl
1562 1234 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1563 00000000 00 000000 0000000000000000ffffffffffffffff
1566 0000 0058 00000000 000003f9 dnl
1567 000000000000ffffffffffff 000000000000ffffffffffff dnl
1568 fffe 04 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1569 00000000 00 000000 0000000000000000ffffffffffffffff
1571 # dl_vlan=10,dl_vlan_pcp=6
1572 0000 0058 00000000 000003f9 dnl
1573 000000000000ffffffffffff 000000000000ffffffffffff dnl
1574 000a 06 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1575 00000000 00 000000 0000000000000000ffffffffffffffff
1578 0000 0058 00000000 000003f7 dnl
1579 000000000000ffffffffffff 000000000000ffffffffffff dnl
1580 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1581 00000000 00 000000 0000000000000000ffffffffffffffff
1584 0000 0058 00000000 000003e7 dnl
1585 000000000000ffffffffffff 000000000000ffffffffffff dnl
1586 0000 00 00 0800 fc 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1587 00000000 00 000000 0000000000000000ffffffffffffffff
1589 dnl Try invalid TOS:
1590 # bad ofp11_match: OFPBMC_BAD_VALUE
1591 0000 0058 00000000 000003e7 dnl
1592 000000000000ffffffffffff 000000000000ffffffffffff dnl
1593 0000 00 00 0800 01 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1594 00000000 00 000000 0000000000000000ffffffffffffffff
1597 0000 0058 00000000 000003d7 dnl
1598 000000000000ffffffffffff 000000000000ffffffffffff dnl
1599 0000 00 00 0800 00 05 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1600 00000000 00 000000 0000000000000000ffffffffffffffff
1603 0000 0058 00000000 000003d7 dnl
1604 000000000000ffffffffffff 000000000000ffffffffffff dnl
1605 0000 00 00 0806 00 02 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1606 00000000 00 000000 0000000000000000ffffffffffffffff
1608 # ip,nw_src=192.168.128.0/24
1609 0000 0058 00000000 000003f7 dnl
1610 000000000000ffffffffffff 000000000000ffffffffffff dnl
1611 0000 00 00 0800 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
1612 00000000 00 000000 0000000000000000ffffffffffffffff
1614 # ip,nw_src=128.160.128.0/165.165.165.165
1617 0000 0058 00000000 000003f7 dnl
1618 000000000000ffffffffffff 000000000000ffffffffffff dnl
1619 0000 00 00 0800 00 00 c0a880005a5a5a5a 00000000ffffffff 0000 0000 dnl
1620 00000000 00 000000 0000000000000000ffffffffffffffff
1622 # ip,nw_dst=192.168.128.0/24
1623 0000 0058 00000000 000003f7 dnl
1624 000000000000ffffffffffff 000000000000ffffffffffff dnl
1625 0000 00 00 0800 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
1626 00000000 00 000000 0000000000000000ffffffffffffffff
1628 # ip,nw_dst=128.160.128.0/165.165.165.165
1631 0000 0058 00000000 000003f7 dnl
1632 000000000000ffffffffffff 000000000000ffffffffffff dnl
1633 0000 00 00 0800 00 00 00000000ffffffff c0a880005a5a5a5a 0000 0000 dnl
1634 00000000 00 000000 0000000000000000ffffffffffffffff
1636 # arp,arp_spa=192.168.128.0/24
1637 0000 0058 00000000 000003f7 dnl
1638 000000000000ffffffffffff 000000000000ffffffffffff dnl
1639 0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
1640 00000000 00 000000 0000000000000000ffffffffffffffff
1642 # arp,arp_tpa=192.168.128.0/24
1643 0000 0058 00000000 000003f7 dnl
1644 000000000000ffffffffffff 000000000000ffffffffffff dnl
1645 0000 00 00 0806 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
1646 00000000 00 000000 0000000000000000ffffffffffffffff
1649 0000 0058 00000000 00000397 dnl
1650 000000000000ffffffffffff 000000000000ffffffffffff dnl
1651 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1652 00000000 00 000000 0000000000000000ffffffffffffffff
1655 0000 0058 00000000 00000357 dnl
1656 000000000000ffffffffffff 000000000000ffffffffffff dnl
1657 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 0000 01bb dnl
1658 00000000 00 000000 0000000000000000ffffffffffffffff
1661 0000 0058 00000000 00000397 dnl
1662 000000000000ffffffffffff 000000000000ffffffffffff dnl
1663 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1664 00000000 00 000000 0000000000000000ffffffffffffffff
1667 0000 0058 00000000 00000397 dnl
1668 000000000000ffffffffffff 000000000000ffffffffffff dnl
1669 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0005 0000 dnl
1670 00000000 00 000000 0000000000000000ffffffffffffffff
1673 0000 0058 00000000 00000357 dnl
1674 000000000000ffffffffffff 000000000000ffffffffffff dnl
1675 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0000 0008 dnl
1676 00000000 00 000000 0000000000000000ffffffffffffffff
1679 0000 0058 00000000 00000397 dnl
1680 000000000000ffffffffffff 000000000000ffffffffffff dnl
1681 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1682 00000000 00 000000 0000000000000000ffffffffffffffff
1685 0000 0058 00000000 00000357 dnl
1686 000000000000ffffffffffff 000000000000ffffffffffff dnl
1687 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 0000 01bb dnl
1688 00000000 00 000000 0000000000000000ffffffffffffffff
1691 0000 0058 00000000 000003d7 dnl
1692 000000000000ffffffffffff 000000000000ffffffffffff dnl
1693 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1694 00000000 00 000000 0000000000000000ffffffffffffffff
1697 0000 0058 00000000 00000397 dnl
1698 000000000000ffffffffffff 000000000000ffffffffffff dnl
1699 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1700 00000000 00 000000 0000000000000000ffffffffffffffff
1703 0000 0058 00000000 00000357 dnl
1704 000000000000ffffffffffff 000000000000ffffffffffff dnl
1705 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 01bb dnl
1706 00000000 00 000000 0000000000000000ffffffffffffffff
1708 dnl Ignore tp_src if not TCP/UDP/SCTP:
1713 0000 0058 00000000 00000397 dnl
1714 000000000000ffffffffffff 000000000000ffffffffffff dnl
1715 0000 00 00 0800 00 15 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1716 00000000 00 000000 0000000000000000ffffffffffffffff
1718 dnl Ignore tp_dst if not TCP/UDP/SCTP:
1723 0000 0058 00000000 00000357 dnl
1724 000000000000ffffffffffff 000000000000ffffffffffff dnl
1725 0000 00 00 0800 00 16 00000000ffffffff 00000000ffffffff 0000 01bb dnl
1726 00000000 00 000000 0000000000000000ffffffffffffffff
1728 # mpls,mpls_label=284280
1731 0000 0058 00000000 000002f7 dnl
1732 000000000000ffffffffffff 000000000000ffffffffffff dnl
1733 0000 00 00 8847 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1734 12345678 00 000000 0000000000000000ffffffffffffffff
1738 0000 0058 00000000 000001f7 dnl
1739 000000000000ffffffffffff 000000000000ffffffffffff dnl
1740 0000 00 00 8848 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1741 00000000 5a 000000 0000000000000000ffffffffffffffff
1743 dnl mpls_label and mpls_tc must be ignored if dl_type is not MPLS:
1751 0000 0058 00000000 000000f7 dnl
1752 000000000000ffffffffffff 000000000000ffffffffffff dnl
1753 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1754 12345678 5a 000000 0000000000000000ffffffffffffffff
1757 # metadata=0x1234567890abcdef
1758 0000 0058 00000000 000003ff dnl
1759 000000000000ffffffffffff 000000000000ffffffffffff dnl
1760 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1761 00000000 00 000000 1234567890abcdef0000000000000000
1764 # metadata=0x5555555555555555/0x5555555555555555
1765 0000 0058 00000000 000003ff dnl
1766 000000000000ffffffffffff 000000000000ffffffffffff dnl
1767 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1768 00000000 00 000000 5555555555555555aaaaaaaaaaaaaaaa
1771 # metadata=0x1234000090ab0000/0xffff0000ffff0000
1776 0000 0058 00000000 000003ff dnl
1777 000000000000ffffffffffff 000000000000ffffffffffff dnl
1778 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1779 00000000 00 000000 1234567890abcdef0000ffff0000ffff
1782 sed '/^[[#&]]/d' < test-data > input.txt
1783 sed -n 's/^# //p; /^$/p' < test-data > expout
1784 sed -n 's/^& //p' < test-data > experr
1785 AT_CAPTURE_FILE([input.txt])
1786 AT_CAPTURE_FILE([expout])
1787 AT_CAPTURE_FILE([experr])
1789 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-match < input.txt],
1790 [0], [expout], [experr])
1793 AT_SETUP([ovs-ofctl parse-nx-match loose])
1794 AT_KEYWORDS([nx-match])
1795 AT_DATA([nx-match.txt], [dnl
1796 NXM_OF_IN_PORT(0001), 01020304(1111/3333), NXM_OF_ETH_TYPE(0800)
1797 NXM_OF_IN_PORT(0001), ffff020800002320(11112222), NXM_OF_ETH_TYPE(0800)
1798 NXM_OF_IN_PORT(0001), ffff030800002320(1111/3333), NXM_OF_ETH_TYPE(0800)
1801 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
1802 nx_pull_match() returned error OFPBMC_BAD_FIELD
1803 nx_pull_match() returned error OFPBMC_BAD_FIELD
1804 nx_pull_match() returned error OFPBMC_BAD_FIELD
1807 AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl
1808 NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
1809 NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
1810 NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
1814 AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.2)])
1816 AT_DATA([oxm.txt], [dnl
1820 OXM_OF_IN_PORT(00000000)
1821 OXM_OF_IN_PORT(fffffffe)
1824 OXM_OF_METADATA(5a5a5a5a5a5a5a5a)
1825 OXM_OF_METADATA_W(0000000000000000/00000000ffffffff)
1826 OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000)
1827 OXM_OF_METADATA_W(1234567890abcdef/ffffffffffffffff)
1828 OXM_OF_METADATA_W(1234567890abcdef/0000000000000000)
1831 OXM_OF_ETH_DST(0002e30f80a4)
1832 OXM_OF_ETH_DST_W(010000000000/010000000000)
1833 OXM_OF_ETH_DST_W(000000000000/010000000000)
1834 OXM_OF_ETH_DST_W(ffffffffffff/010000000000)
1835 OXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
1836 OXM_OF_ETH_DST_W(0002e30f80a4/000000000000)
1837 OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
1840 OXM_OF_ETH_SRC(020898456ddb)
1843 OXM_OF_ETH_TYPE(0800)
1844 OXM_OF_ETH_TYPE(0800) OXM_OF_IN_PORT(00000012)
1847 OXM_OF_VLAN_VID(1009) OXM_OF_VLAN_VID(1009) # Duplicate Field
1848 OXM_OF_VLAN_VID(f009) # Bad Value
1849 OXM_OF_VLAN_PCP(00) # Bad Pre-Requisite
1850 OXM_OF_VLAN_VID(0000) # Packets without 802.1Q header or with VID=0
1851 OXM_OF_VLAN_VID(1123) # Packets with VID=123, any PCP
1852 OXM_OF_VLAN_VID(1123) OXM_OF_VLAN_PCP(01) # Packets with VID=123, PCP=1.
1853 OXM_OF_VLAN_VID(0123) # Does not make sense (but supported anyway)
1854 OXM_OF_VLAN_VID_W(0123/0123) # Does not make sense (but supported anyway)
1855 OXM_OF_VLAN_VID_W(1123/0123) # Does not make sense (but supported anyway)
1856 OXM_OF_VLAN_VID_W(0123/1123) # Does not make sense (but supported anyway)
1857 OXM_OF_VLAN_VID(0123) OXM_OF_VLAN_PCP(01) #Bad Pre-Requisite
1858 OXM_OF_VLAN_VID_W(1123/1fff) # Packets with VID=123, any PCP.
1859 OXM_OF_VLAN_VID_W(1123/ffff) # Packets with VID=123, any PCP.
1860 OXM_OF_VLAN_VID_W(0000/0000) # Packets with or without 802.1Q header
1861 OXM_OF_VLAN_VID_W(1103/1f0f), # Packets with # VID=123 (masked)
1862 OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01) # Packets with VID=123 (masked), any PCP.
1863 OXM_OF_VLAN_VID_W(1000/1000) # Packets with any VID, any PCP
1864 OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) # Packets with any VID, PCP=1.
1867 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(f0)
1868 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(41)
1869 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(3f)
1873 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(03)
1874 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(06)
1878 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01)
1879 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(05)
1883 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC(ac100014)
1884 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFF0000)
1885 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFFFFFF)
1886 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(00000000/00000000)
1887 OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_SRC(ac100014)
1888 OXM_OF_IPV4_SRC_W(C0D80000/FFFF0000)
1891 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST(ac100014)
1892 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a80000/FFFF0000)
1893 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFFFFFF)
1894 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(00000000/00000000)
1895 OXM_OF_IPV4_DST(ac100014)
1896 OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_DST_W(C0D80000/FFFF0000)
1899 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC(4231)
1900 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/F0F0)
1901 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/FFFF)
1902 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(0000/0000)
1903 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_SRC(4231)
1905 # TCP destination port
1906 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST(4231)
1907 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFF0)
1908 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFFF)
1909 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(0000/0000)
1910 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_DST(4231)
1913 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC(8732)
1914 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/01FF)
1915 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/FFFF)
1916 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0000/0000)
1917 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_UDP_SRC(7823)
1919 # UDP destination port
1920 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST(1782)
1921 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/F00F)
1922 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/FFFF)
1923 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(0000/0000)
1924 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_UDP_DST(1293)
1927 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC(8732)
1928 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/01FF)
1929 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/FFFF)
1930 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0000/0000)
1931 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_SCTP_SRC(7823)
1933 # SCTP destination port
1934 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST(1782)
1935 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/F00F)
1936 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/FFFF)
1937 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(0000/0000)
1938 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_SCTP_DST(1293)
1941 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_TYPE(12)
1942 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_TYPE(10)
1945 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_CODE(12)
1946 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_CODE(10)
1947 OXM_OF_ETH_TYPE(0800) OXM_OF_ICMPV4_CODE(10)
1948 OXM_OF_ICMPV4_CODE(00)
1951 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001)
1952 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(1111)
1953 OXM_OF_ETH_TYPE(0000) OXM_OF_ARP_OP(0001)
1955 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) OXM_OF_ARP_OP(0001)
1957 # ARP source protocol address
1958 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA(ac100014)
1959 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81200/FFFFFF00)
1960 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFFFF)
1961 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(00000000/00000000)
1962 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SPA(ac100014)
1963 OXM_OF_ARP_SPA_W(C0D80000/FFFF0000)
1965 # ARP destination protocol address
1966 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA(ac100014)
1967 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a81200/FFFFFF00)
1968 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFFFF)
1969 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(00000000/00000000)
1970 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_TPA(ac100014)
1971 OXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
1973 # ARP source hardware address
1974 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA(0002e30f80a4)
1975 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SHA(0002e30f80a4)
1976 OXM_OF_ARP_SHA(0002e30f80a4)
1977 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/ffffffffffff)
1978 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000000/000000000000)
1979 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000004/00000000000f)
1981 # ARP destination hardware address
1982 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA(0002e30f80a4)
1983 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_THA(0002e30f80a4)
1984 OXM_OF_ARP_THA(0002e30f80a4)
1985 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/ffffffffffff)
1986 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000000/000000000000)
1987 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000004/00000000000f)
1990 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
1991 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
1992 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1993 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
1994 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(00000000000000000000000000000000/00000000000000000000000000000000)
1995 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1998 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
1999 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
2000 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
2001 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
2002 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000)
2003 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
2006 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(1000000f)
2007 OXM_OF_IPV6_FLABEL(0000000f)
2008 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(0000000f)
2009 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/0000000f)
2010 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000fffff)
2011 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/000ffff0)
2012 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/100fffff)
2013 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/ffffffff)
2014 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/00000000)
2016 # ND source hardware address
2017 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)
2018 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)
2019 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)
2020 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)
2022 # ND destination hardware address
2023 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)
2024 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)
2025 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)
2026 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)
2028 # Registers 0, 1, and 2.
2029 NXM_NX_REG0(acebdf56)
2030 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
2031 NXM_NX_REG0(a0e0d050)
2032 NXM_NX_REG1(acebdf56)
2033 NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0)
2034 NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050)
2035 NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0)
2036 NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050)
2038 # Extended registers 0, 1, and 2.
2039 # (For OpenFlow 1.2, OVS transforms these into its extension registers.)
2040 OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000)
2041 OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000)
2042 OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000)
2043 OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff)
2044 OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0)
2045 OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff)
2046 OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000)
2047 OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000)
2049 # Invalid field number.
2052 # Invalid field numbers (experimenter OXM).
2053 ffff020800002320(11112222)
2054 ffff030800002320(1111/3333)
2056 AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow12 < oxm.txt],
2061 OXM_OF_IN_PORT(00000000)
2062 OXM_OF_IN_PORT(fffffffe)
2065 OXM_OF_METADATA(5a5a5a5a5a5a5a5a)
2066 OXM_OF_METADATA_W(0000000000000000/00000000ffffffff)
2067 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
2068 OXM_OF_METADATA(1234567890abcdef)
2069 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
2072 OXM_OF_ETH_DST(0002e30f80a4)
2073 OXM_OF_ETH_DST_W(010000000000/010000000000)
2074 OXM_OF_ETH_DST_W(000000000000/010000000000)
2075 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
2076 OXM_OF_ETH_DST(0002e30f80a4)
2077 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
2078 OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
2081 OXM_OF_ETH_SRC(020898456ddb)
2084 OXM_OF_ETH_TYPE(0800)
2085 OXM_OF_IN_PORT(00000012), OXM_OF_ETH_TYPE(0800)
2088 nx_pull_match() returned error OFPBMC_DUP_FIELD
2089 nx_pull_match() returned error OFPBMC_BAD_VALUE
2090 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2091 OXM_OF_VLAN_VID(0000)
2092 OXM_OF_VLAN_VID(1123)
2093 OXM_OF_VLAN_VID(1123), OXM_OF_VLAN_PCP(01)
2094 OXM_OF_VLAN_VID(0123)
2095 OXM_OF_VLAN_VID_W(0123/0123)
2096 nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
2097 OXM_OF_VLAN_VID_W(0123/1123)
2098 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2099 OXM_OF_VLAN_VID(1123)
2100 OXM_OF_VLAN_VID(1123)
2102 OXM_OF_VLAN_VID_W(1103/1f0f)
2103 OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01)
2104 OXM_OF_VLAN_VID_W(1000/1000)
2105 OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01)
2108 nx_pull_match() returned error OFPBMC_BAD_VALUE
2109 nx_pull_match() returned error OFPBMC_BAD_VALUE
2110 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_DSCP(3f)
2111 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2114 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_ECN(03)
2115 nx_pull_match() returned error OFPBMC_BAD_VALUE
2116 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2119 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01)
2120 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(05)
2121 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2124 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(ac100014)
2125 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC_W(c0a80000/ffff0000)
2126 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(c0a80000)
2127 OXM_OF_ETH_TYPE(0800)
2128 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2129 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2132 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(ac100014)
2133 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST_W(c0a80000/ffff0000)
2134 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(c0a88012)
2135 OXM_OF_ETH_TYPE(0800)
2136 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2137 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2140 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(4231)
2141 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC_W(5050/f0f0)
2142 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(5050)
2143 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06)
2144 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2146 # TCP destination port
2147 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(4231)
2148 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST_W(fde0/fff0)
2149 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(fde0)
2150 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06)
2151 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2154 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(8732)
2155 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC_W(0132/01ff)
2156 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(0132)
2157 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11)
2158 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2160 # UDP destination port
2161 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(1782)
2162 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST_W(5005/f00f)
2163 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(5005)
2164 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11)
2165 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2168 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(8732)
2169 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC_W(0132/01ff)
2170 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(0132)
2171 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84)
2172 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2174 # SCTP destination port
2175 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(1782)
2176 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST_W(5005/f00f)
2177 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(5005)
2178 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84)
2179 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2182 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_TYPE(12)
2183 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2186 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_CODE(12)
2187 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2188 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2189 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2192 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_OP(0001)
2193 nx_pull_match() returned error OFPBMC_BAD_VALUE
2194 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2195 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2196 nx_pull_match() returned error OFPBMC_DUP_FIELD
2198 # ARP source protocol address
2199 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(ac100014)
2200 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA_W(c0a81200/ffffff00)
2201 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(c0a81234)
2202 OXM_OF_ETH_TYPE(0806)
2203 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2204 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2206 # ARP destination protocol address
2207 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(ac100014)
2208 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA_W(c0a81200/ffffff00)
2209 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(c0a812fe)
2210 OXM_OF_ETH_TYPE(0806)
2211 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2212 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2214 # ARP source hardware address
2215 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4)
2216 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2217 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2218 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4)
2219 OXM_OF_ETH_TYPE(0806)
2220 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA_W(000000000004/00000000000f)
2222 # ARP destination hardware address
2223 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4)
2224 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2225 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2226 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4)
2227 OXM_OF_ETH_TYPE(0806)
2228 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA_W(000000000004/00000000000f)
2231 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
2232 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2233 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
2234 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010000000000000000)
2235 OXM_OF_ETH_TYPE(86dd)
2236 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2239 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
2240 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2241 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
2242 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010000000000000000)
2243 OXM_OF_ETH_TYPE(86dd)
2244 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2247 nx_pull_match() returned error OFPBMC_BAD_VALUE
2248 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2249 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
2250 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(0000000f/0000000f)
2251 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
2252 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(00000000/000ffff0)
2253 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
2254 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
2255 OXM_OF_ETH_TYPE(86dd)
2257 # ND source hardware address
2258 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)
2259 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2260 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2261 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2263 # ND destination hardware address
2264 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)
2265 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2266 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2267 nx_pull_match() returned error OFPBMC_BAD_PREREQ
2269 # Registers 0, 1, and 2.
2270 NXM_NX_REG0(acebdf56)
2271 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
2272 NXM_NX_REG0(a0e0d050)
2273 NXM_NX_REG1(acebdf56)
2274 NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0)
2275 NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050)
2276 NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0)
2277 NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050)
2279 # Extended registers 0, 1, and 2.
2280 # (For OpenFlow 1.2, OVS transforms these into its extension registers.)
2281 NXM_NX_REG0(acebdf56)
2282 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
2283 NXM_NX_REG0(a0e0d050)
2284 NXM_NX_REG1(acebdf56)
2285 NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0)
2286 NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050)
2287 NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0)
2288 NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050)
2290 # Invalid field number.
2291 nx_pull_match() returned error OFPBMC_BAD_FIELD
2293 # Invalid field numbers (experimenter OXM).
2294 nx_pull_match() returned error OFPBMC_BAD_FIELD
2295 nx_pull_match() returned error OFPBMC_BAD_FIELD
2298 # Check that at least the first warning made it. (It's rate-limited
2299 # so a variable number could show up, especially under valgrind etc.)
2300 AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl
2301 nx_match|WARN|Rejecting NXM/OXM entry 0:32768:2:1:16 with 1-bits in value for bits wildcarded by the mask.
2304 # Check that there wasn't any other stderr output.
2305 AT_CHECK([grep -v '1-bits in value' stderr], [1])
2308 AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.3)])
2310 AT_DATA([oxm.txt], [dnl
2312 ONFOXM_ET_ACTSET_OUTPUT(00000000)
2313 ONFOXM_ET_ACTSET_OUTPUT(fffffffe)
2314 ONFOXM_ET_ACTSET_OUTPUT(fffffff7)
2315 OXM_OF_ACTSET_OUTPUT(00000000)
2316 OXM_OF_ACTSET_OUTPUT(fffffffe)
2317 OXM_OF_ACTSET_OUTPUT(fffffff7)
2319 AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow13 < oxm.txt],
2322 ONFOXM_ET_ACTSET_OUTPUT(00000000)
2323 ONFOXM_ET_ACTSET_OUTPUT(fffffffe)
2324 ONFOXM_ET_ACTSET_OUTPUT(fffffff7)
2325 ONFOXM_ET_ACTSET_OUTPUT(00000000)
2326 ONFOXM_ET_ACTSET_OUTPUT(fffffffe)
2327 ONFOXM_ET_ACTSET_OUTPUT(fffffff7)
2331 AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.5)])
2333 AT_DATA([oxm.txt], [dnl
2334 # Extended registers 0 and 1.
2335 OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000)
2336 OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000)
2337 OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000)
2338 OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff)
2339 OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0)
2340 OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff)
2341 OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000)
2342 OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000)
2344 # Registers 0, 1, and 2.
2345 # (OpenFlow 1.5 transforms these into the standard "xregs".)
2346 NXM_NX_REG0(acebdf56)
2347 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
2348 NXM_NX_REG0(a0e0d050)
2349 NXM_NX_REG1(acebdf56)
2350 NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0)
2351 NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050)
2352 NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0)
2353 NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050)
2356 ONFOXM_ET_ACTSET_OUTPUT(00000000)
2357 ONFOXM_ET_ACTSET_OUTPUT(fffffffe)
2358 ONFOXM_ET_ACTSET_OUTPUT(fffffff7)
2359 OXM_OF_ACTSET_OUTPUT(00000000)
2360 OXM_OF_ACTSET_OUTPUT(fffffffe)
2361 OXM_OF_ACTSET_OUTPUT(fffffff7)
2363 AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow15 < oxm.txt],
2365 # Extended registers 0 and 1.
2366 OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000)
2367 OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000)
2368 OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000)
2369 OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff)
2370 OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0)
2371 OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff)
2372 OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000)
2373 OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000)
2375 # Registers 0, 1, and 2.
2376 # (OpenFlow 1.5 transforms these into the standard "xregs".)
2377 OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000)
2378 OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000)
2379 OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000)
2380 OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff)
2381 OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0)
2382 OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff)
2383 OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000)
2384 OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000)
2387 OXM_OF_ACTSET_OUTPUT(00000000)
2388 OXM_OF_ACTSET_OUTPUT(fffffffe)
2389 OXM_OF_ACTSET_OUTPUT(fffffff7)
2390 OXM_OF_ACTSET_OUTPUT(00000000)
2391 OXM_OF_ACTSET_OUTPUT(fffffffe)
2392 OXM_OF_ACTSET_OUTPUT(fffffff7)
2396 AT_SETUP([ovs-ofctl parse-oxm loose])
2398 AT_DATA([oxm.txt], [dnl
2399 OXM_OF_IN_PORT(00000001), 01020304(1111/3333), OXM_OF_ETH_TYPE(0800)
2400 OXM_OF_IN_PORT(00000001), ffff020800002320(11112222), OXM_OF_ETH_TYPE(0800)
2401 OXM_OF_IN_PORT(00000001), ffff030800002320(1111/3333), OXM_OF_ETH_TYPE(0800)
2404 AT_CHECK([ovs-ofctl --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
2405 nx_pull_match() returned error OFPBMC_BAD_FIELD
2406 nx_pull_match() returned error OFPBMC_BAD_FIELD
2407 nx_pull_match() returned error OFPBMC_BAD_FIELD
2410 AT_CHECK([ovs-ofctl parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
2411 OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
2412 OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
2413 OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
2417 AT_SETUP([experimenter OXM encoding])
2418 AT_DATA([oxm.txt], [dnl
2419 NXM_NX_DP_HASH(01234567)
2420 NXOXM_ET_DP_HASH(01234567)
2422 NXM_NX_DP_HASH_W(01234567/0fffffff)
2423 NXOXM_ET_DP_HASH_W(01234567/0fffffff)
2426 # To allow for testing experimenter OXM, which doesn't really have many
2427 # examples in the wild, we've defined a variant of NXM_NX_DP_HASH that uses
2428 # the experimenter OXM mechanism, called NXOXM_ET_DP_HASH. We've defined
2429 # it as if it were introduced with OpenFlow 1.5, which gives us the
2430 # opportunity to see that both forms are accepted in all OpenFlow versions
2431 # but the experimenter form is used for encoding in OF1.5+.
2433 # First verify that both forms are accepted and NXOXM_ET_DP_HASH is encoded
2435 AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow15 < oxm.txt], [0], [dnl
2436 NXOXM_ET_DP_HASH(01234567)
2437 00000000 00 01 00 10 ff ff 00 08-00 00 23 20 01 23 45 67 @&t@
2438 NXOXM_ET_DP_HASH(01234567)
2439 00000000 00 01 00 10 ff ff 00 08-00 00 23 20 01 23 45 67 @&t@
2441 NXOXM_ET_DP_HASH_W(01234567/0fffffff)
2442 00000000 00 01 00 14 ff ff 01 0c-00 00 23 20 01 23 45 67 @&t@
2443 00000010 0f ff ff ff 00 00 00 00-
2444 NXOXM_ET_DP_HASH_W(01234567/0fffffff)
2445 00000000 00 01 00 14 ff ff 01 0c-00 00 23 20 01 23 45 67 @&t@
2446 00000010 0f ff ff ff 00 00 00 00-
2449 # Then verify that both forms are accepted and NXM_NX_DP_HASH is encoded
2451 AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
2452 NXM_NX_DP_HASH(01234567)
2453 00000000 00 01 00 0c 00 01 46 04-01 23 45 67 00 00 00 00 @&t@
2454 NXM_NX_DP_HASH(01234567)
2455 00000000 00 01 00 0c 00 01 46 04-01 23 45 67 00 00 00 00 @&t@
2457 NXM_NX_DP_HASH_W(01234567/0fffffff)
2458 00000000 00 01 00 10 00 01 47 08-01 23 45 67 0f ff ff ff @&t@
2459 NXM_NX_DP_HASH_W(01234567/0fffffff)
2460 00000000 00 01 00 10 00 01 47 08-01 23 45 67 0f ff ff ff @&t@
2464 AT_SETUP([check TCP flags expression in OXM and NXM])
2465 # NXM/OXM input for matching on TCP flags.
2466 tcp_flags='OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)'
2468 # Check that marshaling into NXM gives all NXM headers.
2469 AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-nxm], [0],
2470 [NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff)
2473 # Check that marshaling in OXM for OF1.2 gives OXM headers except for
2474 # TCP flags, which didn't have an OXM definition.
2475 AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow12], [0],
2476 [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff)
2479 # Check that marshaling in OXM for OF1.3 and OF1.4 gives OXM headers,
2480 # including the ONF extension for TCP flags introduced in OF1.3.
2481 AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow13], [0],
2482 [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff)
2484 AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow14], [0],
2485 [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff)
2488 # OpenFlow 1.5 added an OXM header for TCP flags:
2489 AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow15], [0],
2490 [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)
2494 dnl Check all of the patterns mentioned in the "VLAN Matching" section
2495 dnl in the topics/design doc
2496 AT_SETUP([ovs-ofctl check-vlan])
2500 AT_CHECK([ovs-ofctl check-vlan 0000 0000], [0], [dnl
2502 NXM: <any> -> 0000/0000
2503 OXM: <any> -> 0000/0000,--
2504 OF1.0: 0000/1,00/1 -> 0000/0000
2505 OF1.1: 0000/1,00/1 -> 0000/0000
2509 AT_CHECK([ovs-ofctl check-vlan 0000 ffff], [0], [dnl
2510 vlan_tci=0x0000 -> 0000/ffff
2511 NXM: NXM_OF_VLAN_TCI(0000) -> 0000/ffff
2512 OXM: OXM_OF_VLAN_VID(0000) -> 0000/1fff,--
2513 OF1.0: ffff/0,00/0 -> 0000/ffff
2514 OF1.1: ffff/0,00/1 -> 0000/ffff
2518 AT_CHECK([ovs-ofctl check-vlan 1abc 1fff], [0], [dnl
2519 dl_vlan=2748 -> 1abc/1fff
2520 NXM: NXM_OF_VLAN_TCI_W(1abc/1fff) -> 1abc/1fff
2521 OXM: OXM_OF_VLAN_VID(1abc) -> 1abc/1fff,--
2522 OF1.0: 0abc/0,00/1 -> 1abc/1fff
2523 OF1.1: 0abc/0,00/1 -> 1abc/1fff
2527 AT_CHECK([ovs-ofctl check-vlan b000 f000], [0], [dnl
2528 dl_vlan_pcp=5 -> b000/f000
2529 NXM: NXM_OF_VLAN_TCI_W(b000/f000) -> b000/f000
2530 OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(05) -> 1000/1000,05
2531 OF1.0: 0000/1,05/0 -> b000/f000
2532 OF1.1: fffe/0,05/0 -> b000/f000
2536 AT_CHECK([ovs-ofctl check-vlan babc ffff], [0], [dnl
2537 dl_vlan=2748,dl_vlan_pcp=5 -> babc/ffff
2538 NXM: NXM_OF_VLAN_TCI(babc) -> babc/ffff
2539 OXM: OXM_OF_VLAN_VID(1abc), OXM_OF_VLAN_PCP(05) -> 1abc/1fff,05
2540 OF1.0: 0abc/0,05/0 -> babc/ffff
2541 OF1.1: 0abc/0,05/0 -> babc/ffff
2545 AT_CHECK([ovs-ofctl check-vlan 0000 0fff], [0], [dnl
2546 vlan_tci=0x0000/0x0fff -> 0000/0fff
2547 NXM: NXM_OF_VLAN_TCI_W(0000/0fff) -> 0000/0fff
2548 OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,--
2549 OF1.0: 0000/0,00/1 -> 1000/1fff
2550 OF1.1: 0000/0,00/1 -> 1000/1fff
2554 AT_CHECK([ovs-ofctl check-vlan 0000 f000], [0], [dnl
2555 vlan_tci=0x0000/0xf000 -> 0000/f000
2556 NXM: NXM_OF_VLAN_TCI_W(0000/f000) -> 0000/f000
2557 OXM: OXM_OF_VLAN_VID_W(0000/1000) -> 0000/1000,--
2558 OF1.0: ffff/0,00/0 -> 0000/ffff
2559 OF1.1: ffff/0,00/1 -> 0000/ffff
2563 AT_CHECK([ovs-ofctl check-vlan 0000 efff], [0], [dnl
2564 vlan_tci=0x0000/0xefff -> 0000/efff
2565 NXM: NXM_OF_VLAN_TCI_W(0000/efff) -> 0000/efff
2566 OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,--
2567 OF1.0: 0000/0,00/0 -> 1000/ffff
2568 OF1.1: 0000/0,00/0 -> 1000/ffff
2572 AT_CHECK([ovs-ofctl check-vlan 1001 1001], [0], [dnl
2573 vlan_tci=0x1001/0x1001 -> 1001/1001
2574 NXM: NXM_OF_VLAN_TCI_W(1001/1001) -> 1001/1001
2575 OXM: OXM_OF_VLAN_VID_W(1001/1001) -> 1001/1001,--
2576 OF1.0: 0001/0,00/1 -> 1001/1fff
2577 OF1.1: 0001/0,00/1 -> 1001/1fff
2581 AT_CHECK([ovs-ofctl check-vlan 3000 3000], [0], [dnl
2582 vlan_tci=0x3000/0x3000 -> 3000/3000
2583 NXM: NXM_OF_VLAN_TCI_W(3000/3000) -> 3000/3000
2584 OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) -> 1000/1000,01
2585 OF1.0: 0000/1,01/0 -> 3000/f000
2586 OF1.1: fffe/0,01/0 -> 3000/f000
2591 dnl Check that "-F openflow10" rejects a flow_mod with unsupported features,
2592 dnl such as tunnels and metadata.
2593 AT_SETUP([ovs-ofctl -F option and NXM features])
2594 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
2595 [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
2597 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop],
2598 [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10)
2602 dnl Check that "-F nxm" really forces add-flow to use the NXM flow format.
2603 dnl (If it doesn't, then either the tun_id won't show up at all, or it will
2604 dnl additionally show up as the top 32 bits of the cookie.) This checks
2605 dnl for regression against bug #4566.
2606 AT_SETUP([ovs-ofctl -F option with flow_mods])
2608 AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop])
2609 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
2611 tun_id=0x12345678 actions=drop
2616 dnl Check that "-F openflow10" is really honored on dump-flows.
2617 dnl (If it isn't, then dump-flows will show the register match.)
2618 AT_SETUP([ovs-ofctl dump-flows honors -F option])
2620 AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop])
2621 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl
2628 dnl Check that "-F openflow10" fails on dump-flows if the requested match
2629 dnl can't be represented in OpenFlow 1.0.
2630 AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
2632 AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
2633 [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
2638 dnl Check that add-flow reports non-normalized flows (feature #5029).
2639 AT_SETUP([ovs-ofctl add-flow reports non-normalized flows])
2641 AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5],
2643 ofp_util|INFO|normalization changed ofp_match, details:
2644 ofp_util|INFO| pre: nw_src=1.2.3.4
2645 ofp_util|INFO|post: @&t@
2650 dnl Check that --sort and --rsort works with dump-flows
2651 dnl Default field is 'priority'. Flow entries are displayed based
2652 dnl on field to sort.
2653 AT_SETUP([ovs-ofctl dump-flows with sorting])
2656 AT_DATA([allflows.txt], [[
2657 priority=4,in_port=23213 actions=output:42
2658 priority=5,in_port=1029 actions=output:43
2659 priority=7,in_port=1029 actions=output:43
2660 priority=3,in_port=1028 actions=output:44
2661 priority=1,in_port=1026 actions=output:45
2662 priority=6,in_port=1027 actions=output:64
2663 priority=2,in_port=1025 actions=output:47
2664 priority=8,tcp,tp_src=5 actions=drop
2665 priority=9,tcp,tp_src=6 actions=drop
2666 priority=10,tun_metadata0=0xab actions=drop
2667 priority=11,tun_metadata0=0xcd actions=drop
2670 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"])
2671 AT_CHECK([ovs-ofctl add-flows br0 allflows.txt
2674 AT_CHECK([ovs-ofctl --sort dump-flows br0 | ofctl_strip], [0], [dnl
2675 priority=1,in_port=1026 actions=output:45
2676 priority=2,in_port=1025 actions=output:47
2677 priority=3,in_port=1028 actions=output:44
2678 priority=4,in_port=23213 actions=output:42
2679 priority=5,in_port=1029 actions=output:43
2680 priority=6,in_port=1027 actions=output:64
2681 priority=7,in_port=1029 actions=output:43
2682 priority=8,tcp,tp_src=5 actions=drop
2683 priority=9,tcp,tp_src=6 actions=drop
2684 priority=10,tun_metadata0=0xab actions=drop
2685 priority=11,tun_metadata0=0xcd actions=drop
2687 AT_CHECK([ovs-ofctl --rsort dump-flows br0 | ofctl_strip], [0], [dnl
2688 priority=11,tun_metadata0=0xcd actions=drop
2689 priority=10,tun_metadata0=0xab actions=drop
2690 priority=9,tcp,tp_src=6 actions=drop
2691 priority=8,tcp,tp_src=5 actions=drop
2692 priority=7,in_port=1029 actions=output:43
2693 priority=6,in_port=1027 actions=output:64
2694 priority=5,in_port=1029 actions=output:43
2695 priority=4,in_port=23213 actions=output:42
2696 priority=3,in_port=1028 actions=output:44
2697 priority=2,in_port=1025 actions=output:47
2698 priority=1,in_port=1026 actions=output:45
2700 AT_CHECK([ovs-ofctl --sort=in_port dump-flows br0 | ofctl_strip], [0], [dnl
2701 priority=2,in_port=1025 actions=output:47
2702 priority=1,in_port=1026 actions=output:45
2703 priority=6,in_port=1027 actions=output:64
2704 priority=3,in_port=1028 actions=output:44
2705 priority=7,in_port=1029 actions=output:43
2706 priority=5,in_port=1029 actions=output:43
2707 priority=4,in_port=23213 actions=output:42
2708 priority=11,tun_metadata0=0xcd actions=drop
2709 priority=10,tun_metadata0=0xab actions=drop
2710 priority=9,tcp,tp_src=6 actions=drop
2711 priority=8,tcp,tp_src=5 actions=drop
2713 AT_CHECK([ovs-ofctl --rsort=in_port dump-flows br0 | ofctl_strip], [0], [dnl
2714 priority=4,in_port=23213 actions=output:42
2715 priority=7,in_port=1029 actions=output:43
2716 priority=5,in_port=1029 actions=output:43
2717 priority=3,in_port=1028 actions=output:44
2718 priority=6,in_port=1027 actions=output:64
2719 priority=1,in_port=1026 actions=output:45
2720 priority=2,in_port=1025 actions=output:47
2721 priority=11,tun_metadata0=0xcd actions=drop
2722 priority=10,tun_metadata0=0xab actions=drop
2723 priority=9,tcp,tp_src=6 actions=drop
2724 priority=8,tcp,tp_src=5 actions=drop
2726 AT_CHECK([ovs-ofctl --sort=tcp_src dump-flows br0 | ofctl_strip], [0], [dnl
2727 priority=8,tcp,tp_src=5 actions=drop
2728 priority=9,tcp,tp_src=6 actions=drop
2729 priority=11,tun_metadata0=0xcd actions=drop
2730 priority=10,tun_metadata0=0xab actions=drop
2731 priority=7,in_port=1029 actions=output:43
2732 priority=6,in_port=1027 actions=output:64
2733 priority=5,in_port=1029 actions=output:43
2734 priority=4,in_port=23213 actions=output:42
2735 priority=3,in_port=1028 actions=output:44
2736 priority=2,in_port=1025 actions=output:47
2737 priority=1,in_port=1026 actions=output:45
2740 [ovs-ofctl --sort=in_port --sort=tcp_src --sort=tun_metadata0 dump-flows br0 | ofctl_strip], [0],
2741 [ priority=2,in_port=1025 actions=output:47
2742 priority=1,in_port=1026 actions=output:45
2743 priority=6,in_port=1027 actions=output:64
2744 priority=3,in_port=1028 actions=output:44
2745 priority=7,in_port=1029 actions=output:43
2746 priority=5,in_port=1029 actions=output:43
2747 priority=4,in_port=23213 actions=output:42
2748 priority=8,tcp,tp_src=5 actions=drop
2749 priority=9,tcp,tp_src=6 actions=drop
2750 priority=10,tun_metadata0=0xab actions=drop
2751 priority=11,tun_metadata0=0xcd actions=drop
2756 AT_SETUP([ovs-ofctl diff-flows])
2759 # Add tons of flows to br0.
2760 for i in `seq 0 1023`; do echo "dl_vlan=$i,actions=drop"; done > add-flows.txt
2761 AT_CHECK([ovs-ofctl add-flows br0 add-flows.txt])
2763 # Dump them and compare against what we expect by hand, then with diff-flows.
2764 for i in `seq 0 1023`; do echo " dl_vlan=$i actions=drop"; done | sort > expout
2765 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/NXST_FLOW/d' | sort],
2767 AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt])
2769 # Remove even-numbered flows, compare again.
2770 for i in `seq 0 1023 2`; do echo "dl_vlan=$i"; done > del-flows.txt
2771 AT_CHECK([ovs-ofctl del-flows br0 - < del-flows.txt])
2772 for i in `seq 0 1023 2`; do echo "+dl_vlan=$i actions=drop"; done | sort > expout
2773 AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt | sort], [0], [expout])
2774 for i in `seq 0 1023 2`; do echo "-dl_vlan=$i actions=drop"; done | sort > expout
2775 AT_CHECK([ovs-ofctl diff-flows add-flows.txt br0 | sort], [0], [expout])
2780 AT_SETUP([ovs-ofctl diff-flows - tunnel metadata])
2783 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0,{class=0xffff,type=1,len=8}->tun_metadata1"])
2785 # Tunnel metadata requires dynamic allocation of space in the metadata table.
2786 # To stress this, try flows with different sizes for metadata, in different
2787 # orders, and interspersed with other fields to see if they still compare
2789 AT_DATA([flows.txt], [dnl
2790 priority=0,tun_metadata0=0,actions=drop
2791 priority=1,tun_metadata1=0xef/0xff,tun_metadata0=0xabcd,actions=drop
2792 priority=2,tun_metadata0=0xffffffff,actions=drop
2795 AT_DATA([flows2.txt], [dnl
2796 priority=2,tun_metadata0=0xffffffff,actions=drop
2797 priority=0,tun_metadata0=0,actions=drop
2800 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2801 AT_CHECK([ovs-ofctl diff-flows br0 flows2.txt], [2], [dnl
2802 -priority=1,tun_metadata0=0xabcd,tun_metadata1=0xef/0xff actions=drop
2808 dnl ofpacts that differ bytewise don't necessarily differ when
2809 dnl converted to another representation, such as OpenFlow 1.0
2810 dnl or to a string. "resubmit(,1)" is an example of an action
2811 dnl of this type: "ofpact_resubmit"s can differ in their "compat"
2812 dnl values even though this doesn't affect the string format.
2814 dnl This test checks that "ovs-ofctl diff-flows" doesn't report
2815 dnl false ofpacts differences.
2816 AT_SETUP([ovs-ofctl diff-flows - suppress false differences])
2818 AT_DATA([flows.txt], [actions=resubmit(,1)
2820 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2821 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
2822 AT_CHECK([ovs-ofctl add-flow br0 idle_timeout=60,dl_vlan=9,actions=output:1])
2823 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt], [2], [dnl
2824 -dl_vlan=9 idle_timeout=60 actions=output:1
2826 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=120,cookie=1234,dl_vlan=9,actions=output:1])
2827 AT_CHECK([ovs-ofctl diff-flows flows.txt br0], [2], [dnl
2828 +dl_vlan=9 cookie=0x4d2 hard_timeout=120 actions=output:1
2833 AT_SETUP([ovs-ofctl -F and -O interaction])
2834 AT_CHECK([ovs-ofctl -F oxm -O openflow10], [1], [],
2835 [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.)
2837 AT_CHECK([ovs-ofctl -F oxm -O openflow11], [1], [],
2838 [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.)
2840 AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow11], [1], [],
2841 [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.)
2843 AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow12], [1], [],
2844 [ovs-ofctl: missing command name; use --help for help
2846 AT_CHECK([ovs-ofctl -F oxm -O openflow12], [1], [],
2847 [ovs-ofctl: missing command name; use --help for help
2849 AT_CHECK([ovs-ofctl -F oxm -O openflow13], [1], [],
2850 [ovs-ofctl: missing command name; use --help for help
2854 AT_SETUP([ovs-ofctl ofp-parse])
2855 # Test the echo request/reply messages (0 payload).
2856 AT_CHECK([printf '\1\2\0\10\0\0\0\0\1\3\0\10\0\0\0\0' > binary_ofp_msg])
2857 AT_CHECK([ovs-ofctl ofp-parse binary_ofp_msg], [0], [dnl
2858 OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload
2859 OFPT_ECHO_REPLY (xid=0x0): 0 bytes of payload
2862 # Test the hello (xid:1 3-byte payload).
2863 AT_CHECK([printf '\1\0\0\13\0\0\0\1\101\102\103' > binary_ofp_msg])
2864 AT_CHECK([ovs-ofctl ofp-parse - < binary_ofp_msg], [0], [dnl
2865 OFPT_HELLO (xid=0x1):
2866 version bitmap: 0x01
2867 unknown data in hello:
2868 00000000 01 00 00 0b 00 00 00 01-41 42 43 |........ABC |
2872 AT_SETUP([tcp flags - filtering])
2873 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \
2874 -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2])
2875 AT_DATA([flows.txt], [dnl
2876 in_port=1,tcp,tp_dst=80,tcp_flags=+syn-rst-ack-fin,action=2 # Allow outbound web traffic bare-SYN
2877 in_port=1,tcp,tp_dst=80,tcp_flags=+ack,action=2 # Allow outbound web traffic with ACK bit
2878 in_port=1,tcp,tp_dst=80,tcp_flags=+rst,action=2 # Allow outbound web traffic with RST bit
2879 in_port=2,tcp,tp_src=80,tcp_flags=+ack,action=1 # Allow inbound web traffic with ACK bit
2880 in_port=2,tcp,tp_src=80,tcp_flags=+rst,action=1 # Allow inbound web traffic with RST bit
2881 priority=0,in_port=1,action=drop # Default drop outbound
2882 priority=0,in_port=2,action=drop # Default drop inbound
2885 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2887 AT_CHECK([ovs-ofctl add-flow br0 "tcp,tcp_flags=+ack-ack,action="], [1], [],
2888 [ovs-ofctl: ack: Each TCP flag can be specified only once
2891 AT_CHECK([ovs-appctl dpif/show | tail -n +4], [0], [dnl
2896 dnl Outbound web traffic with bare-SYN
2897 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])
2898 AT_CHECK([tail -1 stdout], [0],
2899 [Datapath actions: 2
2902 dnl Outbopund web traffic with ACK bit
2903 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])
2904 AT_CHECK([tail -1 stdout], [0],
2905 [Datapath actions: 2
2908 dnl Outbound web traffic with RST bit
2909 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])
2910 AT_CHECK([tail -1 stdout], [0],
2911 [Datapath actions: 2
2914 dnl Inbound web traffic with ACK bit
2915 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])
2916 AT_CHECK([tail -1 stdout], [0],
2917 [Datapath actions: 1
2920 dnl Inbound web traffic with RST bit
2921 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])
2922 AT_CHECK([tail -1 stdout], [0],
2923 [Datapath actions: 1
2926 dnl Inbound web traffic with SYN bit without ACK or RST bits
2927 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])
2928 AT_CHECK([tail -1 stdout], [0],
2929 [Datapath actions: drop
2935 dnl Check importance parameter added in OF1.4.
2936 dnl It validates whether importance set via add-flow via OpenFlow1.4+ gets
2937 dnl set or not by validating it against the dump-flows output via OpenFlow1.4+
2938 dnl If add-flow or dump-flows is used with later version of OpenFlow prior to 1.4+
2939 dnl then the importance will be considered zero whether provided as an argument.
2941 AT_SETUP([ovs-ofctl rule with importance])
2943 dnl Flow with importance parameter added via OF1.4+ and later version
2944 AT_CHECK([ovs-ofctl -O OpenFlow14 add-flow br0 priority=21,importance=21,actions=normal])
2945 AT_CHECK([ovs-ofctl add-flow br0 priority=22,importance=22,actions=normal])
2947 dnl Importance parameter will only be visible of flows that are added via OF1.4+ if dumped via OF1.4+
2948 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl
2949 importance=21, priority=21 actions=NORMAL
2950 reset_counts priority=22 actions=NORMAL
2953 dnl Importance parameter will not be visible if flow is dumped with previous version prior to OF1.4+ whether added via OF1.4+
2954 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl
2955 priority=21 actions=NORMAL
2956 priority=22 actions=NORMAL
2963 dnl Importance parameter added in OF1.4.
2964 dnl This validates whether flows with importance
2965 dnl parameter are getting replaced with "replace-flows" or
2966 dnl not by validating dump-flows output after replace with the expected output.
2968 AT_SETUP([ovs-ofctl replace-flows with importance])
2971 dnl Add flows to br0 with importance via OF1.4+. For more details refer "ovs-ofctl rule with importance" test case.
2972 for i in 1 2 3 4 5 6 7 8; do echo "dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt
2973 AT_CHECK([ovs-ofctl -O OpenFlow14 add-flows br0 add-flows.txt])
2975 dnl Replace the flows in the bridge.
2976 for i in 1 3 5 7; do echo " importance=`expr $i + 10`, dl_vlan=$i actions=drop"; done > replace-flows.txt
2977 AT_CHECK([ovs-ofctl -O OpenFlow14 replace-flows br0 replace-flows.txt])
2979 dnl Dump them and compare the dump flows output against the expected output.
2980 cat replace-flows.txt > expout
2981 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort],
2987 AT_SETUP([ovs-ofctl replace-flows with --bundle])
2990 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
2992 dnl Add flows to br0 with importance via OF1.4+, using an OF1.4+ bundle. For more details refer "ovs-ofctl rule with importance" test case.
2993 for i in 1 2 3 4 5 6 7 8; do echo "table=$i,dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt
2994 AT_CHECK([ovs-ofctl --bundle add-flows br0 add-flows.txt])
2996 dnl Replace some flows in the bridge.
2997 for i in 1 3 5 7; do echo " table=$i, importance=`expr $i + 10`, dl_vlan=$i actions=drop"; done > replace-flows.txt
2998 AT_CHECK([ovs-ofctl --bundle replace-flows br0 replace-flows.txt])
3000 dnl Dump them and compare the dump flows output against the expected output.
3001 cat replace-flows.txt > expout
3002 AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort],
3005 dnl Check logs for OpenFlow trace
3007 OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): OFPST_FLOW reply" | wc -l` -ge 2])
3008 # AT_CHECK([sed -n "s/^.*\(|vconn|DBG|.*xid=.*:\).*$/\1/p" ovs-vswitchd.log], [0], [dnl
3009 AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
3010 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
3011 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
3012 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3013 version bitmap: 0x05
3014 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05)
3015 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3016 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
3017 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3018 bundle_id=0 type=OPEN_REPLY flags=0
3019 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3020 bundle_id=0 flags=atomic ordered
3021 OFPT_FLOW_MOD (OF1.4): ADD table:1 dl_vlan=1 importance:1 actions=drop
3022 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3023 bundle_id=0 flags=atomic ordered
3024 OFPT_FLOW_MOD (OF1.4): ADD table:2 dl_vlan=2 importance:2 actions=drop
3025 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3026 bundle_id=0 flags=atomic ordered
3027 OFPT_FLOW_MOD (OF1.4): ADD table:3 dl_vlan=3 importance:3 actions=drop
3028 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3029 bundle_id=0 flags=atomic ordered
3030 OFPT_FLOW_MOD (OF1.4): ADD table:4 dl_vlan=4 importance:4 actions=drop
3031 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3032 bundle_id=0 flags=atomic ordered
3033 OFPT_FLOW_MOD (OF1.4): ADD table:5 dl_vlan=5 importance:5 actions=drop
3034 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3035 bundle_id=0 flags=atomic ordered
3036 OFPT_FLOW_MOD (OF1.4): ADD table:6 dl_vlan=6 importance:6 actions=drop
3037 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3038 bundle_id=0 flags=atomic ordered
3039 OFPT_FLOW_MOD (OF1.4): ADD table:7 dl_vlan=7 importance:7 actions=drop
3040 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3041 bundle_id=0 flags=atomic ordered
3042 OFPT_FLOW_MOD (OF1.4): ADD table:8 dl_vlan=8 importance:8 actions=drop
3043 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
3044 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
3045 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3046 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
3047 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3048 bundle_id=0 type=COMMIT_REPLY flags=0
3049 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
3050 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
3051 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3052 version bitmap: 0x05
3053 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05)
3054 vconn|DBG|unix: received: OFPST_FLOW request (OF1.4):
3055 vconn|DBG|unix: sent (Success): OFPST_FLOW reply (OF1.4):
3056 table=1, importance=1, dl_vlan=1 actions=drop
3057 table=2, importance=2, dl_vlan=2 actions=drop
3058 table=3, importance=3, dl_vlan=3 actions=drop
3059 table=4, importance=4, dl_vlan=4 actions=drop
3060 table=5, importance=5, dl_vlan=5 actions=drop
3061 table=6, importance=6, dl_vlan=6 actions=drop
3062 table=7, importance=7, dl_vlan=7 actions=drop
3063 table=8, importance=8, dl_vlan=8 actions=drop
3064 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3065 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
3066 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3067 bundle_id=0 type=OPEN_REPLY flags=0
3068 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3069 bundle_id=0 flags=atomic ordered
3070 OFPT_FLOW_MOD (OF1.4): ADD table:1 dl_vlan=1 importance:11 actions=drop
3071 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3072 bundle_id=0 flags=atomic ordered
3073 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:2 dl_vlan=2 actions=drop
3074 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3075 bundle_id=0 flags=atomic ordered
3076 OFPT_FLOW_MOD (OF1.4): ADD table:3 dl_vlan=3 importance:13 actions=drop
3077 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3078 bundle_id=0 flags=atomic ordered
3079 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:4 dl_vlan=4 actions=drop
3080 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3081 bundle_id=0 flags=atomic ordered
3082 OFPT_FLOW_MOD (OF1.4): ADD table:5 dl_vlan=5 importance:15 actions=drop
3083 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3084 bundle_id=0 flags=atomic ordered
3085 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:6 dl_vlan=6 actions=drop
3086 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3087 bundle_id=0 flags=atomic ordered
3088 OFPT_FLOW_MOD (OF1.4): ADD table:7 dl_vlan=7 importance:17 actions=drop
3089 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3090 bundle_id=0 flags=atomic ordered
3091 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:8 dl_vlan=8 actions=drop
3092 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
3093 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
3094 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3095 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
3096 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3097 bundle_id=0 type=COMMIT_REPLY flags=0
3098 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.6):
3099 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
3100 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3101 version bitmap: 0x05
3102 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x07 and earlier, peer supports version 0x05)
3103 vconn|DBG|unix: received: OFPST_FLOW request (OF1.4):
3104 vconn|DBG|unix: sent (Success): OFPST_FLOW reply (OF1.4):
3105 table=1, importance=11, dl_vlan=1 actions=drop
3106 table=3, importance=13, dl_vlan=3 actions=drop
3107 table=5, importance=15, dl_vlan=5 actions=drop
3108 table=7, importance=17, dl_vlan=7 actions=drop
3115 AT_SETUP([ovs-ofctl ct-flush-zone])
3118 AT_CHECK([ovs-appctl vlog/set ct_dpif:dbg])
3119 AT_CHECK([ovs-ofctl ct-flush-zone br0 123])
3121 OVS_WAIT_UNTIL([grep -q "|ct_dpif|DBG|.*ct_flush:" ovs-vswitchd.log])
3122 AT_CHECK([grep -q "ct_dpif|DBG|.*ct_flush: 123" ovs-vswitchd.log])