97ea703f9aecb8780e04e2f7ea60f5f83b461210
[openvswitch] / tests / ovs-ofctl.at
1 AT_BANNER([ovs-ofctl])
2
3 AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.0)])
4 AT_DATA([flows.txt], [[
5 # comment
6 tcp,tp_src=123,actions=flood
7 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
8 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
9 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
10 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
11 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
12 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
13 ]])
14
15 AT_CHECK([ovs-ofctl parse-flows flows.txt
16 ], [0], [stdout])
17 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
18 [[usable protocols: any
19 chosen protocol: OpenFlow10-table_id
20 OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
21 OFPT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
22 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
23 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
24 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
25 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
26 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
27 ]])
28 AT_CLEANUP
29
30 AT_SETUP([ovs-ofctl parse-flows (NXM)])
31 AT_DATA([flows.txt], [[
32 # comment
33 tcp,tp_src=123,actions=flood
34 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
35 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
36 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
37 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
38 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
39 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
40 tcp,tp_src=0x1230/0xfff0,tun_id=0x1234,cookie=0x5678,actions=flood
41 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789
42 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])
43 table=1,actions=drop
44 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
45 metadata=0x1234ffff5678ffff/0xffff0000ffff0000,actions=drop
46 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
47 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
48 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
49 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
50 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
51 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
52 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:[2,3])
53 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
54 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2
55 actions=resubmit:1,resubmit(2),resubmit(,3),resubmit(2,3)
56 send_flow_rem,actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3
57 check_overlap,actions=output:1,exit,output:2
58 actions=fin_timeout(idle_timeout=5,hard_timeout=15)
59 actions=controller(max_len=123,reason=invalid_ttl,id=555)
60 ]])
61
62 AT_CHECK([ovs-ofctl parse-flows flows.txt
63 ], [0], [stdout])
64 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
65 [[usable protocols: NXM+table_id
66 chosen protocol: NXM+table_id
67 NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD
68 NXT_FLOW_MOD: ADD table:255 in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
69 NXT_FLOW_MOD: ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
70 NXT_FLOW_MOD: ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
71 NXT_FLOW_MOD: ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
72 NXT_FLOW_MOD: ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
73 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
74 NXT_FLOW_MOD: ADD table:255 tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD
75 NXT_FLOW_MOD: ADD table:255 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789
76 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])
77 NXT_FLOW_MOD: ADD table:1 actions=drop
78 NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
79 NXT_FLOW_MOD: ADD table:255 metadata=0x1234000056780000/0xffff0000ffff0000 actions=drop
80 NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
81 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
82 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
83 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
84 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
85 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
86 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
87 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
88 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
89 NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3)
90 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
91 NXT_FLOW_MOD: ADD table:255 check_overlap actions=output:1,exit,output:2
92 NXT_FLOW_MOD: ADD table:255 actions=fin_timeout(idle_timeout=5,hard_timeout=15)
93 NXT_FLOW_MOD: ADD table:255 actions=controller(reason=invalid_ttl,max_len=123,id=555)
94 ]])
95 AT_CLEANUP
96
97 AT_SETUP([ovs-ofctl -F nxm parse-flows])
98 AT_DATA([flows.txt], [
99 # comment
100 tcp,tp_src=123,actions=flood
101 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
102 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
103 ipv6,ipv6_label=0x12345 actions=2
104 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
105 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
106 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
107 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop 
108 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop 
109 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
110 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
111 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
112 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
113 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
114 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4F:0571/112 actions=drop
115 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
116 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
117 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE00:0000/96,nd_tll=00:0A:E4:25:6B:B1 actions=drop
118 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
119 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
120 tun_id=0x1234,cookie=0x5678,actions=flood
121 actions=drop
122 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
123 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop
124 dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop
125 dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop
126 dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop
127 ])
128 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
129 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
130 usable protocols: NXM
131 chosen protocol: NXM-table_id
132 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
133 NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
134 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
135 NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2
136 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
137 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4
138 NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5
139 NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
140 NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
141 NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
142 NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
143 NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
144 NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
145 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571 actions=drop
146 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4f:0/112 actions=drop
147 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop
148 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
149 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
150 NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
151 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
152 NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
153 NXT_FLOW_MOD: ADD actions=drop
154 NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
155 NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
156 NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop
157 NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop
158 NXT_FLOW_MOD: ADD actions=drop
159 ])
160 AT_CLEANUP
161
162 AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows])
163 AT_DATA([flows.txt], [[
164 # comment
165 tcp,tp_src=123,actions=flood
166 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
167 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
168 ipv6,ipv6_label=0x12345 actions=2
169 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
170 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
171 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
172 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop 
173 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop 
174 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
175 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
176 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
177 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
178 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
179 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
180 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
181 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
182 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
183 tun_id=0x1234,cookie=0x5678,actions=flood
184 actions=drop
185 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[]
186 actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[]
187 actions=autopath(5,NXM_NX_REG0[])
188 vlan_tci=0x1123/0x1fff,actions=drop
189 ]])
190 AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout])
191 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
192 [[usable protocols: NXM
193 chosen protocol: NXM-table_id
194 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
195 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
196 NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop
197 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2
198 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3
199 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4
200 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5
201 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
202 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
203 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
204 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
205 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
206 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
207 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
208 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
209 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
210 NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535
211 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
212 NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
213 NXT_FLOW_MOD: ADD <any> actions=drop
214 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[]
215 NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[]
216 NXT_FLOW_MOD: ADD <any> actions=autopath(5,NXM_NX_REG0[])
217 NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
218 ]])
219 AT_CLEANUP
220
221 AT_SETUP([ovs-ofctl parse-nx-match])
222 AT_KEYWORDS([nx-match])
223 AT_DATA([nx-match.txt], [dnl
224 <any>
225
226 # in port
227 NXM_OF_IN_PORT(0000)
228 NXM_OF_IN_PORT(fffe)
229
230 # eth dst
231 NXM_OF_ETH_DST(0002e30f80a4)
232 NXM_OF_ETH_DST_W(010000000000/010000000000)
233 NXM_OF_ETH_DST_W(000000000000/010000000000)
234 NXM_OF_ETH_DST_W(ffffffffffff/010000000000)
235 NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
236 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
237 NXM_OF_ETH_DST_W(60175619848f/5a5a5a5a5a5a)
238
239 # eth src
240 NXM_OF_ETH_SRC(020898456ddb)
241 NXM_OF_ETH_SRC_W(012345abcdef/ffffff555555)
242 NXM_OF_ETH_SRC_W(020898456ddb/ffffffffffff)
243
244 # eth type
245 NXM_OF_ETH_TYPE(0800)
246 NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012)
247
248 # vlan tci
249 NXM_OF_VLAN_TCI(f009)
250 NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009)
251 NXM_OF_VLAN_TCI(0000)           # Packets without 802.1Q header.
252 NXM_OF_VLAN_TCI(3123)           # Packets with VID=123, PCP=1.
253 NXM_OF_VLAN_TCI(0123)           # Does not make sense (but supported anyway)
254 NXM_OF_VLAN_TCI_W(1123/1fff)    # Packets with VID=123, any PCP.
255 NXM_OF_VLAN_TCI_W(f000/f000)    # Packets with any VID, PCP=7.
256 NXM_OF_VLAN_TCI_W(0000/e000)    # No 802.1Q or with VID=0
257
258 # IP TOS
259 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0)
260 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41)
261 NXM_OF_IP_TOS(f0)
262
263 # IP ECN
264 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03)
265 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06)
266 NXM_NX_IP_ECN(03)
267
268 # IP protocol
269 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01)
270 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05)
271 NXM_OF_IP_PROTO(05)
272
273 # IP TTL
274 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80)
275 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff)
276 NXM_NX_IP_TTL(80)
277
278 # IP source
279 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014)
280 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000)
281 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/5a5a5a5a)
282 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014)
283 NXM_OF_IP_SRC_W(C0D80000/FFFF0000)
284
285 # IP destination
286 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014)
287 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000)
288 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/5a5a5a5a)
289 NXM_OF_IP_DST(ac100014)
290 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000)
291
292 # TCP source port
293 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231)
294 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0)
295 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231)
296
297 # TCP destination port
298 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231)
299 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0)
300 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231)
301
302 # UDP source port
303 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732)
304 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF)
305 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823)
306
307 # UDP destination port
308 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782)
309 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F)
310 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293)
311
312 # ICMP type
313 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12)
314 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10)
315
316 # ICMP code
317 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12)
318 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10)
319 NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10)
320 NXM_OF_ICMP_CODE(00)
321
322 # ARP opcode
323 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001)
324 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111)
325 NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001)
326 NXM_OF_ARP_OP(0001)
327 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001)
328
329 # ARP source protocol address
330 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014)
331 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
332 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00)
333 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
334 NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
335
336 # ARP destination protocol address
337 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014)
338 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
339 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/77777777)
340 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
341 NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
342
343 # ARP source hardware address
344 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4)
345 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
346 NXM_NX_ARP_SHA(0002e30f80a4)
347
348 # ARP destination hardware address
349 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
350 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
351 NXM_NX_ARP_THA(0002e30f80a4)
352
353 # IPv6 source
354 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
355 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
356 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
357 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/5a5a5a5a5a5a5a5a0000000000000000)
358 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
359
360 # IPv6 destination
361 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
362 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
363 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/77777777777777777777777777777777)
364 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
365
366 # IPv6 Flow Label
367 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(1000000f)
368 NXM_NX_IPV6_LABEL(0000000f)
369 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(0000000f)
370
371 # ND target address
372 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
373 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
374 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/0123456789abcdeffedcba9876543210)
375 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/fedcba98765432100123456789abcdef)
376
377 # ND source hardware address
378 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)
379 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)
380 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)
381 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)
382
383 # ND destination hardware address
384 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)
385 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)
386 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)
387 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)
388
389 # IPv4 fragments.
390 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00)
391 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01)
392 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02)
393 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03)
394 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03)
395 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd)
396 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02)
397 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01)
398 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02)
399 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03)
400 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3)
401
402 # IPv6 fragments.
403 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00)
404 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01)
405 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02)
406 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03)
407 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03)
408 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01)
409 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02)
410 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01)
411 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02)
412 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03)
413 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3)
414
415 # Flow cookie.
416 NXM_NX_COOKIE(00000000abcdef01)
417 NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF)
418
419 # Tunnel ID.
420 NXM_NX_TUN_ID(00000000abcdef01)
421 NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF)
422
423 # Register 0.
424 NXM_NX_REG0(acebdf56)
425 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
426
427 # Invalid field number.
428 01020304(1111/2222)
429
430 # Unimplemented registers.
431 #
432 # This test assumes that at least two registers, but fewer than 16,
433 # registers are implemented.
434 00010004(12345678)
435 00010108(12345678/12345678)
436 00011e04(12345678)
437 00011f08(12345678/12345678)
438 ])
439 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
440 <any>
441
442 # in port
443 NXM_OF_IN_PORT(0000)
444 NXM_OF_IN_PORT(fffe)
445
446 # eth dst
447 NXM_OF_ETH_DST(0002e30f80a4)
448 NXM_OF_ETH_DST_W(010000000000/010000000000)
449 NXM_OF_ETH_DST_W(000000000000/010000000000)
450 NXM_OF_ETH_DST_W(010000000000/010000000000)
451 NXM_OF_ETH_DST(0002e30f80a4)
452 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
453 NXM_OF_ETH_DST_W(40125218000a/5a5a5a5a5a5a)
454
455 # eth src
456 NXM_OF_ETH_SRC(020898456ddb)
457 NXM_OF_ETH_SRC_W(012345014545/ffffff555555)
458 NXM_OF_ETH_SRC(020898456ddb)
459
460 # eth type
461 NXM_OF_ETH_TYPE(0800)
462 NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800) 
463
464 # vlan tci
465 NXM_OF_VLAN_TCI(f009)
466 nx_pull_match() returned error OFPBMC_DUP_FIELD
467 NXM_OF_VLAN_TCI(0000)
468 NXM_OF_VLAN_TCI(3123)
469 NXM_OF_VLAN_TCI(0123)
470 NXM_OF_VLAN_TCI_W(1123/1fff)
471 NXM_OF_VLAN_TCI_W(f000/f000)
472 NXM_OF_VLAN_TCI_W(0000/e000)
473
474 # IP TOS
475 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0)
476 nx_pull_match() returned error OFPBMC_BAD_VALUE
477 nx_pull_match() returned error OFPBMC_BAD_PREREQ
478
479 # IP ECN
480 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03)
481 nx_pull_match() returned error OFPBMC_BAD_VALUE
482 nx_pull_match() returned error OFPBMC_BAD_PREREQ
483
484 # IP protocol
485 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01)
486 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05)
487 nx_pull_match() returned error OFPBMC_BAD_PREREQ
488
489 # IP TTL
490 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80)
491 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff)
492 nx_pull_match() returned error OFPBMC_BAD_PREREQ
493
494 # IP source
495 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014)
496 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000)
497 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(40080000/5a5a5a5a)
498 nx_pull_match() returned error OFPBMC_BAD_PREREQ
499 nx_pull_match() returned error OFPBMC_BAD_PREREQ
500
501 # IP destination
502 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014)
503 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(c0a80000/ffff0000)
504 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(40080000/5a5a5a5a)
505 nx_pull_match() returned error OFPBMC_BAD_PREREQ
506 nx_pull_match() returned error OFPBMC_BAD_PREREQ
507
508 # TCP source port
509 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231)
510 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0)
511 nx_pull_match() returned error OFPBMC_BAD_PREREQ
512
513 # TCP destination port
514 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231)
515 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0)
516 nx_pull_match() returned error OFPBMC_BAD_PREREQ
517
518 # UDP source port
519 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732)
520 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff)
521 nx_pull_match() returned error OFPBMC_BAD_PREREQ
522
523 # UDP destination port
524 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782)
525 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f)
526 nx_pull_match() returned error OFPBMC_BAD_PREREQ
527
528 # ICMP type
529 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12)
530 nx_pull_match() returned error OFPBMC_BAD_PREREQ
531
532 # ICMP code
533 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12)
534 nx_pull_match() returned error OFPBMC_BAD_PREREQ
535 nx_pull_match() returned error OFPBMC_BAD_PREREQ
536 nx_pull_match() returned error OFPBMC_BAD_PREREQ
537
538 # ARP opcode
539 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001)
540 nx_pull_match() returned error OFPBMC_BAD_VALUE
541 nx_pull_match() returned error OFPBMC_BAD_PREREQ
542 nx_pull_match() returned error OFPBMC_BAD_PREREQ
543 nx_pull_match() returned error OFPBMC_DUP_FIELD
544
545 # ARP source protocol address
546 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014)
547 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
548 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(80a80200/aaaaaa00)
549 nx_pull_match() returned error OFPBMC_BAD_PREREQ
550 nx_pull_match() returned error OFPBMC_BAD_PREREQ
551
552 # ARP destination protocol address
553 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014)
554 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
555 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(40201234/77777777)
556 nx_pull_match() returned error OFPBMC_BAD_PREREQ
557 nx_pull_match() returned error OFPBMC_BAD_PREREQ
558
559 # ARP source hardware address
560 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4)
561 nx_pull_match() returned error OFPBMC_BAD_PREREQ
562 nx_pull_match() returned error OFPBMC_BAD_PREREQ
563
564 # ARP destination hardware address
565 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
566 nx_pull_match() returned error OFPBMC_BAD_PREREQ
567 nx_pull_match() returned error OFPBMC_BAD_PREREQ
568
569 # IPv6 source
570 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
571 nx_pull_match() returned error OFPBMC_BAD_PREREQ
572 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
573 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(00000818184800000000000000000000/5a5a5a5a5a5a5a5a0000000000000000)
574 nx_pull_match() returned error OFPBMC_BAD_PREREQ
575
576 # IPv6 destination
577 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
578 nx_pull_match() returned error OFPBMC_BAD_PREREQ
579 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010530344500010000000000000000/77777777777777777777777777777777)
580 nx_pull_match() returned error OFPBMC_BAD_PREREQ
581
582 # IPv6 Flow Label
583 nx_pull_match() returned error OFPBMC_BAD_VALUE
584 nx_pull_match() returned error OFPBMC_BAD_PREREQ
585 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(0000000f)
586
587 # ND target address
588 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
589 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
590 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET_W(00010520080900010000000000040000/0123456789abcdeffedcba9876543210)
591 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET_W(20000898344400000002000300000005/fedcba98765432100123456789abcdef)
592
593 # ND source hardware address
594 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)
595 nx_pull_match() returned error OFPBMC_BAD_PREREQ
596 nx_pull_match() returned error OFPBMC_BAD_PREREQ
597 nx_pull_match() returned error OFPBMC_BAD_PREREQ
598
599 # ND destination hardware address
600 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)
601 nx_pull_match() returned error OFPBMC_BAD_PREREQ
602 nx_pull_match() returned error OFPBMC_BAD_PREREQ
603 nx_pull_match() returned error OFPBMC_BAD_PREREQ
604
605 # IPv4 fragments.
606 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
607 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01)
608 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02)
609 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
610 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
611 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01)
612 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02)
613 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01)
614 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02)
615 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
616 nx_pull_match() returned error OFPBMC_BAD_VALUE
617
618 # IPv6 fragments.
619 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
620 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01)
621 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02)
622 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
623 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
624 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01)
625 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02)
626 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01)
627 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02)
628 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
629 nx_pull_match() returned error OFPBMC_BAD_VALUE
630
631 # Flow cookie.
632 NXM_NX_COOKIE(00000000abcdef01)
633 NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff)
634
635 # Tunnel ID.
636 NXM_NX_TUN_ID(00000000abcdef01)
637 NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff)
638
639 # Register 0.
640 NXM_NX_REG0(acebdf56)
641 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
642
643 # Invalid field number.
644 nx_pull_match() returned error OFPBMC_BAD_FIELD
645
646 # Unimplemented registers.
647 #
648 # This test assumes that at least two registers, but fewer than 16,
649 # registers are implemented.
650 NXM_NX_REG0(12345678)
651 NXM_NX_REG0_W(12345678/12345678)
652 nx_pull_match() returned error OFPBMC_BAD_FIELD
653 nx_pull_match() returned error OFPBMC_BAD_FIELD
654 ])
655 AT_CLEANUP
656
657 AT_SETUP([ovs-ofctl parse-ofp11-match])
658 AT_KEYWORDS([OF1.1])
659 AT_DATA([test-data], [dnl
660 # in_port=65534
661 0000 0058 fffffffe 000003fe dnl
662 000000000000ffffffffffff 000000000000ffffffffffff dnl
663 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
664 00000000 00 000000 0000000000000000ffffffffffffffff
665
666 # bad ofp11_match: OFPBMC_BAD_VALUE
667 & ofp_util|WARN|port 305419896 is outside the supported range 0 through 65279 or 0xffffff00 through 0xffffffff
668 0000 0058 12345678 000003fe dnl
669 000000000000ffffffffffff 000000000000ffffffffffff dnl
670 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
671 00000000 00 000000 0000000000000000ffffffffffffffff
672
673 # dl_src=00:01:02:03:04:05
674 0000 0058 00000000 000003ff dnl
675 000102030405000000000000 000000000000ffffffffffff dnl
676 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
677 00000000 00 000000 0000000000000000ffffffffffffffff
678
679 # dl_src=55:55:55:55:55:55/55:55:55:55:55:55
680 0000 0058 00000000 000003ff dnl
681 555555555555aaaaaaaaaaaa 000000000000ffffffffffff dnl
682 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
683 00000000 00 000000 0000000000000000ffffffffffffffff
684
685 # dl_dst=00:01:02:03:04:05
686 0000 0058 00000000 000003ff dnl
687 000000000000ffffffffffff 000102030405000000000000 dnl
688 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
689 00000000 00 000000 0000000000000000ffffffffffffffff
690
691 # dl_dst=01:00:00:00:00:00/01:00:00:00:00:00
692 0000 0058 00000000 000003ff dnl
693 000000000000ffffffffffff 010000000000feffffffffff dnl
694 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
695 00000000 00 000000 0000000000000000ffffffffffffffff
696
697 # dl_dst=00:01:02:03:04:05/fe:ff:ff:ff:ff:ff
698 0000 0058 00000000 000003ff dnl
699 000000000000ffffffffffff 000102030405010000000000 dnl
700 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
701 00000000 00 000000 0000000000000000ffffffffffffffff
702
703 # dl_dst=55:55:55:55:55:55/55:55:55:55:55:55
704 0000 0058 00000000 000003ff dnl
705 000000000000ffffffffffff 555555555555aaaaaaaaaaaa dnl
706 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
707 00000000 00 000000 0000000000000000ffffffffffffffff
708
709 dnl dl_vlan_pcp is ignored if dl_vlan is wildcarded, which causes the
710 dnl the wildcard bit and the dl_vlan_pcp to be dropped for output:
711 # in_port=1
712 # 11: fa -> fe
713 # 38: 03 -> 00
714 0000 0058 00000001 000003fa dnl
715 000000000000ffffffffffff 000000000000ffffffffffff dnl
716 0000 03 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
717 00000000 00 000000 0000000000000000ffffffffffffffff
718
719 # dl_vlan=291
720 0000 0058 00000000 000003fd dnl
721 000000000000ffffffffffff 000000000000ffffffffffff dnl
722 0123 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
723 00000000 00 000000 0000000000000000ffffffffffffffff
724
725 dnl OFPVID_NONE:
726 # vlan_tci=0x0000
727 0000 0058 00000000 000003fd dnl
728 000000000000ffffffffffff 000000000000ffffffffffff dnl
729 ffff 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
730 00000000 00 000000 0000000000000000ffffffffffffffff
731
732 dnl OFPVID_NONE ignores dl_vlan_pcp even if not wildcarded, which causes
733 dnl the wildcard bit and the dl_vlan_pcp to be dropped for output:
734 # vlan_tci=0x0000
735 # 11: f9 -> fd
736 # 38: 05 -> 00
737 0000 0058 00000000 000003f9 dnl
738 000000000000ffffffffffff 000000000000ffffffffffff dnl
739 ffff 05 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
740 00000000 00 000000 0000000000000000ffffffffffffffff
741
742 # vlan_tci=0x1000/0x1000
743 0000 0058 00000000 000003fd dnl
744 000000000000ffffffffffff 000000000000ffffffffffff dnl
745 fffe 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
746 00000000 00 000000 0000000000000000ffffffffffffffff
747
748 dnl Try invalid VID:
749 # bad ofp11_match: OFPBMC_BAD_VALUE
750 0000 0058 00000000 000003fd dnl
751 000000000000ffffffffffff 000000000000ffffffffffff dnl
752 1234 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
753 00000000 00 000000 0000000000000000ffffffffffffffff
754
755 # dl_vlan_pcp=4
756 0000 0058 00000000 000003f9 dnl
757 000000000000ffffffffffff 000000000000ffffffffffff dnl
758 fffe 04 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
759 00000000 00 000000 0000000000000000ffffffffffffffff
760
761 # dl_vlan=10,dl_vlan_pcp=6
762 0000 0058 00000000 000003f9 dnl
763 000000000000ffffffffffff 000000000000ffffffffffff dnl
764 000a 06 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
765 00000000 00 000000 0000000000000000ffffffffffffffff
766
767 # dl_type=0x1234
768 0000 0058 00000000 000003f7 dnl
769 000000000000ffffffffffff 000000000000ffffffffffff dnl
770 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
771 00000000 00 000000 0000000000000000ffffffffffffffff
772
773 # ip,nw_tos=252
774 0000 0058 00000000 000003e7 dnl
775 000000000000ffffffffffff 000000000000ffffffffffff dnl
776 0000 00 00 0800 fc 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
777 00000000 00 000000 0000000000000000ffffffffffffffff
778
779 dnl Try invalid TOS:
780 # bad ofp11_match: OFPBMC_BAD_VALUE
781 0000 0058 00000000 000003e7 dnl
782 000000000000ffffffffffff 000000000000ffffffffffff dnl
783 0000 00 00 0800 01 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
784 00000000 00 000000 0000000000000000ffffffffffffffff
785
786 # ip,nw_proto=5
787 0000 0058 00000000 000003d7 dnl
788 000000000000ffffffffffff 000000000000ffffffffffff dnl
789 0000 00 00 0800 00 05 00000000ffffffff 00000000ffffffff 0000 0000 dnl
790 00000000 00 000000 0000000000000000ffffffffffffffff
791
792 # arp,arp_op=2
793 0000 0058 00000000 000003d7 dnl
794 000000000000ffffffffffff 000000000000ffffffffffff dnl
795 0000 00 00 0806 00 02 00000000ffffffff 00000000ffffffff 0000 0000 dnl
796 00000000 00 000000 0000000000000000ffffffffffffffff
797
798 # ip,nw_src=192.168.128.0/24
799 0000 0058 00000000 000003f7 dnl
800 000000000000ffffffffffff 000000000000ffffffffffff dnl
801 0000 00 00 0800 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
802 00000000 00 000000 0000000000000000ffffffffffffffff
803
804 # ip,nw_src=128.160.128.0/165.165.165.165
805 # 44: c0 -> 80
806 # 45: a8 -> a0
807 0000 0058 00000000 000003f7 dnl
808 000000000000ffffffffffff 000000000000ffffffffffff dnl
809 0000 00 00 0800 00 00 c0a880005a5a5a5a 00000000ffffffff 0000 0000 dnl
810 00000000 00 000000 0000000000000000ffffffffffffffff
811
812 # ip,nw_dst=192.168.128.0/24
813 0000 0058 00000000 000003f7 dnl
814 000000000000ffffffffffff 000000000000ffffffffffff dnl
815 0000 00 00 0800 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
816 00000000 00 000000 0000000000000000ffffffffffffffff
817
818 # ip,nw_dst=128.160.128.0/165.165.165.165
819 # 52: c0 -> 80
820 # 53: a8 -> a0
821 0000 0058 00000000 000003f7 dnl
822 000000000000ffffffffffff 000000000000ffffffffffff dnl
823 0000 00 00 0800 00 00 00000000ffffffff c0a880005a5a5a5a 0000 0000 dnl
824 00000000 00 000000 0000000000000000ffffffffffffffff
825
826 # arp,nw_src=192.168.128.0/24
827 0000 0058 00000000 000003f7 dnl
828 000000000000ffffffffffff 000000000000ffffffffffff dnl
829 0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
830 00000000 00 000000 0000000000000000ffffffffffffffff
831
832 # arp,nw_dst=192.168.128.0/24
833 0000 0058 00000000 000003f7 dnl
834 000000000000ffffffffffff 000000000000ffffffffffff dnl
835 0000 00 00 0806 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
836 00000000 00 000000 0000000000000000ffffffffffffffff
837
838 # tcp,tp_src=443
839 0000 0058 00000000 00000397 dnl
840 000000000000ffffffffffff 000000000000ffffffffffff dnl
841 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
842 00000000 00 000000 0000000000000000ffffffffffffffff
843
844 # tcp,tp_dst=443
845 0000 0058 00000000 00000357 dnl
846 000000000000ffffffffffff 000000000000ffffffffffff dnl
847 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 0000 01bb dnl
848 00000000 00 000000 0000000000000000ffffffffffffffff
849
850 # udp,tp_src=443
851 0000 0058 00000000 00000397 dnl
852 000000000000ffffffffffff 000000000000ffffffffffff dnl
853 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
854 00000000 00 000000 0000000000000000ffffffffffffffff
855
856 # icmp,icmp_type=5
857 0000 0058 00000000 00000397 dnl
858 000000000000ffffffffffff 000000000000ffffffffffff dnl
859 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0005 0000 dnl
860 00000000 00 000000 0000000000000000ffffffffffffffff
861
862 # icmp,icmp_code=8
863 0000 0058 00000000 00000357 dnl
864 000000000000ffffffffffff 000000000000ffffffffffff dnl
865 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0000 0008 dnl
866 00000000 00 000000 0000000000000000ffffffffffffffff
867
868 # udp,tp_src=443
869 0000 0058 00000000 00000397 dnl
870 000000000000ffffffffffff 000000000000ffffffffffff dnl
871 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
872 00000000 00 000000 0000000000000000ffffffffffffffff
873
874 # udp,tp_dst=443
875 0000 0058 00000000 00000357 dnl
876 000000000000ffffffffffff 000000000000ffffffffffff dnl
877 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 0000 01bb dnl
878 00000000 00 000000 0000000000000000ffffffffffffffff
879
880 dnl SCTP, no ports.
881 # ip,nw_proto=132
882 0000 0058 00000000 000003d7 dnl
883 000000000000ffffffffffff 000000000000ffffffffffff dnl
884 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 0000 dnl
885 00000000 00 000000 0000000000000000ffffffffffffffff
886
887 dnl SCTP tp_src matching not supported:
888 # bad ofp11_match: OFPBMC_BAD_FIELD
889 0000 0058 00000000 00000397 dnl
890 000000000000ffffffffffff 000000000000ffffffffffff dnl
891 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
892 00000000 00 000000 0000000000000000ffffffffffffffff
893
894 dnl SCTP tp_dst matching not supported:
895 # bad ofp11_match: OFPBMC_BAD_FIELD
896 0000 0058 00000000 00000357 dnl
897 000000000000ffffffffffff 000000000000ffffffffffff dnl
898 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 01bb dnl
899 00000000 00 000000 0000000000000000ffffffffffffffff
900
901 dnl Ignore tp_src if not TCP or UDP or SCTP:
902 # ip,nw_proto=21
903 # 11: 97 -> d7
904 # 60: 01 -> 00
905 # 61: bb -> 00
906 0000 0058 00000000 00000397 dnl
907 000000000000ffffffffffff 000000000000ffffffffffff dnl
908 0000 00 00 0800 00 15 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
909 00000000 00 000000 0000000000000000ffffffffffffffff
910
911 dnl Ignore tp_dst if not TCP or UDP or SCTP:
912 # ip,nw_proto=22
913 # 11: 57 -> d7
914 # 62: 01 -> 00
915 # 63: bb -> 00
916 0000 0058 00000000 00000357 dnl
917 000000000000ffffffffffff 000000000000ffffffffffff dnl
918 0000 00 00 0800 00 16 00000000ffffffff 00000000ffffffff 0000 01bb dnl
919 00000000 00 000000 0000000000000000ffffffffffffffff
920
921 dnl mpls_label not yet supported:
922 # bad ofp11_match: OFPBMC_BAD_TAG
923 0000 0058 00000000 000002f7 dnl
924 000000000000ffffffffffff 000000000000ffffffffffff dnl
925 0000 00 00 8847 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
926 12345678 00 000000 0000000000000000ffffffffffffffff
927
928 dnl mpls_tc not yet supported:
929 # bad ofp11_match: OFPBMC_BAD_TAG
930 0000 0058 00000000 000001f7 dnl
931 000000000000ffffffffffff 000000000000ffffffffffff dnl
932 0000 00 00 8848 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
933 00000000 5a 000000 0000000000000000ffffffffffffffff
934
935 dnl mpls_label and mpls_tc must be ignored if dl_type is not MPLS:
936 # dl_type=0x1234
937 # 10: 00 -> 03
938 # 64: 12 -> 00
939 # 65: 34 -> 00
940 # 66: 56 -> 00
941 # 67: 78 -> 00
942 # 68: 5a -> 00
943 0000 0058 00000000 000000f7 dnl
944 000000000000ffffffffffff 000000000000ffffffffffff dnl
945 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
946 12345678 5a 000000 0000000000000000ffffffffffffffff
947
948 dnl metadata match:
949 # metadata=0x1234567890abcdef
950 0000 0058 00000000 000003ff dnl
951 000000000000ffffffffffff 000000000000ffffffffffff dnl
952 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
953 00000000 00 000000 1234567890abcdef0000000000000000
954
955 dnl metadata match:
956 # metadata=0x5555555555555555/0x5555555555555555
957 0000 0058 00000000 000003ff dnl
958 000000000000ffffffffffff 000000000000ffffffffffff dnl
959 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
960 00000000 00 000000 5555555555555555aaaaaaaaaaaaaaaa
961
962 dnl metadata match:
963 # metadata=0x1234000090ab0000/0xffff0000ffff0000
964 # 74: 56 -> 00
965 # 75: 78 -> 00
966 # 78: cd -> 00
967 # 79: ef -> 00
968 0000 0058 00000000 000003ff dnl
969 000000000000ffffffffffff 000000000000ffffffffffff dnl
970 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
971 00000000 00 000000 1234567890abcdef0000ffff0000ffff
972
973 ])
974 sed '/^[[#&]]/d' < test-data > input.txt
975 sed -n 's/^# //p; /^$/p' < test-data > expout
976 sed -n 's/^& //p' < test-data > experr
977 AT_CAPTURE_FILE([input.txt])
978 AT_CAPTURE_FILE([expout])
979 AT_CAPTURE_FILE([experr])
980 AT_CHECK(
981   [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-match < input.txt],
982   [0], [expout], [experr])
983 AT_CLEANUP
984
985 AT_SETUP([ovs-ofctl parse-nx-match loose])
986 AT_KEYWORDS([nx-match])
987 AT_DATA([nx-match.txt], [dnl
988 NXM_OF_IN_PORT(0001), 01020304(1111/2222), NXM_OF_ETH_TYPE(0800)
989 ])
990
991 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
992 nx_pull_match() returned error OFPBMC_BAD_FIELD
993 ])
994
995 AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl
996 NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
997 ])
998 AT_CLEANUP
999
1000 AT_SETUP([ovs-ofctl parse-oxm])
1001 AT_KEYWORDS([oxm])
1002 AT_DATA([oxm.txt], [dnl
1003 <any>
1004
1005 # in port
1006 OXM_OF_IN_PORT(00000000)
1007 OXM_OF_IN_PORT(fffffffe)
1008
1009 # metadata
1010 OXM_OF_METADATA(5a5a5a5a5a5a5a5a)
1011 OXM_OF_METADATA_W(0000000000000000/00000000ffffffff)
1012 OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000)
1013 OXM_OF_METADATA_W(1234567890abcdef/ffffffffffffffff)
1014
1015 # eth dst
1016 OXM_OF_ETH_DST(0002e30f80a4)
1017 OXM_OF_ETH_DST_W(010000000000/010000000000)
1018 OXM_OF_ETH_DST_W(000000000000/010000000000)
1019 OXM_OF_ETH_DST_W(ffffffffffff/010000000000)
1020 OXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
1021 OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
1022
1023 # eth src
1024 OXM_OF_ETH_SRC(020898456ddb)
1025
1026 # eth type
1027 OXM_OF_ETH_TYPE(0800)
1028 OXM_OF_ETH_TYPE(0800) OXM_OF_IN_PORT(00000012)
1029
1030 # IP ECN
1031 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(03)
1032 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(06)
1033 OXM_OF_IP_ECN(03)
1034
1035 # IP protocol
1036 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01)
1037 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(05)
1038 OXM_OF_IP_PROTO(05)
1039
1040 # IP source
1041 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC(ac100014)
1042 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFF0000)
1043 OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_SRC(ac100014)
1044 OXM_OF_IPV4_SRC_W(C0D80000/FFFF0000)
1045
1046 # IP destination
1047 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST(ac100014)
1048 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFF0000)
1049 OXM_OF_IPV4_DST(ac100014)
1050 OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_DST_W(C0D80000/FFFF0000)
1051
1052 # TCP source port
1053 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC(4231)
1054 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/F0F0)
1055 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_SRC(4231)
1056
1057 # TCP destination port
1058 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST(4231)
1059 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFF0)
1060 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_DST(4231)
1061
1062 # UDP source port
1063 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC(8732)
1064 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/01FF)
1065 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_UDP_SRC(7823)
1066
1067 # UDP destination port
1068 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST(1782)
1069 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/F00F)
1070 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_UDP_DST(1293)
1071
1072 # ICMP type
1073 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_TYPE(12)
1074 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_TYPE(10)
1075
1076 # ICMP code
1077 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_CODE(12)
1078 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_CODE(10)
1079 OXM_OF_ETH_TYPE(0800) OXM_OF_ICMPV4_CODE(10)
1080 OXM_OF_ICMPV4_CODE(00)
1081
1082 # ARP opcode
1083 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001)
1084 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(1111)
1085 OXM_OF_ETH_TYPE(0000) OXM_OF_ARP_OP(0001)
1086 OXM_OF_ARP_OP(0001)
1087 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) OXM_OF_ARP_OP(0001)
1088
1089 # ARP source protocol address
1090 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA(ac100014)
1091 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
1092 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SPA(ac100014)
1093 OXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
1094
1095 # ARP destination protocol address
1096 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA(ac100014)
1097 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
1098 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_TPA(ac100014)
1099 OXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
1100
1101 # ARP source hardware address
1102 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA(0002e30f80a4)
1103 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SHA(0002e30f80a4)
1104 OXM_OF_ARP_SHA(0002e30f80a4)
1105
1106 # ARP destination hardware address
1107 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA(0002e30f80a4)
1108 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_THA(0002e30f80a4)
1109 OXM_OF_ARP_THA(0002e30f80a4)
1110
1111 # IPv6 source
1112 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
1113 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
1114 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1115 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1116
1117 # IPv6 destination
1118 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
1119 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
1120 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1121 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1122
1123 # IPv6 Flow Label
1124 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(1000000f)
1125 OXM_OF_IPV6_FLABEL(0000000f)
1126 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(0000000f)
1127
1128 # ND source hardware address
1129 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)
1130 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)
1131 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)
1132 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)
1133
1134 # ND destination hardware address
1135 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)
1136 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)
1137 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)
1138 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)
1139
1140 # Invalid field number.
1141 01020304(1111/2222)
1142 ])
1143 AT_CHECK([ovs-ofctl --strict parse-oxm < oxm.txt], [0], [dnl
1144 <any>
1145
1146 # in port
1147 OXM_OF_IN_PORT(00000000)
1148 OXM_OF_IN_PORT(fffffffe)
1149
1150 # metadata
1151 OXM_OF_METADATA(5a5a5a5a5a5a5a5a)
1152 OXM_OF_METADATA_W(0000000000000000/00000000ffffffff)
1153 OXM_OF_METADATA_W(1234000090ab0000/ffff0000ffff0000)
1154 OXM_OF_METADATA(1234567890abcdef)
1155
1156 # eth dst
1157 OXM_OF_ETH_DST(0002e30f80a4)
1158 OXM_OF_ETH_DST_W(010000000000/010000000000)
1159 OXM_OF_ETH_DST_W(000000000000/010000000000)
1160 OXM_OF_ETH_DST_W(010000000000/010000000000)
1161 OXM_OF_ETH_DST(0002e30f80a4)
1162 OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
1163
1164 # eth src
1165 OXM_OF_ETH_SRC(020898456ddb)
1166
1167 # eth type
1168 OXM_OF_ETH_TYPE(0800)
1169 OXM_OF_IN_PORT(00000012), OXM_OF_ETH_TYPE(0800)
1170
1171 # IP ECN
1172 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_ECN(03)
1173 nx_pull_match() returned error OFPBMC_BAD_VALUE
1174 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1175
1176 # IP protocol
1177 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01)
1178 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(05)
1179 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1180
1181 # IP source
1182 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(ac100014)
1183 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC_W(c0a80000/ffff0000)
1184 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1185 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1186
1187 # IP destination
1188 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(ac100014)
1189 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST_W(c0a80000/ffff0000)
1190 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1191 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1192
1193 # TCP source port
1194 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(4231)
1195 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC_W(5050/f0f0)
1196 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1197
1198 # TCP destination port
1199 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(4231)
1200 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST_W(fde0/fff0)
1201 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1202
1203 # UDP source port
1204 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(8732)
1205 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC_W(0132/01ff)
1206 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1207
1208 # UDP destination port
1209 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(1782)
1210 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST_W(5005/f00f)
1211 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1212
1213 # ICMP type
1214 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_TYPE(12)
1215 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1216
1217 # ICMP code
1218 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_CODE(12)
1219 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1220 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1221 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1222
1223 # ARP opcode
1224 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_OP(0001)
1225 nx_pull_match() returned error OFPBMC_BAD_VALUE
1226 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1227 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1228 nx_pull_match() returned error OFPBMC_DUP_FIELD
1229
1230 # ARP source protocol address
1231 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(ac100014)
1232 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA_W(c0a81200/ffffff00)
1233 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1234 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1235
1236 # ARP destination protocol address
1237 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(ac100014)
1238 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA_W(c0a81200/ffffff00)
1239 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1240 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1241
1242 # ARP source hardware address
1243 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4)
1244 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1245 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1246
1247 # ARP destination hardware address
1248 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4)
1249 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1250 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1251
1252 # IPv6 source
1253 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
1254 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1255 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1256 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1257
1258 # IPv6 destination
1259 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
1260 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1261 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1262 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1263
1264 # IPv6 Flow Label
1265 nx_pull_match() returned error OFPBMC_BAD_VALUE
1266 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1267 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
1268
1269 # ND source hardware address
1270 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)
1271 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1272 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1273 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1274
1275 # ND destination hardware address
1276 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)
1277 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1278 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1279 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1280
1281 # Invalid field number.
1282 nx_pull_match() returned error OFPBMC_BAD_FIELD
1283 ])
1284 AT_CLEANUP
1285
1286 AT_SETUP([ovs-ofctl parse-oxm loose])
1287 AT_KEYWORDS([oxm])
1288 AT_DATA([oxm.txt], [dnl
1289 OXM_OF_IN_PORT(00000001), 01020304(1111/2222), OXM_OF_ETH_TYPE(0800)
1290 ])
1291
1292 AT_CHECK([ovs-ofctl --strict parse-oxm < oxm.txt], [0], [dnl
1293 nx_pull_match() returned error OFPBMC_BAD_FIELD
1294 ])
1295
1296 AT_CHECK([ovs-ofctl parse-oxm < oxm.txt], [0], [dnl
1297 OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
1298 ])
1299 AT_CLEANUP
1300
1301 dnl Check that "-F openflow10" rejects a flow_mod with unsupported features,
1302 dnl such as tunnels and metadata.
1303 AT_SETUP([ovs-ofctl -F option and NXM features])
1304 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
1305   [1], [], [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
1306 ])
1307 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop],
1308   [1], [], [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
1309 ])
1310 AT_CLEANUP
1311
1312 dnl Check that "-F nxm" really forces add-flow to use the NXM flow format.
1313 dnl (If it doesn't, then either the tun_id won't show up at all, or it will
1314 dnl additionally show up as the top 32 bits of the cookie.)  This checks
1315 dnl for regression against bug #4566.
1316 AT_SETUP([ovs-ofctl -F option with flow_mods])
1317 OVS_VSWITCHD_START
1318 AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop])
1319 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
1320 NXST_FLOW reply:
1321  tun_id=0x12345678 actions=drop
1322 ])
1323 OVS_VSWITCHD_STOP
1324 AT_CLEANUP
1325
1326 dnl Check that "-F openflow10" is really honored on dump-flows.
1327 dnl (If it isn't, then dump-flows will show the register match.)
1328 AT_SETUP([ovs-ofctl dump-flows honors -F option])
1329 OVS_VSWITCHD_START
1330 AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop])
1331 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl
1332 OFPST_FLOW reply:
1333  actions=drop
1334 ])
1335 OVS_VSWITCHD_STOP
1336 AT_CLEANUP
1337
1338 dnl Check that "-F openflow10" fails on dump-flows if the requested match
1339 dnl can't be represented in OpenFlow 1.0.
1340 AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
1341 OVS_VSWITCHD_START
1342 AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
1343   [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
1344 ])
1345 OVS_VSWITCHD_STOP
1346 AT_CLEANUP
1347
1348 dnl Check that add-flow reports non-normalized flows (feature #5029).
1349 AT_SETUP([ovs-ofctl add-flow reports non-normalized flows])
1350 OVS_VSWITCHD_START
1351 AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5],
1352   [0], [], [dnl
1353 ofp_util|INFO|normalization changed ofp_match, details:
1354 ofp_util|INFO| pre: nw_src=1.2.3.4
1355 ofp_util|INFO|post: @&t@
1356 ])
1357 OVS_VSWITCHD_STOP
1358 AT_CLEANUP
1359