Implement new "fin_timeout" action and "learn" feature.
[openvswitch] / tests / ovs-ofctl.at
1 AT_BANNER([ovs-ofctl])
2
3 AT_SETUP([ovs-ofctl parse-flows])
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 tcp,tp_src=0x1230/0xfff0,tun_id=0x1234,cookie=0x5678,actions=flood
14 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789
15 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])
16 table=1,actions=drop
17 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
18 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
19 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
20 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
21 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
22 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
23 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
24 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:[2,3])
25 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
26 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2
27 actions=resubmit:1,resubmit(2),resubmit(,3),resubmit(2,3)
28 send_flow_rem,actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3
29 check_overlap,actions=output:1,exit,output:2
30 actions=fin_timeout(idle_timeout=5,hard_timeout=15)
31 ]])
32
33 AT_CHECK([ovs-ofctl parse-flows flows.txt
34 ], [0], [stdout])
35 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], 
36 [[OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
37 OFPT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
38 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
39 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
40 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
41 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
42 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
43 NXT_SET_FLOW_FORMAT: format=nxm
44 NXT_FLOW_MOD: ADD tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD
45 NXT_FLOW_MOD: ADD actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789
46 NXT_FLOW_MOD: ADD 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])
47 NXT_FLOW_MOD_TABLE_ID: enable
48 NXT_FLOW_MOD: ADD table:1 actions=drop
49 NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
50 NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
51 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
52 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
53 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
54 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
55 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
56 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
57 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
58 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
59 NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3)
60 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
61 NXT_FLOW_MOD: ADD table:255 check_overlap actions=output:1,exit,output:2
62 NXT_FLOW_MOD: ADD table:255 actions=fin_timeout(idle_timeout=5,hard_timeout=15)
63 ]])
64 AT_CLEANUP
65
66 AT_SETUP([ovs-ofctl -F nxm parse-flows])
67 AT_DATA([flows.txt], [
68 # comment
69 tcp,tp_src=123,actions=flood
70 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
71 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
72 ipv6,ipv6_label=0x12345 actions=2
73 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
74 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
75 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
76 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop 
77 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop 
78 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
79 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
80 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
81 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
82 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
83 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
84 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
85 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
86 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
87 tun_id=0x1234,cookie=0x5678,actions=flood
88 actions=drop
89 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
90 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop
91 dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop
92 dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop
93 dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop
94 ])
95 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
96 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
97 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
98 NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
99 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
100 NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2
101 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
102 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4
103 NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5
104 NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
105 NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
106 NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
107 NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
108 NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
109 NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
110 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571 actions=drop
111 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop
112 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
113 NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
114 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
115 NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
116 NXT_FLOW_MOD: ADD actions=drop
117 NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
118 NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
119 NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop
120 NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop
121 NXT_FLOW_MOD: ADD actions=drop
122 ])
123 AT_CLEANUP
124
125 AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows])
126 AT_DATA([flows.txt], [[
127 # comment
128 tcp,tp_src=123,actions=flood
129 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
130 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
131 ipv6,ipv6_label=0x12345 actions=2
132 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
133 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
134 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
135 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop 
136 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop 
137 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
138 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
139 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
140 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
141 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
142 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
143 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
144 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
145 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
146 tun_id=0x1234,cookie=0x5678,actions=flood
147 actions=drop
148 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[]
149 actions=autopath(5,NXM_NX_REG0[])
150 vlan_tci=0x1123/0x1fff,actions=drop
151 ]])
152 AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout])
153 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
154 [[NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
155 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
156 NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop
157 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2
158 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3
159 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4
160 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5
161 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
162 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
163 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
164 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
165 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
166 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
167 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
168 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
169 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
170 NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535
171 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
172 NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
173 NXT_FLOW_MOD: ADD <any> actions=drop
174 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[]
175 NXT_FLOW_MOD: ADD <any> actions=autopath(5,NXM_NX_REG0[])
176 NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
177 ]])
178 AT_CLEANUP
179
180 AT_SETUP([ovs-ofctl parse-nx-match])
181 AT_KEYWORDS([nx-match])
182 AT_DATA([nx-match.txt], [dnl
183 <any>
184
185 # in port
186 NXM_OF_IN_PORT(0000)
187 NXM_OF_IN_PORT(fffe)
188
189 # eth dst
190 NXM_OF_ETH_DST(0002e30f80a4)
191 NXM_OF_ETH_DST_W(010000000000/010000000000)
192 NXM_OF_ETH_DST_W(000000000000/010000000000)
193 NXM_OF_ETH_DST_W(ffffffffffff/010000000000)
194 NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
195 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
196
197 # eth src
198 NXM_OF_ETH_SRC(020898456ddb)
199
200 # eth type
201 NXM_OF_ETH_TYPE(0800)
202 NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012)
203
204 # vlan tci
205 NXM_OF_VLAN_TCI(f009)
206 NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009)
207 NXM_OF_VLAN_TCI(0000)           # Packets without 802.1Q header.
208 NXM_OF_VLAN_TCI(3123)           # Packets with VID=123, PCP=1.
209 NXM_OF_VLAN_TCI(0123)           # Does not make sense (but supported anyway)
210 NXM_OF_VLAN_TCI_W(1123/1fff)    # Packets with VID=123, any PCP.
211 NXM_OF_VLAN_TCI_W(f000/f000)    # Packets with any VID, PCP=7.
212 NXM_OF_VLAN_TCI_W(0000/e000)    # No 802.1Q or with VID=0
213
214 # IP TOS
215 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0)
216 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41)
217 NXM_OF_IP_TOS(f0)
218
219 # IP ECN
220 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03)
221 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06)
222 NXM_NX_IP_ECN(03)
223
224 # IP protocol
225 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01)
226 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05)
227 NXM_OF_IP_PROTO(05)
228
229 # IP TTL
230 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80)
231 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff)
232 NXM_NX_IP_TTL(80)
233
234 # IP source
235 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014)
236 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000)
237 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014)
238 NXM_OF_IP_SRC_W(C0D80000/FFFF0000)
239
240 # IP destination
241 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014)
242 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000)
243 NXM_OF_IP_DST(ac100014)
244 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000)
245
246 # TCP source port
247 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231)
248 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0)
249 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231)
250
251 # TCP destination port
252 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231)
253 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0)
254 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231)
255
256 # UDP source port
257 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732)
258 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF)
259 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823)
260
261 # UDP destination port
262 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782)
263 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F)
264 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293)
265
266 # ICMP type
267 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12)
268 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10)
269
270 # ICMP code
271 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12)
272 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10)
273 NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10)
274 NXM_OF_ICMP_CODE(00)
275
276 # ARP opcode
277 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001)
278 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111)
279 NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001)
280 NXM_OF_ARP_OP(0001)
281 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001)
282
283 # ARP source protocol address
284 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014)
285 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
286 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
287 NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
288
289 # ARP destination protocol address
290 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014)
291 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
292 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
293 NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
294
295 # ARP source hardware address
296 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4)
297 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
298 NXM_NX_ARP_SHA(0002e30f80a4)
299
300 # ARP destination hardware address
301 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
302 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
303 NXM_NX_ARP_THA(0002e30f80a4)
304
305 # IPv6 source
306 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
307 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
308 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
309 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
310
311 # IPv6 destination
312 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
313 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
314 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
315 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
316
317 # ND source hardware address
318 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)
319 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)
320 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)
321 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)
322
323 # ND destination hardware address
324 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)
325 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)
326 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)
327 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)
328
329 # IPv4 fragments.
330 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00)
331 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01)
332 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02)
333 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03)
334 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03)
335 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd)
336 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02)
337 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01)
338 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02)
339 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03)
340 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3)
341
342 # IPv6 fragments.
343 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00)
344 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01)
345 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02)
346 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03)
347 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03)
348 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01)
349 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02)
350 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01)
351 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02)
352 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03)
353 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3)
354
355 # Flow cookie.
356 NXM_NX_COOKIE(00000000abcdef01)
357 NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF)
358
359 # Tunnel ID.
360 NXM_NX_TUN_ID(00000000abcdef01)
361 NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF)
362
363 # Register 0.
364 NXM_NX_REG0(acebdf56)
365 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
366
367 # Invalid field number.
368 01020304(1111/2222)
369
370 # Unimplemented registers.
371 #
372 # This test assumes that at least two registers, but fewer than 16,
373 # registers are implemented.
374 00010004(12345678)
375 00010108(12345678/12345678)
376 00011e04(12345678)
377 00011f08(12345678/12345678)
378 ])
379 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
380 <any>
381
382 # in port
383 NXM_OF_IN_PORT(0000)
384 NXM_OF_IN_PORT(fffe)
385
386 # eth dst
387 NXM_OF_ETH_DST(0002e30f80a4)
388 NXM_OF_ETH_DST_W(010000000000/010000000000)
389 NXM_OF_ETH_DST_W(000000000000/010000000000)
390 NXM_OF_ETH_DST_W(010000000000/010000000000)
391 NXM_OF_ETH_DST(0002e30f80a4)
392 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
393
394 # eth src
395 NXM_OF_ETH_SRC(020898456ddb)
396
397 # eth type
398 NXM_OF_ETH_TYPE(0800)
399 NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800) 
400
401 # vlan tci
402 NXM_OF_VLAN_TCI(f009)
403 nx_pull_match() returned error NXBRC_NXM_DUP_TYPE
404 NXM_OF_VLAN_TCI(0000)
405 NXM_OF_VLAN_TCI(3123)
406 NXM_OF_VLAN_TCI(0123)
407 NXM_OF_VLAN_TCI_W(1123/1fff)
408 NXM_OF_VLAN_TCI_W(f000/f000)
409 NXM_OF_VLAN_TCI_W(0000/e000)
410
411 # IP TOS
412 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0)
413 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
414 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
415
416 # IP ECN
417 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03)
418 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
419 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
420
421 # IP protocol
422 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01)
423 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05)
424 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
425
426 # IP TTL
427 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80)
428 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff)
429 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
430
431 # IP source
432 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014)
433 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000)
434 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
435 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
436
437 # IP destination
438 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014)
439 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(c0a80000/ffff0000)
440 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
441 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
442
443 # TCP source port
444 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231)
445 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0)
446 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
447
448 # TCP destination port
449 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231)
450 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0)
451 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
452
453 # UDP source port
454 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732)
455 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff)
456 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
457
458 # UDP destination port
459 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782)
460 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f)
461 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
462
463 # ICMP type
464 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12)
465 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
466
467 # ICMP code
468 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12)
469 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
470 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
471 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
472
473 # ARP opcode
474 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001)
475 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
476 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
477 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
478 nx_pull_match() returned error NXBRC_NXM_DUP_TYPE
479
480 # ARP source protocol address
481 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014)
482 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
483 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
484 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
485
486 # ARP destination protocol address
487 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014)
488 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
489 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
490 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
491
492 # ARP source hardware address
493 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4)
494 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
495 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
496
497 # ARP destination hardware address
498 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
499 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
500 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
501
502 # IPv6 source
503 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
504 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
505 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
506 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
507
508 # IPv6 destination
509 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
510 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
511 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
512 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
513
514 # ND source hardware address
515 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)
516 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
517 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
518 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
519
520 # ND destination hardware address
521 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)
522 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
523 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
524 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
525
526 # IPv4 fragments.
527 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
528 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01)
529 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02)
530 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
531 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
532 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01)
533 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02)
534 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01)
535 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02)
536 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
537 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
538
539 # IPv6 fragments.
540 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
541 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01)
542 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02)
543 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
544 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
545 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01)
546 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02)
547 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01)
548 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02)
549 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
550 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
551
552 # Flow cookie.
553 NXM_NX_COOKIE(00000000abcdef01)
554 NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff)
555
556 # Tunnel ID.
557 NXM_NX_TUN_ID(00000000abcdef01)
558 NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff)
559
560 # Register 0.
561 NXM_NX_REG0(acebdf56)
562 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
563
564 # Invalid field number.
565 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
566
567 # Unimplemented registers.
568 #
569 # This test assumes that at least two registers, but fewer than 16,
570 # registers are implemented.
571 NXM_NX_REG0(12345678)
572 NXM_NX_REG0_W(12345678/12345678)
573 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
574 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
575 ])
576 AT_CLEANUP
577
578 AT_SETUP([ovs-ofctl parse-nx-match loose])
579 AT_KEYWORDS([nx-match])
580 AT_DATA([nx-match.txt], [dnl
581 NXM_OF_IN_PORT(0001), 01020304(1111/2222), NXM_OF_ETH_TYPE(0800)
582 ])
583
584 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
585 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
586 ])
587
588 AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl
589 NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
590 ])
591 AT_CLEANUP
592
593 dnl Check that "-F openflow10" rejects a flow_mod with a tun_id, since
594 dnl OpenFlow 1.0 doesn't support tunnels.
595 AT_SETUP([ovs-ofctl -F option and tun_id])
596 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
597   [1], [], [ovs-ofctl: flow cannot be expressed in flow format openflow10 (flow format nxm or better is required)
598 ])
599 AT_CLEANUP
600
601 dnl Check that "-F nxm" really forces add-flow to use the NXM flow format.
602 dnl (If it doesn't, then either the tun_id won't show up at all, or it will
603 dnl additionally show up as the top 32 bits of the cookie.)  This checks
604 dnl for regression against bug #4566.
605 AT_SETUP([ovs-ofctl -F option with flow_mods])
606 OVS_VSWITCHD_START
607 AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop])
608 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
609 NXST_FLOW reply:
610  tun_id=0x12345678 actions=drop
611 ])
612 OVS_VSWITCHD_STOP
613 AT_CLEANUP
614
615 dnl Check that "-F openflow10" is really honored on dump-flows.
616 dnl (If it isn't, then dump-flows will show the register match.)
617 AT_SETUP([ovs-ofctl dump-flows honors -F option])
618 OVS_VSWITCHD_START
619 AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop])
620 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl
621 OFPST_FLOW reply:
622  actions=drop
623 ])
624 OVS_VSWITCHD_STOP
625 AT_CLEANUP
626
627 dnl Check that "-F openflow10" fails on dump-flows if the requested match
628 dnl can't be represented in OpenFlow 1.0.
629 AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
630 OVS_VSWITCHD_START
631 AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
632   [ovs-ofctl: unix:br0.mgmt: cannot use requested flow format nxm for specified flow
633 ])
634 OVS_VSWITCHD_STOP
635 AT_CLEANUP
636
637 dnl Check that add-flow reports non-normalized flows (feature #5029).
638 AT_SETUP([ovs-ofctl add-flow reports non-normalized flows])
639 OVS_VSWITCHD_START
640 AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5],
641   [0], [], [dnl
642 ofp_util|INFO|normalization changed ofp_match, details:
643 ofp_util|INFO| pre: nw_src=1.2.3.4
644 ofp_util|INFO|post: @&t@
645 ])
646 OVS_VSWITCHD_STOP
647 AT_CLEANUP