3 AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.0)])
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
15 AT_CHECK([ovs-ofctl parse-flows flows.txt
17 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
18 [[usable protocols: any
19 chosen protocol: OpenFlow10-table_id
20 OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
21 OFPT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
22 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
23 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
24 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
25 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
26 OFPT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
30 AT_SETUP([ovs-ofctl parse-flows (NXM)])
31 AT_DATA([flows.txt], [[
33 tcp,tp_src=123,actions=flood
34 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
35 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
36 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
37 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
38 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
39 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
40 tcp,tp_src=0x1230/0xfff0,tun_id=0x1234,cookie=0x5678,actions=flood
41 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789
42 actions=multipath(eth_src, 50, hrw, 12, 0, NXM_NX_REG0[0..3]),multipath(symmetric_l4, 1024, iter_hash, 5000, 5050, NXM_NX_REG0[0..12])
44 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
45 metadata=0x1234ffff5678ffff/0xffff0000ffff0000,actions=drop
46 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
47 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
48 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
49 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
50 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
51 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
52 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:[2,3])
53 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
54 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2
55 actions=resubmit:1,resubmit(2),resubmit(,3),resubmit(2,3)
56 send_flow_rem,actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3
57 check_overlap,actions=output:1,exit,output:2
58 actions=fin_timeout(idle_timeout=5,hard_timeout=15)
59 actions=controller(max_len=123,reason=invalid_ttl,id=555)
62 AT_CHECK([ovs-ofctl parse-flows flows.txt
64 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
65 [[usable protocols: NXM+table_id
66 chosen protocol: NXM+table_id
67 NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD
68 NXT_FLOW_MOD: ADD table:255 in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
69 NXT_FLOW_MOD: ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
70 NXT_FLOW_MOD: ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
71 NXT_FLOW_MOD: ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
72 NXT_FLOW_MOD: ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
73 NXT_FLOW_MOD: ADD table:255 actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
74 NXT_FLOW_MOD: ADD table:255 tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD
75 NXT_FLOW_MOD: ADD table:255 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789
76 NXT_FLOW_MOD: ADD table:255 actions=multipath(eth_src,50,hrw,12,0,NXM_NX_REG0[0..3]),multipath(symmetric_l4,1024,iter_hash,5000,5050,NXM_NX_REG0[0..12])
77 NXT_FLOW_MOD: ADD table:1 actions=drop
78 NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
79 NXT_FLOW_MOD: ADD table:255 metadata=0x1234000056780000/0xffff0000ffff0000 actions=drop
80 NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1)
81 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3)
82 NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:)
83 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2
84 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1)
85 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
86 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3)
87 NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:)
88 NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2
89 NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3)
90 NXT_FLOW_MOD: ADD table:255 send_flow_rem actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3
91 NXT_FLOW_MOD: ADD table:255 check_overlap actions=output:1,exit,output:2
92 NXT_FLOW_MOD: ADD table:255 actions=fin_timeout(idle_timeout=5,hard_timeout=15)
93 NXT_FLOW_MOD: ADD table:255 actions=controller(reason=invalid_ttl,max_len=123,id=555)
97 AT_SETUP([ovs-ofctl -F nxm parse-flows])
98 AT_DATA([flows.txt], [
100 tcp,tp_src=123,actions=flood
101 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
102 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
103 ipv6,ipv6_label=0x12345 actions=2
104 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
105 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
106 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
107 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
108 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
109 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
110 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
111 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
112 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
113 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
114 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4F:0571/112 actions=drop
115 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
116 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
117 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE00:0000/96,nd_tll=00:0A:E4:25:6B:B1 actions=drop
118 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
119 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
120 tun_id=0x1234,cookie=0x5678,actions=flood
122 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
123 dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop
124 dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop
125 dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop
126 dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop
128 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
129 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
130 usable protocols: NXM
131 chosen protocol: NXM-table_id
132 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
133 NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
134 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
135 NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2
136 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
137 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4
138 NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5
139 NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
140 NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
141 NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
142 NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
143 NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
144 NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
145 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571 actions=drop
146 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4f:0/112 actions=drop
147 NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop
148 NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571,nd_tll=00:0a:e4:25:6b:b1 actions=drop
149 NXT_FLOW_MOD: ADD icmp6,icmp_type=136,nd_target=fec0:0:1234:f045:8fff:1111::/96,nd_tll=00:0a:e4:25:6b:b1 actions=drop
150 NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
151 NXT_FLOW_MOD: ADD actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
152 NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
153 NXT_FLOW_MOD: ADD actions=drop
154 NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
155 NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop
156 NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop
157 NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop
158 NXT_FLOW_MOD: ADD actions=drop
162 AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows])
163 AT_DATA([flows.txt], [[
165 tcp,tp_src=123,actions=flood
166 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
167 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
168 ipv6,ipv6_label=0x12345 actions=2
169 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
170 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
171 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
172 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
173 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
174 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
175 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
176 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
177 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
178 icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop
179 icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop
180 icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop
181 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
182 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
183 tun_id=0x1234,cookie=0x5678,actions=flood
185 reg0=123,actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:55->NXM_NX_REG2[0..31],move:NXM_NX_REG0[0..31]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[]
186 actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[]
187 actions=autopath(5,NXM_NX_REG0[])
188 vlan_tci=0x1123/0x1fff,actions=drop
190 AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout], [stderr])
191 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
192 [[usable protocols: NXM
193 chosen protocol: NXM-table_id
194 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
195 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
196 NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop
197 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2
198 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3
199 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4
200 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5
201 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000001), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(0050) actions=drop
202 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000003), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(0035) actions=drop
203 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(0003), NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000001), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(86) actions=drop
204 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_VLAN_TCI_W(f000/f000), NXM_OF_IP_PROTO(11) idle:5 actions=strip_vlan,output:0
205 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80003), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(0050) actions=set_queue:37,output:1
206 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80003), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(0035) actions=pop_queue,output:1
207 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(fec000001234f0458fff1111fe4e0571) actions=drop
208 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_SLL(000ae4256bb0) actions=drop
209 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(fec000001234f0458fff1111fe4e0571), NXM_NX_ND_TLL(000ae4256bb1) actions=drop
210 NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535
211 NXT_FLOW_MOD: ADD <any> actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00
212 NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
213 NXT_FLOW_MOD: ADD <any> actions=drop
214 NXT_FLOW_MOD: ADD NXM_NX_REG0(0000007b) actions=move:NXM_NX_REG0[0..5]->NXM_NX_REG1[26..31],load:0x37->NXM_NX_REG2[],move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],move:NXM_NX_REG0[0..15]->NXM_OF_VLAN_TCI[]
215 NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[]
216 NXT_FLOW_MOD: ADD <any> actions=autopath(5,NXM_NX_REG0[])
217 NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop
219 AT_CHECK([[sed 's/^[^|]*|[^|]*|//' stderr]], [0], [dnl
220 autopath|WARN|The autopath action is deprecated and may be removed in February 2013. Please email dev@openvswitch.org with concerns.
224 AT_SETUP([ovs-ofctl parse-nx-match])
225 AT_KEYWORDS([nx-match])
226 AT_DATA([nx-match.txt], [dnl
234 NXM_OF_ETH_DST(0002e30f80a4)
235 NXM_OF_ETH_DST_W(010000000000/010000000000)
236 NXM_OF_ETH_DST_W(000000000000/010000000000)
237 NXM_OF_ETH_DST_W(ffffffffffff/010000000000)
238 NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
239 NXM_OF_ETH_DST_W(60175619848f/000000000000)
240 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
241 NXM_OF_ETH_DST_W(60175619848f/5a5a5a5a5a5a)
244 NXM_OF_ETH_SRC(020898456ddb)
245 NXM_OF_ETH_SRC_W(012345abcdef/ffffff555555)
246 NXM_OF_ETH_SRC_W(020898456ddb/ffffffffffff)
247 NXM_OF_ETH_SRC_W(020898456ddb/000000000000)
250 NXM_OF_ETH_TYPE(0800)
251 NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012)
254 NXM_OF_VLAN_TCI(f009)
255 NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009)
256 NXM_OF_VLAN_TCI(0000) # Packets without 802.1Q header.
257 NXM_OF_VLAN_TCI(3123) # Packets with VID=123, PCP=1.
258 NXM_OF_VLAN_TCI(0123) # Does not make sense (but supported anyway)
259 NXM_OF_VLAN_TCI_W(1123/1fff) # Packets with VID=123, any PCP.
260 NXM_OF_VLAN_TCI_W(1123/ffff) # Packets with VID=123, PCP=0
261 NXM_OF_VLAN_TCI_W(1123/0000) # Packets with or without 802.1Q header
262 NXM_OF_VLAN_TCI_W(f000/f000) # Packets with any VID, PCP=7.
263 NXM_OF_VLAN_TCI_W(0000/e000) # No 802.1Q or with VID=0
266 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0)
267 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41)
271 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03)
272 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06)
276 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01)
277 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05)
281 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80)
282 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff)
286 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014)
287 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000)
288 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/5a5a5a5a)
289 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/ffffffff)
290 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/00000000)
291 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014)
292 NXM_OF_IP_SRC_W(C0D80000/FFFF0000)
295 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014)
296 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000)
297 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/5a5a5a5a)
298 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/ffffffff)
299 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/00000000)
300 NXM_OF_IP_DST(ac100014)
301 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000)
304 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231)
305 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0)
306 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/ffff)
307 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/0000)
308 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231)
310 # TCP destination port
311 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231)
312 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0)
313 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/ffff)
314 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/0000)
315 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231)
318 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732)
319 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF)
320 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/ffff)
321 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/0000)
322 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823)
324 # UDP destination port
325 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782)
326 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F)
327 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/FFFF)
328 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/0000)
329 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293)
332 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12)
333 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10)
336 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12)
337 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10)
338 NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10)
342 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001)
343 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111)
344 NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001)
346 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001)
348 # ARP source protocol address
349 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014)
350 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
351 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00)
352 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/ffffffff)
353 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/00000000)
354 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
355 NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
357 # ARP destination protocol address
358 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014)
359 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
360 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/77777777)
361 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/ffffffff)
362 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/00000000)
363 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
364 NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
366 # ARP source hardware address
367 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4)
368 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
369 NXM_NX_ARP_SHA(0002e30f80a4)
371 # ARP destination hardware address
372 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
373 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
374 NXM_NX_ARP_THA(0002e30f80a4)
377 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
378 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
379 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
380 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/5a5a5a5a5a5a5a5a0000000000000000)
381 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
382 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000)
383 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
386 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
387 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
388 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/77777777777777777777777777777777)
389 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
390 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/00000000000000000000000000000000)
391 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
394 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(1000000f)
395 NXM_NX_IPV6_LABEL(0000000f)
396 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(0000000f)
399 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
400 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
401 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/0123456789abcdeffedcba9876543210)
402 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/ffffffffffffffffffffffffffffffff)
403 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/00000000000000000000000000000000)
404 NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/fedcba98765432100123456789abcdef)
406 # ND source hardware address
407 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)
408 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)
409 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)
410 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)
412 # ND destination hardware address
413 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)
414 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)
415 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)
416 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)
419 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00)
420 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01)
421 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02)
422 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03)
423 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03)
424 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd)
425 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02)
426 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01)
427 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02)
428 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03)
429 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/ff)
430 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/00)
431 NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3)
434 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00)
435 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01)
436 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02)
437 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03)
438 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03)
439 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01)
440 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02)
441 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01)
442 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02)
443 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03)
444 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/00)
445 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/ff)
446 NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3)
449 NXM_NX_COOKIE(00000000abcdef01)
450 NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF)
451 NXM_NX_COOKIE_W(84200000abcdef01/ffffffffffffffff)
452 NXM_NX_COOKIE_W(84200000abcdef01/0000000000000000)
455 NXM_NX_TUN_ID(00000000abcdef01)
456 NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF)
457 NXM_NX_TUN_ID_W(84200000abcdef01/FFFFFFFFFFFFFFFF)
458 NXM_NX_TUN_ID_W(84200000abcdef01/0000000000000000)
461 NXM_NX_REG0(acebdf56)
462 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
463 NXM_NX_REG0_W(a0e0d050/ffffffff)
464 NXM_NX_REG0_W(a0e0d050/00000000)
466 # Invalid field number.
469 # Unimplemented registers.
471 # This test assumes that at least two registers, but fewer than 16,
472 # registers are implemented.
474 00010108(12345678/12345678)
476 00011f08(12345678/12345678)
478 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
486 NXM_OF_ETH_DST(0002e30f80a4)
487 NXM_OF_ETH_DST_W(010000000000/010000000000)
488 NXM_OF_ETH_DST_W(000000000000/010000000000)
489 NXM_OF_ETH_DST_W(010000000000/010000000000)
490 NXM_OF_ETH_DST(0002e30f80a4)
492 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
493 NXM_OF_ETH_DST_W(40125218000a/5a5a5a5a5a5a)
496 NXM_OF_ETH_SRC(020898456ddb)
497 NXM_OF_ETH_SRC_W(012345014545/ffffff555555)
498 NXM_OF_ETH_SRC(020898456ddb)
502 NXM_OF_ETH_TYPE(0800)
503 NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800)
506 NXM_OF_VLAN_TCI(f009)
507 nx_pull_match() returned error OFPBMC_DUP_FIELD
508 NXM_OF_VLAN_TCI(0000)
509 NXM_OF_VLAN_TCI(3123)
510 NXM_OF_VLAN_TCI(0123)
511 NXM_OF_VLAN_TCI_W(1123/1fff)
512 NXM_OF_VLAN_TCI(1123)
514 NXM_OF_VLAN_TCI_W(f000/f000)
515 NXM_OF_VLAN_TCI_W(0000/e000)
518 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0)
519 nx_pull_match() returned error OFPBMC_BAD_VALUE
520 nx_pull_match() returned error OFPBMC_BAD_PREREQ
523 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03)
524 nx_pull_match() returned error OFPBMC_BAD_VALUE
525 nx_pull_match() returned error OFPBMC_BAD_PREREQ
528 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01)
529 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05)
530 nx_pull_match() returned error OFPBMC_BAD_PREREQ
533 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80)
534 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff)
535 nx_pull_match() returned error OFPBMC_BAD_PREREQ
538 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014)
539 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000)
540 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(40080000/5a5a5a5a)
541 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80000)
542 NXM_OF_ETH_TYPE(0800)
543 nx_pull_match() returned error OFPBMC_BAD_PREREQ
544 nx_pull_match() returned error OFPBMC_BAD_PREREQ
547 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014)
548 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(c0a80000/ffff0000)
549 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(40080000/5a5a5a5a)
550 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(c0a80000)
551 NXM_OF_ETH_TYPE(0800)
552 nx_pull_match() returned error OFPBMC_BAD_PREREQ
553 nx_pull_match() returned error OFPBMC_BAD_PREREQ
556 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231)
557 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0)
558 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(5050)
559 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06)
560 nx_pull_match() returned error OFPBMC_BAD_PREREQ
562 # TCP destination port
563 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231)
564 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0)
565 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(fde0)
566 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06)
567 nx_pull_match() returned error OFPBMC_BAD_PREREQ
570 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732)
571 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff)
572 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(0132)
573 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11)
574 nx_pull_match() returned error OFPBMC_BAD_PREREQ
576 # UDP destination port
577 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782)
578 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f)
579 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(5005)
580 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11)
581 nx_pull_match() returned error OFPBMC_BAD_PREREQ
584 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12)
585 nx_pull_match() returned error OFPBMC_BAD_PREREQ
588 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12)
589 nx_pull_match() returned error OFPBMC_BAD_PREREQ
590 nx_pull_match() returned error OFPBMC_BAD_PREREQ
591 nx_pull_match() returned error OFPBMC_BAD_PREREQ
594 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001)
595 nx_pull_match() returned error OFPBMC_BAD_VALUE
596 nx_pull_match() returned error OFPBMC_BAD_PREREQ
597 nx_pull_match() returned error OFPBMC_BAD_PREREQ
598 nx_pull_match() returned error OFPBMC_DUP_FIELD
600 # ARP source protocol address
601 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014)
602 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
603 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(80a80200/aaaaaa00)
604 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(c0a81234)
605 NXM_OF_ETH_TYPE(0806)
606 nx_pull_match() returned error OFPBMC_BAD_PREREQ
607 nx_pull_match() returned error OFPBMC_BAD_PREREQ
609 # ARP destination protocol address
610 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014)
611 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
612 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(40201234/77777777)
613 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(c0a81234)
614 NXM_OF_ETH_TYPE(0806)
615 nx_pull_match() returned error OFPBMC_BAD_PREREQ
616 nx_pull_match() returned error OFPBMC_BAD_PREREQ
618 # ARP source hardware address
619 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4)
620 nx_pull_match() returned error OFPBMC_BAD_PREREQ
621 nx_pull_match() returned error OFPBMC_BAD_PREREQ
623 # ARP destination hardware address
624 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
625 nx_pull_match() returned error OFPBMC_BAD_PREREQ
626 nx_pull_match() returned error OFPBMC_BAD_PREREQ
629 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
630 nx_pull_match() returned error OFPBMC_BAD_PREREQ
631 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
632 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(00000818184800000000000000000000/5a5a5a5a5a5a5a5a0000000000000000)
633 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000000)
634 NXM_OF_ETH_TYPE(86dd)
635 nx_pull_match() returned error OFPBMC_BAD_PREREQ
638 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
639 nx_pull_match() returned error OFPBMC_BAD_PREREQ
640 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010530344500010000000000000000/77777777777777777777777777777777)
641 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010000000000000000)
642 NXM_OF_ETH_TYPE(86dd)
643 nx_pull_match() returned error OFPBMC_BAD_PREREQ
646 nx_pull_match() returned error OFPBMC_BAD_VALUE
647 nx_pull_match() returned error OFPBMC_BAD_PREREQ
648 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(0000000f)
651 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
652 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
653 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET_W(00010520080900010000000000040000/0123456789abcdeffedcba9876543210)
654 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005)
655 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87)
656 NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET_W(20000898344400000002000300000005/fedcba98765432100123456789abcdef)
658 # ND source hardware address
659 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)
660 nx_pull_match() returned error OFPBMC_BAD_PREREQ
661 nx_pull_match() returned error OFPBMC_BAD_PREREQ
662 nx_pull_match() returned error OFPBMC_BAD_PREREQ
664 # ND destination hardware address
665 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)
666 nx_pull_match() returned error OFPBMC_BAD_PREREQ
667 nx_pull_match() returned error OFPBMC_BAD_PREREQ
668 nx_pull_match() returned error OFPBMC_BAD_PREREQ
671 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
672 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01)
673 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02)
674 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
675 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
676 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01)
677 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02)
678 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01)
679 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02)
680 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
681 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03)
682 NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00)
683 nx_pull_match() returned error OFPBMC_BAD_VALUE
686 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
687 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01)
688 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02)
689 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
690 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
691 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01)
692 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02)
693 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01)
694 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02)
695 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
696 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00)
697 NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03)
698 nx_pull_match() returned error OFPBMC_BAD_VALUE
701 NXM_NX_COOKIE(00000000abcdef01)
702 NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff)
703 NXM_NX_COOKIE(84200000abcdef01)
707 NXM_NX_TUN_ID(00000000abcdef01)
708 NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff)
709 NXM_NX_TUN_ID(84200000abcdef01)
713 NXM_NX_REG0(acebdf56)
714 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
715 NXM_NX_REG0(a0e0d050)
718 # Invalid field number.
719 nx_pull_match() returned error OFPBMC_BAD_FIELD
721 # Unimplemented registers.
723 # This test assumes that at least two registers, but fewer than 16,
724 # registers are implemented.
725 NXM_NX_REG0(12345678)
726 NXM_NX_REG0_W(12345678/12345678)
727 nx_pull_match() returned error OFPBMC_BAD_FIELD
728 nx_pull_match() returned error OFPBMC_BAD_FIELD
732 AT_SETUP([ovs-ofctl parse-ofp10-match])
734 AT_DATA([test-data], [dnl
736 003820fe fffe xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl
737 xxxxxxxx xxxxxxxx xxxx xxxx
739 # dl_src=00:01:02:03:04:05
740 003820fb xxxx 000102030405 xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl
741 xxxxxxxx xxxxxxxx xxxx xxxx
743 # dl_dst=10:20:30:40:50:60
744 003820f7 xxxx xxxxxxxxxxxx 102030405060 xxxx xx xx xxxx xx xx xxxx dnl
745 xxxxxxxx xxxxxxxx xxxx xxxx
748 003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 xx xx xxxx xx xx xxxx dnl
749 xxxxxxxx xxxxxxxx xxxx xxxx
752 002820ff xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx 05 xx xxxx xx xx xxxx dnl
753 xxxxxxxx xxxxxxxx xxxx xxxx
755 # dl_vlan=291,dl_vlan_pcp=4
756 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 04 xx xxxx xx xx xxxx dnl
757 xxxxxxxx xxxxxxxx xxxx xxxx
760 003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff xx xx xxxx xx xx xxxx dnl
761 xxxxxxxx xxxxxxxx xxxx xxxx
763 dnl dl_vlan_pcp doesn't make sense when dl_vlan is "none", so
764 dnl OVS ignores it and drops it on output.
768 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff 05 xx xxxx xx xx xxxx dnl
769 xxxxxxxx xxxxxxxx xxxx xxxx
771 dnl Invalid VID and PCP discards out-of-range bits:
772 # dl_vlan=256,dl_vlan_pcp=7
775 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx f100 ff xx xxxx xx xx xxxx dnl
776 xxxxxxxx xxxxxxxx xxxx xxxx
779 003820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
780 xxxxxxxx xxxxxxxx xxxx xxxx
783 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 05 xxxx dnl
784 xxxxxxxx xxxxxxxx xxxx xxxx
786 dnl Ignore nw_proto if not IP or ARP:
787 # dl_type=0x1234,nw_proto=5
788 # normal: 3: cf -> ef
789 # normal: 25: 05 -> 00
790 & ofp_util|INFO|normalization changed ofp_match, details:
791 & ofp_util|INFO| pre: dl_type=0x1234,nw_proto=5
792 & ofp_util|INFO|post: dl_type=0x1234
793 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx 05 xxxx dnl
794 xxxxxxxx xxxxxxxx xxxx xxxx
797 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 fc xx xxxx dnl
798 xxxxxxxx xxxxxxxx xxxx xxxx
800 dnl Ignore nw_tos if not IP:
803 # normal: 1: 18 -> 38
804 # normal: 24: 04 -> 00
805 & ofp_util|INFO|normalization changed ofp_match, details:
806 & ofp_util|INFO| pre: arp,nw_tos=4
807 & ofp_util|INFO|post: arp
808 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 05 xx xxxx dnl
809 xxxxxxxx xxxxxxxx xxxx xxxx
811 dnl Low 2 bits of invalid TOS are forced to 0:
814 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 31 xx xxxx dnl
815 xxxxxxxx xxxxxxxx xxxx xxxx
818 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx 02 xxxx dnl
819 xxxxxxxx xxxxxxxx xxxx xxxx
821 # ip,nw_src=192.168.128.85
822 003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
823 c0a88055 xxxxxxxx xxxx xxxx
825 # ip,nw_src=192.168.128.0/24
827 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
828 c0a88055 xxxxxxxx xxxx xxxx
830 # ip,nw_dst=192.168.128.85
831 003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
832 xxxxxxxx c0a88055 xxxx xxxx
834 # ip,nw_dst=192.168.128.0/24
836 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl
837 xxxxxxxx c0a88055 xxxx xxxx
839 # arp,nw_src=192.168.128.85
840 003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
841 c0a88055 xxxxxxxx xxxx xxxx
843 # arp,nw_src=192.168.128.0/24
845 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
846 c0a88055 xxxxxxxx xxxx xxxx
848 # arp,nw_dst=192.168.128.85
849 003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
850 xxxxxxxx c0a88055 xxxx xxxx
852 # arp,nw_dst=192.168.128.0/24
854 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl
855 xxxxxxxx c0a88055 xxxx xxxx
857 dnl Ignore nw_src if not IP or ARP:
858 # dl_type=0x1234,nw_src=192.168.128.0/24
860 # normal: 2: 08 -> 20
861 # normal: 28: c0 -> 00
862 # normal: 29: a8 -> 00
863 # normal: 30: 80 -> 00
864 & ofp_util|INFO|normalization changed ofp_match, details:
865 & ofp_util|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24
866 & ofp_util|INFO|post: dl_type=0x1234
867 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
868 c0a88055 xxxxxxxx xxxx xxxx
870 dnl Ignore nw_dst if not IP or ARP:
871 # dl_type=0x1234,nw_dst=192.168.128.0/24
873 # normal: 1: 32 -> 38
874 # normal: 32: c0 -> 00
875 # normal: 33: a8 -> 00
876 # normal: 34: 80 -> 00
877 & ofp_util|INFO|normalization changed ofp_match, details:
878 & ofp_util|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24
879 & ofp_util|INFO|post: dl_type=0x1234
880 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl
881 xxxxxxxx c0a88055 xxxx xxxx
884 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl
885 xxxxxxxx xxxxxxxx 01bb xxxx
888 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl
889 xxxxxxxx xxxxxxxx xxxx 01bb
892 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl
893 xxxxxxxx xxxxxxxx 01bb xxxx
896 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl
897 xxxxxxxx xxxxxxxx xxxx 01bb
900 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl
901 xxxxxxxx xxxxxxxx 0005 xxxx
904 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl
905 xxxxxxxx xxxxxxxx xxxx 0008
907 dnl Ignore tp_src if not TCP or UDP:
908 # ip,nw_proto=21,tp_src=443
909 # normal: 3: 8f -> cf
910 # normal: 36: 01 -> 00
911 # normal: 37: bb -> 00
912 & ofp_util|INFO|normalization changed ofp_match, details:
913 & ofp_util|INFO| pre: ip,nw_proto=21,tp_src=443
914 & ofp_util|INFO|post: ip,nw_proto=21
915 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl
916 xxxxxxxx xxxxxxxx 01bb xxxx
918 dnl Ignore tp_dst if not TCP or UDP:
919 # ip,nw_proto=21,tp_dst=443
920 # normal: 3: 4f -> cf
921 # normal: 38: 01 -> 00
922 # normal: 39: bb -> 00
923 dnl The normalization details are suppressed here due to rate-limiting.
924 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl
925 xxxxxxxx xxxxxxxx xxxx 01bb
928 sed '/^[[#&]]/d' < test-data > input.txt
929 sed -n 's/^# //p; /^$/p' < test-data > expout
930 sed -n 's/^& //p' < test-data > experr
931 AT_CAPTURE_FILE([input.txt])
932 AT_CAPTURE_FILE([expout])
933 AT_CAPTURE_FILE([experr])
935 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-match < input.txt],
936 [0], [expout], [experr])
939 AT_SETUP([ovs-ofctl parse-ofp11-match])
941 AT_DATA([test-data], [dnl
943 0000 0058 fffffffe 000003fe dnl
944 000000000000ffffffffffff 000000000000ffffffffffff dnl
945 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
946 00000000 00 000000 0000000000000000ffffffffffffffff
948 # bad ofp11_match: OFPBMC_BAD_VALUE
949 & ofp_util|WARN|port 305419896 is outside the supported range 0 through 65279 or 0xffffff00 through 0xffffffff
950 0000 0058 12345678 000003fe dnl
951 000000000000ffffffffffff 000000000000ffffffffffff dnl
952 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
953 00000000 00 000000 0000000000000000ffffffffffffffff
955 # dl_src=00:01:02:03:04:05
956 0000 0058 00000000 000003ff dnl
957 000102030405000000000000 000000000000ffffffffffff dnl
958 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
959 00000000 00 000000 0000000000000000ffffffffffffffff
961 # dl_src=55:55:55:55:55:55/55:55:55:55:55:55
962 0000 0058 00000000 000003ff dnl
963 555555555555aaaaaaaaaaaa 000000000000ffffffffffff dnl
964 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
965 00000000 00 000000 0000000000000000ffffffffffffffff
967 # dl_dst=00:01:02:03:04:05
968 0000 0058 00000000 000003ff dnl
969 000000000000ffffffffffff 000102030405000000000000 dnl
970 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
971 00000000 00 000000 0000000000000000ffffffffffffffff
973 # dl_dst=01:00:00:00:00:00/01:00:00:00:00:00
974 0000 0058 00000000 000003ff dnl
975 000000000000ffffffffffff 010000000000feffffffffff dnl
976 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
977 00000000 00 000000 0000000000000000ffffffffffffffff
979 # dl_dst=00:01:02:03:04:05/fe:ff:ff:ff:ff:ff
980 0000 0058 00000000 000003ff dnl
981 000000000000ffffffffffff 000102030405010000000000 dnl
982 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
983 00000000 00 000000 0000000000000000ffffffffffffffff
985 # dl_dst=55:55:55:55:55:55/55:55:55:55:55:55
986 0000 0058 00000000 000003ff dnl
987 000000000000ffffffffffff 555555555555aaaaaaaaaaaa dnl
988 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
989 00000000 00 000000 0000000000000000ffffffffffffffff
991 dnl dl_vlan_pcp is ignored if dl_vlan is wildcarded, which causes the
992 dnl the wildcard bit and the dl_vlan_pcp to be dropped for output:
996 0000 0058 00000001 000003fa dnl
997 000000000000ffffffffffff 000000000000ffffffffffff dnl
998 0000 03 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
999 00000000 00 000000 0000000000000000ffffffffffffffff
1002 0000 0058 00000000 000003fd dnl
1003 000000000000ffffffffffff 000000000000ffffffffffff dnl
1004 0123 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1005 00000000 00 000000 0000000000000000ffffffffffffffff
1009 0000 0058 00000000 000003fd dnl
1010 000000000000ffffffffffff 000000000000ffffffffffff dnl
1011 ffff 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1012 00000000 00 000000 0000000000000000ffffffffffffffff
1014 dnl OFPVID_NONE ignores dl_vlan_pcp even if not wildcarded, which causes
1015 dnl the wildcard bit and the dl_vlan_pcp to be dropped for output:
1019 0000 0058 00000000 000003f9 dnl
1020 000000000000ffffffffffff 000000000000ffffffffffff dnl
1021 ffff 05 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1022 00000000 00 000000 0000000000000000ffffffffffffffff
1024 # vlan_tci=0x1000/0x1000
1025 0000 0058 00000000 000003fd dnl
1026 000000000000ffffffffffff 000000000000ffffffffffff dnl
1027 fffe 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1028 00000000 00 000000 0000000000000000ffffffffffffffff
1030 dnl Try invalid VID:
1031 # bad ofp11_match: OFPBMC_BAD_VALUE
1032 0000 0058 00000000 000003fd dnl
1033 000000000000ffffffffffff 000000000000ffffffffffff dnl
1034 1234 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1035 00000000 00 000000 0000000000000000ffffffffffffffff
1038 0000 0058 00000000 000003f9 dnl
1039 000000000000ffffffffffff 000000000000ffffffffffff dnl
1040 fffe 04 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1041 00000000 00 000000 0000000000000000ffffffffffffffff
1043 # dl_vlan=10,dl_vlan_pcp=6
1044 0000 0058 00000000 000003f9 dnl
1045 000000000000ffffffffffff 000000000000ffffffffffff dnl
1046 000a 06 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1047 00000000 00 000000 0000000000000000ffffffffffffffff
1050 0000 0058 00000000 000003f7 dnl
1051 000000000000ffffffffffff 000000000000ffffffffffff dnl
1052 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1053 00000000 00 000000 0000000000000000ffffffffffffffff
1056 0000 0058 00000000 000003e7 dnl
1057 000000000000ffffffffffff 000000000000ffffffffffff dnl
1058 0000 00 00 0800 fc 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1059 00000000 00 000000 0000000000000000ffffffffffffffff
1061 dnl Try invalid TOS:
1062 # bad ofp11_match: OFPBMC_BAD_VALUE
1063 0000 0058 00000000 000003e7 dnl
1064 000000000000ffffffffffff 000000000000ffffffffffff dnl
1065 0000 00 00 0800 01 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1066 00000000 00 000000 0000000000000000ffffffffffffffff
1069 0000 0058 00000000 000003d7 dnl
1070 000000000000ffffffffffff 000000000000ffffffffffff dnl
1071 0000 00 00 0800 00 05 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1072 00000000 00 000000 0000000000000000ffffffffffffffff
1075 0000 0058 00000000 000003d7 dnl
1076 000000000000ffffffffffff 000000000000ffffffffffff dnl
1077 0000 00 00 0806 00 02 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1078 00000000 00 000000 0000000000000000ffffffffffffffff
1080 # ip,nw_src=192.168.128.0/24
1081 0000 0058 00000000 000003f7 dnl
1082 000000000000ffffffffffff 000000000000ffffffffffff dnl
1083 0000 00 00 0800 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
1084 00000000 00 000000 0000000000000000ffffffffffffffff
1086 # ip,nw_src=128.160.128.0/165.165.165.165
1089 0000 0058 00000000 000003f7 dnl
1090 000000000000ffffffffffff 000000000000ffffffffffff dnl
1091 0000 00 00 0800 00 00 c0a880005a5a5a5a 00000000ffffffff 0000 0000 dnl
1092 00000000 00 000000 0000000000000000ffffffffffffffff
1094 # ip,nw_dst=192.168.128.0/24
1095 0000 0058 00000000 000003f7 dnl
1096 000000000000ffffffffffff 000000000000ffffffffffff dnl
1097 0000 00 00 0800 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
1098 00000000 00 000000 0000000000000000ffffffffffffffff
1100 # ip,nw_dst=128.160.128.0/165.165.165.165
1103 0000 0058 00000000 000003f7 dnl
1104 000000000000ffffffffffff 000000000000ffffffffffff dnl
1105 0000 00 00 0800 00 00 00000000ffffffff c0a880005a5a5a5a 0000 0000 dnl
1106 00000000 00 000000 0000000000000000ffffffffffffffff
1108 # arp,nw_src=192.168.128.0/24
1109 0000 0058 00000000 000003f7 dnl
1110 000000000000ffffffffffff 000000000000ffffffffffff dnl
1111 0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl
1112 00000000 00 000000 0000000000000000ffffffffffffffff
1114 # arp,nw_dst=192.168.128.0/24
1115 0000 0058 00000000 000003f7 dnl
1116 000000000000ffffffffffff 000000000000ffffffffffff dnl
1117 0000 00 00 0806 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl
1118 00000000 00 000000 0000000000000000ffffffffffffffff
1121 0000 0058 00000000 00000397 dnl
1122 000000000000ffffffffffff 000000000000ffffffffffff dnl
1123 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1124 00000000 00 000000 0000000000000000ffffffffffffffff
1127 0000 0058 00000000 00000357 dnl
1128 000000000000ffffffffffff 000000000000ffffffffffff dnl
1129 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 0000 01bb dnl
1130 00000000 00 000000 0000000000000000ffffffffffffffff
1133 0000 0058 00000000 00000397 dnl
1134 000000000000ffffffffffff 000000000000ffffffffffff dnl
1135 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1136 00000000 00 000000 0000000000000000ffffffffffffffff
1139 0000 0058 00000000 00000397 dnl
1140 000000000000ffffffffffff 000000000000ffffffffffff dnl
1141 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0005 0000 dnl
1142 00000000 00 000000 0000000000000000ffffffffffffffff
1145 0000 0058 00000000 00000357 dnl
1146 000000000000ffffffffffff 000000000000ffffffffffff dnl
1147 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0000 0008 dnl
1148 00000000 00 000000 0000000000000000ffffffffffffffff
1151 0000 0058 00000000 00000397 dnl
1152 000000000000ffffffffffff 000000000000ffffffffffff dnl
1153 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1154 00000000 00 000000 0000000000000000ffffffffffffffff
1157 0000 0058 00000000 00000357 dnl
1158 000000000000ffffffffffff 000000000000ffffffffffff dnl
1159 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 0000 01bb dnl
1160 00000000 00 000000 0000000000000000ffffffffffffffff
1164 0000 0058 00000000 000003d7 dnl
1165 000000000000ffffffffffff 000000000000ffffffffffff dnl
1166 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1167 00000000 00 000000 0000000000000000ffffffffffffffff
1169 dnl SCTP tp_src matching not supported:
1170 # bad ofp11_match: OFPBMC_BAD_FIELD
1171 0000 0058 00000000 00000397 dnl
1172 000000000000ffffffffffff 000000000000ffffffffffff dnl
1173 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1174 00000000 00 000000 0000000000000000ffffffffffffffff
1176 dnl SCTP tp_dst matching not supported:
1177 # bad ofp11_match: OFPBMC_BAD_FIELD
1178 0000 0058 00000000 00000357 dnl
1179 000000000000ffffffffffff 000000000000ffffffffffff dnl
1180 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 01bb dnl
1181 00000000 00 000000 0000000000000000ffffffffffffffff
1183 dnl Ignore tp_src if not TCP or UDP or SCTP:
1188 0000 0058 00000000 00000397 dnl
1189 000000000000ffffffffffff 000000000000ffffffffffff dnl
1190 0000 00 00 0800 00 15 00000000ffffffff 00000000ffffffff 01bb 0000 dnl
1191 00000000 00 000000 0000000000000000ffffffffffffffff
1193 dnl Ignore tp_dst if not TCP or UDP or SCTP:
1198 0000 0058 00000000 00000357 dnl
1199 000000000000ffffffffffff 000000000000ffffffffffff dnl
1200 0000 00 00 0800 00 16 00000000ffffffff 00000000ffffffff 0000 01bb dnl
1201 00000000 00 000000 0000000000000000ffffffffffffffff
1203 dnl mpls_label not yet supported:
1204 # bad ofp11_match: OFPBMC_BAD_TAG
1205 0000 0058 00000000 000002f7 dnl
1206 000000000000ffffffffffff 000000000000ffffffffffff dnl
1207 0000 00 00 8847 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1208 12345678 00 000000 0000000000000000ffffffffffffffff
1210 dnl mpls_tc not yet supported:
1211 # bad ofp11_match: OFPBMC_BAD_TAG
1212 0000 0058 00000000 000001f7 dnl
1213 000000000000ffffffffffff 000000000000ffffffffffff dnl
1214 0000 00 00 8848 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1215 00000000 5a 000000 0000000000000000ffffffffffffffff
1217 dnl mpls_label and mpls_tc must be ignored if dl_type is not MPLS:
1225 0000 0058 00000000 000000f7 dnl
1226 000000000000ffffffffffff 000000000000ffffffffffff dnl
1227 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1228 12345678 5a 000000 0000000000000000ffffffffffffffff
1231 # metadata=0x1234567890abcdef
1232 0000 0058 00000000 000003ff dnl
1233 000000000000ffffffffffff 000000000000ffffffffffff dnl
1234 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1235 00000000 00 000000 1234567890abcdef0000000000000000
1238 # metadata=0x5555555555555555/0x5555555555555555
1239 0000 0058 00000000 000003ff dnl
1240 000000000000ffffffffffff 000000000000ffffffffffff dnl
1241 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1242 00000000 00 000000 5555555555555555aaaaaaaaaaaaaaaa
1245 # metadata=0x1234000090ab0000/0xffff0000ffff0000
1250 0000 0058 00000000 000003ff dnl
1251 000000000000ffffffffffff 000000000000ffffffffffff dnl
1252 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl
1253 00000000 00 000000 1234567890abcdef0000ffff0000ffff
1256 sed '/^[[#&]]/d' < test-data > input.txt
1257 sed -n 's/^# //p; /^$/p' < test-data > expout
1258 sed -n 's/^& //p' < test-data > experr
1259 AT_CAPTURE_FILE([input.txt])
1260 AT_CAPTURE_FILE([expout])
1261 AT_CAPTURE_FILE([experr])
1263 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-match < input.txt],
1264 [0], [expout], [experr])
1267 AT_SETUP([ovs-ofctl parse-nx-match loose])
1268 AT_KEYWORDS([nx-match])
1269 AT_DATA([nx-match.txt], [dnl
1270 NXM_OF_IN_PORT(0001), 01020304(1111/2222), NXM_OF_ETH_TYPE(0800)
1273 AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl
1274 nx_pull_match() returned error OFPBMC_BAD_FIELD
1277 AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl
1278 NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800)
1282 AT_SETUP([ovs-ofctl parse-oxm])
1284 AT_DATA([oxm.txt], [dnl
1288 OXM_OF_IN_PORT(00000000)
1289 OXM_OF_IN_PORT(fffffffe)
1292 OXM_OF_METADATA(5a5a5a5a5a5a5a5a)
1293 OXM_OF_METADATA_W(0000000000000000/00000000ffffffff)
1294 OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000)
1295 OXM_OF_METADATA_W(1234567890abcdef/ffffffffffffffff)
1296 OXM_OF_METADATA_W(1234567890abcdef/0000000000000000)
1299 OXM_OF_ETH_DST(0002e30f80a4)
1300 OXM_OF_ETH_DST_W(010000000000/010000000000)
1301 OXM_OF_ETH_DST_W(000000000000/010000000000)
1302 OXM_OF_ETH_DST_W(ffffffffffff/010000000000)
1303 OXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
1304 OXM_OF_ETH_DST_W(0002e30f80a4/000000000000)
1305 OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
1308 OXM_OF_ETH_SRC(020898456ddb)
1311 OXM_OF_ETH_TYPE(0800)
1312 OXM_OF_ETH_TYPE(0800) OXM_OF_IN_PORT(00000012)
1315 OXM_OF_VLAN_VID(1009) OXM_OF_VLAN_VID(1009) # Duplicate Field
1316 OXM_OF_VLAN_VID(f009) # Bad Value
1317 OXM_OF_VLAN_PCP(00) # Bad Pre-Requisite
1318 OXM_OF_VLAN_VID(0000) # Packets without 802.1Q header or with VID=0
1319 OXM_OF_VLAN_VID(1123) # Packets with VID=123, any PCP
1320 OXM_OF_VLAN_VID(1123) OXM_OF_VLAN_PCP(01) # Packets with VID=123, PCP=1.
1321 OXM_OF_VLAN_VID(0123) # Does not make sense (but supported anyway)
1322 OXM_OF_VLAN_VID_W(0123/0123) # Does not make sense (but supported anyway)
1323 OXM_OF_VLAN_VID_W(1123/0123) # Does not make sense (but supported anyway)
1324 OXM_OF_VLAN_VID_W(0123/1123) # Does not make sense (but supported anyway)
1325 OXM_OF_VLAN_VID(0123) OXM_OF_VLAN_PCP(01) #Bad Pre-Requisite
1326 OXM_OF_VLAN_VID_W(1123/1fff) # Packets with VID=123, any PCP.
1327 OXM_OF_VLAN_VID_W(1123/ffff) # Packets with VID=123, any PCP.
1328 OXM_OF_VLAN_VID_W(1123/0000) # Packets with or without 802.1Q header
1329 OXM_OF_VLAN_VID_W(1123/1f0f), # Packets with # VID=123 (masked)
1330 OXM_OF_VLAN_VID_W(1123/1f0f), OXM_OF_VLAN_PCP(01) # Packets with VID=123 (masked), any PCP.
1331 OXM_OF_VLAN_VID_W(1000/1000) # Packets with any VID, any PCP
1332 OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) # Packets with any VID, PCP=1.
1335 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(03)
1336 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(06)
1340 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01)
1341 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(05)
1345 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC(ac100014)
1346 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFF0000)
1347 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFFFFFF)
1348 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/00000000)
1349 OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_SRC(ac100014)
1350 OXM_OF_IPV4_SRC_W(C0D80000/FFFF0000)
1353 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST(ac100014)
1354 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFF0000)
1355 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFFFFFF)
1356 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/00000000)
1357 OXM_OF_IPV4_DST(ac100014)
1358 OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_DST_W(C0D80000/FFFF0000)
1361 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC(4231)
1362 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/F0F0)
1363 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/FFFF)
1364 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/0000)
1365 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_SRC(4231)
1367 # TCP destination port
1368 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST(4231)
1369 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFF0)
1370 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFFF)
1371 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/0000)
1372 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_DST(4231)
1375 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC(8732)
1376 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/01FF)
1377 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/FFFF)
1378 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/0000)
1379 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_UDP_SRC(7823)
1381 # UDP destination port
1382 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST(1782)
1383 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/F00F)
1384 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/FFFF)
1385 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/0000)
1386 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_UDP_DST(1293)
1389 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_TYPE(12)
1390 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_TYPE(10)
1393 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_CODE(12)
1394 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_CODE(10)
1395 OXM_OF_ETH_TYPE(0800) OXM_OF_ICMPV4_CODE(10)
1396 OXM_OF_ICMPV4_CODE(00)
1399 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001)
1400 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(1111)
1401 OXM_OF_ETH_TYPE(0000) OXM_OF_ARP_OP(0001)
1403 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) OXM_OF_ARP_OP(0001)
1405 # ARP source protocol address
1406 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA(ac100014)
1407 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
1408 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFFFF)
1409 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/00000000)
1410 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SPA(ac100014)
1411 OXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
1413 # ARP destination protocol address
1414 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA(ac100014)
1415 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
1416 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFFFF)
1417 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/00000000)
1418 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_TPA(ac100014)
1419 OXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
1421 # ARP source hardware address
1422 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA(0002e30f80a4)
1423 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SHA(0002e30f80a4)
1424 OXM_OF_ARP_SHA(0002e30f80a4)
1425 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/ffffffffffff)
1426 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/000000000000)
1427 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/00000000000f)
1429 # ARP destination hardware address
1430 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA(0002e30f80a4)
1431 OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_THA(0002e30f80a4)
1432 OXM_OF_ARP_THA(0002e30f80a4)
1433 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/ffffffffffff)
1434 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/000000000000)
1435 OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/00000000000f)
1438 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
1439 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
1440 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1441 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
1442 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000)
1443 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1446 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
1447 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
1448 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1449 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff)
1450 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/00000000000000000000000000000000)
1451 OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1454 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(1000000f)
1455 OXM_OF_IPV6_FLABEL(0000000f)
1456 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(0000000f)
1457 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/0000000f)
1458 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000fffff)
1459 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000ffff0)
1460 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/100fffff)
1461 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/ffffffff)
1462 OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/00000000)
1464 # ND source hardware address
1465 OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4)
1466 OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4)
1467 OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3b) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4)
1468 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_SLL(0002e30f80a4)
1470 # ND destination hardware address
1471 OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4)
1472 OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4)
1473 OXM_OF_ETH_TYPE(86dd) OXM_OF_IP_PROTO(3b) OXM_OF_ICMPV6_TYPE(87) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4)
1474 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(3a) OXM_OF_ICMPV6_TYPE(88) OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005) OXM_OF_IPV6_ND_TLL(0002e30f80a4)
1476 # Invalid field number.
1479 AT_CHECK([ovs-ofctl --strict parse-oxm < oxm.txt], [0], [dnl
1483 OXM_OF_IN_PORT(00000000)
1484 OXM_OF_IN_PORT(fffffffe)
1487 OXM_OF_METADATA(5a5a5a5a5a5a5a5a)
1488 OXM_OF_METADATA_W(0000000000000000/00000000ffffffff)
1489 OXM_OF_METADATA_W(1234000090ab0000/ffff0000ffff0000)
1490 OXM_OF_METADATA(1234567890abcdef)
1494 OXM_OF_ETH_DST(0002e30f80a4)
1495 OXM_OF_ETH_DST_W(010000000000/010000000000)
1496 OXM_OF_ETH_DST_W(000000000000/010000000000)
1497 OXM_OF_ETH_DST_W(010000000000/010000000000)
1498 OXM_OF_ETH_DST(0002e30f80a4)
1500 OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
1503 OXM_OF_ETH_SRC(020898456ddb)
1506 OXM_OF_ETH_TYPE(0800)
1507 OXM_OF_IN_PORT(00000012), OXM_OF_ETH_TYPE(0800)
1510 nx_pull_match() returned error OFPBMC_DUP_FIELD
1511 nx_pull_match() returned error OFPBMC_BAD_VALUE
1512 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1513 OXM_OF_VLAN_VID(0000)
1514 OXM_OF_VLAN_VID(1123)
1515 OXM_OF_VLAN_VID(1123), OXM_OF_VLAN_PCP(01)
1516 OXM_OF_VLAN_VID(0123)
1517 OXM_OF_VLAN_VID_W(0123/0123)
1518 OXM_OF_VLAN_VID_W(0123/0123)
1519 OXM_OF_VLAN_VID_W(0123/1123)
1520 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1521 OXM_OF_VLAN_VID(1123)
1522 OXM_OF_VLAN_VID(1123)
1524 OXM_OF_VLAN_VID_W(1103/1f0f)
1525 OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01)
1526 OXM_OF_VLAN_VID_W(1000/1000)
1527 OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01)
1530 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_ECN(03)
1531 nx_pull_match() returned error OFPBMC_BAD_VALUE
1532 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1535 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01)
1536 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(05)
1537 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1540 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(ac100014)
1541 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC_W(c0a80000/ffff0000)
1542 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(c0a80000)
1543 OXM_OF_ETH_TYPE(0800)
1544 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1545 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1548 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(ac100014)
1549 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST_W(c0a80000/ffff0000)
1550 OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(c0a88012)
1551 OXM_OF_ETH_TYPE(0800)
1552 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1553 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1556 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(4231)
1557 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC_W(5050/f0f0)
1558 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(5050)
1559 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06)
1560 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1562 # TCP destination port
1563 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(4231)
1564 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST_W(fde0/fff0)
1565 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(fde0)
1566 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06)
1567 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1570 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(8732)
1571 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC_W(0132/01ff)
1572 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(0132)
1573 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11)
1574 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1576 # UDP destination port
1577 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(1782)
1578 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST_W(5005/f00f)
1579 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(5005)
1580 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11)
1581 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1584 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_TYPE(12)
1585 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1588 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_CODE(12)
1589 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1590 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1591 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1594 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_OP(0001)
1595 nx_pull_match() returned error OFPBMC_BAD_VALUE
1596 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1597 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1598 nx_pull_match() returned error OFPBMC_DUP_FIELD
1600 # ARP source protocol address
1601 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(ac100014)
1602 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA_W(c0a81200/ffffff00)
1603 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(c0a81234)
1604 OXM_OF_ETH_TYPE(0806)
1605 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1606 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1608 # ARP destination protocol address
1609 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(ac100014)
1610 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA_W(c0a81200/ffffff00)
1611 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(c0a812fe)
1612 OXM_OF_ETH_TYPE(0806)
1613 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1614 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1616 # ARP source hardware address
1617 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4)
1618 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1619 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1620 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4)
1621 OXM_OF_ETH_TYPE(0806)
1622 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA_W(000000000004/00000000000f)
1624 # ARP destination hardware address
1625 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4)
1626 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1627 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1628 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4)
1629 OXM_OF_ETH_TYPE(0806)
1630 OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA_W(000000000004/00000000000f)
1633 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005)
1634 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1635 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1636 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010000000000000000)
1637 OXM_OF_ETH_TYPE(86dd)
1638 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1641 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010002000300040005)
1642 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1643 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
1644 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010000000000000000)
1645 OXM_OF_ETH_TYPE(86dd)
1646 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1649 nx_pull_match() returned error OFPBMC_BAD_VALUE
1650 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1651 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
1652 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(0000000f/0000000f)
1653 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
1654 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(00000000/000ffff0)
1655 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
1656 OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f)
1657 OXM_OF_ETH_TYPE(86dd)
1659 # ND source hardware address
1660 OXM_OF_ETH_TYPE(86dd), OXM_OF_IP_PROTO(3a), OXM_OF_ICMPV6_TYPE(87), OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005), OXM_OF_IPV6_ND_SLL(0002e30f80a4)
1661 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1662 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1663 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1665 # ND destination hardware address
1666 OXM_OF_ETH_TYPE(86dd), OXM_OF_IP_PROTO(3a), OXM_OF_ICMPV6_TYPE(88), OXM_OF_IPV6_ND_TARGET(20010db83c4d00010002000300040005), OXM_OF_IPV6_ND_TLL(0002e30f80a4)
1667 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1668 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1669 nx_pull_match() returned error OFPBMC_BAD_PREREQ
1671 # Invalid field number.
1672 nx_pull_match() returned error OFPBMC_BAD_FIELD
1676 AT_SETUP([ovs-ofctl parse-oxm loose])
1678 AT_DATA([oxm.txt], [dnl
1679 OXM_OF_IN_PORT(00000001), 01020304(1111/2222), OXM_OF_ETH_TYPE(0800)
1682 AT_CHECK([ovs-ofctl --strict parse-oxm < oxm.txt], [0], [dnl
1683 nx_pull_match() returned error OFPBMC_BAD_FIELD
1686 AT_CHECK([ovs-ofctl parse-oxm < oxm.txt], [0], [dnl
1687 OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800)
1691 dnl Check all of the patterns mentioned in the "VLAN Matching" section
1692 dnl in the DESIGN file at top level.
1693 AT_SETUP([ovs-ofctl check-vlan])
1697 AT_CHECK([ovs-ofctl check-vlan 0000 0000], [0], [dnl
1699 NXM: <any> -> 0000/0000
1700 OXM: <any> -> 0000/0000,--
1701 OF1.0: 0000/1,00/1 -> 0000/0000
1702 OF1.1: 0000/1,00/1 -> 0000/0000
1706 AT_CHECK([ovs-ofctl check-vlan 0000 ffff], [0], [dnl
1707 vlan_tci=0x0000 -> 0000/ffff
1708 NXM: NXM_OF_VLAN_TCI(0000) -> 0000/ffff
1709 OXM: OXM_OF_VLAN_VID(0000) -> 0000/1fff,--
1710 OF1.0: ffff/0,00/1 -> 0000/ffff
1711 OF1.1: ffff/0,00/1 -> 0000/ffff
1715 AT_CHECK([ovs-ofctl check-vlan 1abc 1fff], [0], [dnl
1716 dl_vlan=2748 -> 1abc/1fff
1717 NXM: NXM_OF_VLAN_TCI_W(1abc/1fff) -> 1abc/1fff
1718 OXM: OXM_OF_VLAN_VID(1abc) -> 1abc/1fff,--
1719 OF1.0: 0abc/0,00/1 -> 1abc/1fff
1720 OF1.1: 0abc/0,00/1 -> 1abc/1fff
1724 AT_CHECK([ovs-ofctl check-vlan b000 f000], [0], [dnl
1725 dl_vlan_pcp=5 -> b000/f000
1726 NXM: NXM_OF_VLAN_TCI_W(b000/f000) -> b000/f000
1727 OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(05) -> 1000/1000,05
1728 OF1.0: 0000/1,05/0 -> b000/f000
1729 OF1.1: fffe/0,05/0 -> b000/f000
1733 AT_CHECK([ovs-ofctl check-vlan babc ffff], [0], [dnl
1734 dl_vlan=2748,dl_vlan_pcp=5 -> babc/ffff
1735 NXM: NXM_OF_VLAN_TCI(babc) -> babc/ffff
1736 OXM: OXM_OF_VLAN_VID(1abc), OXM_OF_VLAN_PCP(05) -> 1abc/1fff,05
1737 OF1.0: 0abc/0,05/0 -> babc/ffff
1738 OF1.1: 0abc/0,05/0 -> babc/ffff
1742 AT_CHECK([ovs-ofctl check-vlan 0000 0fff], [0], [dnl
1743 vlan_tci=0x0000/0x0fff -> 0000/0fff
1744 NXM: NXM_OF_VLAN_TCI_W(0000/0fff) -> 0000/0fff
1745 OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,--
1746 OF1.0: 0000/0,00/1 -> 1000/1fff
1747 OF1.1: 0000/0,00/1 -> 1000/1fff
1751 AT_CHECK([ovs-ofctl check-vlan 0000 f000], [0], [dnl
1752 vlan_tci=0x0000/0xf000 -> 0000/f000
1753 NXM: NXM_OF_VLAN_TCI_W(0000/f000) -> 0000/f000
1754 OXM: OXM_OF_VLAN_VID_W(0000/1000) -> 0000/1000,--
1755 OF1.0: ffff/0,00/1 -> 0000/ffff
1756 OF1.1: ffff/0,00/1 -> 0000/ffff
1760 AT_CHECK([ovs-ofctl check-vlan 0000 efff], [0], [dnl
1761 vlan_tci=0x0000/0xefff -> 0000/efff
1762 NXM: NXM_OF_VLAN_TCI_W(0000/efff) -> 0000/efff
1763 OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,--
1764 OF1.0: 0000/0,00/0 -> 1000/ffff
1765 OF1.1: 0000/0,00/0 -> 1000/ffff
1769 AT_CHECK([ovs-ofctl check-vlan 1001 1001], [0], [dnl
1770 vlan_tci=0x1001/0x1001 -> 1001/1001
1771 NXM: NXM_OF_VLAN_TCI_W(1001/1001) -> 1001/1001
1772 OXM: OXM_OF_VLAN_VID_W(1001/1001) -> 1001/1001,--
1773 OF1.0: 0001/0,00/1 -> 1001/1fff
1774 OF1.1: 0001/0,00/1 -> 1001/1fff
1778 AT_CHECK([ovs-ofctl check-vlan 3000 3000], [0], [dnl
1779 vlan_tci=0x3000/0x3000 -> 3000/3000
1780 NXM: NXM_OF_VLAN_TCI_W(3000/3000) -> 3000/3000
1781 OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) -> 1000/1000,01
1782 OF1.0: 0000/1,01/0 -> 3000/f000
1783 OF1.1: fffe/0,01/0 -> 3000/f000
1788 dnl Check that "-F openflow10" rejects a flow_mod with unsupported features,
1789 dnl such as tunnels and metadata.
1790 AT_SETUP([ovs-ofctl -F option and NXM features])
1791 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop],
1792 [1], [], [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
1794 AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop],
1795 [1], [], [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
1799 dnl Check that "-F nxm" really forces add-flow to use the NXM flow format.
1800 dnl (If it doesn't, then either the tun_id won't show up at all, or it will
1801 dnl additionally show up as the top 32 bits of the cookie.) This checks
1802 dnl for regression against bug #4566.
1803 AT_SETUP([ovs-ofctl -F option with flow_mods])
1805 AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop])
1806 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl
1808 tun_id=0x12345678 actions=drop
1813 dnl Check that "-F openflow10" is really honored on dump-flows.
1814 dnl (If it isn't, then dump-flows will show the register match.)
1815 AT_SETUP([ovs-ofctl dump-flows honors -F option])
1817 AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop])
1818 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl
1825 dnl Check that "-F openflow10" fails on dump-flows if the requested match
1826 dnl can't be represented in OpenFlow 1.0.
1827 AT_SETUP([ovs-ofctl dump-flows rejects bad -F option])
1829 AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [],
1830 [ovs-ofctl: none of the usable flow formats (NXM) is among the allowed flow formats (OpenFlow10)
1835 dnl Check that add-flow reports non-normalized flows (feature #5029).
1836 AT_SETUP([ovs-ofctl add-flow reports non-normalized flows])
1838 AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5],
1840 ofp_util|INFO|normalization changed ofp_match, details:
1841 ofp_util|INFO| pre: nw_src=1.2.3.4
1842 ofp_util|INFO|post: @&t@
1847 dnl Check that --sort and --rsort works with dump-flows
1848 dnl Default field is 'priority'. Flow entries are displayed based
1849 dnl on field to sort.
1850 AT_SETUP([ovs-ofctl dump-flows with sorting])
1853 AT_DATA([allflows.txt], [[
1854 priority=4,in_port=23213 actions=output:42
1855 priority=5,in_port=1029 actions=output:43
1856 priority=7,in_port=1029 actions=output:43
1857 priority=3,in_port=1028 actions=output:44
1858 priority=1,in_port=1026 actions=output:45
1859 priority=6,in_port=1027 actions=output:64
1860 priority=2,in_port=1025 actions=output:47
1861 priority=8,tcp,tp_src=5 actions=drop
1862 priority=9,tcp,tp_src=6 actions=drop
1865 AT_CHECK([ovs-ofctl add-flows br0 allflows.txt
1867 AT_CHECK([ovs-ofctl --sort dump-flows br0 | ofctl_strip], [0], [dnl
1868 priority=1,in_port=1026 actions=output:45
1869 priority=2,in_port=1025 actions=output:47
1870 priority=3,in_port=1028 actions=output:44
1871 priority=4,in_port=23213 actions=output:42
1872 priority=5,in_port=1029 actions=output:43
1873 priority=6,in_port=1027 actions=output:64
1874 priority=7,in_port=1029 actions=output:43
1875 priority=8,tcp,tp_src=5 actions=drop
1876 priority=9,tcp,tp_src=6 actions=drop
1878 AT_CHECK([ovs-ofctl --rsort dump-flows br0 | ofctl_strip], [0], [dnl
1879 priority=9,tcp,tp_src=6 actions=drop
1880 priority=8,tcp,tp_src=5 actions=drop
1881 priority=7,in_port=1029 actions=output:43
1882 priority=6,in_port=1027 actions=output:64
1883 priority=5,in_port=1029 actions=output:43
1884 priority=4,in_port=23213 actions=output:42
1885 priority=3,in_port=1028 actions=output:44
1886 priority=2,in_port=1025 actions=output:47
1887 priority=1,in_port=1026 actions=output:45
1889 AT_CHECK([ovs-ofctl --sort=in_port dump-flows br0 | ofctl_strip], [0], [dnl
1890 priority=2,in_port=1025 actions=output:47
1891 priority=1,in_port=1026 actions=output:45
1892 priority=6,in_port=1027 actions=output:64
1893 priority=3,in_port=1028 actions=output:44
1894 priority=7,in_port=1029 actions=output:43
1895 priority=5,in_port=1029 actions=output:43
1896 priority=4,in_port=23213 actions=output:42
1897 priority=9,tcp,tp_src=6 actions=drop
1898 priority=8,tcp,tp_src=5 actions=drop
1900 AT_CHECK([ovs-ofctl --rsort=in_port dump-flows br0 | ofctl_strip], [0], [dnl
1901 priority=4,in_port=23213 actions=output:42
1902 priority=7,in_port=1029 actions=output:43
1903 priority=5,in_port=1029 actions=output:43
1904 priority=3,in_port=1028 actions=output:44
1905 priority=6,in_port=1027 actions=output:64
1906 priority=1,in_port=1026 actions=output:45
1907 priority=2,in_port=1025 actions=output:47
1908 priority=9,tcp,tp_src=6 actions=drop
1909 priority=8,tcp,tp_src=5 actions=drop
1911 AT_CHECK([ovs-ofctl --sort=tcp_src dump-flows br0 | ofctl_strip], [0], [dnl
1912 priority=8,tcp,tp_src=5 actions=drop
1913 priority=9,tcp,tp_src=6 actions=drop
1914 priority=7,in_port=1029 actions=output:43
1915 priority=6,in_port=1027 actions=output:64
1916 priority=5,in_port=1029 actions=output:43
1917 priority=4,in_port=23213 actions=output:42
1918 priority=3,in_port=1028 actions=output:44
1919 priority=2,in_port=1025 actions=output:47
1920 priority=1,in_port=1026 actions=output:45
1923 [ovs-ofctl --sort=in_port --sort=tcp_src dump-flows br0 | ofctl_strip], [0],
1924 [ priority=2,in_port=1025 actions=output:47
1925 priority=1,in_port=1026 actions=output:45
1926 priority=6,in_port=1027 actions=output:64
1927 priority=3,in_port=1028 actions=output:44
1928 priority=7,in_port=1029 actions=output:43
1929 priority=5,in_port=1029 actions=output:43
1930 priority=4,in_port=23213 actions=output:42
1931 priority=8,tcp,tp_src=5 actions=drop
1932 priority=9,tcp,tp_src=6 actions=drop
1937 AT_SETUP([ovs-ofctl diff-flows])
1940 # Add tons of flows to br0.
1941 for i in `seq 0 1023`; do echo "dl_vlan=$i,actions=drop"; done > add-flows.txt
1942 AT_CHECK([ovs-ofctl add-flows br0 add-flows.txt])
1944 # Dump them and compare against what we expect by hand, then with diff-flows.
1945 for i in `seq 0 1023`; do echo " dl_vlan=$i actions=drop"; done | sort > expout
1946 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/NXST_FLOW/d' | sort],
1948 AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt])
1950 # Remove even-numbered flows, compare again.
1951 for i in `seq 0 1023 2`; do echo "dl_vlan=$i"; done > del-flows.txt
1952 AT_CHECK([ovs-ofctl del-flows br0 - < del-flows.txt])
1953 for i in `seq 0 1023 2`; do echo "+dl_vlan=$i actions=drop"; done | sort > expout
1954 AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt | sort], [0], [expout])
1955 for i in `seq 0 1023 2`; do echo "-dl_vlan=$i actions=drop"; done | sort > expout
1956 AT_CHECK([ovs-ofctl diff-flows add-flows.txt br0 | sort], [0], [expout])
1961 dnl ofpacts that differ bytewise don't necessarily differ when
1962 dnl converted to another representation, such as OpenFlow 1.0
1963 dnl or to a string. "resubmit(,1)" is an example of an action
1964 dnl of this type: "ofpact_resubmit"s can differ in their "compat"
1965 dnl values even though this doesn't affect the string format.
1967 dnl This test checks that "ovs-ofctl diff-flows" doesn't report
1968 dnl false ofpacts differences.
1969 AT_SETUP([ovs-ofctl diff-flows - suppress false differences])
1971 AT_DATA([flows.txt], [actions=resubmit(,1)
1973 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1974 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
1975 AT_CHECK([ovs-ofctl add-flow br0 idle_timeout=60,dl_vlan=9,actions=output:1])
1976 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt], [2], [dnl
1977 -dl_vlan=9 idle_timeout=60 actions=output:1
1979 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=120,cookie=1234,dl_vlan=9,actions=output:1])
1980 AT_CHECK([ovs-ofctl diff-flows flows.txt br0], [2], [dnl
1981 +dl_vlan=9 cookie=0x4d2 hard_timeout=120 actions=output:1