]> git.proxmox.com Git - ovs.git/blame - tests/ovs-ofctl.at
Fix ovs-dpctl-top by removing 3 wrong hunks in py3-compat.patch.
[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' \
847b8b02
JP
44 'reg8=8/1 NXM,OXM' \
45 'reg8=8 NXM,OXM' \
46 'reg9=9/1 NXM,OXM' \
47 'reg9=9 NXM,OXM' \
48 'reg10=10 NXM,OXM' \
49 'reg10=10/1 NXM,OXM' \
50 'reg11=11 NXM,OXM' \
51 'reg11=11/1 NXM,OXM' \
52 'reg12=12 NXM,OXM' \
53 'reg12=12/1 NXM,OXM' \
54 'reg13=13 NXM,OXM' \
55 'reg13=13/1 NXM,OXM' \
56 'reg14=14 NXM,OXM' \
57 'reg14=14/1 NXM,OXM' \
79fe0f46
BP
58 'xreg0=0 NXM,OXM' \
59 'xreg0=0/1 NXM,OXM' \
60 'xreg1=1 NXM,OXM' \
61 'xreg1=1/1 NXM,OXM' \
62 'xreg2=2 NXM,OXM' \
63 'xreg2=2/3 NXM,OXM' \
64 'xreg3=3 NXM,OXM' \
65 'xreg3=3/5 NXM,OXM' \
847b8b02
JP
66 'xreg4=4 NXM,OXM' \
67 'xreg4=4/1 NXM,OXM' \
68 'xreg5=5 NXM,OXM' \
69 'xreg5=5/1 NXM,OXM' \
70 'xreg6=6 NXM,OXM' \
71 'xreg6=6/1 NXM,OXM' \
72 'xreg7=7 NXM,OXM' \
73 'xreg7=7/1 NXM,OXM' \
b23ada8e
JP
74 'xxreg0=0 NXM,OXM' \
75 'xxreg0=0/1 NXM,OXM' \
76 'xxreg1=1 NXM,OXM' \
77 'xxreg1=1/1 NXM,OXM' \
78 'xxreg2=2 NXM,OXM' \
79 'xxreg2=2/1 NXM,OXM' \
80 'xxreg3=3 NXM,OXM' \
81 'xxreg3=3/1 NXM,OXM' \
21b2fa61
JR
82 'xxreg3[[0..0]]=1 NXM,OXM' \
83 'xxreg3[[126..127]]=3 NXM,OXM' \
84 'reg3[[]]=3 NXM,OXM' \
aa233d57
BP
85 'dl_src=00:11:22:33:44:55 any' \
86 'dl_src=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \
87 'dl_dst=00:11:22:33:44:55 any' \
88 'dl_dst=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \
89 'dl_type=0x1234 any' \
90 'dl_type=0x0800 any' \
91 'dl_type=0x0806 any' \
92 'dl_type=0x86dd any' \
93 'vlan_tci=0 any' \
94 'vlan_tci=0x1009 any' \
95 'vlan_tci=0x1009/0x1 NXM,OXM' \
96 'dl_vlan=9 any' \
97 'vlan_vid=11 any' \
98 'vlan_vid=11/0x1 NXM,OXM' \
99 'dl_vlan_pcp=6 any' \
100 'vlan_pcp=5 any' \
101 'mpls,mpls_label=5 NXM,OXM,OpenFlow11' \
102 'mpls,mpls_tc=1 NXM,OXM,OpenFlow11' \
103 'mpls,mpls_bos=0 NXM,OXM' \
0062a04d 104 'mpls,mpls_ttl=5 NXM,OXM' \
aa233d57
BP
105 'ip,ip_src=1.2.3.4 any' \
106 'ip,ip_src=192.168.0.0/24 any' \
107 'ip,ip_src=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \
108 'ip,ip_dst=1.2.3.4 any' \
109 'ip,ip_dst=192.168.0.0/24 any' \
110 'ip,ip_dst=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \
111 'ipv6,ipv6_src=::1 NXM,OXM' \
ccad219b 112 'ipv6,ipv6_src=0:0:0:0:0:0:0:1/::1 NXM,OXM' \
aa233d57 113 'ipv6,ipv6_dst=::1 NXM,OXM' \
ccad219b 114 'ipv6,ipv6_dst=0:0:0:0:0:0:0:1/::1 NXM,OXM' \
aa233d57
BP
115 'ipv6,ipv6_label=5 NXM,OXM' \
116 'ipv6,ipv6_label=5/1 NXM,OXM' \
117 'ip,nw_proto=1 any' \
118 'ipv6,nw_proto=1 NXM,OXM' \
119 'ip,nw_tos=0xf0 any' \
120 'ipv6,nw_tos=0xf0 NXM,OXM' \
121 'ip,ip_dscp=0x3c any' \
122 'ipv6,ip_dscp=0x3c NXM,OXM' \
1a1e1a49 123 'ip,nw_ecn=1 NXM,OXM,OpenFlow11' \
aa233d57
BP
124 'ipv6,nw_ecn=1 NXM,OXM' \
125 'ip,nw_ttl=5 NXM,OXM' \
126 'ipv6,nw_ttl=5 NXM,OXM' \
127 'ip,ip_frag=no NXM,OXM' \
128 'ipv6,ip_frag=no NXM,OXM' \
129 'arp,arp_op=0 any' \
130 'arp,arp_spa=1.2.3.4 any' \
131 'arp,arp_spa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \
132 'arp,arp_tpa=1.2.3.4 any' \
133 'arp,arp_tpa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \
134 'arp,arp_sha=00:11:22:33:44:55 NXM,OXM' \
135 'arp,arp_sha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \
136 'arp,arp_tha=00:11:22:33:44:55 NXM,OXM' \
137 'arp,arp_tha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \
138 'tcp,tcp_src=80 any' \
139 'tcp,tcp_src=0x1000/0x1000 NXM,OXM' \
140 'tcp6,tcp_src=80 NXM,OXM' \
141 'tcp6,tcp_src=0x1000/0x1000 NXM,OXM' \
142 'tcp,tcp_dst=80 any' \
143 'tcp,tcp_dst=0x1000/0x1000 NXM,OXM' \
144 'tcp6,tcp_dst=80 NXM,OXM' \
145 'tcp6,tcp_dst=0x1000/0x1000 NXM,OXM' \
146 'udp,udp_src=80 any' \
147 'udp,udp_src=0x1000/0x1000 NXM,OXM' \
148 'udp6,udp_src=80 NXM,OXM' \
149 'udp6,udp_src=0x1000/0x1000 NXM,OXM' \
150 'udp,udp_dst=80 any' \
151 'udp,udp_dst=0x1000/0x1000 NXM,OXM' \
152 'udp6,udp_dst=80 NXM,OXM' \
153 'udp6,udp_dst=0x1000/0x1000 NXM,OXM' \
21b2fa61 154 'udp6,udp_dst[[12]]=1 NXM,OXM' \
aa233d57
BP
155 'icmp,icmp_type=1 any' \
156 'icmp,icmp_code=2 any' \
157 'icmp6,icmpv6_type=1 NXM,OXM' \
07659514
JS
158 'icmp6,icmpv6_code=2 NXM,OXM' \
159 'ct_state=+trk NXM,OXM' \
8e53fe8c 160 'ct_zone=0 NXM,OXM' \
9daf2348
JS
161 'ct_mark=0 NXM,OXM' \
162 'ct_label=0 NXM,OXM' \
163 'ct_label=0x1234567890ABCDEF12345678 NXM,OXM'
340c7bb2
BP
164do
165 set $test_case
166 echo
167 echo "### test case: '$1' should have usable protocols '$2'"
168 if test "$2" = none; then
169 AT_CHECK([ovs-ofctl parse-flow "$1,actions=drop"], [1],
a805558c 170 [dnl
340c7bb2 171],
a805558c 172 [ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
340c7bb2
BP
173])
174 else
175 AT_CHECK_UNQUOTED([ovs-ofctl parse-flow "$1,actions=drop" | sed 1q], [0],
176 [usable protocols: $2
177])
178 fi
179done
180AT_CLEANUP
181
27527aa0
BP
182AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.0)])
183AT_DATA([flows.txt], [[
184# comment
19ba1422 185tcp,tp_src=123,actions=flood
27527aa0
BP
186in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
187udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
188tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
189udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
190cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
191actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
4b684612 192ip,actions=set_field:10.4.3.77->ip_src,mod_nw_ecn:2
db0b6c29
JR
193sctp actions=drop
194sctp actions=drop
e3432ee9 195in_port=0 actions=resubmit:0
29089a54 196actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
4930ea56 197actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,ingress)
f69f713b 198actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
4930ea56 199actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789,egress)
ed26e3ea
JR
200ip,actions=ct(nat)
201ip,actions=ct(commit,nat(dst))
202ip,actions=ct(commit,nat(src))
203ip,actions=ct(commit,nat(src=10.0.0.240,random))
204ip,actions=ct(commit,nat(src=10.0.0.240:32768-65535,random))
205ip,actions=ct(commit,nat(dst=10.0.0.128-10.0.0.254,hash))
206ip,actions=ct(commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent))
207ipv6,actions=ct(commit,nat(src=fe80::20c:29ff:fe88:a18b,random))
208ipv6,actions=ct(commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random))
209ipv6,actions=ct(commit,nat(src=[fe80::20c:29ff:fe88:1]-[fe80::20c:29ff:fe88:a18b]:255-4096,random))
210tcp,actions=ct(commit,nat(src=10.1.1.240-10.1.1.255),alg=ftp)
7df14f8b 211actions=in_port,output:in_port
27527aa0
BP
212]])
213
214AT_CHECK([ovs-ofctl parse-flows flows.txt
215], [0], [stdout])
216AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
ed26e3ea 217[[usable protocols: any
27527aa0 218chosen protocol: OpenFlow10-table_id
19ba1422 219OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
576ec803 220OFPT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
27527aa0
BP
221OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
222OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
223OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
224OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
225OFPT_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
4b684612 226OFPT_FLOW_MOD: ADD ip actions=mod_nw_src:10.4.3.77,load:0x2->NXM_NX_IP_ECN[]
db0b6c29
JR
227OFPT_FLOW_MOD: ADD sctp actions=drop
228OFPT_FLOW_MOD: ADD sctp actions=drop
e3432ee9 229OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0
29089a54 230OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
4930ea56 231OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,ingress)
f69f713b 232OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
4930ea56 233OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789,egress)
ed26e3ea
JR
234OFPT_FLOW_MOD: ADD ip actions=ct(nat)
235OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(dst))
236OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(src))
237OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(src=10.0.0.240,random))
238OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(src=10.0.0.240:32768-65535,random))
239OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(dst=10.0.0.128-10.0.0.254,hash))
240OFPT_FLOW_MOD: ADD ip actions=ct(commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent))
241OFPT_FLOW_MOD: ADD ipv6 actions=ct(commit,nat(src=fe80::20c:29ff:fe88:a18b,random))
242OFPT_FLOW_MOD: ADD ipv6 actions=ct(commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random))
243OFPT_FLOW_MOD: ADD ipv6 actions=ct(commit,nat(src=[fe80::20c:29ff:fe88:1]-[fe80::20c:29ff:fe88:a18b]:255-4096,random))
244OFPT_FLOW_MOD: ADD tcp actions=ct(commit,nat(src=10.1.1.240-10.1.1.255),alg=ftp)
7df14f8b 245OFPT_FLOW_MOD: ADD actions=IN_PORT,IN_PORT
f0992bed
SH
246]])
247AT_CLEANUP
248
ff14eb7a
JR
249AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.1)])
250AT_DATA([flows.txt], [[
251# comment
19ba1422 252tcp,tp_src=123,actions=flood
ff14eb7a
JR
253in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
254udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
255tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
256udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1
257cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
258actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
0c20dbe4 259ip,actions=mod_nw_ttl:1,set_field:10.4.3.77->ip_src
ff14eb7a
JR
260sctp actions=drop
261sctp actions=drop
262in_port=0 actions=resubmit:0
263actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 264actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
ff14eb7a
JR
265]])
266
267AT_CHECK([ovs-ofctl --protocols OpenFlow11 parse-flows flows.txt
268], [0], [stdout])
269AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
aa233d57 270[[usable protocols: any
ff14eb7a 271chosen protocol: OpenFlow11
19ba1422 272OFPT_FLOW_MOD (OF1.1): ADD tcp,tp_src=123 actions=FLOOD
0e197060
BP
273OFPT_FLOW_MOD (OF1.1): ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
274OFPT_FLOW_MOD (OF1.1): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0
275OFPT_FLOW_MOD (OF1.1): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
276OFPT_FLOW_MOD (OF1.1): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1
277OFPT_FLOW_MOD (OF1.1): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
278OFPT_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
279OFPT_FLOW_MOD (OF1.1): ADD ip actions=mod_nw_ttl:1,mod_nw_src:10.4.3.77
280OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop
281OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop
282OFPT_FLOW_MOD (OF1.1): ADD in_port=0 actions=resubmit:0
283OFPT_FLOW_MOD (OF1.1): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 284OFPT_FLOW_MOD (OF1.1): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
ff14eb7a
JR
285]])
286AT_CLEANUP
287
f0992bed
SH
288AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.2)])
289AT_DATA([flows.txt], [[
290# comment
70bd4e6d
JR
291tcp,tp_src[5]=1,actions=flood
292tcp,tp_src[6..10]=19,actions=flood
f0992bed 293tcp,tp_src=123,actions=flood
1e7db674 294in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=mod_vlan_vid:7,mod_vlan_pcp:2
f0992bed
SH
295udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
296tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
297udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
298cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
299actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
b019d34d 300ipv6,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
0d56eaf2
JS
301sctp actions=set_field:3334->sctp_src
302sctp actions=set_field:4445->sctp_dst
1e7db674
JR
303tcp actions=mod_tp_dst:1234
304udp actions=mod_tp_src:1111
305ip 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
306in_port=0 actions=mod_dl_src:11:22:33:44:55:66,mod_dl_dst:10:20:30:40:50:60
f0992bed 307in_port=0 actions=resubmit:0
29089a54 308actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 309actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
f0992bed
SH
310]])
311
312AT_CHECK([ovs-ofctl --protocols OpenFlow12 parse-flows flows.txt
313], [0], [stdout])
314AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
aa233d57 315[[usable protocols: NXM,OXM
f0992bed 316chosen protocol: OXM-OpenFlow12
70bd4e6d
JR
317OFPT_FLOW_MOD (OF1.2): ADD tcp,tp_src=0x20/0x20 actions=FLOOD
318OFPT_FLOW_MOD (OF1.2): ADD tcp,tp_src=0x4c0/0x7c0 actions=FLOOD
0e197060
BP
319OFPT_FLOW_MOD (OF1.2): ADD tcp,tp_src=123 actions=FLOOD
320OFPT_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
321OFPT_FLOW_MOD (OF1.2): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0
322OFPT_FLOW_MOD (OF1.2): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
323OFPT_FLOW_MOD (OF1.2): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
324OFPT_FLOW_MOD (OF1.2): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
325OFPT_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
326OFPT_FLOW_MOD (OF1.2): ADD ipv6 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
327OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:3334->sctp_src
328OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:4445->sctp_dst
329OFPT_FLOW_MOD (OF1.2): ADD tcp actions=set_field:1234->tcp_dst
330OFPT_FLOW_MOD (OF1.2): ADD udp actions=set_field:1111->udp_src
331OFPT_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
332OFPT_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
333OFPT_FLOW_MOD (OF1.2): ADD in_port=0 actions=resubmit:0
334OFPT_FLOW_MOD (OF1.2): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 335OFPT_FLOW_MOD (OF1.2): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
27527aa0
BP
336]])
337AT_CLEANUP
338
3634dff8
BP
339AT_SETUP([ovs-ofctl parse-flow with invalid mask])
340for test_case in \
341 'tun_tos 1/1' \
342 'tun_ttl 1/1' \
343 'skb_priority 1/1' \
344 'eth_type 0x1234/0x1' \
345 'dl_vlan 9/0x1' \
346 'dl_vlan_pcp 6/0x1' \
347 'vlan_pcp 5/0x1' \
348 'mpls mpls_label 5/0x1' \
349 'mpls mpls_tc 1/0x1' \
350 'mpls mpls_bos 1/0x1' \
351 'ip nw_proto 1/1' \
352 'ipv6 nw_proto 1/1' \
353 'ip nw_tos 0xf0/0xf0' \
354 'ipv6 nw_tos 0xf0/0xf0' \
44a7e26d
JR
355 'ip ip_dscp 0x3c/0xf0' \
356 'ipv6 ip_dscp 0x3c/0xf0' \
3634dff8
BP
357 'ip nw_ecn 1/1' \
358 'ipv6 nw_ecn 1/1' \
359 'ip nw_ttl 5/1' \
360 'ipv6 nw_ttl 5/1' \
361 'arp arp_op 0/1' \
362 'icmp icmp_type 1/1' \
363 'icmp icmp_code 2/1' \
364 'icmp6 icmpv6_code 2/1'
365do
366 set $test_case
367 if test $# = 3; then
368 prereq=$1, field=$2 value=$3
369 else
370 prereq= field=$1 value=$2
371 fi
372 AT_CHECK_UNQUOTED([ovs-ofctl parse-flow "$prereq$field=$value,actions=drop"], [1], [],
373[ovs-ofctl: $value: invalid mask for field $field
374])
375done
376AT_CLEANUP
377
8621547c 378AT_SETUP([ovs-ofctl action inconsistency (OpenFlow 1.1)])
50f96b10
BP
379OVS_VSWITCHD_START
380add_of_ports br0 1 2 3
8621547c 381AT_CHECK([ovs-ofctl --protocols OpenFlow11 add-flow br0 'ip actions=mod_tp_dst:1234'
ba2fe8e9 382], [1], [stdout], [ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM) is among the allowed flow formats (OpenFlow11)
8621547c 383])
50f96b10 384OVS_VSWITCHD_STOP
8621547c
JR
385AT_CLEANUP
386
ac923e91 387AT_SETUP([ovs-ofctl parse-flows (skb_priority)])
1b567fb9 388AT_DATA([flows.txt], [[
ac923e91 389skb_priority=0x12341234,tcp,tp_src=123,actions=flood
1b567fb9
AA
390]])
391
392AT_CHECK([ovs-ofctl parse-flows flows.txt
a805558c 393], [1], [dnl
1b567fb9
AA
394], [stderr])
395
396AT_CLEANUP
397
398
27527aa0 399AT_SETUP([ovs-ofctl parse-flows (NXM)])
53ddd40a 400AT_DATA([flows.txt], [[
0e581146
BP
401# comment
402tcp,tp_src=123,actions=flood
403in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
ac923e91 404pkt_mark=0xbb,actions=set_field:0xaa->pkt_mark
0e581146 405udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
eedc0097
JP
406tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
407udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
0e581146 408cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
96fc46e8 409actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
73f33563 410tcp,tp_src=0x1230/0xfff0,tun_id=0x1234,cookie=0x5678,actions=flood
b9298d3f 411actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789
21b2fa61 412actions=multipath(eth_src, 50, hrw, 12, 0, NXM_NX_REG0[0..3]),multipath(symmetric_l4, 1024, iter_hash, 5000, 5050, reg0[0..12])
84ddf96c 413actions=multipath(eth_src, 50, hrw, 12, 0, NXM_NX_REG0[0..3]),multipath(symmetric_l3, 1024, iter_hash, 5000, 5050, reg0[0..12])
6c1491fb 414table=1,actions=drop
8368c090 415tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
7525e578 416metadata=0x1234ffff5678ffff/0xffff0000ffff0000,actions=drop
91fc374a
BP
417actions=bundle(eth_src,50,active_backup,ofport,members:1)
418actions=bundle(symmetric_l4,60,hrw,ofport,members:2,3)
419actions=bundle(symmetric_l4,60,hrw,ofport,members:)
420actions=bundle(symmetric_l3,60,hrw,ofport,members:2,3)
421actions=bundle(symmetric_l3,60,hrw,ofport,members:)
422actions=output:1,bundle(eth_src,0,hrw,ofport,members:1),output:2
423actions=bundle_load(eth_src,50,active_backup,ofport,reg0,members:1)
424actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],members:2,3)
425actions=bundle_load(symmetric_l4,60,hrw,ofport,reg0[0..15],members:[2,3])
426actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],members:)
427actions=bundle_load(symmetric_l3,60,hrw,ofport,NXM_NX_REG0[0..15],members:2,3)
428actions=bundle_load(symmetric_l3,60,hrw,ofport,reg0[0..15],members:[2,3])
429actions=bundle_load(symmetric_l3,60,hrw,ofport,NXM_NX_REG0[0..30],members:)
430actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],members:1),output:2
29901626 431actions=resubmit:1,resubmit(2),resubmit(,3),resubmit(2,3)
21b2fa61 432send_flow_rem,actions=output:1,output:NXM_NX_REG0,output:2,output:reg1[16..31],output:3
a993007b 433check_overlap,actions=output:1,exit,output:2
8621547c 434tcp,actions=fin_timeout(idle_timeout=5,hard_timeout=15)
a7349929 435actions=controller(max_len=123,reason=invalid_ttl,id=555)
29089a54 436actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 437actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
0062a04d 438mpls,mpls_label=5,mpls_tc=1,mpls_ttl=1,mpls_bos=0,actions=drop
07659514 439ip,actions=ct(commit,zone=5)
8e53fe8c 440ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[])))
9daf2348
JS
441ip,actions=ct(commit,exec(load(0x1->NXM_NX_CT_LABEL[])))
442ip,actions=ct(commit,exec(load(0x1234567890ABCDEF->NXM_NX_CT_LABEL[32..95])))
21b2fa61
JR
443ip,actions=ct(commit,exec(load(1->ct_mark)))
444ip,actions=ct(commit,exec(load(0x1->ct_label[])))
445ip,actions=ct(commit,exec(load(0x1234567890ABCDEF->ct_label[32..95])))
9daf2348
JS
446ip,actions=ct(commit,exec(set_field(0x1->ct_label)))
447ip,ct_state=+trk,ct_label=0x1234567890abcdef12345678,actions=ct(commit)
aaca4fe0
WT
448actions=output(max_len=100,port=123)
449actions=output(port=100,max_len=123)
450actions=output(port=LOCAL,max_len=123)
451actions=output(port=IN_PORT,max_len=123)
53ddd40a 452]])
29901626 453
53ddd40a 454AT_CHECK([ovs-ofctl parse-flows flows.txt
f1f41fb6 455], [0], [stdout])
27527aa0 456AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
aa233d57 457[[usable protocols: OXM,NXM+table_id
27527aa0
BP
458chosen protocol: NXM+table_id
459NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD
576ec803 460NXT_FLOW_MOD: ADD table:255 in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
ac923e91 461NXT_FLOW_MOD: ADD table:255 pkt_mark=0xbb actions=load:0xaa->NXM_NX_PKT_MARK[]
27527aa0
BP
462NXT_FLOW_MOD: ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
463NXT_FLOW_MOD: ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
464NXT_FLOW_MOD: ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
465NXT_FLOW_MOD: ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
466NXT_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
467NXT_FLOW_MOD: ADD table:255 tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD
468NXT_FLOW_MOD: ADD table:255 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789
469NXT_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])
84ddf96c 470NXT_FLOW_MOD: ADD table:255 actions=multipath(eth_src,50,hrw,12,0,NXM_NX_REG0[0..3]),multipath(symmetric_l3,1024,iter_hash,5000,5050,NXM_NX_REG0[0..12])
e896c2d4
BP
471NXT_FLOW_MOD: ADD table:1 actions=drop
472NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
7525e578 473NXT_FLOW_MOD: ADD table:255 metadata=0x1234000056780000/0xffff0000ffff0000 actions=drop
91fc374a
BP
474NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,members:1)
475NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,members:2,3)
476NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,members:)
477NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l3,60,hrw,ofport,members:2,3)
478NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l3,60,hrw,ofport,members:)
479NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,members:1),output:2
480NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],members:1)
481NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],members:2,3)
482NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],members:2,3)
483NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],members:)
484NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l3,60,hrw,ofport,NXM_NX_REG0[0..15],members:2,3)
485NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l3,60,hrw,ofport,NXM_NX_REG0[0..15],members:2,3)
486NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l3,60,hrw,ofport,NXM_NX_REG0[0..30],members:)
487NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],members:1),output:2
29901626 488NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3)
a993007b
BP
489NXT_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
490NXT_FLOW_MOD: ADD table:255 check_overlap actions=output:1,exit,output:2
8621547c 491NXT_FLOW_MOD: ADD table:255 tcp actions=fin_timeout(idle_timeout=5,hard_timeout=15)
a7349929 492NXT_FLOW_MOD: ADD table:255 actions=controller(reason=invalid_ttl,max_len=123,id=555)
29089a54 493NXT_FLOW_MOD: ADD table:255 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 494NXT_FLOW_MOD: ADD table:255 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
0062a04d 495NXT_FLOW_MOD: ADD table:255 mpls,mpls_label=5,mpls_tc=1,mpls_ttl=1,mpls_bos=0 actions=drop
07659514 496NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,zone=5)
8e53fe8c 497NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[]))
9daf2348
JS
498NXT_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]))
499NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1234567890abcdef->NXM_NX_CT_LABEL[32..95]))
21b2fa61
JR
500NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[]))
501NXT_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]))
502NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1234567890abcdef->NXM_NX_CT_LABEL[32..95]))
9daf2348
JS
503NXT_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]))
504NXT_FLOW_MOD: ADD table:255 ct_state=+trk,ct_label=0x1234567890abcdef12345678,ip actions=ct(commit)
aaca4fe0
WT
505NXT_FLOW_MOD: ADD table:255 actions=output(port=123,max_len=100)
506NXT_FLOW_MOD: ADD table:255 actions=output(port=100,max_len=123)
50f96b10
BP
507NXT_FLOW_MOD: ADD table:255 actions=output(port=LOCAL,max_len=123)
508NXT_FLOW_MOD: ADD table:255 actions=output(port=IN_PORT,max_len=123)
53ddd40a 509]])
88ca35ee
BP
510AT_CLEANUP
511
512AT_SETUP([ovs-ofctl -F nxm parse-flows])
513AT_DATA([flows.txt], [
514# comment
515tcp,tp_src=123,actions=flood
516in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
bad68a99 517arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
fa8223b7 518ipv6,ipv6_label=0x12345 actions=2
d31f1109
JP
519ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
520ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
521ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
522tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
523udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
524in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
88ca35ee
BP
525udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
526tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
527udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
685a51a5 528icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
47284b1f 529icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4F:0571/112 actions=drop
685a51a5
JP
530icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
531icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
47284b1f 532icmp6,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
533cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
534actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
535tun_id=0x1234,cookie=0x5678,actions=flood
536actions=drop
8368c090 537tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
cb8ca532
BP
538dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop
539dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop
540dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop
541dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop
29089a54 542actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 543actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
07659514 544ip,actions=ct(commit,zone=5)
8e53fe8c 545ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[[]])))
9daf2348 546ip,actions=ct(commit,exec(load(0x1->NXM_NX_CT_LABEL[[]])))
88ca35ee
BP
547])
548AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
ff8802aa
BP
549
550# The substitution for fec0:0: is because some libcs (e.g. MUSL)
551# abbreviate a single zero and others (e.g. glibc) don't.
552AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//
553s/fec0:0:/fec0::/g' stdout]], [0], [dnl
aa233d57 554usable protocols: NXM,OXM
27527aa0 555chosen protocol: NXM-table_id
88ca35ee 556NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
576ec803 557NXT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
bad68a99 558NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
fa8223b7 559NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2
d31f1109
JP
560NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
561NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4
562NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5
563NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
564NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
565NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
88ca35ee
BP
566NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
567NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
568NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
ff8802aa
BP
569NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0::1234:f045:8fff:1111:fe4e:571 actions=drop
570NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0::1234:f045:8fff:1111:fe4f:0/112 actions=drop
685a51a5 571NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop
ff8802aa
BP
572NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0::1234:f045:8fff:1111:fe4e:571,nd_tll=00:0a:e4:25:6b:b1 actions=drop
573NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0::1234:f045:8fff:1111::/96,nd_tll=00:0a:e4:25:6b:b1 actions=drop
88ca35ee
BP
574NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
575NXT_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
576NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
577NXT_FLOW_MOD: ADD actions=drop
8368c090 578NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
cb8ca532
BP
579NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
580NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop
581NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop
582NXT_FLOW_MOD: ADD actions=drop
29089a54 583NXT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 584NXT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
07659514 585NXT_FLOW_MOD: ADD ip actions=ct(commit,zone=5)
8e53fe8c 586NXT_FLOW_MOD: ADD ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[[]]))
9daf2348 587NXT_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
588])
589AT_CLEANUP
09246b99 590
4f564f8d 591AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows])
f393f81e 592AT_DATA([flows.txt], [[
4f564f8d
BP
593# comment
594tcp,tp_src=123,actions=flood
595in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
bad68a99 596arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
fa8223b7 597ipv6,ipv6_label=0x12345 actions=2
d31f1109
JP
598ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
599ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
600ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
0d56eaf2
JS
601tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
602udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
603sctp6,ipv6_src=2001:db8:3c4d:1::5,tp_dst=309 actions=drop
d31f1109 604in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
4f564f8d
BP
605udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
606tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
607udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
0d56eaf2 608sctp,nw_src=192.168.0.3,tp_dst=309 actions=pop_queue,output:1
685a51a5
JP
609icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
610icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
611icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
4f564f8d
BP
612cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
613actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
614tun_id=0x1234,cookie=0x5678,actions=flood
615actions=drop
21b2fa61 616reg0=123,actions=move:reg0[0..5]->reg1[26..31],load:55->reg2,move:reg0->tun_id[0..31],move:reg0[0..15]->vlan_tci
b5e5143b 617actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[]
21b2fa61
JR
618actions=push:reg0[0..31],pop:NXM_NX_REG0[]
619reg0=123,actions=move:reg0[0..5]->reg1[26..31],load:55->reg2,move:reg0->tun_id[0..31],move:reg0[0..15]->vlan_tci
620actions=move:eth_dst->eth_src[]
621actions=push:reg0[0..31],pop:reg0
33d8c6b4 622vlan_tci=0x1123/0x1fff,actions=drop
29089a54 623actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 624actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
07659514 625ip,actions=ct(commit,zone=5)
8e53fe8c 626ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[])))
9daf2348
JS
627ip,actions=ct(commit,exec(load(1->NXM_NX_CT_LABEL[])))
628ip,actions=ct(commit,exec(set_field(1->ct_label)))
f393f81e 629]])
ad7c0437 630AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout], [stderr])
f393f81e 631AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
aa233d57 632[[usable protocols: NXM,OXM
27527aa0
BP
633chosen protocol: NXM-table_id
634NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
4f564f8d 635NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
bad68a99 636NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop
fa8223b7 637NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2
d31f1109
JP
638NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3
639NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4
640NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5
641NXT_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
642NXT_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 643NXT_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 644NXT_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
645NXT_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
646NXT_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
647NXT_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 648NXT_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
649NXT_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
650NXT_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
651NXT_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
652NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535
653NXT_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
654NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
655NXT_FLOW_MOD: ADD <any> actions=drop
d90611f1 656NXT_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 657NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[]
bd85dac1 658NXT_FLOW_MOD: ADD <any> actions=push:NXM_NX_REG0[],pop:NXM_NX_REG0[]
21b2fa61
JR
659NXT_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[]
660NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[]
661NXT_FLOW_MOD: ADD <any> actions=push:NXM_NX_REG0[],pop:NXM_NX_REG0[]
33d8c6b4 662NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
29089a54 663NXT_FLOW_MOD: ADD <any> actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678)
f69f713b 664NXT_FLOW_MOD: ADD <any> actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678,sampling_port=56789)
07659514 665NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,zone=5)
8e53fe8c 666NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[]))
9daf2348
JS
667NXT_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]))
668NXT_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 669]])
4f564f8d
BP
670AT_CLEANUP
671
09246b99
BP
672AT_SETUP([ovs-ofctl parse-nx-match])
673AT_KEYWORDS([nx-match])
674AT_DATA([nx-match.txt], [dnl
675<any>
676
677# in port
678NXM_OF_IN_PORT(0000)
679NXM_OF_IN_PORT(fffe)
680
681# eth dst
682NXM_OF_ETH_DST(0002e30f80a4)
1e37a2d7
BP
683NXM_OF_ETH_DST_W(010000000000/010000000000)
684NXM_OF_ETH_DST_W(000000000000/010000000000)
06da29ee 685NXM_OF_ETH_DST_W(ffffffffffff/010000000000)
1e37a2d7 686NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
fbcbc814 687NXM_OF_ETH_DST_W(60175619848f/000000000000)
1e37a2d7 688NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
73c0ce34 689NXM_OF_ETH_DST_W(60175619848f/5a5a5a5a5a5a)
09246b99
BP
690
691# eth src
692NXM_OF_ETH_SRC(020898456ddb)
73c0ce34
JS
693NXM_OF_ETH_SRC_W(012345abcdef/ffffff555555)
694NXM_OF_ETH_SRC_W(020898456ddb/ffffffffffff)
fbcbc814 695NXM_OF_ETH_SRC_W(020898456ddb/000000000000)
09246b99
BP
696
697# eth type
698NXM_OF_ETH_TYPE(0800)
699NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012)
700
701# vlan tci
702NXM_OF_VLAN_TCI(f009)
703NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009)
704NXM_OF_VLAN_TCI(0000) # Packets without 802.1Q header.
705NXM_OF_VLAN_TCI(3123) # Packets with VID=123, PCP=1.
66642cb4 706NXM_OF_VLAN_TCI(0123) # Does not make sense (but supported anyway)
09246b99 707NXM_OF_VLAN_TCI_W(1123/1fff) # Packets with VID=123, any PCP.
fbcbc814
SH
708NXM_OF_VLAN_TCI_W(1123/ffff) # Packets with VID=123, PCP=0
709NXM_OF_VLAN_TCI_W(1123/0000) # Packets with or without 802.1Q header
09246b99 710NXM_OF_VLAN_TCI_W(f000/f000) # Packets with any VID, PCP=7.
66642cb4 711NXM_OF_VLAN_TCI_W(0000/e000) # No 802.1Q or with VID=0
09246b99
BP
712
713# IP TOS
714NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0)
530180fd 715NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41)
09246b99
BP
716NXM_OF_IP_TOS(f0)
717
530180fd
JP
718# IP ECN
719NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03)
720NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06)
721NXM_NX_IP_ECN(03)
722
09246b99
BP
723# IP protocol
724NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01)
725NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05)
726NXM_OF_IP_PROTO(05)
727
a61680c6
JP
728# IP TTL
729NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80)
730NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff)
731NXM_NX_IP_TTL(80)
732
09246b99
BP
733# IP source
734NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014)
735NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000)
c08201d6 736NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/5a5a5a5a)
fbcbc814 737NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/ffffffff)
09246b99
BP
738NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014)
739NXM_OF_IP_SRC_W(C0D80000/FFFF0000)
740
741# IP destination
742NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014)
06da29ee 743NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000)
c08201d6 744NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/5a5a5a5a)
fbcbc814 745NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/ffffffff)
09246b99
BP
746NXM_OF_IP_DST(ac100014)
747NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000)
748
749# TCP source port
750NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231)
73f33563 751NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0)
fbcbc814 752NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/ffff)
09246b99
BP
753NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231)
754
755# TCP destination port
756NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231)
73f33563 757NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0)
fbcbc814 758NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/ffff)
09246b99
BP
759NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231)
760
dc235f7f
JR
761# TCP flags
762NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS(0131)
763NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(00F0/0FF0)
764NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(01E2/ffff)
178742f9 765NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_NX_TCP_FLAGS(0fff)
dc235f7f 766
09246b99
BP
767# UDP source port
768NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732)
73f33563 769NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF)
fbcbc814 770NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/ffff)
09246b99
BP
771NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823)
772
773# UDP destination port
774NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782)
73f33563 775NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F)
fbcbc814 776NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/FFFF)
09246b99
BP
777NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293)
778
779# ICMP type
780NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12)
781NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10)
782
783# ICMP code
784NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12)
785NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10)
786NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10)
787NXM_OF_ICMP_CODE(00)
788
789# ARP opcode
790NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001)
791NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111)
792NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001)
793NXM_OF_ARP_OP(0001)
794NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001)
795
bad68a99 796# ARP source protocol address
09246b99 797NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014)
06da29ee 798NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
c08201d6 799NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00)
fbcbc814 800NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/ffffffff)
09246b99 801NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
178742f9 802NXM_OF_ARP_SPA_W(C0D80000/FFFF0000)
09246b99 803
bad68a99 804# ARP destination protocol address
09246b99 805NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014)
06da29ee 806NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
c08201d6 807NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/77777777)
fbcbc814 808NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/ffffffff)
09246b99
BP
809NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
810NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
811
bad68a99
JP
812# ARP source hardware address
813NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4)
814NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
815NXM_NX_ARP_SHA(0002e30f80a4)
816
817# ARP destination hardware address
818NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
819NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
820NXM_NX_ARP_THA(0002e30f80a4)
821
8087f5ff
MM
822# RARP opcode
823NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003)
824NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(1111)
825NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0003)
826NXM_OF_ARP_OP(0003)
827NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003) NXM_OF_ARP_OP(0003)
828
829# RARP source protocol address
830NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA(ac100014)
3947cc76 831NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81200/FFFFFF00)
8087f5ff
MM
832NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00)
833NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/ffffffff)
8087f5ff 834NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
178742f9 835NXM_OF_ARP_SPA_W(C0D80000/FFFF0000)
8087f5ff
MM
836
837# RARP destination protocol address
838NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA(ac100014)
3947cc76 839NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81200/FFFFFF00)
8087f5ff
MM
840NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/77777777)
841NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/ffffffff)
8087f5ff
MM
842NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
843NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
844
845# RARP source hardware address
846NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_SHA(0002e30f80a4)
847NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
848NXM_NX_ARP_SHA(0002e30f80a4)
849
850# RARP destination hardware address
851NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_THA(0002e30f80a4)
852NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
853NXM_NX_ARP_THA(0002e30f80a4)
854
d31f1109
JP
855# IPv6 source
856NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
857NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
858NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
ff0b06ee 859NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/5a5a5a5a5a5a5a5a0000000000000000)
fbcbc814
SH
860NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
861NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000)
178742f9 862NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffff000000000000)
d31f1109
JP
863
864# IPv6 destination
865NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
866NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
ff0b06ee 867NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/77777777777777777777777777777777)
fbcbc814 868NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
3947cc76 869NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000)
d31f1109
JP
870NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
871
626186c3
SH
872# IPv6 Flow Label
873NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(1000000f)
874NXM_NX_IPV6_LABEL(0000000f)
875NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(0000000f)
876
ff0b06ee
BP
877# ND target address
878NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
879NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
880NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/0123456789abcdeffedcba9876543210)
fbcbc814 881NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/ffffffffffffffffffffffffffffffff)
3947cc76 882NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(00000000000000000000000000000000/00000000000000000000000000000000)
ff0b06ee
BP
883NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/fedcba98765432100123456789abcdef)
884
685a51a5
JP
885# ND source hardware address
886NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4)
887NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4)
888NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3b) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4)
889NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_SLL(0002e30f80a4)
890
891# ND destination hardware address
892NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4)
893NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4)
894NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3b) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4)
895NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) NXM_NX_ND_TLL(0002e30f80a4)
896
7257b535
BP
897# IPv4 fragments.
898NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00)
899NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01)
900NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02)
901NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03)
902NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03)
903NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd)
904NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02)
905NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01)
906NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02)
907NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03)
fbcbc814
SH
908NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/ff)
909NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/00)
7257b535
BP
910NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3)
911
912# IPv6 fragments.
913NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00)
914NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01)
915NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02)
916NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03)
917NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03)
918NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01)
919NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02)
920NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01)
921NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02)
922NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03)
fbcbc814
SH
923NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/00)
924NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/ff)
7257b535
BP
925NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3)
926
e729e793
JP
927# Flow cookie.
928NXM_NX_COOKIE(00000000abcdef01)
929NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF)
fbcbc814 930NXM_NX_COOKIE_W(84200000abcdef01/ffffffffffffffff)
178742f9 931NXM_NX_COOKIE_W(0000000000000000/0000000000000000)
e729e793 932
09246b99
BP
933# Tunnel ID.
934NXM_NX_TUN_ID(00000000abcdef01)
8368c090 935NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF)
fbcbc814 936NXM_NX_TUN_ID_W(84200000abcdef01/FFFFFFFFFFFFFFFF)
3947cc76 937NXM_NX_TUN_ID_W(0000000000000000/0000000000000000)
b6c9e612
BP
938
939# Register 0.
940NXM_NX_REG0(acebdf56)
941NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
fbcbc814 942NXM_NX_REG0_W(a0e0d050/ffffffff)
3947cc76 943NXM_NX_REG0_W(00000000/00000000)
558d80cb 944
07659514 945# Connection tracking fields,
63bc9fb1 946NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE(00000020)
07659514 947NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE(00001080)
63bc9fb1
JR
948NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE_W(00000020/00000020)
949NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE_W(00000020/000000F0)
07659514 950NXM_OF_ETH_TYPE(0800) NXM_NX_CT_ZONE(5a5a)
8e53fe8c
JS
951NXM_OF_ETH_TYPE(0800) NXM_NX_CT_MARK(5a5a5a5a)
952NXM_OF_ETH_TYPE(0800) NXM_NX_CT_MARK_W(5a5a5a5a/fefefefe)
9daf2348
JS
953NXM_OF_ETH_TYPE(0800) NXM_NX_CT_LABEL(1234567890abcdef1234567890abcdef)
954NXM_OF_ETH_TYPE(0800) NXM_NX_CT_LABEL_W(10203040506070809000a0b0c0d0e0f0/f1f2f3f4f5f6f7f8f9f0fafbfcfdfeff)
07659514 955
508a9338
BP
956# dp_hash (testing experimenter OXM).
957NXM_NX_DP_HASH(01234567)
958NXOXM_ET_DP_HASH(01234567)
959
d4ee9a73
WT
960# ERSPAN (testing experimenter OXM).
961NXOXM_ET_ERSPAN_VER(01)
962NXOXM_ET_ERSPAN_IDX(01020304)
963NXOXM_ET_ERSPAN_DIR(01)
964NXOXM_ET_ERSPAN_HWID(12)
965
558d80cb 966# Invalid field number.
178742f9 96701020304(1111/3333)
558d80cb 968
508a9338
BP
969# Invalid field numbers (experimenter OXM).
970ffff020800002320(11112222)
971ffff030800002320(1111/3333)
09246b99 972])
e1cfc4e4 973AT_CHECK([ovs-ofctl -vPATTERN:'console:%c|%p|%m' --strict parse-nx-match < nx-match.txt], [0], [dnl
09246b99
BP
974<any>
975
976# in port
abe529af 977NXM_OF_IN_PORT(0000)
09246b99
BP
978NXM_OF_IN_PORT(fffe)
979
980# eth dst
981NXM_OF_ETH_DST(0002e30f80a4)
1e37a2d7
BP
982NXM_OF_ETH_DST_W(010000000000/010000000000)
983NXM_OF_ETH_DST_W(000000000000/010000000000)
3947cc76 984nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1e37a2d7 985NXM_OF_ETH_DST(0002e30f80a4)
3947cc76 986nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1e37a2d7 987NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
3947cc76 988nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
09246b99
BP
989
990# eth src
991NXM_OF_ETH_SRC(020898456ddb)
3947cc76 992nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
73c0ce34 993NXM_OF_ETH_SRC(020898456ddb)
3947cc76 994nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
09246b99
BP
995
996# eth type
997NXM_OF_ETH_TYPE(0800)
998NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800)
999
1000# vlan tci
1001NXM_OF_VLAN_TCI(f009)
2e0525bc 1002nx_pull_match() returned error OFPBMC_DUP_FIELD
09246b99
BP
1003NXM_OF_VLAN_TCI(0000)
1004NXM_OF_VLAN_TCI(3123)
66642cb4 1005NXM_OF_VLAN_TCI(0123)
09246b99 1006NXM_OF_VLAN_TCI_W(1123/1fff)
fbcbc814 1007NXM_OF_VLAN_TCI(1123)
3947cc76 1008nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
09246b99 1009NXM_OF_VLAN_TCI_W(f000/f000)
66642cb4 1010NXM_OF_VLAN_TCI_W(0000/e000)
09246b99
BP
1011
1012# IP TOS
1013NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0)
2e0525bc
SH
1014nx_pull_match() returned error OFPBMC_BAD_VALUE
1015nx_pull_match() returned error OFPBMC_BAD_PREREQ
530180fd
JP
1016
1017# IP ECN
1018NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03)
2e0525bc
SH
1019nx_pull_match() returned error OFPBMC_BAD_VALUE
1020nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99
BP
1021
1022# IP protocol
1023NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01)
1024NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05)
2e0525bc 1025nx_pull_match() returned error OFPBMC_BAD_PREREQ
a61680c6
JP
1026
1027# IP TTL
1028NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80)
1029NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff)
2e0525bc 1030nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99
BP
1031
1032# IP source
1033NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014)
1034NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000)
3947cc76 1035nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
fbcbc814 1036NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80000)
2e0525bc
SH
1037nx_pull_match() returned error OFPBMC_BAD_PREREQ
1038nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99
BP
1039
1040# IP destination
1041NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014)
3947cc76
BP
1042nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1043nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
fbcbc814 1044NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(c0a80000)
2e0525bc
SH
1045nx_pull_match() returned error OFPBMC_BAD_PREREQ
1046nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99
BP
1047
1048# TCP source port
1049NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231)
73f33563 1050NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0)
fbcbc814 1051NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(5050)
2e0525bc 1052nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99
BP
1053
1054# TCP destination port
1055NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231)
73f33563 1056NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0)
fbcbc814 1057NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(fde0)
2e0525bc 1058nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99 1059
dc235f7f
JR
1060# TCP flags
1061NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0131)
1062NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS_W(00f0/0ff0)
1063NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(01e2)
dc235f7f
JR
1064nx_pull_match() returned error OFPBMC_BAD_PREREQ
1065
09246b99
BP
1066# UDP source port
1067NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732)
73f33563 1068NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff)
fbcbc814 1069NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(0132)
2e0525bc 1070nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99
BP
1071
1072# UDP destination port
1073NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782)
73f33563 1074NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f)
fbcbc814 1075NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(5005)
2e0525bc 1076nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99
BP
1077
1078# ICMP type
1079NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12)
2e0525bc 1080nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99
BP
1081
1082# ICMP code
1083NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12)
2e0525bc
SH
1084nx_pull_match() returned error OFPBMC_BAD_PREREQ
1085nx_pull_match() returned error OFPBMC_BAD_PREREQ
1086nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99
BP
1087
1088# ARP opcode
1089NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001)
2e0525bc
SH
1090nx_pull_match() returned error OFPBMC_BAD_VALUE
1091nx_pull_match() returned error OFPBMC_BAD_PREREQ
1092nx_pull_match() returned error OFPBMC_BAD_PREREQ
1093nx_pull_match() returned error OFPBMC_DUP_FIELD
09246b99 1094
bad68a99 1095# ARP source protocol address
09246b99 1096NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014)
3947cc76
BP
1097nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1098nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
fbcbc814 1099NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(c0a81234)
2e0525bc
SH
1100nx_pull_match() returned error OFPBMC_BAD_PREREQ
1101nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99 1102
bad68a99 1103# ARP destination protocol address
09246b99 1104NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014)
3947cc76
BP
1105nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
1106nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
fbcbc814 1107NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(c0a81234)
2e0525bc
SH
1108nx_pull_match() returned error OFPBMC_BAD_PREREQ
1109nx_pull_match() returned error OFPBMC_BAD_PREREQ
09246b99 1110
bad68a99
JP
1111# ARP source hardware address
1112NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4)
2e0525bc
SH
1113nx_pull_match() returned error OFPBMC_BAD_PREREQ
1114nx_pull_match() returned error OFPBMC_BAD_PREREQ
bad68a99
JP
1115
1116# ARP destination hardware address
1117NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
2e0525bc 1118nx_pull_match() returned error OFPBMC_BAD_PREREQ
8087f5ff
MM
1119nx_pull_match() returned error OFPBMC_BAD_PREREQ
1120
1121# RARP opcode
1122NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_OP(0003)
1123nx_pull_match() returned error OFPBMC_BAD_VALUE
1124nx_pull_match() returned error OFPBMC_BAD_PREREQ
1125nx_pull_match() returned error OFPBMC_BAD_PREREQ
1126nx_pull_match() returned error OFPBMC_DUP_FIELD
1127
1128# RARP source protocol address
1129NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(ac100014)
1130NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
3947cc76 1131nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
8087f5ff 1132NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(c0a81234)
8087f5ff
MM
1133nx_pull_match() returned error OFPBMC_BAD_PREREQ
1134nx_pull_match() returned error OFPBMC_BAD_PREREQ
1135
1136# RARP destination protocol address
1137NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(ac100014)
1138NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
3947cc76 1139nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
8087f5ff 1140NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(c0a81234)
8087f5ff
MM
1141nx_pull_match() returned error OFPBMC_BAD_PREREQ
1142nx_pull_match() returned error OFPBMC_BAD_PREREQ
1143
1144# RARP source hardware address
1145NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_SHA(0002e30f80a4)
1146nx_pull_match() returned error OFPBMC_BAD_PREREQ
1147nx_pull_match() returned error OFPBMC_BAD_PREREQ
1148
1149# RARP destination hardware address
1150NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_THA(0002e30f80a4)
1151nx_pull_match() returned error OFPBMC_BAD_PREREQ
2e0525bc 1152nx_pull_match() returned error OFPBMC_BAD_PREREQ
bad68a99 1153
d31f1109
JP
1154# IPv6 source
1155NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
2e0525bc 1156nx_pull_match() returned error OFPBMC_BAD_PREREQ
d31f1109 1157NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
3947cc76 1158nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
fbcbc814 1159NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000000)
3947cc76 1160nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
2e0525bc 1161nx_pull_match() returned error OFPBMC_BAD_PREREQ
d31f1109
JP
1162
1163# IPv6 destination
1164NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
2e0525bc 1165nx_pull_match() returned error OFPBMC_BAD_PREREQ
3947cc76 1166nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
fbcbc814
SH
1167NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010000000000000000)
1168NXM_OF_ETH_TYPE(86dd)
2e0525bc 1169nx_pull_match() returned error OFPBMC_BAD_PREREQ
d31f1109 1170
626186c3
SH
1171# IPv6 Flow Label
1172nx_pull_match() returned error OFPBMC_BAD_VALUE
1173nx_pull_match() returned error OFPBMC_BAD_PREREQ
1174NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(0000000f)
1175
ff0b06ee
BP
1176# ND target address
1177NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
1178NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
3947cc76 1179nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
fbcbc814
SH
1180NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
1181NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87)
3947cc76 1182nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
ff0b06ee 1183
685a51a5
JP
1184# ND source hardware address
1185NXM_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
1186nx_pull_match() returned error OFPBMC_BAD_PREREQ
1187nx_pull_match() returned error OFPBMC_BAD_PREREQ
1188nx_pull_match() returned error OFPBMC_BAD_PREREQ
685a51a5
JP
1189
1190# ND destination hardware address
1191NXM_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
1192nx_pull_match() returned error OFPBMC_BAD_PREREQ
1193nx_pull_match() returned error OFPBMC_BAD_PREREQ
1194nx_pull_match() returned error OFPBMC_BAD_PREREQ
685a51a5 1195
7257b535
BP
1196# IPv4 fragments.
1197NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
1198NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01)
1199NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02)
1200NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
1201NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
1202NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01)
1203NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02)
1204NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01)
1205NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02)
1206NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
fbcbc814 1207NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
3947cc76 1208nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
2e0525bc 1209nx_pull_match() returned error OFPBMC_BAD_VALUE
7257b535
BP
1210
1211# IPv6 fragments.
1212NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
1213NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01)
1214NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02)
1215NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
1216NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
1217NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01)
1218NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02)
1219NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01)
1220NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02)
1221NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
3947cc76 1222nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
fbcbc814 1223NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
2e0525bc 1224nx_pull_match() returned error OFPBMC_BAD_VALUE
7257b535 1225
e729e793
JP
1226# Flow cookie.
1227NXM_NX_COOKIE(00000000abcdef01)
1228NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff)
fbcbc814
SH
1229NXM_NX_COOKIE(84200000abcdef01)
1230<any>
e729e793 1231
09246b99
BP
1232# Tunnel ID.
1233NXM_NX_TUN_ID(00000000abcdef01)
8368c090 1234NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff)
fbcbc814
SH
1235NXM_NX_TUN_ID(84200000abcdef01)
1236<any>
b6c9e612
BP
1237
1238# Register 0.
1239NXM_NX_REG0(acebdf56)
1240NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
fbcbc814
SH
1241NXM_NX_REG0(a0e0d050)
1242<any>
558d80cb 1243
07659514
JS
1244# Connection tracking fields,
1245dnl
2a28ccc8 1246dnl When re-serialising, bits 8-31 are wildcarded, because current OVS userspace
07659514 1247dnl doesn't understand (or store) those bits.
2a28ccc8 1248NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/000000ff)
07659514 1249nx_pull_match() returned error OFPBMC_BAD_VALUE
63bc9fb1
JR
1250NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/00000020)
1251NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/000000f0)
07659514 1252NXM_OF_ETH_TYPE(0800), NXM_NX_CT_ZONE(5a5a)
8e53fe8c
JS
1253NXM_OF_ETH_TYPE(0800), NXM_NX_CT_MARK(5a5a5a5a)
1254NXM_OF_ETH_TYPE(0800), NXM_NX_CT_MARK_W(5a5a5a5a/fefefefe)
9daf2348
JS
1255NXM_OF_ETH_TYPE(0800), NXM_NX_CT_LABEL(1234567890abcdef1234567890abcdef)
1256NXM_OF_ETH_TYPE(0800), NXM_NX_CT_LABEL_W(10203040506070809000a0b0c0d0e0f0/f1f2f3f4f5f6f7f8f9f0fafbfcfdfeff)
07659514 1257
508a9338
BP
1258# dp_hash (testing experimenter OXM).
1259NXM_NX_DP_HASH(01234567)
1260NXM_NX_DP_HASH(01234567)
1261
d4ee9a73
WT
1262# ERSPAN (testing experimenter OXM).
1263NXOXM_ET_ERSPAN_VER_W(01/01)
1264NXOXM_ET_ERSPAN_IDX(01020304)
1265NXOXM_ET_ERSPAN_DIR_W(01/01)
1266NXOXM_ET_ERSPAN_HWID_W(12/12)
1267
558d80cb 1268# Invalid field number.
2e0525bc 1269nx_pull_match() returned error OFPBMC_BAD_FIELD
558d80cb 1270
508a9338
BP
1271# Invalid field numbers (experimenter OXM).
1272nx_pull_match() returned error OFPBMC_BAD_FIELD
2e0525bc 1273nx_pull_match() returned error OFPBMC_BAD_FIELD
e1cfc4e4
BP
1274], [stderr])
1275
1276# Check that at least the first warning made it. (It's rate-limited
1277# so a variable number could show up, especially under valgrind etc.)
3947cc76 1278AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl
508a9338 1279nx_match|WARN|Rejecting NXM/OXM entry 0:0:1:1:12 with 1-bits in value for bits wildcarded by the mask.
09246b99 1280])
e1cfc4e4
BP
1281
1282# Check that there wasn't any other stderr output.
3947cc76 1283AT_CHECK([grep -v '1-bits in value' stderr], [1])
09246b99 1284AT_CLEANUP
0fbc9f11 1285
96628ae8
BP
1286AT_SETUP([ovs-ofctl parse-ofp10-match])
1287AT_KEYWORDS([OF1.0])
1288AT_DATA([test-data], [dnl
576ec803 1289# in_port=LOCAL
8812ec2c
BP
1290003820fe fffe xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl
1291xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1292
1293# dl_src=00:01:02:03:04:05
8812ec2c
BP
1294003820fb xxxx 000102030405 xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl
1295xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1296
1297# dl_dst=10:20:30:40:50:60
8812ec2c
BP
1298003820f7 xxxx xxxxxxxxxxxx 102030405060 xxxx xx xx xxxx xx xx xxxx dnl
1299xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1300
1301# dl_vlan=291
8812ec2c
BP
1302003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 xx xx xxxx xx xx xxxx dnl
1303xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1304
1305# dl_vlan_pcp=5
8812ec2c
BP
1306002820ff xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx 05 xx xxxx xx xx xxxx dnl
1307xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1308
1309# dl_vlan=291,dl_vlan_pcp=4
8812ec2c
BP
1310002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 04 xx xxxx xx xx xxxx dnl
1311xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8 1312
053df7bd
BP
1313dnl dl_vlan_pcp doesn't make sense when 802.1Q is not present, so
1314dnl OVS ignores it and drops it on output.
96628ae8 1315# vlan_tci=0x0000
053df7bd 1316# 1: 38 -> 28
8812ec2c
BP
1317003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff xx xx xxxx xx xx xxxx dnl
1318xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8 1319
053df7bd 1320dnl dl_vlan_pcp doesn't make sense when 802.1Q is not present, so
96628ae8
BP
1321dnl OVS ignores it and drops it on output.
1322# vlan_tci=0x0000
96628ae8 1323# 20: 05 -> 00
8812ec2c
BP
1324002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff 05 xx xxxx xx xx xxxx dnl
1325xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1326
1327dnl Invalid VID and PCP discards out-of-range bits:
1328# dl_vlan=256,dl_vlan_pcp=7
1329# 18: f1 -> 01
1330# 20: ff -> 07
8812ec2c
BP
1331002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx f100 ff xx xxxx xx xx xxxx dnl
1332xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1333
1334# dl_type=0x1234
8812ec2c
BP
1335003820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
1336xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1337
1338# ip,nw_proto=5
8812ec2c
BP
1339003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 05 xxxx dnl
1340xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1341
1342dnl Ignore nw_proto if not IP or ARP:
1343# dl_type=0x1234,nw_proto=5
1344# normal: 3: cf -> ef
1345# normal: 25: 05 -> 00
0d71302e
BP
1346& ofp_match|INFO|normalization changed ofp_match, details:
1347& ofp_match|INFO| pre: dl_type=0x1234,nw_proto=5
1348& ofp_match|INFO|post: dl_type=0x1234
8812ec2c
BP
1349003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx 05 xxxx dnl
1350xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1351
1352# ip,nw_tos=252
8812ec2c
BP
1353001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 fc xx xxxx dnl
1354xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1355
1356dnl Ignore nw_tos if not IP:
1357# arp,nw_tos=4
1358# 24: 05 -> 04
1359# normal: 1: 18 -> 38
1360# normal: 24: 04 -> 00
0d71302e
BP
1361& ofp_match|INFO|normalization changed ofp_match, details:
1362& ofp_match|INFO| pre: arp,nw_tos=4
1363& ofp_match|INFO|post: arp
8812ec2c
BP
1364001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 05 xx xxxx dnl
1365xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1366
1367dnl Low 2 bits of invalid TOS are forced to 0:
1368# ip,nw_tos=48
1369# 24: 31 -> 30
8812ec2c
BP
1370001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 31 xx xxxx dnl
1371xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1372
1373# arp,arp_op=2
8812ec2c
BP
1374003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx 02 xxxx dnl
1375xxxxxxxx xxxxxxxx xxxx xxxx
96628ae8
BP
1376
1377# ip,nw_src=192.168.128.85
8812ec2c
BP
1378003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
1379c0a88055 xxxxxxxx xxxx xxxx
96628ae8
BP
1380
1381# ip,nw_src=192.168.128.0/24
1382# 31: 55 -> 00
8812ec2c
BP
1383003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
1384c0a88055 xxxxxxxx xxxx xxxx
96628ae8
BP
1385
1386# ip,nw_dst=192.168.128.85
8812ec2c
BP
1387003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
1388xxxxxxxx c0a88055 xxxx xxxx
96628ae8
BP
1389
1390# ip,nw_dst=192.168.128.0/24
1391# 35: 55 -> 00
8812ec2c
BP
1392003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
1393xxxxxxxx c0a88055 xxxx xxxx
96628ae8 1394
666d0863 1395# arp,arp_spa=192.168.128.85
8812ec2c
BP
1396003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
1397c0a88055 xxxxxxxx xxxx xxxx
96628ae8 1398
666d0863 1399# arp,arp_spa=192.168.128.0/24
96628ae8 1400# 31: 55 -> 00
8812ec2c
BP
1401003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
1402c0a88055 xxxxxxxx xxxx xxxx
96628ae8 1403
666d0863 1404# arp,arp_tpa=192.168.128.85
8812ec2c
BP
1405003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
1406xxxxxxxx c0a88055 xxxx xxxx
96628ae8 1407
666d0863 1408# arp,arp_tpa=192.168.128.0/24
96628ae8 1409# 35: 55 -> 00
8812ec2c
BP
1410003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
1411xxxxxxxx c0a88055 xxxx xxxx
96628ae8
BP
1412
1413dnl Ignore nw_src if not IP or ARP:
1414# dl_type=0x1234,nw_src=192.168.128.0/24
1415# 31: 55 -> 00
1416# normal: 2: 08 -> 20
1417# normal: 28: c0 -> 00
1418# normal: 29: a8 -> 00
1419# normal: 30: 80 -> 00
0d71302e
BP
1420& ofp_match|INFO|normalization changed ofp_match, details:
1421& ofp_match|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24
1422& ofp_match|INFO|post: dl_type=0x1234
8812ec2c
BP
1423003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
1424c0a88055 xxxxxxxx xxxx xxxx
96628ae8
BP
1425
1426dnl Ignore nw_dst if not IP or ARP:
1427# dl_type=0x1234,nw_dst=192.168.128.0/24
1428# 35: 55 -> 00
1429# normal: 1: 32 -> 38
1430# normal: 32: c0 -> 00
1431# normal: 33: a8 -> 00
1432# normal: 34: 80 -> 00
0d71302e
BP
1433& ofp_match|INFO|normalization changed ofp_match, details:
1434& ofp_match|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24
1435& ofp_match|INFO|post: dl_type=0x1234
8812ec2c
BP
1436003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
1437xxxxxxxx c0a88055 xxxx xxxx
96628ae8
BP
1438
1439# tcp,tp_src=443
8812ec2c
BP
14400038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl
1441xxxxxxxx xxxxxxxx 01bb xxxx
96628ae8
BP
1442
1443# tcp,tp_dst=443
8812ec2c
BP
14440038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl
1445xxxxxxxx xxxxxxxx xxxx 01bb
96628ae8
BP
1446
1447# udp,tp_src=443
8812ec2c
BP
14480038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl
1449xxxxxxxx xxxxxxxx 01bb xxxx
96628ae8
BP
1450
1451# udp,tp_dst=443
8812ec2c
BP
14520038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl
1453xxxxxxxx xxxxxxxx xxxx 01bb
96628ae8 1454
0d56eaf2
JS
1455# sctp,tp_src=443
14560038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx dnl
1457xxxxxxxx xxxxxxxx 01bb xxxx
1458
1459# sctp,tp_dst=443
14600038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx dnl
1461xxxxxxxx xxxxxxxx xxxx 01bb
1462
96628ae8 1463# icmp,icmp_type=5
8812ec2c
BP
14640038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl
1465xxxxxxxx xxxxxxxx 0005 xxxx
96628ae8
BP
1466
1467# icmp,icmp_code=8
8812ec2c
BP
14680038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl
1469xxxxxxxx xxxxxxxx xxxx 0008
96628ae8 1470
0d56eaf2 1471dnl Ignore tp_src if not TCP/UDP/SCTP:
96628ae8
BP
1472# ip,nw_proto=21,tp_src=443
1473# normal: 3: 8f -> cf
1474# normal: 36: 01 -> 00
1475# normal: 37: bb -> 00
0d71302e
BP
1476& ofp_match|INFO|normalization changed ofp_match, details:
1477& ofp_match|INFO| pre: ip,nw_proto=21,tp_src=443
1478& ofp_match|INFO|post: ip,nw_proto=21
8812ec2c
BP
14790038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl
1480xxxxxxxx xxxxxxxx 01bb xxxx
96628ae8 1481
0d56eaf2 1482dnl Ignore tp_dst if not TCP/UDP/SCTP:
96628ae8
BP
1483# ip,nw_proto=21,tp_dst=443
1484# normal: 3: 4f -> cf
1485# normal: 38: 01 -> 00
1486# normal: 39: bb -> 00
1487dnl The normalization details are suppressed here due to rate-limiting.
8812ec2c
BP
14880038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl
1489xxxxxxxx xxxxxxxx xxxx 01bb
96628ae8
BP
1490
1491])
1492sed '/^[[#&]]/d' < test-data > input.txt
1493sed -n 's/^# //p; /^$/p' < test-data > expout
1494sed -n 's/^& //p' < test-data > experr
1495AT_CAPTURE_FILE([input.txt])
1496AT_CAPTURE_FILE([expout])
1497AT_CAPTURE_FILE([experr])
1498AT_CHECK(
1499 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-match < input.txt],
1500 [0], [expout], [experr])
1501AT_CLEANUP
1502
410698cf
BP
1503AT_SETUP([ovs-ofctl parse-ofp11-match])
1504AT_KEYWORDS([OF1.1])
1505AT_DATA([test-data], [dnl
576ec803 1506# in_port=LOCAL
410698cf
BP
15070000 0058 fffffffe 000003fe dnl
1508000000000000ffffffffffff 000000000000ffffffffffff dnl
15090000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
151000000000 00 000000 0000000000000000ffffffffffffffff
1511
1512# bad ofp11_match: OFPBMC_BAD_VALUE
0d71302e 1513& ofp_port|WARN|port 305419896 is outside the supported range 0 through 65279 or 0xffffff00 through 0xffffffff
410698cf
BP
15140000 0058 12345678 000003fe dnl
1515000000000000ffffffffffff 000000000000ffffffffffff dnl
15160000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
151700000000 00 000000 0000000000000000ffffffffffffffff
1518
1519# dl_src=00:01:02:03:04:05
15200000 0058 00000000 000003ff dnl
1521000102030405000000000000 000000000000ffffffffffff dnl
15220000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
152300000000 00 000000 0000000000000000ffffffffffffffff
1524
1525# dl_src=55:55:55:55:55:55/55:55:55:55:55:55
15260000 0058 00000000 000003ff dnl
1527555555555555aaaaaaaaaaaa 000000000000ffffffffffff dnl
15280000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
152900000000 00 000000 0000000000000000ffffffffffffffff
1530
1531# dl_dst=00:01:02:03:04:05
15320000 0058 00000000 000003ff dnl
1533000000000000ffffffffffff 000102030405000000000000 dnl
15340000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
153500000000 00 000000 0000000000000000ffffffffffffffff
1536
1537# dl_dst=01:00:00:00:00:00/01:00:00:00:00:00
15380000 0058 00000000 000003ff dnl
1539000000000000ffffffffffff 010000000000feffffffffff dnl
15400000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
154100000000 00 000000 0000000000000000ffffffffffffffff
1542
1543# dl_dst=00:01:02:03:04:05/fe:ff:ff:ff:ff:ff
15440000 0058 00000000 000003ff dnl
1545000000000000ffffffffffff 000102030405010000000000 dnl
15460000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
154700000000 00 000000 0000000000000000ffffffffffffffff
1548
1549# dl_dst=55:55:55:55:55:55/55:55:55:55:55:55
15500000 0058 00000000 000003ff dnl
1551000000000000ffffffffffff 555555555555aaaaaaaaaaaa dnl
15520000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
155300000000 00 000000 0000000000000000ffffffffffffffff
1554
1555dnl dl_vlan_pcp is ignored if dl_vlan is wildcarded, which causes the
1556dnl the wildcard bit and the dl_vlan_pcp to be dropped for output:
1557# in_port=1
1558# 11: fa -> fe
1559# 38: 03 -> 00
15600000 0058 00000001 000003fa dnl
1561000000000000ffffffffffff 000000000000ffffffffffff dnl
15620000 03 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
156300000000 00 000000 0000000000000000ffffffffffffffff
1564
1565# dl_vlan=291
15660000 0058 00000000 000003fd dnl
1567000000000000ffffffffffff 000000000000ffffffffffff dnl
15680123 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
156900000000 00 000000 0000000000000000ffffffffffffffff
1570
1571dnl OFPVID_NONE:
1572# vlan_tci=0x0000
15730000 0058 00000000 000003fd dnl
1574000000000000ffffffffffff 000000000000ffffffffffff dnl
1575ffff 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
157600000000 00 000000 0000000000000000ffffffffffffffff
1577
1578dnl OFPVID_NONE ignores dl_vlan_pcp even if not wildcarded, which causes
1579dnl the wildcard bit and the dl_vlan_pcp to be dropped for output:
1580# vlan_tci=0x0000
1581# 11: f9 -> fd
1582# 38: 05 -> 00
15830000 0058 00000000 000003f9 dnl
1584000000000000ffffffffffff 000000000000ffffffffffff dnl
1585ffff 05 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
158600000000 00 000000 0000000000000000ffffffffffffffff
1587
1588# vlan_tci=0x1000/0x1000
15890000 0058 00000000 000003fd dnl
1590000000000000ffffffffffff 000000000000ffffffffffff dnl
1591fffe 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
159200000000 00 000000 0000000000000000ffffffffffffffff
1593
1594dnl Try invalid VID:
1595# bad ofp11_match: OFPBMC_BAD_VALUE
15960000 0058 00000000 000003fd dnl
1597000000000000ffffffffffff 000000000000ffffffffffff dnl
15981234 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
159900000000 00 000000 0000000000000000ffffffffffffffff
1600
1601# dl_vlan_pcp=4
16020000 0058 00000000 000003f9 dnl
1603000000000000ffffffffffff 000000000000ffffffffffff dnl
1604fffe 04 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
160500000000 00 000000 0000000000000000ffffffffffffffff
1606
1607# dl_vlan=10,dl_vlan_pcp=6
16080000 0058 00000000 000003f9 dnl
1609000000000000ffffffffffff 000000000000ffffffffffff dnl
1610000a 06 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
161100000000 00 000000 0000000000000000ffffffffffffffff
1612
1613# dl_type=0x1234
16140000 0058 00000000 000003f7 dnl
1615000000000000ffffffffffff 000000000000ffffffffffff dnl
16160000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
161700000000 00 000000 0000000000000000ffffffffffffffff
1618
1619# ip,nw_tos=252
16200000 0058 00000000 000003e7 dnl
1621000000000000ffffffffffff 000000000000ffffffffffff dnl
16220000 00 00 0800 fc 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
162300000000 00 000000 0000000000000000ffffffffffffffff
1624
1625dnl Try invalid TOS:
1626# bad ofp11_match: OFPBMC_BAD_VALUE
16270000 0058 00000000 000003e7 dnl
1628000000000000ffffffffffff 000000000000ffffffffffff dnl
16290000 00 00 0800 01 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
163000000000 00 000000 0000000000000000ffffffffffffffff
1631
1632# ip,nw_proto=5
16330000 0058 00000000 000003d7 dnl
1634000000000000ffffffffffff 000000000000ffffffffffff dnl
16350000 00 00 0800 00 05 00000000ffffffff 00000000ffffffff 0000 0000 dnl
163600000000 00 000000 0000000000000000ffffffffffffffff
1637
1638# arp,arp_op=2
16390000 0058 00000000 000003d7 dnl
1640000000000000ffffffffffff 000000000000ffffffffffff dnl
16410000 00 00 0806 00 02 00000000ffffffff 00000000ffffffff 0000 0000 dnl
164200000000 00 000000 0000000000000000ffffffffffffffff
1643
1644# ip,nw_src=192.168.128.0/24
16450000 0058 00000000 000003f7 dnl
1646000000000000ffffffffffff 000000000000ffffffffffff dnl
16470000 00 00 0800 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
164800000000 00 000000 0000000000000000ffffffffffffffff
1649
c08201d6
BP
1650# ip,nw_src=128.160.128.0/165.165.165.165
1651# 44: c0 -> 80
1652# 45: a8 -> a0
410698cf
BP
16530000 0058 00000000 000003f7 dnl
1654000000000000ffffffffffff 000000000000ffffffffffff dnl
16550000 00 00 0800 00 00 c0a880005a5a5a5a 00000000ffffffff 0000 0000 dnl
165600000000 00 000000 0000000000000000ffffffffffffffff
1657
1658# ip,nw_dst=192.168.128.0/24
16590000 0058 00000000 000003f7 dnl
1660000000000000ffffffffffff 000000000000ffffffffffff dnl
16610000 00 00 0800 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
166200000000 00 000000 0000000000000000ffffffffffffffff
1663
c08201d6
BP
1664# ip,nw_dst=128.160.128.0/165.165.165.165
1665# 52: c0 -> 80
1666# 53: a8 -> a0
410698cf
BP
16670000 0058 00000000 000003f7 dnl
1668000000000000ffffffffffff 000000000000ffffffffffff dnl
16690000 00 00 0800 00 00 00000000ffffffff c0a880005a5a5a5a 0000 0000 dnl
167000000000 00 000000 0000000000000000ffffffffffffffff
1671
666d0863 1672# arp,arp_spa=192.168.128.0/24
410698cf
BP
16730000 0058 00000000 000003f7 dnl
1674000000000000ffffffffffff 000000000000ffffffffffff dnl
16750000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
167600000000 00 000000 0000000000000000ffffffffffffffff
1677
666d0863 1678# arp,arp_tpa=192.168.128.0/24
410698cf
BP
16790000 0058 00000000 000003f7 dnl
1680000000000000ffffffffffff 000000000000ffffffffffff dnl
16810000 00 00 0806 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
168200000000 00 000000 0000000000000000ffffffffffffffff
1683
1684# tcp,tp_src=443
16850000 0058 00000000 00000397 dnl
1686000000000000ffffffffffff 000000000000ffffffffffff dnl
16870000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
168800000000 00 000000 0000000000000000ffffffffffffffff
1689
1690# tcp,tp_dst=443
16910000 0058 00000000 00000357 dnl
1692000000000000ffffffffffff 000000000000ffffffffffff dnl
16930000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 0000 01bb dnl
169400000000 00 000000 0000000000000000ffffffffffffffff
1695
1696# udp,tp_src=443
16970000 0058 00000000 00000397 dnl
1698000000000000ffffffffffff 000000000000ffffffffffff dnl
16990000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
170000000000 00 000000 0000000000000000ffffffffffffffff
1701
1702# icmp,icmp_type=5
17030000 0058 00000000 00000397 dnl
1704000000000000ffffffffffff 000000000000ffffffffffff dnl
17050000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0005 0000 dnl
170600000000 00 000000 0000000000000000ffffffffffffffff
1707
1708# icmp,icmp_code=8
17090000 0058 00000000 00000357 dnl
1710000000000000ffffffffffff 000000000000ffffffffffff dnl
17110000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0000 0008 dnl
171200000000 00 000000 0000000000000000ffffffffffffffff
1713
1714# udp,tp_src=443
17150000 0058 00000000 00000397 dnl
1716000000000000ffffffffffff 000000000000ffffffffffff dnl
17170000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
171800000000 00 000000 0000000000000000ffffffffffffffff
1719
1720# udp,tp_dst=443
17210000 0058 00000000 00000357 dnl
1722000000000000ffffffffffff 000000000000ffffffffffff dnl
17230000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 0000 01bb dnl
172400000000 00 000000 0000000000000000ffffffffffffffff
1725
0d56eaf2 1726# sctp
410698cf
BP
17270000 0058 00000000 000003d7 dnl
1728000000000000ffffffffffff 000000000000ffffffffffff dnl
17290000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 0000 dnl
173000000000 00 000000 0000000000000000ffffffffffffffff
1731
0d56eaf2 1732# sctp,tp_src=443
410698cf
BP
17330000 0058 00000000 00000397 dnl
1734000000000000ffffffffffff 000000000000ffffffffffff dnl
17350000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
173600000000 00 000000 0000000000000000ffffffffffffffff
1737
0d56eaf2 1738# sctp,tp_dst=443
410698cf
BP
17390000 0058 00000000 00000357 dnl
1740000000000000ffffffffffff 000000000000ffffffffffff dnl
17410000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 01bb dnl
174200000000 00 000000 0000000000000000ffffffffffffffff
1743
0d56eaf2 1744dnl Ignore tp_src if not TCP/UDP/SCTP:
410698cf
BP
1745# ip,nw_proto=21
1746# 11: 97 -> d7
1747# 60: 01 -> 00
1748# 61: bb -> 00
17490000 0058 00000000 00000397 dnl
1750000000000000ffffffffffff 000000000000ffffffffffff dnl
17510000 00 00 0800 00 15 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
175200000000 00 000000 0000000000000000ffffffffffffffff
1753
0d56eaf2 1754dnl Ignore tp_dst if not TCP/UDP/SCTP:
410698cf
BP
1755# ip,nw_proto=22
1756# 11: 57 -> d7
1757# 62: 01 -> 00
1758# 63: bb -> 00
17590000 0058 00000000 00000357 dnl
1760000000000000ffffffffffff 000000000000ffffffffffff dnl
17610000 00 00 0800 00 16 00000000ffffffff 00000000ffffffff 0000 01bb dnl
176200000000 00 000000 0000000000000000ffffffffffffffff
1763
097d4939
JR
1764# mpls,mpls_label=284280
1765# 64: 12 -> 00
1766# 65: 34 -> 04
410698cf
BP
17670000 0058 00000000 000002f7 dnl
1768000000000000ffffffffffff 000000000000ffffffffffff dnl
17690000 00 00 8847 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
177012345678 00 000000 0000000000000000ffffffffffffffff
1771
097d4939
JR
1772# mplsm,mpls_tc=2
1773# 68: 5a -> 02
410698cf
BP
17740000 0058 00000000 000001f7 dnl
1775000000000000ffffffffffff 000000000000ffffffffffff dnl
17760000 00 00 8848 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
177700000000 5a 000000 0000000000000000ffffffffffffffff
1778
1779dnl mpls_label and mpls_tc must be ignored if dl_type is not MPLS:
1780# dl_type=0x1234
1781# 10: 00 -> 03
1782# 64: 12 -> 00
1783# 65: 34 -> 00
1784# 66: 56 -> 00
1785# 67: 78 -> 00
1786# 68: 5a -> 00
17870000 0058 00000000 000000f7 dnl
1788000000000000ffffffffffff 000000000000ffffffffffff dnl
17890000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
179012345678 5a 000000 0000000000000000ffffffffffffffff
1791
969fc56c
JS
1792dnl metadata match:
1793# metadata=0x1234567890abcdef
17940000 0058 00000000 000003ff dnl
1795000000000000ffffffffffff 000000000000ffffffffffff dnl
17960000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
179700000000 00 000000 1234567890abcdef0000000000000000
1798
1799dnl metadata match:
1800# metadata=0x5555555555555555/0x5555555555555555
410698cf
BP
18010000 0058 00000000 000003ff dnl
1802000000000000ffffffffffff 000000000000ffffffffffff dnl
18030000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
969fc56c
JS
180400000000 00 000000 5555555555555555aaaaaaaaaaaaaaaa
1805
1806dnl metadata match:
1807# metadata=0x1234000090ab0000/0xffff0000ffff0000
1808# 74: 56 -> 00
1809# 75: 78 -> 00
1810# 78: cd -> 00
1811# 79: ef -> 00
18120000 0058 00000000 000003ff dnl
1813000000000000ffffffffffff 000000000000ffffffffffff dnl
18140000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
181500000000 00 000000 1234567890abcdef0000ffff0000ffff
410698cf
BP
1816
1817])
1818sed '/^[[#&]]/d' < test-data > input.txt
1819sed -n 's/^# //p; /^$/p' < test-data > expout
1820sed -n 's/^& //p' < test-data > experr
1821AT_CAPTURE_FILE([input.txt])
1822AT_CAPTURE_FILE([expout])
1823AT_CAPTURE_FILE([experr])
1824AT_CHECK(
1825 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-match < input.txt],
1826 [0], [expout], [experr])
1827AT_CLEANUP
1828
102ce766
EJ
1829AT_SETUP([ovs-ofctl parse-nx-match loose])
1830AT_KEYWORDS([nx-match])
1831AT_DATA([nx-match.txt], [dnl
178742f9 1832NXM_OF_IN_PORT(0001), 01020304(1111/3333), NXM_OF_ETH_TYPE(0800)
508a9338
BP
1833NXM_OF_IN_PORT(0001), ffff020800002320(11112222), NXM_OF_ETH_TYPE(0800)
1834NXM_OF_IN_PORT(0001), ffff030800002320(1111/3333), NXM_OF_ETH_TYPE(0800)
102ce766
EJ
1835])
1836
1837AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
2e0525bc 1838nx_pull_match() returned error OFPBMC_BAD_FIELD
508a9338
BP
1839nx_pull_match() returned error OFPBMC_BAD_FIELD
1840nx_pull_match() returned error OFPBMC_BAD_FIELD
102ce766
EJ
1841])
1842
508a9338
BP
1843AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl
1844NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
1845NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
102ce766
EJ
1846NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
1847])
1848AT_CLEANUP
1849
c61f3870 1850AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.2)])
b5ae8913
SH
1851AT_KEYWORDS([oxm])
1852AT_DATA([oxm.txt], [dnl
1853<any>
1854
1855# in port
1856OXM_OF_IN_PORT(00000000)
1857OXM_OF_IN_PORT(fffffffe)
1858
969fc56c
JS
1859# metadata
1860OXM_OF_METADATA(5a5a5a5a5a5a5a5a)
1861OXM_OF_METADATA_W(0000000000000000/00000000ffffffff)
1862OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000)
1863OXM_OF_METADATA_W(1234567890abcdef/ffffffffffffffff)
fbcbc814 1864OXM_OF_METADATA_W(1234567890abcdef/0000000000000000)
969fc56c 1865
b5ae8913
SH
1866# eth dst
1867OXM_OF_ETH_DST(0002e30f80a4)
1868OXM_OF_ETH_DST_W(010000000000/010000000000)
1869OXM_OF_ETH_DST_W(000000000000/010000000000)
1870OXM_OF_ETH_DST_W(ffffffffffff/010000000000)
1871OXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
fbcbc814 1872OXM_OF_ETH_DST_W(0002e30f80a4/000000000000)
b5ae8913
SH
1873OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
1874
1875# eth src
1876OXM_OF_ETH_SRC(020898456ddb)
1877
1878# eth type
1879OXM_OF_ETH_TYPE(0800)
1880OXM_OF_ETH_TYPE(0800) OXM_OF_IN_PORT(00000012)
1881
95f61ba8
SH
1882# vlan
1883OXM_OF_VLAN_VID(1009) OXM_OF_VLAN_VID(1009) # Duplicate Field
1884OXM_OF_VLAN_VID(f009) # Bad Value
8069b0da 1885OXM_OF_VLAN_PCP(00) # Bad Pre-Requisite
95f61ba8
SH
1886OXM_OF_VLAN_VID(0000) # Packets without 802.1Q header or with VID=0
1887OXM_OF_VLAN_VID(1123) # Packets with VID=123, any PCP
1888OXM_OF_VLAN_VID(1123) OXM_OF_VLAN_PCP(01) # Packets with VID=123, PCP=1.
1889OXM_OF_VLAN_VID(0123) # Does not make sense (but supported anyway)
4b9f9232
SH
1890OXM_OF_VLAN_VID_W(0123/0123) # Does not make sense (but supported anyway)
1891OXM_OF_VLAN_VID_W(1123/0123) # Does not make sense (but supported anyway)
1892OXM_OF_VLAN_VID_W(0123/1123) # Does not make sense (but supported anyway)
8069b0da 1893OXM_OF_VLAN_VID(0123) OXM_OF_VLAN_PCP(01) #Bad Pre-Requisite
4b9f9232
SH
1894OXM_OF_VLAN_VID_W(1123/1fff) # Packets with VID=123, any PCP.
1895OXM_OF_VLAN_VID_W(1123/ffff) # Packets with VID=123, any PCP.
3947cc76
BP
1896OXM_OF_VLAN_VID_W(0000/0000) # Packets with or without 802.1Q header
1897OXM_OF_VLAN_VID_W(1103/1f0f), # Packets with # VID=123 (masked)
1898OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01) # Packets with VID=123 (masked), any PCP.
4b9f9232
SH
1899OXM_OF_VLAN_VID_W(1000/1000) # Packets with any VID, any PCP
1900OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) # Packets with any VID, PCP=1.
95f61ba8 1901
1638b906
BP
1902# IP TOS
1903OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(f0)
1904OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(41)
1905OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(3f)
178742f9 1906OXM_OF_IP_DSCP(3f)
1638b906 1907
b5ae8913
SH
1908# IP ECN
1909OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(03)
1910OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(06)
1911OXM_OF_IP_ECN(03)
1912
1913# IP protocol
1914OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01)
1915OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(05)
1916OXM_OF_IP_PROTO(05)
1917
1918# IP source
1919OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC(ac100014)
1920OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFF0000)
fbcbc814 1921OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFFFFFF)
3947cc76 1922OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(00000000/00000000)
b5ae8913
SH
1923OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_SRC(ac100014)
1924OXM_OF_IPV4_SRC_W(C0D80000/FFFF0000)
1925
1926# IP destination
1927OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST(ac100014)
3947cc76 1928OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a80000/FFFF0000)
fbcbc814 1929OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFFFFFF)
3947cc76 1930OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(00000000/00000000)
b5ae8913
SH
1931OXM_OF_IPV4_DST(ac100014)
1932OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_DST_W(C0D80000/FFFF0000)
1933
1934# TCP source port
1935OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC(4231)
1936OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/F0F0)
fbcbc814 1937OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/FFFF)
3947cc76 1938OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(0000/0000)
b5ae8913
SH
1939OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_SRC(4231)
1940
1941# TCP destination port
1942OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST(4231)
1943OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFF0)
fbcbc814 1944OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFFF)
3947cc76 1945OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(0000/0000)
b5ae8913
SH
1946OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_DST(4231)
1947
1948# UDP source port
1949OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC(8732)
1950OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/01FF)
fbcbc814 1951OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/FFFF)
3947cc76 1952OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0000/0000)
b5ae8913
SH
1953OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_UDP_SRC(7823)
1954
1955# UDP destination port
1956OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST(1782)
1957OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/F00F)
fbcbc814 1958OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/FFFF)
3947cc76 1959OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(0000/0000)
b5ae8913
SH
1960OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_UDP_DST(1293)
1961
0d56eaf2
JS
1962# SCTP source port
1963OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC(8732)
1964OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/01FF)
1965OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/FFFF)
3947cc76 1966OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0000/0000)
0d56eaf2
JS
1967OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_SCTP_SRC(7823)
1968
1969# SCTP destination port
1970OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST(1782)
1971OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/F00F)
1972OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/FFFF)
3947cc76 1973OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(0000/0000)
0d56eaf2
JS
1974OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_SCTP_DST(1293)
1975
b5ae8913
SH
1976# ICMP type
1977OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_TYPE(12)
1978OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_TYPE(10)
1979
1980# ICMP code
1981OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_CODE(12)
1982OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_CODE(10)
1983OXM_OF_ETH_TYPE(0800) OXM_OF_ICMPV4_CODE(10)
1984OXM_OF_ICMPV4_CODE(00)
1985
1986# ARP opcode
1987OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001)
1988OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(1111)
1989OXM_OF_ETH_TYPE(0000) OXM_OF_ARP_OP(0001)
1990OXM_OF_ARP_OP(0001)
1991OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) OXM_OF_ARP_OP(0001)
1992
1993# ARP source protocol address
1994OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA(ac100014)
3947cc76 1995OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81200/FFFFFF00)
fbcbc814 1996OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFFFF)
3947cc76 1997OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(00000000/00000000)
b5ae8913 1998OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SPA(ac100014)
178742f9 1999OXM_OF_ARP_SPA_W(C0D80000/FFFF0000)
b5ae8913
SH
2000
2001# ARP destination protocol address
2002OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA(ac100014)
3947cc76 2003OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a81200/FFFFFF00)
fbcbc814 2004OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFFFF)
3947cc76 2005OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(00000000/00000000)
b5ae8913
SH
2006OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_TPA(ac100014)
2007OXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
2008
2009# ARP source hardware address
2010OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA(0002e30f80a4)
2011OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SHA(0002e30f80a4)
2012OXM_OF_ARP_SHA(0002e30f80a4)
e878338b 2013OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/ffffffffffff)
3947cc76
BP
2014OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000000/000000000000)
2015OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000004/00000000000f)
b5ae8913
SH
2016
2017# ARP destination hardware address
2018OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA(0002e30f80a4)
2019OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_THA(0002e30f80a4)
2020OXM_OF_ARP_THA(0002e30f80a4)
e878338b 2021OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/ffffffffffff)
3947cc76
BP
2022OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000000/000000000000)
2023OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000004/00000000000f)
b5ae8913
SH
2024
2025# IPv6 source
2026OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
2027OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
2028OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
fbcbc814 2029OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
3947cc76 2030OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(00000000000000000000000000000000/00000000000000000000000000000000)
b5ae8913
SH
2031OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
2032
2033# IPv6 destination
2034OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
2035OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
2036OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
fbcbc814 2037OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
3947cc76 2038OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000)
b5ae8913
SH
2039OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
2040
626186c3
SH
2041# IPv6 Flow Label
2042OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(1000000f)
2043OXM_OF_IPV6_FLABEL(0000000f)
2044OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(0000000f)
32455024
SH
2045OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/0000000f)
2046OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000fffff)
3947cc76 2047OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/000ffff0)
32455024
SH
2048OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/100fffff)
2049OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/ffffffff)
3947cc76 2050OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/00000000)
626186c3 2051
b5ae8913
SH
2052# ND source hardware address
2053OXM_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)
2054OXM_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)
2055OXM_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)
2056OXM_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)
2057
2058# ND destination hardware address
2059OXM_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)
2060OXM_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)
2061OXM_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)
2062OXM_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)
2063
a678b23e
BP
2064# Registers 0, 1, and 2.
2065NXM_NX_REG0(acebdf56)
2066NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
2067NXM_NX_REG0(a0e0d050)
2068NXM_NX_REG1(acebdf56)
2069NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0)
2070NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050)
2071NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0)
2072NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050)
2073
2074# Extended registers 0, 1, and 2.
2075# (For OpenFlow 1.2, OVS transforms these into its extension registers.)
2076OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000)
2077OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000)
2078OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000)
2079OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff)
2080OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0)
2081OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff)
2082OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000)
2083OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000)
2084
b5ae8913 2085# Invalid field number.
178742f9 208601020304(1111/3333)
508a9338
BP
2087
2088# Invalid field numbers (experimenter OXM).
2089ffff020800002320(11112222)
2090ffff030800002320(1111/3333)
b5ae8913 2091])
9d84066c 2092AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow12 < oxm.txt],
e1cfc4e4 2093 [0], [dnl
b5ae8913
SH
2094<any>
2095
2096# in port
2097OXM_OF_IN_PORT(00000000)
2098OXM_OF_IN_PORT(fffffffe)
2099
969fc56c
JS
2100# metadata
2101OXM_OF_METADATA(5a5a5a5a5a5a5a5a)
2102OXM_OF_METADATA_W(0000000000000000/00000000ffffffff)
3947cc76 2103nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
969fc56c 2104OXM_OF_METADATA(1234567890abcdef)
3947cc76 2105nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
969fc56c 2106
b5ae8913
SH
2107# eth dst
2108OXM_OF_ETH_DST(0002e30f80a4)
2109OXM_OF_ETH_DST_W(010000000000/010000000000)
2110OXM_OF_ETH_DST_W(000000000000/010000000000)
3947cc76 2111nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
b5ae8913 2112OXM_OF_ETH_DST(0002e30f80a4)
3947cc76 2113nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
b5ae8913
SH
2114OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
2115
2116# eth src
2117OXM_OF_ETH_SRC(020898456ddb)
2118
2119# eth type
2120OXM_OF_ETH_TYPE(0800)
2121OXM_OF_IN_PORT(00000012), OXM_OF_ETH_TYPE(0800)
2122
95f61ba8
SH
2123# vlan
2124nx_pull_match() returned error OFPBMC_DUP_FIELD
2125nx_pull_match() returned error OFPBMC_BAD_VALUE
8069b0da 2126nx_pull_match() returned error OFPBMC_BAD_PREREQ
95f61ba8
SH
2127OXM_OF_VLAN_VID(0000)
2128OXM_OF_VLAN_VID(1123)
2129OXM_OF_VLAN_VID(1123), OXM_OF_VLAN_PCP(01)
2130OXM_OF_VLAN_VID(0123)
4b9f9232 2131OXM_OF_VLAN_VID_W(0123/0123)
3947cc76 2132nx_pull_match() returned error OFPBMC_BAD_WILDCARDS
4b9f9232 2133OXM_OF_VLAN_VID_W(0123/1123)
8069b0da 2134nx_pull_match() returned error OFPBMC_BAD_PREREQ
4b9f9232
SH
2135OXM_OF_VLAN_VID(1123)
2136OXM_OF_VLAN_VID(1123)
3d4b2e6e 2137OXM_OF_PACKET_TYPE(00000000)
4b9f9232
SH
2138OXM_OF_VLAN_VID_W(1103/1f0f)
2139OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01)
2140OXM_OF_VLAN_VID_W(1000/1000)
2141OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01)
95f61ba8 2142
1638b906
BP
2143# IP TOS
2144nx_pull_match() returned error OFPBMC_BAD_VALUE
2145nx_pull_match() returned error OFPBMC_BAD_VALUE
2146OXM_OF_ETH_TYPE(0800), OXM_OF_IP_DSCP(3f)
2147nx_pull_match() returned error OFPBMC_BAD_PREREQ
2148
b5ae8913
SH
2149# IP ECN
2150OXM_OF_ETH_TYPE(0800), OXM_OF_IP_ECN(03)
2151nx_pull_match() returned error OFPBMC_BAD_VALUE
2152nx_pull_match() returned error OFPBMC_BAD_PREREQ
2153
2154# IP protocol
2155OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01)
2156OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(05)
2157nx_pull_match() returned error OFPBMC_BAD_PREREQ
2158
2159# IP source
2160OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(ac100014)
2161OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC_W(c0a80000/ffff0000)
fbcbc814
SH
2162OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(c0a80000)
2163OXM_OF_ETH_TYPE(0800)
b5ae8913
SH
2164nx_pull_match() returned error OFPBMC_BAD_PREREQ
2165nx_pull_match() returned error OFPBMC_BAD_PREREQ
2166
2167# IP destination
2168OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(ac100014)
2169OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST_W(c0a80000/ffff0000)
fbcbc814
SH
2170OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(c0a88012)
2171OXM_OF_ETH_TYPE(0800)
b5ae8913
SH
2172nx_pull_match() returned error OFPBMC_BAD_PREREQ
2173nx_pull_match() returned error OFPBMC_BAD_PREREQ
2174
2175# TCP source port
2176OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(4231)
2177OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC_W(5050/f0f0)
fbcbc814
SH
2178OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(5050)
2179OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06)
b5ae8913
SH
2180nx_pull_match() returned error OFPBMC_BAD_PREREQ
2181
2182# TCP destination port
2183OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(4231)
2184OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST_W(fde0/fff0)
fbcbc814
SH
2185OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(fde0)
2186OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06)
b5ae8913
SH
2187nx_pull_match() returned error OFPBMC_BAD_PREREQ
2188
2189# UDP source port
2190OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(8732)
2191OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC_W(0132/01ff)
fbcbc814
SH
2192OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(0132)
2193OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11)
b5ae8913
SH
2194nx_pull_match() returned error OFPBMC_BAD_PREREQ
2195
2196# UDP destination port
2197OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(1782)
2198OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST_W(5005/f00f)
fbcbc814
SH
2199OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(5005)
2200OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11)
b5ae8913
SH
2201nx_pull_match() returned error OFPBMC_BAD_PREREQ
2202
0d56eaf2
JS
2203# SCTP source port
2204OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(8732)
2205OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC_W(0132/01ff)
2206OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(0132)
2207OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84)
2208nx_pull_match() returned error OFPBMC_BAD_PREREQ
2209
2210# SCTP destination port
2211OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(1782)
2212OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST_W(5005/f00f)
2213OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(5005)
2214OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84)
2215nx_pull_match() returned error OFPBMC_BAD_PREREQ
2216
b5ae8913
SH
2217# ICMP type
2218OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_TYPE(12)
2219nx_pull_match() returned error OFPBMC_BAD_PREREQ
2220
2221# ICMP code
2222OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_CODE(12)
2223nx_pull_match() returned error OFPBMC_BAD_PREREQ
2224nx_pull_match() returned error OFPBMC_BAD_PREREQ
2225nx_pull_match() returned error OFPBMC_BAD_PREREQ
2226
2227# ARP opcode
2228OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_OP(0001)
2229nx_pull_match() returned error OFPBMC_BAD_VALUE
2230nx_pull_match() returned error OFPBMC_BAD_PREREQ
2231nx_pull_match() returned error OFPBMC_BAD_PREREQ
2232nx_pull_match() returned error OFPBMC_DUP_FIELD
2233
2234# ARP source protocol address
2235OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(ac100014)
2236OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA_W(c0a81200/ffffff00)
fbcbc814
SH
2237OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(c0a81234)
2238OXM_OF_ETH_TYPE(0806)
b5ae8913
SH
2239nx_pull_match() returned error OFPBMC_BAD_PREREQ
2240nx_pull_match() returned error OFPBMC_BAD_PREREQ
2241
2242# ARP destination protocol address
2243OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(ac100014)
2244OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA_W(c0a81200/ffffff00)
fbcbc814
SH
2245OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(c0a812fe)
2246OXM_OF_ETH_TYPE(0806)
b5ae8913
SH
2247nx_pull_match() returned error OFPBMC_BAD_PREREQ
2248nx_pull_match() returned error OFPBMC_BAD_PREREQ
2249
2250# ARP source hardware address
2251OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4)
2252nx_pull_match() returned error OFPBMC_BAD_PREREQ
2253nx_pull_match() returned error OFPBMC_BAD_PREREQ
e878338b
SH
2254OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4)
2255OXM_OF_ETH_TYPE(0806)
2256OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA_W(000000000004/00000000000f)
b5ae8913
SH
2257
2258# ARP destination hardware address
2259OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4)
2260nx_pull_match() returned error OFPBMC_BAD_PREREQ
2261nx_pull_match() returned error OFPBMC_BAD_PREREQ
e878338b
SH
2262OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4)
2263OXM_OF_ETH_TYPE(0806)
2264OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA_W(000000000004/00000000000f)
b5ae8913
SH
2265
2266# IPv6 source
2267OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
2268nx_pull_match() returned error OFPBMC_BAD_PREREQ
2269OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
fbcbc814
SH
2270OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010000000000000000)
2271OXM_OF_ETH_TYPE(86dd)
b5ae8913
SH
2272nx_pull_match() returned error OFPBMC_BAD_PREREQ
2273
2274# IPv6 destination
2275OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
2276nx_pull_match() returned error OFPBMC_BAD_PREREQ
2277OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
fbcbc814
SH
2278OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010000000000000000)
2279OXM_OF_ETH_TYPE(86dd)
b5ae8913
SH
2280nx_pull_match() returned error OFPBMC_BAD_PREREQ
2281
626186c3
SH
2282# IPv6 Flow Label
2283nx_pull_match() returned error OFPBMC_BAD_VALUE
2284nx_pull_match() returned error OFPBMC_BAD_PREREQ
2285OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
32455024
SH
2286OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(0000000f/0000000f)
2287OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
2288OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(00000000/000ffff0)
2289OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
2290OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
2291OXM_OF_ETH_TYPE(86dd)
626186c3 2292
b5ae8913
SH
2293# ND source hardware address
2294OXM_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)
2295nx_pull_match() returned error OFPBMC_BAD_PREREQ
2296nx_pull_match() returned error OFPBMC_BAD_PREREQ
2297nx_pull_match() returned error OFPBMC_BAD_PREREQ
2298
2299# ND destination hardware address
2300OXM_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)
2301nx_pull_match() returned error OFPBMC_BAD_PREREQ
2302nx_pull_match() returned error OFPBMC_BAD_PREREQ
2303nx_pull_match() returned error OFPBMC_BAD_PREREQ
2304
a678b23e
BP
2305# Registers 0, 1, and 2.
2306NXM_NX_REG0(acebdf56)
2307NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
2308NXM_NX_REG0(a0e0d050)
2309NXM_NX_REG1(acebdf56)
2310NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0)
2311NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050)
2312NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0)
2313NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050)
2314
2315# Extended registers 0, 1, and 2.
2316# (For OpenFlow 1.2, OVS transforms these into its extension registers.)
2317NXM_NX_REG0(acebdf56)
2318NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
2319NXM_NX_REG0(a0e0d050)
2320NXM_NX_REG1(acebdf56)
2321NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0)
2322NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050)
2323NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0)
2324NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050)
2325
b5ae8913
SH
2326# Invalid field number.
2327nx_pull_match() returned error OFPBMC_BAD_FIELD
508a9338
BP
2328
2329# Invalid field numbers (experimenter OXM).
2330nx_pull_match() returned error OFPBMC_BAD_FIELD
2331nx_pull_match() returned error OFPBMC_BAD_FIELD
e1cfc4e4
BP
2332], [stderr])
2333
2334# Check that at least the first warning made it. (It's rate-limited
2335# so a variable number could show up, especially under valgrind etc.)
3947cc76 2336AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl
508a9338 2337nx_match|WARN|Rejecting NXM/OXM entry 0:32768:2:1:16 with 1-bits in value for bits wildcarded by the mask.
b5ae8913 2338])
e1cfc4e4
BP
2339
2340# Check that there wasn't any other stderr output.
3947cc76 2341AT_CHECK([grep -v '1-bits in value' stderr], [1])
b5ae8913
SH
2342AT_CLEANUP
2343
c61f3870
BP
2344AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.3)])
2345AT_KEYWORDS([oxm])
2346AT_DATA([oxm.txt], [dnl
2347# actset_output
2348ONFOXM_ET_ACTSET_OUTPUT(00000000)
2349ONFOXM_ET_ACTSET_OUTPUT(fffffffe)
2350ONFOXM_ET_ACTSET_OUTPUT(fffffff7)
2351OXM_OF_ACTSET_OUTPUT(00000000)
2352OXM_OF_ACTSET_OUTPUT(fffffffe)
2353OXM_OF_ACTSET_OUTPUT(fffffff7)
2354])
2355AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow13 < oxm.txt],
2356 [0], [dnl
2357# actset_output
2358ONFOXM_ET_ACTSET_OUTPUT(00000000)
2359ONFOXM_ET_ACTSET_OUTPUT(fffffffe)
2360ONFOXM_ET_ACTSET_OUTPUT(fffffff7)
2361ONFOXM_ET_ACTSET_OUTPUT(00000000)
2362ONFOXM_ET_ACTSET_OUTPUT(fffffffe)
2363ONFOXM_ET_ACTSET_OUTPUT(fffffff7)
2364], [])
2365AT_CLEANUP
2366
a678b23e
BP
2367AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.5)])
2368AT_KEYWORDS([oxm])
2369AT_DATA([oxm.txt], [dnl
2370# Extended registers 0 and 1.
2371OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000)
2372OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000)
2373OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000)
2374OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff)
2375OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0)
2376OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff)
2377OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000)
2378OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000)
2379
2380# Registers 0, 1, and 2.
2381# (OpenFlow 1.5 transforms these into the standard "xregs".)
2382NXM_NX_REG0(acebdf56)
2383NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
2384NXM_NX_REG0(a0e0d050)
2385NXM_NX_REG1(acebdf56)
2386NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0)
2387NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050)
2388NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0)
2389NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050)
c61f3870
BP
2390
2391# actset_output
2392ONFOXM_ET_ACTSET_OUTPUT(00000000)
2393ONFOXM_ET_ACTSET_OUTPUT(fffffffe)
2394ONFOXM_ET_ACTSET_OUTPUT(fffffff7)
2395OXM_OF_ACTSET_OUTPUT(00000000)
2396OXM_OF_ACTSET_OUTPUT(fffffffe)
2397OXM_OF_ACTSET_OUTPUT(fffffff7)
a678b23e
BP
2398])
2399AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow15 < oxm.txt],
2400 [0], [dnl
2401# Extended registers 0 and 1.
2402OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000)
2403OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000)
2404OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000)
2405OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff)
2406OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0)
2407OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff)
2408OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000)
2409OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000)
2410
2411# Registers 0, 1, and 2.
2412# (OpenFlow 1.5 transforms these into the standard "xregs".)
2413OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000)
2414OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000)
2415OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000)
2416OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff)
2417OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0)
2418OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff)
2419OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000)
2420OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000)
c61f3870
BP
2421
2422# actset_output
2423OXM_OF_ACTSET_OUTPUT(00000000)
2424OXM_OF_ACTSET_OUTPUT(fffffffe)
2425OXM_OF_ACTSET_OUTPUT(fffffff7)
2426OXM_OF_ACTSET_OUTPUT(00000000)
2427OXM_OF_ACTSET_OUTPUT(fffffffe)
2428OXM_OF_ACTSET_OUTPUT(fffffff7)
a678b23e
BP
2429], [])
2430AT_CLEANUP
2431
b5ae8913
SH
2432AT_SETUP([ovs-ofctl parse-oxm loose])
2433AT_KEYWORDS([oxm])
2434AT_DATA([oxm.txt], [dnl
178742f9 2435OXM_OF_IN_PORT(00000001), 01020304(1111/3333), OXM_OF_ETH_TYPE(0800)
508a9338
BP
2436OXM_OF_IN_PORT(00000001), ffff020800002320(11112222), OXM_OF_ETH_TYPE(0800)
2437OXM_OF_IN_PORT(00000001), ffff030800002320(1111/3333), OXM_OF_ETH_TYPE(0800)
b5ae8913
SH
2438])
2439
9d84066c 2440AT_CHECK([ovs-ofctl --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
b5ae8913 2441nx_pull_match() returned error OFPBMC_BAD_FIELD
508a9338
BP
2442nx_pull_match() returned error OFPBMC_BAD_FIELD
2443nx_pull_match() returned error OFPBMC_BAD_FIELD
b5ae8913
SH
2444])
2445
9d84066c 2446AT_CHECK([ovs-ofctl parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
b5ae8913 2447OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
508a9338
BP
2448OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
2449OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
2450])
2451AT_CLEANUP
2452
2453AT_SETUP([experimenter OXM encoding])
2454AT_DATA([oxm.txt], [dnl
d4ee9a73 2455NXOXM_ET_ERSPAN_VER(01)
508a9338 2456
d4ee9a73
WT
2457NXOXM_ET_ERSPAN_IDX(01020304)
2458NXOXM_ET_ERSPAN_IDX_W(01020304/0fffffff)
2459
2460NXOXM_ET_ERSPAN_DIR(01)
2461
2462NXOXM_ET_ERSPAN_HWID(12)
508a9338
BP
2463])
2464
d4ee9a73 2465# Test experimenter OXM encoding.
508a9338 2466AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow15 < oxm.txt], [0], [dnl
d4ee9a73
WT
2467NXOXM_ET_ERSPAN_VER_W(01/01)
246800000000 00 01 00 0e ff ff 19 06-00 00 23 20 01 01 00 00
508a9338 2469
d4ee9a73
WT
2470NXOXM_ET_ERSPAN_IDX(01020304)
247100000000 00 01 00 10 ff ff 16 08-00 00 23 20 01 02 03 04
2472NXOXM_ET_ERSPAN_IDX_W(01020304/0fffffff)
247300000000 00 01 00 14 ff ff 17 0c-00 00 23 20 01 02 03 04
327a39b6 247400000010 0f ff ff ff 00 00 00 00
d4ee9a73
WT
2475
2476NXOXM_ET_ERSPAN_DIR_W(01/01)
247700000000 00 01 00 0e ff ff 1b 06-00 00 23 20 01 01 00 00
2478
2479NXOXM_ET_ERSPAN_HWID_W(12/12)
248000000000 00 01 00 0e ff ff 1d 06-00 00 23 20 12 12 00 00
508a9338
BP
2481])
2482
508a9338 2483AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl
d4ee9a73
WT
2484NXOXM_ET_ERSPAN_VER_W(01/01)
248500000000 00 01 00 0e ff ff 19 06-00 00 23 20 01 01 00 00
2486
2487NXOXM_ET_ERSPAN_IDX(01020304)
248800000000 00 01 00 10 ff ff 16 08-00 00 23 20 01 02 03 04
2489NXOXM_ET_ERSPAN_IDX_W(01020304/0fffffff)
249000000000 00 01 00 14 ff ff 17 0c-00 00 23 20 01 02 03 04
249100000010 0f ff ff ff 00 00 00 00
2492
2493NXOXM_ET_ERSPAN_DIR_W(01/01)
249400000000 00 01 00 0e ff ff 1b 06-00 00 23 20 01 01 00 00
508a9338 2495
d4ee9a73
WT
2496NXOXM_ET_ERSPAN_HWID_W(12/12)
249700000000 00 01 00 0e ff ff 1d 06-00 00 23 20 12 12 00 00
b5ae8913
SH
2498])
2499AT_CLEANUP
2500
52ca734e
BP
2501AT_SETUP([check TCP flags expression in OXM and NXM])
2502# NXM/OXM input for matching on TCP flags.
2503tcp_flags='OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)'
2504
2505# Check that marshaling into NXM gives all NXM headers.
2506AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-nxm], [0],
2507 [NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff)
2508])
2509
ff057509
BP
2510# Check that marshaling in OXM for OF1.2 gives OXM headers except for
2511# TCP flags, which didn't have an OXM definition.
2512AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow12], [0],
2513 [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff)
2514])
2515
2516# Check that marshaling in OXM for OF1.3 and OF1.4 gives OXM headers,
2517# including the ONF extension for TCP flags introduced in OF1.3.
2518AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow13], [0],
2519 [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff)
2520])
2521AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow14], [0],
2522 [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff)
52ca734e 2523])
52ca734e
BP
2524
2525# OpenFlow 1.5 added an OXM header for TCP flags:
2526AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow15], [0],
2527 [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)
2528])
2529AT_CLEANUP
2530
df778240 2531dnl Check all of the patterns mentioned in the "VLAN Matching" section
7c9afefd 2532dnl in the topics/design doc
df778240
BP
2533AT_SETUP([ovs-ofctl check-vlan])
2534AT_KEYWORDS([VLAN])
2535
2536dnl [1]
2537AT_CHECK([ovs-ofctl check-vlan 0000 0000], [0], [dnl
2538 -> 0000/0000
2539NXM: <any> -> 0000/0000
476a0e9e 2540OXM: <any> -> 0000/0000,--
df778240
BP
2541OF1.0: 0000/1,00/1 -> 0000/0000
2542OF1.1: 0000/1,00/1 -> 0000/0000
2543])
2544
2545dnl [2]
2546AT_CHECK([ovs-ofctl check-vlan 0000 ffff], [0], [dnl
2547vlan_tci=0x0000 -> 0000/ffff
2548NXM: NXM_OF_VLAN_TCI(0000) -> 0000/ffff
476a0e9e 2549OXM: OXM_OF_VLAN_VID(0000) -> 0000/1fff,--
053df7bd 2550OF1.0: ffff/0,00/0 -> 0000/ffff
df778240
BP
2551OF1.1: ffff/0,00/1 -> 0000/ffff
2552])
2553
2554dnl [3]
2555AT_CHECK([ovs-ofctl check-vlan 1abc 1fff], [0], [dnl
2556dl_vlan=2748 -> 1abc/1fff
2557NXM: NXM_OF_VLAN_TCI_W(1abc/1fff) -> 1abc/1fff
476a0e9e 2558OXM: OXM_OF_VLAN_VID(1abc) -> 1abc/1fff,--
df778240
BP
2559OF1.0: 0abc/0,00/1 -> 1abc/1fff
2560OF1.1: 0abc/0,00/1 -> 1abc/1fff
2561])
2562
2563dnl [4]
2564AT_CHECK([ovs-ofctl check-vlan b000 f000], [0], [dnl
2565dl_vlan_pcp=5 -> b000/f000
2566NXM: NXM_OF_VLAN_TCI_W(b000/f000) -> b000/f000
476a0e9e 2567OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(05) -> 1000/1000,05
df778240
BP
2568OF1.0: 0000/1,05/0 -> b000/f000
2569OF1.1: fffe/0,05/0 -> b000/f000
2570])
2571
2572dnl [5]
2573AT_CHECK([ovs-ofctl check-vlan babc ffff], [0], [dnl
2574dl_vlan=2748,dl_vlan_pcp=5 -> babc/ffff
2575NXM: NXM_OF_VLAN_TCI(babc) -> babc/ffff
476a0e9e 2576OXM: OXM_OF_VLAN_VID(1abc), OXM_OF_VLAN_PCP(05) -> 1abc/1fff,05
df778240
BP
2577OF1.0: 0abc/0,05/0 -> babc/ffff
2578OF1.1: 0abc/0,05/0 -> babc/ffff
2579])
2580
2581dnl [6]
2582AT_CHECK([ovs-ofctl check-vlan 0000 0fff], [0], [dnl
2583vlan_tci=0x0000/0x0fff -> 0000/0fff
2584NXM: NXM_OF_VLAN_TCI_W(0000/0fff) -> 0000/0fff
476a0e9e 2585OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,--
df778240
BP
2586OF1.0: 0000/0,00/1 -> 1000/1fff
2587OF1.1: 0000/0,00/1 -> 1000/1fff
2588])
2589
2590dnl [7]
2591AT_CHECK([ovs-ofctl check-vlan 0000 f000], [0], [dnl
2592vlan_tci=0x0000/0xf000 -> 0000/f000
2593NXM: NXM_OF_VLAN_TCI_W(0000/f000) -> 0000/f000
476a0e9e 2594OXM: OXM_OF_VLAN_VID_W(0000/1000) -> 0000/1000,--
053df7bd 2595OF1.0: ffff/0,00/0 -> 0000/ffff
df778240
BP
2596OF1.1: ffff/0,00/1 -> 0000/ffff
2597])
2598
2599dnl [8]
2600AT_CHECK([ovs-ofctl check-vlan 0000 efff], [0], [dnl
2601vlan_tci=0x0000/0xefff -> 0000/efff
2602NXM: NXM_OF_VLAN_TCI_W(0000/efff) -> 0000/efff
476a0e9e 2603OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,--
df778240
BP
2604OF1.0: 0000/0,00/0 -> 1000/ffff
2605OF1.1: 0000/0,00/0 -> 1000/ffff
2606])
2607
2608dnl [9]
2609AT_CHECK([ovs-ofctl check-vlan 1001 1001], [0], [dnl
2610vlan_tci=0x1001/0x1001 -> 1001/1001
2611NXM: NXM_OF_VLAN_TCI_W(1001/1001) -> 1001/1001
476a0e9e 2612OXM: OXM_OF_VLAN_VID_W(1001/1001) -> 1001/1001,--
df778240
BP
2613OF1.0: 0001/0,00/1 -> 1001/1fff
2614OF1.1: 0001/0,00/1 -> 1001/1fff
2615])
2616
2617dnl [10]
2618AT_CHECK([ovs-ofctl check-vlan 3000 3000], [0], [dnl
2619vlan_tci=0x3000/0x3000 -> 3000/3000
2620NXM: NXM_OF_VLAN_TCI_W(3000/3000) -> 3000/3000
476a0e9e 2621OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) -> 1000/1000,01
df778240
BP
2622OF1.0: 0000/1,01/0 -> 3000/f000
2623OF1.1: fffe/0,01/0 -> 3000/f000
2624])
2625AT_CHECK
2626AT_CLEANUP
2627
7525e578
JS
2628dnl Check that "-F openflow10" rejects a flow_mod with unsupported features,
2629dnl such as tunnels and metadata.
2630AT_SETUP([ovs-ofctl -F option and NXM features])
50f96b10
BP
2631OVS_VSWITCHD_START
2632AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 tun_id=123,actions=drop],
aa233d57 2633 [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
0fbc9f11 2634])
50f96b10 2635AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 metadata=123,actions=drop],
aa233d57 2636 [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10)
7525e578 2637])
50f96b10 2638OVS_VSWITCHD_STOP
0fbc9f11
BP
2639AT_CLEANUP
2640
2641dnl Check that "-F nxm" really forces add-flow to use the NXM flow format.
2642dnl (If it doesn't, then either the tun_id won't show up at all, or it will
2643dnl additionally show up as the top 32 bits of the cookie.) This checks
2644dnl for regression against bug #4566.
2645AT_SETUP([ovs-ofctl -F option with flow_mods])
023e1e0a 2646OVS_VSWITCHD_START
0fbc9f11 2647AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop])
ef0ce8ae 2648AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
0fbc9f11 2649NXST_FLOW reply:
ef0ce8ae 2650 tun_id=0x12345678 actions=drop
0fbc9f11 2651])
023e1e0a 2652OVS_VSWITCHD_STOP
0fbc9f11 2653AT_CLEANUP
f9cbfbe4
BP
2654
2655dnl Check that "-F openflow10" is really honored on dump-flows.
2656dnl (If it isn't, then dump-flows will show the register match.)
2657AT_SETUP([ovs-ofctl dump-flows honors -F option])
023e1e0a 2658OVS_VSWITCHD_START
f9cbfbe4 2659AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop])
ef0ce8ae 2660AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl
f9cbfbe4 2661OFPST_FLOW reply:
ef0ce8ae 2662 actions=drop
f9cbfbe4 2663])
023e1e0a 2664OVS_VSWITCHD_STOP
f9cbfbe4
BP
2665AT_CLEANUP
2666
2667dnl Check that "-F openflow10" fails on dump-flows if the requested match
2668dnl can't be represented in OpenFlow 1.0.
2669AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
023e1e0a 2670OVS_VSWITCHD_START
f9cbfbe4 2671AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
aa233d57 2672 [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10)
f9cbfbe4 2673])
023e1e0a 2674OVS_VSWITCHD_STOP
f9cbfbe4 2675AT_CLEANUP
01b389b1
BP
2676
2677dnl Check that add-flow reports non-normalized flows (feature #5029).
2678AT_SETUP([ovs-ofctl add-flow reports non-normalized flows])
023e1e0a 2679OVS_VSWITCHD_START
01b389b1
BP
2680AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5],
2681 [0], [], [dnl
0d71302e
BP
2682ofp_match|INFO|normalization changed ofp_match, details:
2683ofp_match|INFO| pre: nw_src=1.2.3.4
2684ofp_match|INFO|post: @&t@
01b389b1 2685])
023e1e0a 2686OVS_VSWITCHD_STOP
01b389b1 2687AT_CLEANUP
410698cf 2688
bdcc5925
BP
2689dnl Check that --sort and --rsort works with dump-flows
2690dnl Default field is 'priority'. Flow entries are displayed based
2691dnl on field to sort.
2692AT_SETUP([ovs-ofctl dump-flows with sorting])
2693OVS_VSWITCHD_START
2694AT_KEYWORDS([sort])
2695AT_DATA([allflows.txt], [[
2696priority=4,in_port=23213 actions=output:42
2697priority=5,in_port=1029 actions=output:43
2698priority=7,in_port=1029 actions=output:43
2699priority=3,in_port=1028 actions=output:44
2700priority=1,in_port=1026 actions=output:45
2701priority=6,in_port=1027 actions=output:64
2702priority=2,in_port=1025 actions=output:47
2703priority=8,tcp,tp_src=5 actions=drop
2704priority=9,tcp,tp_src=6 actions=drop
5bc39e9a
JG
2705priority=10,tun_metadata0=0xab actions=drop
2706priority=11,tun_metadata0=0xcd actions=drop
bdcc5925
BP
2707]])
2708
5bc39e9a 2709AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0"])
bdcc5925
BP
2710AT_CHECK([ovs-ofctl add-flows br0 allflows.txt
2711], [0], [ignore])
5bc39e9a 2712
bdcc5925
BP
2713AT_CHECK([ovs-ofctl --sort dump-flows br0 | ofctl_strip], [0], [dnl
2714 priority=1,in_port=1026 actions=output:45
2715 priority=2,in_port=1025 actions=output:47
2716 priority=3,in_port=1028 actions=output:44
2717 priority=4,in_port=23213 actions=output:42
2718 priority=5,in_port=1029 actions=output:43
2719 priority=6,in_port=1027 actions=output:64
2720 priority=7,in_port=1029 actions=output:43
2721 priority=8,tcp,tp_src=5 actions=drop
2722 priority=9,tcp,tp_src=6 actions=drop
5bc39e9a
JG
2723 priority=10,tun_metadata0=0xab actions=drop
2724 priority=11,tun_metadata0=0xcd actions=drop
bdcc5925
BP
2725])
2726AT_CHECK([ovs-ofctl --rsort dump-flows br0 | ofctl_strip], [0], [dnl
5bc39e9a
JG
2727 priority=11,tun_metadata0=0xcd actions=drop
2728 priority=10,tun_metadata0=0xab actions=drop
bdcc5925
BP
2729 priority=9,tcp,tp_src=6 actions=drop
2730 priority=8,tcp,tp_src=5 actions=drop
2731 priority=7,in_port=1029 actions=output:43
2732 priority=6,in_port=1027 actions=output:64
2733 priority=5,in_port=1029 actions=output:43
2734 priority=4,in_port=23213 actions=output:42
2735 priority=3,in_port=1028 actions=output:44
2736 priority=2,in_port=1025 actions=output:47
2737 priority=1,in_port=1026 actions=output:45
2738])
2739AT_CHECK([ovs-ofctl --sort=in_port dump-flows br0 | ofctl_strip], [0], [dnl
2740 priority=2,in_port=1025 actions=output:47
2741 priority=1,in_port=1026 actions=output:45
2742 priority=6,in_port=1027 actions=output:64
2743 priority=3,in_port=1028 actions=output:44
2744 priority=7,in_port=1029 actions=output:43
2745 priority=5,in_port=1029 actions=output:43
2746 priority=4,in_port=23213 actions=output:42
5bc39e9a
JG
2747 priority=11,tun_metadata0=0xcd actions=drop
2748 priority=10,tun_metadata0=0xab actions=drop
bdcc5925
BP
2749 priority=9,tcp,tp_src=6 actions=drop
2750 priority=8,tcp,tp_src=5 actions=drop
2751])
2752AT_CHECK([ovs-ofctl --rsort=in_port dump-flows br0 | ofctl_strip], [0], [dnl
2753 priority=4,in_port=23213 actions=output:42
2754 priority=7,in_port=1029 actions=output:43
2755 priority=5,in_port=1029 actions=output:43
2756 priority=3,in_port=1028 actions=output:44
2757 priority=6,in_port=1027 actions=output:64
2758 priority=1,in_port=1026 actions=output:45
2759 priority=2,in_port=1025 actions=output:47
5bc39e9a
JG
2760 priority=11,tun_metadata0=0xcd actions=drop
2761 priority=10,tun_metadata0=0xab actions=drop
bdcc5925
BP
2762 priority=9,tcp,tp_src=6 actions=drop
2763 priority=8,tcp,tp_src=5 actions=drop
2764])
2765AT_CHECK([ovs-ofctl --sort=tcp_src dump-flows br0 | ofctl_strip], [0], [dnl
2766 priority=8,tcp,tp_src=5 actions=drop
2767 priority=9,tcp,tp_src=6 actions=drop
5bc39e9a
JG
2768 priority=11,tun_metadata0=0xcd actions=drop
2769 priority=10,tun_metadata0=0xab actions=drop
bdcc5925
BP
2770 priority=7,in_port=1029 actions=output:43
2771 priority=6,in_port=1027 actions=output:64
2772 priority=5,in_port=1029 actions=output:43
2773 priority=4,in_port=23213 actions=output:42
2774 priority=3,in_port=1028 actions=output:44
2775 priority=2,in_port=1025 actions=output:47
2776 priority=1,in_port=1026 actions=output:45
2777])
2778AT_CHECK(
5bc39e9a 2779 [ovs-ofctl --sort=in_port --sort=tcp_src --sort=tun_metadata0 dump-flows br0 | ofctl_strip], [0],
bdcc5925
BP
2780 [ priority=2,in_port=1025 actions=output:47
2781 priority=1,in_port=1026 actions=output:45
2782 priority=6,in_port=1027 actions=output:64
2783 priority=3,in_port=1028 actions=output:44
2784 priority=7,in_port=1029 actions=output:43
2785 priority=5,in_port=1029 actions=output:43
2786 priority=4,in_port=23213 actions=output:42
2787 priority=8,tcp,tp_src=5 actions=drop
2788 priority=9,tcp,tp_src=6 actions=drop
5bc39e9a
JG
2789 priority=10,tun_metadata0=0xab actions=drop
2790 priority=11,tun_metadata0=0xcd actions=drop
bdcc5925
BP
2791])
2792OVS_VSWITCHD_STOP
2793AT_CLEANUP
296ed880 2794
50f96b10
BP
2795AT_SETUP([ovs-ofctl dump-flows --names])
2796AT_KEYWORDS([port names])
2797OVS_VSWITCHD_START([\
2798 -- add-port br0 xyzzy -- set Interface xyzzy type=dummy -- \
2799 -- add-port br0 x-y -- set Interface x-y type=dummy -- \
2800 -- add-port br0 abc123 -- set Interface abc123 type=dummy -- \
2801 -- add-port br0 reallyverylongportname -- set Interface reallyverylongportname type=dummy -- \
2802 -- add-port br0 conflictinglongportname1 -- set Interface conflictinglongportname1 type=dummy -- \
2803 -- add-port br0 conflictinglongportname2 -- set Interface conflictinglongportname2 type=dummy])
2804
2805# These plain port names should be accepted.
2806AT_CHECK([ovs-ofctl add-flow br0 in_port=xyzzy,actions=x-y,abc123])
2807
2808# reallyverylongportname is accepted truncated, but not in full.
2809AT_CHECK([ovs-ofctl add-flow br0 in_port=reallyverylongp,actions=drop])
2810AT_CHECK([ovs-ofctl add-flow br0 in_port=reallyverylongportname,actions=drop],
2811 [1], [], [ovs-ofctl: reallyverylongportname: invalid or unknown port for in_port
2812])
2813
2814# conflictinglongportname1 and 2 can't be accepted even truncated, since
2815# they conflict when truncated.
2816AT_CHECK([ovs-ofctl add-flow br0 in_port=conflictinglongportname1,actions=drop], [1], [], [ovs-ofctl: conflictinglongportname1: invalid or unknown port for in_port
2817])
2818AT_CHECK([ovs-ofctl add-flow br0 in_port=conflictinglongportname2,actions=drop], [1], [], [ovs-ofctl: conflictinglongportname2: invalid or unknown port for in_port
2819])
2820AT_CHECK([ovs-ofctl add-flow br0 in_port=conflictinglong,actions=drop], [1], [], [ovs-ofctl: conflictinglong: invalid or unknown port for in_port
2821])
2822
2823# Show that the port names get displayed properly and that port names that
2824# aren't alphanumeric get quoted.
2825AT_CHECK([ovs-ofctl --names dump-flows br0 | ofctl_strip | sort], [0], [dnl
2826 in_port=reallyverylongp actions=drop
2827 in_port=xyzzy actions=output:"x-y",output:abc123
2828])
2829OVS_VSWITCHD_STOP
2830AT_CLEANUP
2831
296ed880
BP
2832AT_SETUP([ovs-ofctl diff-flows])
2833OVS_VSWITCHD_START
2834
296ed880
BP
2835# Add tons of flows to br0.
2836for i in `seq 0 1023`; do echo "dl_vlan=$i,actions=drop"; done > add-flows.txt
2837AT_CHECK([ovs-ofctl add-flows br0 add-flows.txt])
2838
2839# Dump them and compare against what we expect by hand, then with diff-flows.
2840for i in `seq 0 1023`; do echo " dl_vlan=$i actions=drop"; done | sort > expout
2841AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/NXST_FLOW/d' | sort],
2842 [0], [expout])
2843AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt])
2844
2845# Remove even-numbered flows, compare again.
2846for i in `seq 0 1023 2`; do echo "dl_vlan=$i"; done > del-flows.txt
2847AT_CHECK([ovs-ofctl del-flows br0 - < del-flows.txt])
2848for i in `seq 0 1023 2`; do echo "+dl_vlan=$i actions=drop"; done | sort > expout
2849AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt | sort], [0], [expout])
2850for i in `seq 0 1023 2`; do echo "-dl_vlan=$i actions=drop"; done | sort > expout
2851AT_CHECK([ovs-ofctl diff-flows add-flows.txt br0 | sort], [0], [expout])
2852
2853OVS_VSWITCHD_STOP
2854AT_CLEANUP
98f7f427 2855
f6812140
JG
2856AT_SETUP([ovs-ofctl diff-flows - tunnel metadata])
2857OVS_VSWITCHD_START
2858
2859AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=4}->tun_metadata0,{class=0xffff,type=1,len=8}->tun_metadata1"])
2860
2861# Tunnel metadata requires dynamic allocation of space in the metadata table.
2862# To stress this, try flows with different sizes for metadata, in different
2863# orders, and interspersed with other fields to see if they still compare
2864# correctly.
2865AT_DATA([flows.txt], [dnl
2866priority=0,tun_metadata0=0,actions=drop
2867priority=1,tun_metadata1=0xef/0xff,tun_metadata0=0xabcd,actions=drop
2868priority=2,tun_metadata0=0xffffffff,actions=drop
2869])
2870
2871AT_DATA([flows2.txt], [dnl
2872priority=2,tun_metadata0=0xffffffff,actions=drop
2873priority=0,tun_metadata0=0,actions=drop
2874])
2875
2876AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2877AT_CHECK([ovs-ofctl diff-flows br0 flows2.txt], [2], [dnl
2878-priority=1,tun_metadata0=0xabcd,tun_metadata1=0xef/0xff actions=drop
2879])
2880
2881OVS_VSWITCHD_STOP
2882AT_CLEANUP
2883
98f7f427
BP
2884dnl ofpacts that differ bytewise don't necessarily differ when
2885dnl converted to another representation, such as OpenFlow 1.0
2886dnl or to a string. "resubmit(,1)" is an example of an action
2887dnl of this type: "ofpact_resubmit"s can differ in their "compat"
2888dnl values even though this doesn't affect the string format.
2889dnl
2890dnl This test checks that "ovs-ofctl diff-flows" doesn't report
2891dnl false ofpacts differences.
2892AT_SETUP([ovs-ofctl diff-flows - suppress false differences])
2893OVS_VSWITCHD_START
2894AT_DATA([flows.txt], [actions=resubmit(,1)
2895])
2896AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2897AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
2898AT_CHECK([ovs-ofctl add-flow br0 idle_timeout=60,dl_vlan=9,actions=output:1])
2899AT_CHECK([ovs-ofctl diff-flows br0 flows.txt], [2], [dnl
2900-dl_vlan=9 idle_timeout=60 actions=output:1
2901])
2902AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=120,cookie=1234,dl_vlan=9,actions=output:1])
2903AT_CHECK([ovs-ofctl diff-flows flows.txt br0], [2], [dnl
2904+dl_vlan=9 cookie=0x4d2 hard_timeout=120 actions=output:1
2905])
2906OVS_VSWITCHD_STOP
2907AT_CLEANUP
37923ac7
BP
2908
2909AT_SETUP([ovs-ofctl -F and -O interaction])
2910AT_CHECK([ovs-ofctl -F oxm -O openflow10], [1], [],
2911 [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.)
2912])
2913AT_CHECK([ovs-ofctl -F oxm -O openflow11], [1], [],
2914 [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.)
2915])
2916AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow11], [1], [],
2917 [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.)
2918])
2919AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow12], [1], [],
2920 [ovs-ofctl: missing command name; use --help for help
2921])
2922AT_CHECK([ovs-ofctl -F oxm -O openflow12], [1], [],
2923 [ovs-ofctl: missing command name; use --help for help
2924])
2925AT_CHECK([ovs-ofctl -F oxm -O openflow13], [1], [],
2926 [ovs-ofctl: missing command name; use --help for help
2927])
2928AT_CLEANUP
1ac0e975
BP
2929
2930AT_SETUP([ovs-ofctl ofp-parse])
2931# Test the echo request/reply messages (0 payload).
2932AT_CHECK([printf '\1\2\0\10\0\0\0\0\1\3\0\10\0\0\0\0' > binary_ofp_msg])
2933AT_CHECK([ovs-ofctl ofp-parse binary_ofp_msg], [0], [dnl
2934OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload
2935OFPT_ECHO_REPLY (xid=0x0): 0 bytes of payload
2936])
2937
2938# Test the hello (xid:1 3-byte payload).
2939AT_CHECK([printf '\1\0\0\13\0\0\0\1\101\102\103' > binary_ofp_msg])
2940AT_CHECK([ovs-ofctl ofp-parse - < binary_ofp_msg], [0], [dnl
2941OFPT_HELLO (xid=0x1):
2942 version bitmap: 0x01
2943 unknown data in hello:
294400000000 01 00 00 0b 00 00 00 01-41 42 43 |........ABC |
2945])
2946AT_CLEANUP
dc235f7f
JR
2947
2948AT_SETUP([tcp flags - filtering])
2949OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \
2950 -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2])
2951AT_DATA([flows.txt], [dnl
5a0e4aec
BP
2952 in_port=1,tcp,tp_dst=80,tcp_flags=+syn-rst-ack-fin,action=2 # Allow outbound web traffic bare-SYN
2953 in_port=1,tcp,tp_dst=80,tcp_flags=+ack,action=2 # Allow outbound web traffic with ACK bit
2954 in_port=1,tcp,tp_dst=80,tcp_flags=+rst,action=2 # Allow outbound web traffic with RST bit
2955 in_port=2,tcp,tp_src=80,tcp_flags=+ack,action=1 # Allow inbound web traffic with ACK bit
2956 in_port=2,tcp,tp_src=80,tcp_flags=+rst,action=1 # Allow inbound web traffic with RST bit
2957 priority=0,in_port=1,action=drop # Default drop outbound
2958 priority=0,in_port=2,action=drop # Default drop inbound
dc235f7f
JR
2959])
2960
2961AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2962
61bf6666
JR
2963AT_CHECK([ovs-ofctl add-flow br0 "tcp,tcp_flags=+ack-ack,action="], [1], [],
2964 [ovs-ofctl: ack: Each TCP flag can be specified only once
2965])
2966
e79a6c83 2967AT_CHECK([ovs-appctl dpif/show | tail -n +4], [0], [dnl
7be29a47
BP
2968 p1 1/1: (dummy)
2969 p2 2/2: (dummy)
dc235f7f
JR
2970])
2971
61bf6666 2972dnl Outbound web traffic with bare-SYN
dc235f7f
JR
2973AT_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])
2974AT_CHECK([tail -1 stdout], [0],
2975 [Datapath actions: 2
2976])
2977
2978dnl Outbopund web traffic with ACK bit
2979AT_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])
2980AT_CHECK([tail -1 stdout], [0],
2981 [Datapath actions: 2
2982])
2983
2984dnl Outbound web traffic with RST bit
2985AT_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])
2986AT_CHECK([tail -1 stdout], [0],
2987 [Datapath actions: 2
2988])
2989
2990dnl Inbound web traffic with ACK bit
2991AT_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])
2992AT_CHECK([tail -1 stdout], [0],
2993 [Datapath actions: 1
2994])
2995
2996dnl Inbound web traffic with RST bit
2997AT_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])
2998AT_CHECK([tail -1 stdout], [0],
2999 [Datapath actions: 1
3000])
3001
3002dnl Inbound web traffic with SYN bit without ACK or RST bits
3003AT_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])
3004AT_CHECK([tail -1 stdout], [0],
3005 [Datapath actions: drop
3006])
3007
3008OVS_VSWITCHD_STOP
3009AT_CLEANUP
ca26eb44
RB
3010
3011dnl Check importance parameter added in OF1.4.
3012dnl It validates whether importance set via add-flow via OpenFlow1.4+ gets
de1b46de 3013dnl set or not by validating it against the dump-flows output via OpenFlow1.4+
ca26eb44
RB
3014dnl If add-flow or dump-flows is used with later version of OpenFlow prior to 1.4+
3015dnl then the importance will be considered zero whether provided as an argument.
3016
3017AT_SETUP([ovs-ofctl rule with importance])
3018OVS_VSWITCHD_START
3019dnl Flow with importance parameter added via OF1.4+ and later version
3020AT_CHECK([ovs-ofctl -O OpenFlow14 add-flow br0 priority=21,importance=21,actions=normal])
3021AT_CHECK([ovs-ofctl add-flow br0 priority=22,importance=22,actions=normal])
3022
3023dnl Importance parameter will only be visible of flows that are added via OF1.4+ if dumped via OF1.4+
a56dd713 3024AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl
ca26eb44 3025 importance=21, priority=21 actions=NORMAL
13327b8e 3026 reset_counts priority=22 actions=NORMAL
ca26eb44
RB
3027])
3028
3029dnl Importance parameter will not be visible if flow is dumped with previous version prior to OF1.4+ whether added via OF1.4+
a56dd713 3030AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl
ca26eb44 3031 priority=21 actions=NORMAL
a56dd713 3032 priority=22 actions=NORMAL
ca26eb44
RB
3033])
3034
3035OVS_VSWITCHD_STOP
3036AT_CLEANUP
3037
3038
3039dnl Importance parameter added in OF1.4.
3040dnl This validates whether flows with importance
3041dnl parameter are getting replaced with "replace-flows" or
3042dnl not by validating dump-flows output after replace with the expected output.
3043
3044AT_SETUP([ovs-ofctl replace-flows with importance])
3045OVS_VSWITCHD_START
3046
3047dnl Add flows to br0 with importance via OF1.4+. For more details refer "ovs-ofctl rule with importance" test case.
c453c5af 3048for 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
3049AT_CHECK([ovs-ofctl -O OpenFlow14 add-flows br0 add-flows.txt])
3050
4b69263d
JR
3051dnl Replace the flows in the bridge.
3052for i in 1 3 5 7; do echo " importance=`expr $i + 10`, dl_vlan=$i actions=drop"; done > replace-flows.txt
ca26eb44
RB
3053AT_CHECK([ovs-ofctl -O OpenFlow14 replace-flows br0 replace-flows.txt])
3054
3055dnl Dump them and compare the dump flows output against the expected output.
4b69263d 3056cat replace-flows.txt > expout
ca26eb44
RB
3057AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort],
3058 [0], [expout])
3059
3060OVS_VSWITCHD_STOP
3061AT_CLEANUP
db5076ee
JR
3062
3063AT_SETUP([ovs-ofctl replace-flows with --bundle])
3064OVS_VSWITCHD_START
3065
3066AT_CHECK([ovs-appctl vlog/set vconn:dbg])
3067
3068dnl 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 3069for 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
50f96b10 3070AT_CHECK([ovs-ofctl --bundle --no-names add-flows br0 add-flows.txt])
db5076ee
JR
3071
3072dnl Replace some flows in the bridge.
00da1ac5 3073for i in 1 3 5 7; do echo " table=$i, importance=`expr $i + 10`, dl_vlan=$i actions=drop"; done > replace-flows.txt
50f96b10 3074AT_CHECK([ovs-ofctl --bundle --no-names replace-flows br0 replace-flows.txt])
db5076ee
JR
3075
3076dnl Dump them and compare the dump flows output against the expected output.
4b69263d 3077cat replace-flows.txt > expout
50f96b10 3078AT_CHECK([ovs-ofctl -O OpenFlow14 --no-names dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort],
db5076ee
JR
3079 [0], [expout])
3080
3081dnl Check logs for OpenFlow trace
3082# Prevent race.
38b0b29f 3083OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): OFPST_FLOW reply" | wc -l` -ge 2])
db5076ee 3084# AT_CHECK([sed -n "s/^.*\(|vconn|DBG|.*xid=.*:\).*$/\1/p" ovs-vswitchd.log], [0], [dnl
12e2ba2e 3085AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl
29718ad4
BP
3086vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3087 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
db5076ee 3088vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5f8c05ad 3089 version bitmap: 0x05
29718ad4 3090vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
db5076ee 3091vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
39c94593 3092 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
db5076ee
JR
3093vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3094 bundle_id=0 type=OPEN_REPLY flags=0
3095vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3096 bundle_id=0 flags=atomic ordered
00da1ac5 3097OFPT_FLOW_MOD (OF1.4): ADD table:1 dl_vlan=1 importance:1 actions=drop
db5076ee 3098vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3099 bundle_id=0 flags=atomic ordered
00da1ac5 3100OFPT_FLOW_MOD (OF1.4): ADD table:2 dl_vlan=2 importance:2 actions=drop
db5076ee 3101vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3102 bundle_id=0 flags=atomic ordered
00da1ac5 3103OFPT_FLOW_MOD (OF1.4): ADD table:3 dl_vlan=3 importance:3 actions=drop
db5076ee 3104vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3105 bundle_id=0 flags=atomic ordered
00da1ac5 3106OFPT_FLOW_MOD (OF1.4): ADD table:4 dl_vlan=4 importance:4 actions=drop
db5076ee 3107vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3108 bundle_id=0 flags=atomic ordered
00da1ac5 3109OFPT_FLOW_MOD (OF1.4): ADD table:5 dl_vlan=5 importance:5 actions=drop
db5076ee 3110vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3111 bundle_id=0 flags=atomic ordered
00da1ac5 3112OFPT_FLOW_MOD (OF1.4): ADD table:6 dl_vlan=6 importance:6 actions=drop
db5076ee 3113vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3114 bundle_id=0 flags=atomic ordered
00da1ac5 3115OFPT_FLOW_MOD (OF1.4): ADD table:7 dl_vlan=7 importance:7 actions=drop
db5076ee 3116vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3117 bundle_id=0 flags=atomic ordered
00da1ac5 3118OFPT_FLOW_MOD (OF1.4): ADD table:8 dl_vlan=8 importance:8 actions=drop
506c1ddb
JR
3119vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
3120vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
db5076ee 3121vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
39c94593 3122 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
db5076ee
JR
3123vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3124 bundle_id=0 type=COMMIT_REPLY flags=0
29718ad4
BP
3125vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3126 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
db5076ee 3127vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
5f8c05ad 3128 version bitmap: 0x05
29718ad4 3129vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
db5076ee
JR
3130vconn|DBG|unix: received: OFPST_FLOW request (OF1.4):
3131vconn|DBG|unix: sent (Success): OFPST_FLOW reply (OF1.4):
00da1ac5
JR
3132 table=1, importance=1, dl_vlan=1 actions=drop
3133 table=2, importance=2, dl_vlan=2 actions=drop
3134 table=3, importance=3, dl_vlan=3 actions=drop
3135 table=4, importance=4, dl_vlan=4 actions=drop
3136 table=5, importance=5, dl_vlan=5 actions=drop
3137 table=6, importance=6, dl_vlan=6 actions=drop
3138 table=7, importance=7, dl_vlan=7 actions=drop
3139 table=8, importance=8, dl_vlan=8 actions=drop
db5076ee 3140vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
39c94593 3141 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
db5076ee
JR
3142vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3143 bundle_id=0 type=OPEN_REPLY flags=0
4b69263d
JR
3144vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3145 bundle_id=0 flags=atomic ordered
00da1ac5 3146OFPT_FLOW_MOD (OF1.4): ADD table:1 dl_vlan=1 importance:11 actions=drop
4b69263d
JR
3147vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3148 bundle_id=0 flags=atomic ordered
00da1ac5 3149OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:2 dl_vlan=2 actions=drop
4b69263d
JR
3150vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3151 bundle_id=0 flags=atomic ordered
00da1ac5 3152OFPT_FLOW_MOD (OF1.4): ADD table:3 dl_vlan=3 importance:13 actions=drop
4b69263d
JR
3153vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3154 bundle_id=0 flags=atomic ordered
00da1ac5 3155OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:4 dl_vlan=4 actions=drop
db5076ee 3156vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3157 bundle_id=0 flags=atomic ordered
00da1ac5 3158OFPT_FLOW_MOD (OF1.4): ADD table:5 dl_vlan=5 importance:15 actions=drop
db5076ee 3159vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3160 bundle_id=0 flags=atomic ordered
00da1ac5 3161OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:6 dl_vlan=6 actions=drop
db5076ee 3162vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3163 bundle_id=0 flags=atomic ordered
00da1ac5 3164OFPT_FLOW_MOD (OF1.4): ADD table:7 dl_vlan=7 importance:17 actions=drop
db5076ee 3165vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
39c94593 3166 bundle_id=0 flags=atomic ordered
00da1ac5 3167OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:8 dl_vlan=8 actions=drop
506c1ddb
JR
3168vconn|DBG|unix: received: OFPT_BARRIER_REQUEST (OF1.4):
3169vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY (OF1.4):
db5076ee 3170vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
39c94593 3171 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
db5076ee
JR
3172vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3173 bundle_id=0 type=COMMIT_REPLY flags=0
29718ad4
BP
3174vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3175 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
db5076ee
JR
3176vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3177 version bitmap: 0x05
29718ad4 3178vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05)
db5076ee
JR
3179vconn|DBG|unix: received: OFPST_FLOW request (OF1.4):
3180vconn|DBG|unix: sent (Success): OFPST_FLOW reply (OF1.4):
00da1ac5
JR
3181 table=1, importance=11, dl_vlan=1 actions=drop
3182 table=3, importance=13, dl_vlan=3 actions=drop
3183 table=5, importance=15, dl_vlan=5 actions=drop
3184 table=7, importance=17, dl_vlan=7 actions=drop
db5076ee
JR
3185])
3186
3187OVS_VSWITCHD_STOP
3188AT_CLEANUP
2a7c4805
JP
3189
3190
3191AT_SETUP([ovs-ofctl ct-flush-zone])
3192OVS_VSWITCHD_START
3193
3194AT_CHECK([ovs-appctl vlog/set ct_dpif:dbg])
3195AT_CHECK([ovs-ofctl ct-flush-zone br0 123])
3196
3197OVS_WAIT_UNTIL([grep -q "|ct_dpif|DBG|.*ct_flush:" ovs-vswitchd.log])
817a7657 3198AT_CHECK([grep -q "ct_dpif|DBG|.*ct_flush: zone 123" ovs-vswitchd.log])
2a7c4805
JP
3199
3200OVS_VSWITCHD_STOP
3201AT_CLEANUP
ba359312
AV
3202
3203
3204AT_SETUP([ovs-ofctl snoop])
3205OVS_VSWITCHD_START
3206
3207dnl setup controller for br0 before starting the controller
3208AT_CHECK([ovs-vsctl -vsyslog:off set-controller br0 unix:testcontroller])
3209
3210dnl then start listening on the '.snoop' connection
3211on_exit 'kill `cat ovs-ofctl-snoop.pid`'
9a403b07 3212AT_CHECK([ovs-ofctl -vsyslog:off --detach --no-chdir --pidfile=ovs-ofctl-snoop.pid snoop br0 > snoopbr0.txt 2>&1])
ba359312
AV
3213
3214dnl finally start the controller
3215on_exit 'kill `cat ovs-testcontroller.pid`'
9a403b07 3216AT_CHECK([ovs-testcontroller -vsyslog:off --detach --no-chdir --pidfile punix:testcontroller], [0], [ignore])
ba359312
AV
3217OVS_WAIT_UNTIL([test -e testcontroller])
3218
3219dnl check for some of the initial handshake messages
3220OVS_WAIT_UNTIL([egrep "OFPT_FEATURES_REQUEST" snoopbr0.txt >/dev/null 2>&1])
3221OVS_WAIT_UNTIL([egrep "OFPT_FEATURES_REPLY" snoopbr0.txt >/dev/null 2>&1])
3222OVS_WAIT_UNTIL([egrep "OFPT_SET_CONFIG" snoopbr0.txt >/dev/null 2>&1])
3223
3224dnl need to suppress the 'connection failed' WARN message in ovs-vswitchd
3225dnl because we need ovs-vswitchd to have the controller config before starting
3226dnl the controller to 'snoop' the OpenFlow messages from beginning
3227OVS_VSWITCHD_STOP(["/connection failed (No such file or directory)/d"])
3228AT_CLEANUP