nicira-ext: Support matching IPv6 traffic.
[sliver-openvswitch.git] / tests / ovs-ofctl.at
1 AT_BANNER([ovs-ofctl])
2
3 AT_SETUP([ovs-ofctl parse-flows])
4 AT_DATA([flows.txt], [[
5 # comment
6 tcp,tp_src=123,actions=flood
7 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
8 arp,nw_src=192.168.0.1 actions=drop_spoofed_arp,NORMAL
9 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
10 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
11 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
12 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
13 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
14 tun_id=0x1234,cookie=0x5678,actions=flood
15 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789
16 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 actions=drop
18 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
19 ]])
20 AT_CHECK([ovs-ofctl parse-flows flows.txt
21 ], [0], [stdout], [stderr])
22 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], 
23 [[OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
24 OFPT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
25 OFPT_FLOW_MOD: ADD arp,nw_src=192.168.0.1 actions=drop_spoofed_arp,NORMAL
26 OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
27 OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
28 OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
29 OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
30 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
31 NXT_TUN_ID_FROM_COOKIE: set=1
32 OFPT_FLOW_MOD: ADD cookie:0x123400005678 actions=FLOOD
33 OFPT_FLOW_MOD: ADD actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789
34 OFPT_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])
35 OFPT_FLOW_MOD: ADD actions=drop
36 NXT_SET_FLOW_FORMAT: format=nxm
37 NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
38 ]])
39 AT_CHECK([sed 's/.*|//' stderr], [0], [dnl
40 normalization changed ofp_match, details:
41  pre: wildcards=  0x3820f8  in_port=65534  dl_src=00:0a:e4:25:6b:b0  dl_dst=00:00:00:00:00:00  dl_vlan=    9  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
42 post: wildcards=  0x3ffff8  in_port=65534  dl_src=00:0a:e4:25:6b:b0  dl_dst=00:00:00:00:00:00  dl_vlan=    9  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
43 normalization changed ofp_match, details:
44  pre: wildcards=  0x3820ff  in_port=65534  dl_src=00:00:00:00:00:00  dl_dst=00:00:00:00:00:00  dl_vlan=    0  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
45 post: wildcards=  0x3fffff  in_port=65534  dl_src=00:00:00:00:00:00  dl_dst=00:00:00:00:00:00  dl_vlan=    0  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
46 normalization changed ofp_match, details:
47  pre: wildcards=  0x3820ff  in_port=65534  dl_src=00:00:00:00:00:00  dl_dst=00:00:00:00:00:00  dl_vlan=    0  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
48 post: wildcards=  0x3fffff  in_port=65534  dl_src=00:00:00:00:00:00  dl_dst=00:00:00:00:00:00  dl_vlan=    0  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
49 normalization changed ofp_match, details:
50  pre: wildcards=  0x3820ff  in_port=65534  dl_src=00:00:00:00:00:00  dl_dst=00:00:00:00:00:00  dl_vlan=    0  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
51 post: wildcards=  0x3fffff  in_port=65534  dl_src=00:00:00:00:00:00  dl_dst=00:00:00:00:00:00  dl_vlan=    0  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
52 normalization changed ofp_match, details:
53  pre: wildcards= 0x23820ff  in_port=65534  dl_src=00:00:00:00:00:00  dl_dst=00:00:00:00:00:00  dl_vlan=    0  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
54 post: wildcards= 0x23fffff  in_port=65534  dl_src=00:00:00:00:00:00  dl_dst=00:00:00:00:00:00  dl_vlan=    0  dl_vlan_pcp=  0  dl_type=     0  nw_tos=   0  nw_proto=   0  nw_src=         0  nw_dst=         0  tp_src=    0  tp_dst=    0
55 ])
56 AT_CLEANUP
57
58 AT_SETUP([ovs-ofctl -F nxm parse-flows])
59 AT_DATA([flows.txt], [
60 # comment
61 tcp,tp_src=123,actions=flood
62 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
63 arp,nw_src=192.168.0.1 actions=drop_spoofed_arp,NORMAL
64 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
65 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
66 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
67 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
68 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop 
69 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop 
70 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
71 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
72 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
73 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
74 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
75 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
76 tun_id=0x1234,cookie=0x5678,actions=flood
77 actions=drop
78 tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop
79 ])
80 AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout])
81 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl
82 NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD
83 NXT_FLOW_MOD: ADD in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop
84 NXT_FLOW_MOD: ADD arp,nw_src=192.168.0.1 actions=drop_spoofed_arp,NORMAL
85 NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop
86 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3
87 NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4
88 NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5
89 NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop
90 NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop
91 NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
92 NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0
93 NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
94 NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
95 NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535
96 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
97 NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD
98 NXT_FLOW_MOD: ADD actions=drop
99 NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop
100 ])
101 AT_CLEANUP
102
103 AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows])
104 AT_DATA([flows.txt], [[
105 # comment
106 tcp,tp_src=123,actions=flood
107 in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop
108 arp,nw_src=192.168.0.1 actions=drop_spoofed_arp,NORMAL
109 arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop
110 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3
111 ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4
112 ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5
113 tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop 
114 udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop 
115 in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop
116 udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0
117 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1
118 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1
119 cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller
120 actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note
121 tun_id=0x1234,cookie=0x5678,actions=flood
122 actions=drop
123 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[]
124 ]])
125 AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout])
126 AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0],
127 [[NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD
128 NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop
129 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(c0a80001) actions=drop_spoofed_arp,NORMAL
130 NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop
131 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3
132 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4
133 NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5
134 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
135 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
136 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
137 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
138 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
139 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
140 NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535
141 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
142 NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD
143 NXT_FLOW_MOD: ADD <any> actions=drop
144 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[]
145 ]])
146 AT_CLEANUP
147
148 AT_SETUP([ovs-ofctl parse-nx-match])
149 AT_KEYWORDS([nx-match])
150 AT_DATA([nx-match.txt], [dnl
151 <any>
152
153 # in port
154 NXM_OF_IN_PORT(0000)
155 NXM_OF_IN_PORT(fffe)
156
157 # eth dst
158 NXM_OF_ETH_DST(0002e30f80a4)
159 NXM_OF_ETH_DST_W(010000000000/010000000000)
160 NXM_OF_ETH_DST_W(000000000000/010000000000)
161 NXM_OF_ETH_DST_W(ffffffffffff/010000000000)
162 NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff)
163 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
164
165 # eth src
166 NXM_OF_ETH_SRC(020898456ddb)
167
168 # eth type
169 NXM_OF_ETH_TYPE(0800)
170 NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012)
171
172 # vlan tci
173 NXM_OF_VLAN_TCI(f009)
174 NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009)
175 NXM_OF_VLAN_TCI(0000)           # Packets without 802.1Q header.
176 NXM_OF_VLAN_TCI(3123)           # Packets with VID=123, PCP=1.
177 NXM_OF_VLAN_TCI(0123)           # Does not make sense (but supported anyway)
178 NXM_OF_VLAN_TCI_W(1123/1fff)    # Packets with VID=123, any PCP.
179 NXM_OF_VLAN_TCI_W(f000/f000)    # Packets with any VID, PCP=7.
180 NXM_OF_VLAN_TCI_W(0000/e000)    # No 802.1Q or with VID=0
181
182 # IP TOS
183 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0)
184 NXM_OF_IP_TOS(f0)
185
186 # IP protocol
187 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01)
188 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05)
189 NXM_OF_IP_PROTO(05)
190
191 # IP source
192 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014)
193 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000)
194 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014)
195 NXM_OF_IP_SRC_W(C0D80000/FFFF0000)
196
197 # IP destination
198 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014)
199 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000)
200 NXM_OF_IP_DST(ac100014)
201 NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000)
202
203 # TCP source port
204 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231)
205 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231)
206
207 # TCP destination port
208 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231)
209 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231)
210
211 # UDP source port
212 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732)
213 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823)
214
215 # UDP destination port
216 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782)
217 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293)
218
219 # ICMP type
220 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12)
221 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10)
222
223 # ICMP code
224 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12)
225 NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10)
226 NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10)
227 NXM_OF_ICMP_CODE(00)
228
229 # ARP opcode
230 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001)
231 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111)
232 NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001)
233 NXM_OF_ARP_OP(0001)
234 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001)
235
236 # ARP source protocol address
237 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014)
238 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00)
239 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014)
240 NXM_OF_ARP_SPA_W(C0D8fedc/FFFF0000)
241
242 # ARP destination protocol address
243 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014)
244 NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00)
245 NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014)
246 NXM_OF_ARP_TPA_W(C0D80000/FFFF0000)
247
248 # ARP source hardware address
249 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4)
250 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4)
251 NXM_NX_ARP_SHA(0002e30f80a4)
252
253 # ARP destination hardware address
254 NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4)
255 NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4)
256 NXM_NX_ARP_THA(0002e30f80a4)
257
258 # IPv6 source
259 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
260 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
261 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
262 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
263
264 # IPv6 destination
265 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
266 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
267 NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
268 NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
269
270 # Tunnel ID.
271 NXM_NX_TUN_ID(00000000abcdef01)
272 NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF)
273
274 # Register 0.
275 NXM_NX_REG0(acebdf56)
276 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
277
278 # Invalid field number.
279 01020304(1111/2222)
280
281 # Unimplemented registers.
282 #
283 # This test assumes that at least two registers, but fewer than 16,
284 # registers are implemented.
285 00010004(12345678)
286 00010108(12345678/12345678)
287 00011e04(12345678)
288 00011f08(12345678/12345678)
289 ])
290 AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl
291 <any>
292
293 # in port
294 NXM_OF_IN_PORT(fffe)
295 NXM_OF_IN_PORT(fffe)
296
297 # eth dst
298 NXM_OF_ETH_DST(0002e30f80a4)
299 NXM_OF_ETH_DST_W(010000000000/010000000000)
300 NXM_OF_ETH_DST_W(000000000000/010000000000)
301 NXM_OF_ETH_DST_W(010000000000/010000000000)
302 NXM_OF_ETH_DST(0002e30f80a4)
303 NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff)
304
305 # eth src
306 NXM_OF_ETH_SRC(020898456ddb)
307
308 # eth type
309 NXM_OF_ETH_TYPE(0800)
310 NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800) 
311
312 # vlan tci
313 NXM_OF_VLAN_TCI(f009)
314 nx_pull_match() returned error 44010105
315 NXM_OF_VLAN_TCI(0000)
316 NXM_OF_VLAN_TCI(3123)
317 NXM_OF_VLAN_TCI(0123)
318 NXM_OF_VLAN_TCI_W(1123/1fff)
319 NXM_OF_VLAN_TCI_W(f000/f000)
320 NXM_OF_VLAN_TCI_W(0000/e000)
321
322 # IP TOS
323 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0)
324 nx_pull_match() returned error 44010104
325
326 # IP protocol
327 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01)
328 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05)
329 nx_pull_match() returned error 44010104
330
331 # IP source
332 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014)
333 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000)
334 nx_pull_match() returned error 44010104
335 nx_pull_match() returned error 44010104
336
337 # IP destination
338 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014)
339 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST_W(c0a80000/ffff0000)
340 nx_pull_match() returned error 44010104
341 nx_pull_match() returned error 44010104
342
343 # TCP source port
344 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231)
345 nx_pull_match() returned error 44010104
346
347 # TCP destination port
348 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231)
349 nx_pull_match() returned error 44010104
350
351 # UDP source port
352 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732)
353 nx_pull_match() returned error 44010104
354
355 # UDP destination port
356 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782)
357 nx_pull_match() returned error 44010104
358
359 # ICMP type
360 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12)
361 nx_pull_match() returned error 44010104
362
363 # ICMP code
364 NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12)
365 nx_pull_match() returned error 44010104
366 nx_pull_match() returned error 44010104
367 nx_pull_match() returned error 44010104
368
369 # ARP opcode
370 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001)
371 nx_pull_match() returned error 44010102
372 nx_pull_match() returned error 44010104
373 nx_pull_match() returned error 44010104
374 nx_pull_match() returned error 44010105
375
376 # ARP source protocol address
377 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014)
378 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA_W(c0a81200/ffffff00)
379 nx_pull_match() returned error 44010104
380 nx_pull_match() returned error 44010104
381
382 # ARP destination protocol address
383 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014)
384 NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA_W(c0a81200/ffffff00)
385 nx_pull_match() returned error 44010104
386 nx_pull_match() returned error 44010104
387
388 # ARP source hardware address
389 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4)
390 nx_pull_match() returned error 44010104
391 nx_pull_match() returned error 44010104
392
393 # ARP destination hardware address
394 NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4)
395 nx_pull_match() returned error 44010104
396 nx_pull_match() returned error 44010104
397
398 # IPv6 source
399 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005)
400 nx_pull_match() returned error 44010104
401 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
402 nx_pull_match() returned error 44010104
403
404 # IPv6 destination
405 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005)
406 nx_pull_match() returned error 44010104
407 NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000)
408 nx_pull_match() returned error 44010104
409
410 # Tunnel ID.
411 NXM_NX_TUN_ID(00000000abcdef01)
412 NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff)
413
414 # Register 0.
415 NXM_NX_REG0(acebdf56)
416 NXM_NX_REG0_W(a0e0d050/f0f0f0f0)
417
418 # Invalid field number.
419 nx_pull_match() returned error 44010101
420
421 # Unimplemented registers.
422 #
423 # This test assumes that at least two registers, but fewer than 16,
424 # registers are implemented.
425 NXM_NX_REG0(12345678)
426 NXM_NX_REG0_W(12345678/12345678)
427 nx_pull_match() returned error 44010101
428 nx_pull_match() returned error 44010101
429 ])
430 AT_CLEANUP