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 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 actions=controller(max_len=123,reason=invalid_ttl,id=555)
34 AT_CHECK([ovs-ofctl parse-flows flows.txt
36 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
37 [[OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
38 OFPT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
39 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
40 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
41 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
42 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
43 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
44 NXT_SET_FLOW_FORMAT: format=nxm
45 NXT_FLOW_MOD: ADD tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD
46 NXT_FLOW_MOD: ADD actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789
47 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])
48 NXT_FLOW_MOD_TABLE_ID: enable
49 NXT_FLOW_MOD: ADD table:1 actions=drop
50 NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
51 NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
52 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
53 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
54 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
55 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
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..15],slaves:2,3)
58 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
59 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
60 NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3)
61 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
62 NXT_FLOW_MOD: ADD table:255 check_overlap actions=output:1,exit,output:2
63 NXT_FLOW_MOD: ADD table:255 actions=fin_timeout(idle_timeout=5,hard_timeout=15)
64 NXT_FLOW_MOD: ADD table:255 actions=controller(reason=invalid_ttl,max_len=123,id=555)
68 AT_SETUP([ovs-ofctl -F nxm parse-flows])
69 AT_DATA([flows.txt], [
71 tcp,tp_src=123,actions=flood
72 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
73 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
74 ipv6,ipv6_label=0x12345 actions=2
75 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
76 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
77 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
78 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
79 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
80 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
81 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
82 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
83 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
84 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
85 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
86 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
87 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
88 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
89 tun_id=0x1234,cookie=0x5678,actions=flood
91 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
92 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop
93 dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop
94 dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop
95 dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop
97 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
98 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
99 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
100 NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
101 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
102 NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2
103 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
104 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4
105 NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5
106 NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
107 NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
108 NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
109 NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
110 NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
111 NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
112 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571 actions=drop
113 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop
114 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
115 NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
116 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
117 NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
118 NXT_FLOW_MOD: ADD actions=drop
119 NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
120 NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
121 NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop
122 NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop
123 NXT_FLOW_MOD: ADD actions=drop
127 AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows])
128 AT_DATA([flows.txt], [[
130 tcp,tp_src=123,actions=flood
131 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
132 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
133 ipv6,ipv6_label=0x12345 actions=2
134 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
135 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
136 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
137 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
138 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
139 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
140 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
141 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
142 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
143 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
144 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
145 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
146 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
147 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
148 tun_id=0x1234,cookie=0x5678,actions=flood
150 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[]
151 actions=autopath(5,NXM_NX_REG0[])
152 vlan_tci=0x1123/0x1fff,actions=drop
154 AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout])
155 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
156 [[NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
157 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
158 NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop
159 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2
160 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3
161 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4
162 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5
163 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
164 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
165 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
166 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
167 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
168 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
169 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
170 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
171 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
172 NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535
173 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
174 NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
175 NXT_FLOW_MOD: ADD <any> actions=drop
176 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[]
177 NXT_FLOW_MOD: ADD <any> actions=autopath(5,NXM_NX_REG0[])
178 NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
182 AT_SETUP([ovs-ofctl parse-nx-match])
183 AT_KEYWORDS([nx-match])
184 AT_DATA([nx-match.txt], [dnl
192 NXM_OF_ETH_DST(0002e30f80a4)
193 NXM_OF_ETH_DST_W(010000000000/010000000000)
194 NXM_OF_ETH_DST_W(000000000000/010000000000)
195 NXM_OF_ETH_DST_W(ffffffffffff/010000000000)
196 NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
197 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
200 NXM_OF_ETH_SRC(020898456ddb)
203 NXM_OF_ETH_TYPE(0800)
204 NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012)
207 NXM_OF_VLAN_TCI(f009)
208 NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009)
209 NXM_OF_VLAN_TCI(0000) # Packets without 802.1Q header.
210 NXM_OF_VLAN_TCI(3123) # Packets with VID=123, PCP=1.
211 NXM_OF_VLAN_TCI(0123) # Does not make sense (but supported anyway)
212 NXM_OF_VLAN_TCI_W(1123/1fff) # Packets with VID=123, any PCP.
213 NXM_OF_VLAN_TCI_W(f000/f000) # Packets with any VID, PCP=7.
214 NXM_OF_VLAN_TCI_W(0000/e000) # No 802.1Q or with VID=0
217 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0)
218 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41)
222 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03)
223 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06)
227 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01)
228 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05)
232 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80)
233 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff)
237 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014)
238 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000)
239 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014)
240 NXM_OF_IP_SRC_W(C0D80000/FFFF0000)
243 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014)
244 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000)
245 NXM_OF_IP_DST(ac100014)
246 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000)
249 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231)
250 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0)
251 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231)
253 # TCP destination port
254 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231)
255 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0)
256 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231)
259 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732)
260 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF)
261 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823)
263 # UDP destination port
264 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782)
265 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F)
266 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293)
269 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12)
270 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10)
273 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12)
274 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10)
275 NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10)
279 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001)
280 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111)
281 NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001)
283 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001)
285 # ARP source protocol address
286 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014)
287 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
288 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
289 NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
291 # ARP destination protocol address
292 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014)
293 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
294 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
295 NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
297 # ARP source hardware address
298 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4)
299 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
300 NXM_NX_ARP_SHA(0002e30f80a4)
302 # ARP destination hardware address
303 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
304 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
305 NXM_NX_ARP_THA(0002e30f80a4)
308 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
309 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
310 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
311 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
314 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
315 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
316 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
317 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
319 # ND source hardware address
320 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)
321 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)
322 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)
323 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)
325 # ND destination hardware address
326 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)
327 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)
328 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)
329 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)
332 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00)
333 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01)
334 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02)
335 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03)
336 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03)
337 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd)
338 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02)
339 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01)
340 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02)
341 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03)
342 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3)
345 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00)
346 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01)
347 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02)
348 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03)
349 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03)
350 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01)
351 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02)
352 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01)
353 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02)
354 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03)
355 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3)
358 NXM_NX_COOKIE(00000000abcdef01)
359 NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF)
362 NXM_NX_TUN_ID(00000000abcdef01)
363 NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF)
366 NXM_NX_REG0(acebdf56)
367 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
369 # Invalid field number.
372 # Unimplemented registers.
374 # This test assumes that at least two registers, but fewer than 16,
375 # registers are implemented.
377 00010108(12345678/12345678)
379 00011f08(12345678/12345678)
381 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
389 NXM_OF_ETH_DST(0002e30f80a4)
390 NXM_OF_ETH_DST_W(010000000000/010000000000)
391 NXM_OF_ETH_DST_W(000000000000/010000000000)
392 NXM_OF_ETH_DST_W(010000000000/010000000000)
393 NXM_OF_ETH_DST(0002e30f80a4)
394 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
397 NXM_OF_ETH_SRC(020898456ddb)
400 NXM_OF_ETH_TYPE(0800)
401 NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800)
404 NXM_OF_VLAN_TCI(f009)
405 nx_pull_match() returned error NXBRC_NXM_DUP_TYPE
406 NXM_OF_VLAN_TCI(0000)
407 NXM_OF_VLAN_TCI(3123)
408 NXM_OF_VLAN_TCI(0123)
409 NXM_OF_VLAN_TCI_W(1123/1fff)
410 NXM_OF_VLAN_TCI_W(f000/f000)
411 NXM_OF_VLAN_TCI_W(0000/e000)
414 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0)
415 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
416 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
419 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03)
420 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
421 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
424 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01)
425 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05)
426 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
429 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80)
430 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff)
431 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
434 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014)
435 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000)
436 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
437 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
440 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014)
441 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(c0a80000/ffff0000)
442 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
443 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
446 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231)
447 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0)
448 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
450 # TCP destination port
451 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231)
452 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0)
453 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
456 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732)
457 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff)
458 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
460 # UDP destination port
461 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782)
462 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f)
463 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
466 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12)
467 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
470 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12)
471 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
472 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
473 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
476 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001)
477 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
478 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
479 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
480 nx_pull_match() returned error NXBRC_NXM_DUP_TYPE
482 # ARP source protocol address
483 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014)
484 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
485 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
486 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
488 # ARP destination protocol address
489 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014)
490 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
491 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
492 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
494 # ARP source hardware address
495 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4)
496 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
497 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
499 # ARP destination hardware address
500 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
501 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
502 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
505 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
506 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
507 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
508 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
511 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
512 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
513 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
514 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
516 # ND source hardware address
517 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)
518 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
519 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
520 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
522 # ND destination hardware address
523 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)
524 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
525 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
526 nx_pull_match() returned error NXBRC_NXM_BAD_PREREQ
529 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
530 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01)
531 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02)
532 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
533 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
534 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01)
535 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02)
536 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01)
537 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02)
538 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
539 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
542 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
543 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01)
544 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02)
545 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
546 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
547 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01)
548 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02)
549 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01)
550 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02)
551 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
552 nx_pull_match() returned error NXBRC_NXM_BAD_VALUE
555 NXM_NX_COOKIE(00000000abcdef01)
556 NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff)
559 NXM_NX_TUN_ID(00000000abcdef01)
560 NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff)
563 NXM_NX_REG0(acebdf56)
564 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
566 # Invalid field number.
567 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
569 # Unimplemented registers.
571 # This test assumes that at least two registers, but fewer than 16,
572 # registers are implemented.
573 NXM_NX_REG0(12345678)
574 NXM_NX_REG0_W(12345678/12345678)
575 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
576 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
580 AT_SETUP([ovs-ofctl parse-nx-match loose])
581 AT_KEYWORDS([nx-match])
582 AT_DATA([nx-match.txt], [dnl
583 NXM_OF_IN_PORT(0001), 01020304(1111/2222), NXM_OF_ETH_TYPE(0800)
586 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
587 nx_pull_match() returned error NXBRC_NXM_BAD_TYPE
590 AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl
591 NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
595 dnl Check that "-F openflow10" rejects a flow_mod with a tun_id, since
596 dnl OpenFlow 1.0 doesn't support tunnels.
597 AT_SETUP([ovs-ofctl -F option and tun_id])
598 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
599 [1], [], [ovs-ofctl: flow cannot be expressed in flow format openflow10 (flow format nxm or better is required)
603 dnl Check that "-F nxm" really forces add-flow to use the NXM flow format.
604 dnl (If it doesn't, then either the tun_id won't show up at all, or it will
605 dnl additionally show up as the top 32 bits of the cookie.) This checks
606 dnl for regression against bug #4566.
607 AT_SETUP([ovs-ofctl -F option with flow_mods])
609 AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop])
610 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
612 tun_id=0x12345678 actions=drop
617 dnl Check that "-F openflow10" is really honored on dump-flows.
618 dnl (If it isn't, then dump-flows will show the register match.)
619 AT_SETUP([ovs-ofctl dump-flows honors -F option])
621 AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop])
622 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl
629 dnl Check that "-F openflow10" fails on dump-flows if the requested match
630 dnl can't be represented in OpenFlow 1.0.
631 AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
633 AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
634 [ovs-ofctl: unix:br0.mgmt: cannot use requested flow format nxm for specified flow
639 dnl Check that add-flow reports non-normalized flows (feature #5029).
640 AT_SETUP([ovs-ofctl add-flow reports non-normalized flows])
642 AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5],
644 ofp_util|INFO|normalization changed ofp_match, details:
645 ofp_util|INFO| pre: nw_src=1.2.3.4
646 ofp_util|INFO|post: @&t@