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