3 AT_SETUP([ovs-ofctl parse-flows])
4 AT_DATA([flows.txt], [[
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 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])
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..30],slaves:)
25 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2
27 AT_CHECK([ovs-ofctl parse-flows flows.txt
29 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
30 [[OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
31 OFPT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
32 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
33 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
34 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
35 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
36 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
37 NXT_SET_FLOW_FORMAT: format=nxm
38 NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
39 NXT_FLOW_MOD: ADD actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789
40 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])
41 NXT_FLOW_MOD_TABLE_ID: enable
42 NXT_FLOW_MOD: ADD table:1 actions=drop
43 NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
44 NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
45 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
46 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
47 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
48 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
49 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
50 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
51 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
55 AT_SETUP([ovs-ofctl -F nxm parse-flows])
56 AT_DATA([flows.txt], [
58 tcp,tp_src=123,actions=flood
59 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
60 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
61 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
62 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
63 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
64 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
65 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
66 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
67 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
68 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
69 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
70 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
71 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
72 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
73 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
74 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
75 tun_id=0x1234,cookie=0x5678,actions=flood
77 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
78 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop
79 dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop
80 dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop
81 dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop
83 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
84 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
85 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
86 NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
87 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
88 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
89 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4
90 NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5
91 NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
92 NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
93 NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
94 NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
95 NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
96 NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
97 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571 actions=drop
98 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop
99 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
100 NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
101 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
102 NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
103 NXT_FLOW_MOD: ADD actions=drop
104 NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
105 NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
106 NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop
107 NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop
108 NXT_FLOW_MOD: ADD actions=drop
112 AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows])
113 AT_DATA([flows.txt], [[
115 tcp,tp_src=123,actions=flood
116 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
117 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
118 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
119 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
120 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
121 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
122 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
123 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
124 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
125 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
126 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
127 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
128 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
129 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
130 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
131 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
132 tun_id=0x1234,cookie=0x5678,actions=flood
134 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[]
135 actions=autopath(5,NXM_NX_REG0[])
136 vlan_tci=0x1123/0x1fff,actions=drop
138 AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout])
139 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
140 [[NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
141 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
142 NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop
143 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3
144 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4
145 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5
146 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
147 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
148 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
149 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
150 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
151 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
152 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
153 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
154 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
155 NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535
156 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
157 NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
158 NXT_FLOW_MOD: ADD <any> actions=drop
159 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[]
160 NXT_FLOW_MOD: ADD <any> actions=autopath(5,NXM_NX_REG0[])
161 NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
165 AT_SETUP([ovs-ofctl parse-nx-match])
166 AT_KEYWORDS([nx-match])
167 AT_DATA([nx-match.txt], [dnl
175 NXM_OF_ETH_DST(0002e30f80a4)
176 NXM_OF_ETH_DST_W(010000000000/010000000000)
177 NXM_OF_ETH_DST_W(000000000000/010000000000)
178 NXM_OF_ETH_DST_W(ffffffffffff/010000000000)
179 NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
180 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
183 NXM_OF_ETH_SRC(020898456ddb)
186 NXM_OF_ETH_TYPE(0800)
187 NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012)
190 NXM_OF_VLAN_TCI(f009)
191 NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009)
192 NXM_OF_VLAN_TCI(0000) # Packets without 802.1Q header.
193 NXM_OF_VLAN_TCI(3123) # Packets with VID=123, PCP=1.
194 NXM_OF_VLAN_TCI(0123) # Does not make sense (but supported anyway)
195 NXM_OF_VLAN_TCI_W(1123/1fff) # Packets with VID=123, any PCP.
196 NXM_OF_VLAN_TCI_W(f000/f000) # Packets with any VID, PCP=7.
197 NXM_OF_VLAN_TCI_W(0000/e000) # No 802.1Q or with VID=0
200 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0)
204 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01)
205 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05)
209 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014)
210 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000)
211 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014)
212 NXM_OF_IP_SRC_W(C0D80000/FFFF0000)
215 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014)
216 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000)
217 NXM_OF_IP_DST(ac100014)
218 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000)
221 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231)
222 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231)
224 # TCP destination port
225 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231)
226 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231)
229 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732)
230 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823)
232 # UDP destination port
233 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782)
234 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293)
237 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12)
238 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10)
241 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12)
242 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10)
243 NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10)
247 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001)
248 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111)
249 NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001)
251 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001)
253 # ARP source protocol address
254 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014)
255 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
256 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
257 NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
259 # ARP destination protocol address
260 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014)
261 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
262 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
263 NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
265 # ARP source hardware address
266 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4)
267 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
268 NXM_NX_ARP_SHA(0002e30f80a4)
270 # ARP destination hardware address
271 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
272 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
273 NXM_NX_ARP_THA(0002e30f80a4)
276 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
277 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
278 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
279 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
282 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
283 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
284 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
285 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
287 # ND source hardware address
288 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)
289 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)
290 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)
291 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)
293 # ND destination hardware address
294 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)
295 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)
296 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)
297 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)
300 NXM_NX_TUN_ID(00000000abcdef01)
301 NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF)
304 NXM_NX_REG0(acebdf56)
305 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
307 # Invalid field number.
310 # Unimplemented registers.
312 # This test assumes that at least two registers, but fewer than 16,
313 # registers are implemented.
315 00010108(12345678/12345678)
317 00011f08(12345678/12345678)
319 AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl
327 NXM_OF_ETH_DST(0002e30f80a4)
328 NXM_OF_ETH_DST_W(010000000000/010000000000)
329 NXM_OF_ETH_DST_W(000000000000/010000000000)
330 NXM_OF_ETH_DST_W(010000000000/010000000000)
331 NXM_OF_ETH_DST(0002e30f80a4)
332 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
335 NXM_OF_ETH_SRC(020898456ddb)
338 NXM_OF_ETH_TYPE(0800)
339 NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800)
342 NXM_OF_VLAN_TCI(f009)
343 nx_pull_match() returned error 44010105 (type OFPET_BAD_REQUEST, code NXBRC_NXM_DUP_TYPE)
344 NXM_OF_VLAN_TCI(0000)
345 NXM_OF_VLAN_TCI(3123)
346 NXM_OF_VLAN_TCI(0123)
347 NXM_OF_VLAN_TCI_W(1123/1fff)
348 NXM_OF_VLAN_TCI_W(f000/f000)
349 NXM_OF_VLAN_TCI_W(0000/e000)
352 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0)
353 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
356 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01)
357 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05)
358 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
361 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014)
362 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000)
363 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
364 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
367 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014)
368 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(c0a80000/ffff0000)
369 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
370 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
373 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231)
374 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
376 # TCP destination port
377 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231)
378 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
381 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732)
382 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
384 # UDP destination port
385 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782)
386 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
389 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12)
390 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
393 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12)
394 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
395 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
396 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
399 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001)
400 nx_pull_match() returned error 44010102 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_VALUE)
401 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
402 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
403 nx_pull_match() returned error 44010105 (type OFPET_BAD_REQUEST, code NXBRC_NXM_DUP_TYPE)
405 # ARP source protocol address
406 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014)
407 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
408 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
409 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
411 # ARP destination protocol address
412 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014)
413 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
414 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
415 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
417 # ARP source hardware address
418 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4)
419 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
420 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
422 # ARP destination hardware address
423 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
424 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
425 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
428 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
429 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
430 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
431 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
434 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
435 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
436 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
437 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
439 # ND source hardware address
440 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)
441 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
442 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
443 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
445 # ND destination hardware address
446 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)
447 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
448 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
449 nx_pull_match() returned error 44010104 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_PREREQ)
452 NXM_NX_TUN_ID(00000000abcdef01)
453 NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff)
456 NXM_NX_REG0(acebdf56)
457 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
459 # Invalid field number.
460 nx_pull_match() returned error 44010101 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_TYPE)
462 # Unimplemented registers.
464 # This test assumes that at least two registers, but fewer than 16,
465 # registers are implemented.
466 NXM_NX_REG0(12345678)
467 NXM_NX_REG0_W(12345678/12345678)
468 nx_pull_match() returned error 44010101 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_TYPE)
469 nx_pull_match() returned error 44010101 (type OFPET_BAD_REQUEST, code NXBRC_NXM_BAD_TYPE)
473 dnl Check that "-F openflow10" rejects a flow_mod with a tun_id, since
474 dnl OpenFlow 1.0 doesn't support tunnels.
475 AT_SETUP([ovs-ofctl -F option and tun_id])
476 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
477 [1], [], [ovs-ofctl: flow cannot be expressed in flow format openflow10 (flow format nxm or better is required)
481 dnl Check that "-F nxm" really forces add-flow to use the NXM flow format.
482 dnl (If it doesn't, then either the tun_id won't show up at all, or it will
483 dnl additionally show up as the top 32 bits of the cookie.) This checks
484 dnl for regression against bug #4566.
485 AT_SETUP([ovs-ofctl -F option with flow_mods])
487 AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop])
488 AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS | STRIP_DURATION], [0], [dnl
490 cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, tun_id=0x12345678 actions=drop
495 dnl Check that "-F openflow10" is really honored on dump-flows.
496 dnl (If it isn't, then dump-flows will show the register match.)
497 AT_SETUP([ovs-ofctl dump-flows honors -F option])
499 AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop])
500 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | STRIP_XIDS | STRIP_DURATION], [0], [dnl
502 cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, actions=drop
507 dnl Check that "-F openflow10" fails on dump-flows if the requested match
508 dnl can't be represented in OpenFlow 1.0.
509 AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
511 AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
512 [ovs-ofctl: unix:br0.mgmt: cannot use requested flow format nxm for specified flow
517 dnl Check that add-flow reports non-normalized flows (feature #5029).
518 AT_SETUP([ovs-ofctl add-flow reports non-normalized flows])
520 AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5],
522 ofp_util|INFO|normalization changed ofp_match, details:
523 ofp_util|INFO| pre: nw_src=1.2.3.4
524 ofp_util|INFO|post: @&t@