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 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])
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 actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3
29 actions=output:1,exit,output:2
32 AT_CHECK([ovs-ofctl parse-flows flows.txt
34 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
35 [[OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
36 OFPT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
37 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
38 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
39 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
40 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
41 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
42 NXT_SET_FLOW_FORMAT: format=nxm
43 NXT_FLOW_MOD: ADD tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD
44 NXT_FLOW_MOD: ADD actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789
45 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])
46 NXT_FLOW_MOD_TABLE_ID: enable
47 NXT_FLOW_MOD: ADD table:1 actions=drop
48 NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
49 NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
50 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
51 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
52 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
53 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
54 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
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..30],slaves:)
57 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
58 NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3)
59 NXT_FLOW_MOD: ADD table:255 actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3
60 NXT_FLOW_MOD: ADD table:255 actions=output:1,exit,output:2
64 AT_SETUP([ovs-ofctl -F nxm parse-flows])
65 AT_DATA([flows.txt], [
67 tcp,tp_src=123,actions=flood
68 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
69 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
70 ipv6,ipv6_label=0x12345 actions=2
71 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
72 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
73 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
74 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
75 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
76 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
77 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
78 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
79 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
80 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
81 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
82 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
83 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
84 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
85 tun_id=0x1234,cookie=0x5678,actions=flood
87 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
88 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop
89 dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop
90 dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop
91 dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop
93 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
94 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
95 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
96 NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
97 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
98 NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2
99 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
100 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4
101 NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5
102 NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
103 NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
104 NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
105 NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
106 NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
107 NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
108 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571 actions=drop
109 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop
110 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
111 NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
112 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
113 NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
114 NXT_FLOW_MOD: ADD actions=drop
115 NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
116 NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
117 NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop
118 NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop
119 NXT_FLOW_MOD: ADD actions=drop
123 AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows])
124 AT_DATA([flows.txt], [[
126 tcp,tp_src=123,actions=flood
127 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
128 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
129 ipv6,ipv6_label=0x12345 actions=2
130 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
131 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
132 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
133 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
134 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
135 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
136 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
137 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
138 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
139 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
140 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
141 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
142 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
143 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
144 tun_id=0x1234,cookie=0x5678,actions=flood
146 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[]
147 actions=autopath(5,NXM_NX_REG0[])
148 vlan_tci=0x1123/0x1fff,actions=drop
150 AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout])
151 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
152 [[NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
153 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
154 NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop
155 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2
156 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3
157 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4
158 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5
159 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
160 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
161 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
162 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
163 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
164 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
165 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
166 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
167 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
168 NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535
169 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
170 NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
171 NXT_FLOW_MOD: ADD <any> actions=drop
172 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[]
173 NXT_FLOW_MOD: ADD <any> actions=autopath(5,NXM_NX_REG0[])
174 NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
178 AT_SETUP([ovs-ofctl parse-nx-match])
179 AT_KEYWORDS([nx-match])
180 AT_DATA([nx-match.txt], [dnl
188 NXM_OF_ETH_DST(0002e30f80a4)
189 NXM_OF_ETH_DST_W(010000000000/010000000000)
190 NXM_OF_ETH_DST_W(000000000000/010000000000)
191 NXM_OF_ETH_DST_W(ffffffffffff/010000000000)
192 NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
193 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
196 NXM_OF_ETH_SRC(020898456ddb)
199 NXM_OF_ETH_TYPE(0800)
200 NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012)
203 NXM_OF_VLAN_TCI(f009)
204 NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009)
205 NXM_OF_VLAN_TCI(0000) # Packets without 802.1Q header.
206 NXM_OF_VLAN_TCI(3123) # Packets with VID=123, PCP=1.
207 NXM_OF_VLAN_TCI(0123) # Does not make sense (but supported anyway)
208 NXM_OF_VLAN_TCI_W(1123/1fff) # Packets with VID=123, any PCP.
209 NXM_OF_VLAN_TCI_W(f000/f000) # Packets with any VID, PCP=7.
210 NXM_OF_VLAN_TCI_W(0000/e000) # No 802.1Q or with VID=0
213 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0)
214 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41)
218 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03)
219 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06)
223 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01)
224 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05)
228 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80)
229 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff)
233 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014)
234 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000)
235 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014)
236 NXM_OF_IP_SRC_W(C0D80000/FFFF0000)
239 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014)
240 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000)
241 NXM_OF_IP_DST(ac100014)
242 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000)
245 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231)
246 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0)
247 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231)
249 # TCP destination port
250 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231)
251 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0)
252 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231)
255 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732)
256 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF)
257 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823)
259 # UDP destination port
260 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782)
261 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F)
262 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293)
265 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12)
266 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10)
269 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12)
270 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10)
271 NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10)
275 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001)
276 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111)
277 NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001)
279 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001)
281 # ARP source protocol address
282 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014)
283 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
284 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
285 NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
287 # ARP destination protocol address
288 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014)
289 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
290 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
291 NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
293 # ARP source hardware address
294 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4)
295 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
296 NXM_NX_ARP_SHA(0002e30f80a4)
298 # ARP destination hardware address
299 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
300 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
301 NXM_NX_ARP_THA(0002e30f80a4)
304 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
305 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
306 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
307 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
310 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
311 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
312 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
313 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
315 # ND source hardware address
316 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)
317 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)
318 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)
319 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)
321 # ND destination hardware address
322 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)
323 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)
324 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)
325 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 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00)
329 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01)
330 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02)
331 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03)
332 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03)
333 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd)
334 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02)
335 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01)
336 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02)
337 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03)
338 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3)
341 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00)
342 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01)
343 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02)
344 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03)
345 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03)
346 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01)
347 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02)
348 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01)
349 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02)
350 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03)
351 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3)
354 NXM_NX_COOKIE(00000000abcdef01)
355 NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF)
358 NXM_NX_TUN_ID(00000000abcdef01)
359 NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF)
362 NXM_NX_REG0(acebdf56)
363 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
365 # Invalid field number.
368 # Unimplemented registers.
370 # This test assumes that at least two registers, but fewer than 16,
371 # registers are implemented.
373 00010108(12345678/12345678)
375 00011f08(12345678/12345678)
377 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
385 NXM_OF_ETH_DST(0002e30f80a4)
386 NXM_OF_ETH_DST_W(010000000000/010000000000)
387 NXM_OF_ETH_DST_W(000000000000/010000000000)
388 NXM_OF_ETH_DST_W(010000000000/010000000000)
389 NXM_OF_ETH_DST(0002e30f80a4)
390 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
393 NXM_OF_ETH_SRC(020898456ddb)
396 NXM_OF_ETH_TYPE(0800)
397 NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800)
400 NXM_OF_VLAN_TCI(f009)
401 nx_pull_match() returned error NXBRC_NXM_DUP_TYPE
402 NXM_OF_VLAN_TCI(0000)
403 NXM_OF_VLAN_TCI(3123)
404 NXM_OF_VLAN_TCI(0123)
405 NXM_OF_VLAN_TCI_W(1123/1fff)
406 NXM_OF_VLAN_TCI_W(f000/f000)
407 NXM_OF_VLAN_TCI_W(0000/e000)
410 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0)
411 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
412 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
415 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03)
416 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
417 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
420 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01)
421 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05)
422 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
425 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80)
426 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff)
427 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
430 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014)
431 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000)
432 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
433 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
436 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014)
437 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(c0a80000/ffff0000)
438 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
439 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
442 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231)
443 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0)
444 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
446 # TCP destination port
447 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231)
448 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0)
449 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
452 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732)
453 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff)
454 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
456 # UDP destination port
457 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782)
458 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f)
459 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
462 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12)
463 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
466 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12)
467 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
468 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
469 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
472 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001)
473 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
474 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
475 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
476 nx_pull_match() returned error NXBRC_NXM_DUP_TYPE
478 # ARP source protocol address
479 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014)
480 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
481 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
482 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
484 # ARP destination protocol address
485 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014)
486 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
487 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
488 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
490 # ARP source hardware address
491 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4)
492 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
493 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
495 # ARP destination hardware address
496 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
497 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
498 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
501 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
502 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
503 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
504 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
507 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
508 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
509 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
510 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
512 # ND source hardware address
513 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)
514 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
515 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
516 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
518 # ND destination hardware address
519 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)
520 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
521 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
522 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
525 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
526 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01)
527 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02)
528 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
529 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
530 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01)
531 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02)
532 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01)
533 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02)
534 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
535 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
538 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
539 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01)
540 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02)
541 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
542 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
543 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01)
544 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02)
545 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01)
546 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02)
547 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
548 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
551 NXM_NX_COOKIE(00000000abcdef01)
552 NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff)
555 NXM_NX_TUN_ID(00000000abcdef01)
556 NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff)
559 NXM_NX_REG0(acebdf56)
560 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
562 # Invalid field number.
563 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
565 # Unimplemented registers.
567 # This test assumes that at least two registers, but fewer than 16,
568 # registers are implemented.
569 NXM_NX_REG0(12345678)
570 NXM_NX_REG0_W(12345678/12345678)
571 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
572 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
576 AT_SETUP([ovs-ofctl parse-nx-match loose])
577 AT_KEYWORDS([nx-match])
578 AT_DATA([nx-match.txt], [dnl
579 NXM_OF_IN_PORT(0001), 01020304(1111/2222), NXM_OF_ETH_TYPE(0800)
582 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
583 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
586 AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl
587 NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
591 dnl Check that "-F openflow10" rejects a flow_mod with a tun_id, since
592 dnl OpenFlow 1.0 doesn't support tunnels.
593 AT_SETUP([ovs-ofctl -F option and tun_id])
594 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
595 [1], [], [ovs-ofctl: flow cannot be expressed in flow format openflow10 (flow format nxm or better is required)
599 dnl Check that "-F nxm" really forces add-flow to use the NXM flow format.
600 dnl (If it doesn't, then either the tun_id won't show up at all, or it will
601 dnl additionally show up as the top 32 bits of the cookie.) This checks
602 dnl for regression against bug #4566.
603 AT_SETUP([ovs-ofctl -F option with flow_mods])
605 AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop])
606 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
608 tun_id=0x12345678 actions=drop
613 dnl Check that "-F openflow10" is really honored on dump-flows.
614 dnl (If it isn't, then dump-flows will show the register match.)
615 AT_SETUP([ovs-ofctl dump-flows honors -F option])
617 AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop])
618 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl
625 dnl Check that "-F openflow10" fails on dump-flows if the requested match
626 dnl can't be represented in OpenFlow 1.0.
627 AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
629 AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
630 [ovs-ofctl: unix:br0.mgmt: cannot use requested flow format nxm for specified flow
635 dnl Check that add-flow reports non-normalized flows (feature #5029).
636 AT_SETUP([ovs-ofctl add-flow reports non-normalized flows])
638 AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5],
640 ofp_util|INFO|normalization changed ofp_match, details:
641 ofp_util|INFO| pre: nw_src=1.2.3.4
642 ofp_util|INFO|post: @&t@