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