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