]>
Commit | Line | Data |
---|---|---|
0e581146 BP |
1 | AT_BANNER([ovs-ofctl]) |
2 | ||
340c7bb2 BP |
3 | AT_SETUP([ovs-ofctl parse-flows choice of protocol]) |
4 | # This doesn't cover some potential vlan_tci test cases. | |
5 | for test_case in \ | |
aa233d57 BP |
6 | 'tun_id=0 NXM,OXM' \ |
7 | 'tun_id=0/0x1 NXM,OXM' \ | |
8 | 'tun_src=1.2.3.4 NXM,OXM' \ | |
9 | 'tun_src=1.2.3.4/0.0.0.1 NXM,OXM' \ | |
10 | 'tun_dst=1.2.3.4 NXM,OXM' \ | |
11 | 'tun_dst=1.2.3.4/0.0.0.1 NXM,OXM' \ | |
b666962b JG |
12 | 'tun_flags=1 NXM,OXM' \ |
13 | 'tun_flags=+oam NXM,OXM' \ | |
340c7bb2 BP |
14 | 'tun_tos=0 none' \ |
15 | 'tun_ttl=0 none' \ | |
ac6073e3 MC |
16 | 'tun_gbp_id=0 NXM,OXM' \ |
17 | 'tun_gbp_id=0/0x1 NXM,OXM' \ | |
18 | 'tun_gbp_flags=0 NXM,OXM' \ | |
19 | 'tun_gbp_flags=0/0x1 NXM,OXM' \ | |
9558d2a5 JG |
20 | 'tun_metadata0=0 NXM,OXM' \ |
21 | 'tun_metadata0=0/0x1 NXM,OXM' \ | |
1cb20095 | 22 | 'tun_metadata0 NXM,OXM' \ |
aa233d57 BP |
23 | 'metadata=0 NXM,OXM,OpenFlow11' \ |
24 | 'metadata=1/1 NXM,OXM,OpenFlow11' \ | |
25 | 'in_port=1 any' \ | |
340c7bb2 | 26 | 'skb_priority=0 none' \ |
aa233d57 BP |
27 | 'pkt_mark=1 NXM,OXM' \ |
28 | 'pkt_mark=1/1 NXM,OXM' \ | |
29 | 'reg0=0 NXM,OXM' \ | |
30 | 'reg0=0/1 NXM,OXM' \ | |
31 | 'reg1=1 NXM,OXM' \ | |
32 | 'reg1=1/1 NXM,OXM' \ | |
33 | 'reg2=2 NXM,OXM' \ | |
34 | 'reg2=2/1 NXM,OXM' \ | |
35 | 'reg3=3 NXM,OXM' \ | |
36 | 'reg3=3/1 NXM,OXM' \ | |
37 | 'reg4=4 NXM,OXM' \ | |
38 | 'reg4=4/1 NXM,OXM' \ | |
39 | 'reg5=5 NXM,OXM' \ | |
40 | 'reg5=5/1 NXM,OXM' \ | |
41 | 'reg6=6 NXM,OXM' \ | |
42 | 'reg6=6/1 NXM,OXM' \ | |
43 | 'reg7=7 NXM,OXM' \ | |
44 | 'reg7=7/1 NXM,OXM' \ | |
79fe0f46 BP |
45 | 'xreg0=0 NXM,OXM' \ |
46 | 'xreg0=0/1 NXM,OXM' \ | |
47 | 'xreg1=1 NXM,OXM' \ | |
48 | 'xreg1=1/1 NXM,OXM' \ | |
49 | 'xreg2=2 NXM,OXM' \ | |
50 | 'xreg2=2/3 NXM,OXM' \ | |
51 | 'xreg3=3 NXM,OXM' \ | |
52 | 'xreg3=3/5 NXM,OXM' \ | |
aa233d57 BP |
53 | 'dl_src=00:11:22:33:44:55 any' \ |
54 | 'dl_src=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \ | |
55 | 'dl_dst=00:11:22:33:44:55 any' \ | |
56 | 'dl_dst=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM,OpenFlow11' \ | |
57 | 'dl_type=0x1234 any' \ | |
58 | 'dl_type=0x0800 any' \ | |
59 | 'dl_type=0x0806 any' \ | |
60 | 'dl_type=0x86dd any' \ | |
61 | 'vlan_tci=0 any' \ | |
62 | 'vlan_tci=0x1009 any' \ | |
63 | 'vlan_tci=0x1009/0x1 NXM,OXM' \ | |
64 | 'dl_vlan=9 any' \ | |
65 | 'vlan_vid=11 any' \ | |
66 | 'vlan_vid=11/0x1 NXM,OXM' \ | |
67 | 'dl_vlan_pcp=6 any' \ | |
68 | 'vlan_pcp=5 any' \ | |
69 | 'mpls,mpls_label=5 NXM,OXM,OpenFlow11' \ | |
70 | 'mpls,mpls_tc=1 NXM,OXM,OpenFlow11' \ | |
71 | 'mpls,mpls_bos=0 NXM,OXM' \ | |
72 | 'ip,ip_src=1.2.3.4 any' \ | |
73 | 'ip,ip_src=192.168.0.0/24 any' \ | |
74 | 'ip,ip_src=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \ | |
75 | 'ip,ip_dst=1.2.3.4 any' \ | |
76 | 'ip,ip_dst=192.168.0.0/24 any' \ | |
77 | 'ip,ip_dst=192.0.168.0/255.0.255.0 NXM,OXM,OpenFlow11' \ | |
78 | 'ipv6,ipv6_src=::1 NXM,OXM' \ | |
ccad219b | 79 | 'ipv6,ipv6_src=0:0:0:0:0:0:0:1/::1 NXM,OXM' \ |
aa233d57 | 80 | 'ipv6,ipv6_dst=::1 NXM,OXM' \ |
ccad219b | 81 | 'ipv6,ipv6_dst=0:0:0:0:0:0:0:1/::1 NXM,OXM' \ |
aa233d57 BP |
82 | 'ipv6,ipv6_label=5 NXM,OXM' \ |
83 | 'ipv6,ipv6_label=5/1 NXM,OXM' \ | |
84 | 'ip,nw_proto=1 any' \ | |
85 | 'ipv6,nw_proto=1 NXM,OXM' \ | |
86 | 'ip,nw_tos=0xf0 any' \ | |
87 | 'ipv6,nw_tos=0xf0 NXM,OXM' \ | |
88 | 'ip,ip_dscp=0x3c any' \ | |
89 | 'ipv6,ip_dscp=0x3c NXM,OXM' \ | |
90 | 'ip,nw_ecn=1 NXM,OXM' \ | |
91 | 'ipv6,nw_ecn=1 NXM,OXM' \ | |
92 | 'ip,nw_ttl=5 NXM,OXM' \ | |
93 | 'ipv6,nw_ttl=5 NXM,OXM' \ | |
94 | 'ip,ip_frag=no NXM,OXM' \ | |
95 | 'ipv6,ip_frag=no NXM,OXM' \ | |
96 | 'arp,arp_op=0 any' \ | |
97 | 'arp,arp_spa=1.2.3.4 any' \ | |
98 | 'arp,arp_spa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \ | |
99 | 'arp,arp_tpa=1.2.3.4 any' \ | |
100 | 'arp,arp_tpa=1.2.3.4/0.0.0.1 NXM,OXM,OpenFlow11' \ | |
101 | 'arp,arp_sha=00:11:22:33:44:55 NXM,OXM' \ | |
102 | 'arp,arp_sha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \ | |
103 | 'arp,arp_tha=00:11:22:33:44:55 NXM,OXM' \ | |
104 | 'arp,arp_tha=00:11:22:33:44:55/00:ff:ff:ff:ff:ff NXM,OXM' \ | |
105 | 'tcp,tcp_src=80 any' \ | |
106 | 'tcp,tcp_src=0x1000/0x1000 NXM,OXM' \ | |
107 | 'tcp6,tcp_src=80 NXM,OXM' \ | |
108 | 'tcp6,tcp_src=0x1000/0x1000 NXM,OXM' \ | |
109 | 'tcp,tcp_dst=80 any' \ | |
110 | 'tcp,tcp_dst=0x1000/0x1000 NXM,OXM' \ | |
111 | 'tcp6,tcp_dst=80 NXM,OXM' \ | |
112 | 'tcp6,tcp_dst=0x1000/0x1000 NXM,OXM' \ | |
113 | 'udp,udp_src=80 any' \ | |
114 | 'udp,udp_src=0x1000/0x1000 NXM,OXM' \ | |
115 | 'udp6,udp_src=80 NXM,OXM' \ | |
116 | 'udp6,udp_src=0x1000/0x1000 NXM,OXM' \ | |
117 | 'udp,udp_dst=80 any' \ | |
118 | 'udp,udp_dst=0x1000/0x1000 NXM,OXM' \ | |
119 | 'udp6,udp_dst=80 NXM,OXM' \ | |
120 | 'udp6,udp_dst=0x1000/0x1000 NXM,OXM' \ | |
121 | 'icmp,icmp_type=1 any' \ | |
122 | 'icmp,icmp_code=2 any' \ | |
123 | 'icmp6,icmpv6_type=1 NXM,OXM' \ | |
07659514 JS |
124 | 'icmp6,icmpv6_code=2 NXM,OXM' \ |
125 | 'ct_state=+trk NXM,OXM' \ | |
8e53fe8c | 126 | 'ct_zone=0 NXM,OXM' \ |
9daf2348 JS |
127 | 'ct_mark=0 NXM,OXM' \ |
128 | 'ct_label=0 NXM,OXM' \ | |
129 | 'ct_label=0x1234567890ABCDEF12345678 NXM,OXM' | |
340c7bb2 BP |
130 | do |
131 | set $test_case | |
132 | echo | |
133 | echo "### test case: '$1' should have usable protocols '$2'" | |
134 | if test "$2" = none; then | |
135 | AT_CHECK([ovs-ofctl parse-flow "$1,actions=drop"], [1], | |
a805558c | 136 | [dnl |
340c7bb2 | 137 | ], |
a805558c | 138 | [ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT) |
340c7bb2 BP |
139 | ]) |
140 | else | |
141 | AT_CHECK_UNQUOTED([ovs-ofctl parse-flow "$1,actions=drop" | sed 1q], [0], | |
142 | [usable protocols: $2 | |
143 | ]) | |
144 | fi | |
145 | done | |
146 | AT_CLEANUP | |
147 | ||
27527aa0 BP |
148 | AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.0)]) |
149 | AT_DATA([flows.txt], [[ | |
150 | # comment | |
19ba1422 | 151 | tcp,tp_src=123,actions=flood |
27527aa0 BP |
152 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop |
153 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 | |
154 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
155 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
156 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller | |
157 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
b019d34d | 158 | ip,actions=set_field:10.4.3.77->ip_src |
db0b6c29 JR |
159 | sctp actions=drop |
160 | sctp actions=drop | |
e3432ee9 | 161 | in_port=0 actions=resubmit:0 |
29089a54 | 162 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
9ac0aada JR |
163 | actions=ct(nat) |
164 | actions=ct(commit,nat(dst)) | |
165 | actions=ct(commit,nat(src)) | |
166 | actions=ct(commit,nat(src=10.0.0.240,random)) | |
167 | actions=ct(commit,nat(src=10.0.0.240:32768-65535,random)) | |
168 | actions=ct(commit,nat(dst=10.0.0.128-10.0.0.254,hash)) | |
169 | actions=ct(commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent)) | |
170 | actions=ct(commit,nat(src=fe80::20c:29ff:fe88:a18b,random)) | |
171 | actions=ct(commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random)) | |
172 | actions=ct(commit,nat(src=[fe80::20c:29ff:fe88:1]-[fe80::20c:29ff:fe88:a18b]:255-4096,random)) | |
173 | actions=ct(commit,nat(src=10.1.1.240-10.1.1.255),alg=ftp) | |
27527aa0 BP |
174 | ]]) |
175 | ||
176 | AT_CHECK([ovs-ofctl parse-flows flows.txt | |
177 | ], [0], [stdout]) | |
178 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], | |
9ac0aada | 179 | [[usable protocols: OpenFlow10,NXM |
27527aa0 | 180 | chosen protocol: OpenFlow10-table_id |
19ba1422 | 181 | OFPT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD |
576ec803 | 182 | OFPT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop |
27527aa0 BP |
183 | OFPT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 |
184 | OFPT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
185 | OFPT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
186 | OFPT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 | |
187 | 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 | |
a6fd70bb | 188 | OFPT_FLOW_MOD: ADD ip actions=mod_nw_src:10.4.3.77 |
db0b6c29 JR |
189 | OFPT_FLOW_MOD: ADD sctp actions=drop |
190 | OFPT_FLOW_MOD: ADD sctp actions=drop | |
e3432ee9 | 191 | OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0 |
29089a54 | 192 | OFPT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
9ac0aada JR |
193 | OFPT_FLOW_MOD: ADD actions=ct(nat) |
194 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(dst)) | |
195 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(src)) | |
196 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(src=10.0.0.240,random)) | |
197 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(src=10.0.0.240:32768-65535,random)) | |
198 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(dst=10.0.0.128-10.0.0.254,hash)) | |
199 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent)) | |
200 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(src=fe80::20c:29ff:fe88:a18b,random)) | |
201 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random)) | |
202 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(src=[fe80::20c:29ff:fe88:1]-[fe80::20c:29ff:fe88:a18b]:255-4096,random)) | |
203 | OFPT_FLOW_MOD: ADD actions=ct(commit,nat(src=10.1.1.240-10.1.1.255),alg=ftp) | |
f0992bed SH |
204 | ]]) |
205 | AT_CLEANUP | |
206 | ||
ff14eb7a JR |
207 | AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.1)]) |
208 | AT_DATA([flows.txt], [[ | |
209 | # comment | |
19ba1422 | 210 | tcp,tp_src=123,actions=flood |
ff14eb7a JR |
211 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop |
212 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 | |
213 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
214 | udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1 | |
215 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller | |
216 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
0c20dbe4 | 217 | ip,actions=mod_nw_ttl:1,set_field:10.4.3.77->ip_src |
ff14eb7a JR |
218 | sctp actions=drop |
219 | sctp actions=drop | |
220 | in_port=0 actions=resubmit:0 | |
221 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) | |
222 | ]]) | |
223 | ||
224 | AT_CHECK([ovs-ofctl --protocols OpenFlow11 parse-flows flows.txt | |
225 | ], [0], [stdout]) | |
226 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], | |
aa233d57 | 227 | [[usable protocols: any |
ff14eb7a | 228 | chosen protocol: OpenFlow11 |
19ba1422 | 229 | OFPT_FLOW_MOD (OF1.1): ADD tcp,tp_src=123 actions=FLOOD |
0e197060 BP |
230 | OFPT_FLOW_MOD (OF1.1): ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop |
231 | OFPT_FLOW_MOD (OF1.1): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0 | |
232 | OFPT_FLOW_MOD (OF1.1): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
233 | OFPT_FLOW_MOD (OF1.1): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1 | |
234 | OFPT_FLOW_MOD (OF1.1): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 | |
235 | OFPT_FLOW_MOD (OF1.1): 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 | |
236 | OFPT_FLOW_MOD (OF1.1): ADD ip actions=mod_nw_ttl:1,mod_nw_src:10.4.3.77 | |
237 | OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop | |
238 | OFPT_FLOW_MOD (OF1.1): ADD sctp actions=drop | |
239 | OFPT_FLOW_MOD (OF1.1): ADD in_port=0 actions=resubmit:0 | |
240 | OFPT_FLOW_MOD (OF1.1): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) | |
ff14eb7a JR |
241 | ]]) |
242 | AT_CLEANUP | |
243 | ||
f0992bed SH |
244 | AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.2)]) |
245 | AT_DATA([flows.txt], [[ | |
246 | # comment | |
247 | tcp,tp_src=123,actions=flood | |
1e7db674 | 248 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=mod_vlan_vid:7,mod_vlan_pcp:2 |
f0992bed SH |
249 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 |
250 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
251 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
252 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller | |
253 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
b019d34d | 254 | ipv6,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src |
0d56eaf2 JS |
255 | sctp actions=set_field:3334->sctp_src |
256 | sctp actions=set_field:4445->sctp_dst | |
1e7db674 JR |
257 | tcp actions=mod_tp_dst:1234 |
258 | udp actions=mod_tp_src:1111 | |
259 | ip actions=mod_nw_src:10.1.1.2,mod_nw_dst:192.168.10.1,mod_nw_ttl:1,mod_nw_tos:16,mod_nw_ecn:2 | |
260 | in_port=0 actions=mod_dl_src:11:22:33:44:55:66,mod_dl_dst:10:20:30:40:50:60 | |
f0992bed | 261 | in_port=0 actions=resubmit:0 |
29089a54 | 262 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
f0992bed SH |
263 | ]]) |
264 | ||
265 | AT_CHECK([ovs-ofctl --protocols OpenFlow12 parse-flows flows.txt | |
266 | ], [0], [stdout]) | |
267 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], | |
aa233d57 | 268 | [[usable protocols: NXM,OXM |
f0992bed | 269 | chosen protocol: OXM-OpenFlow12 |
0e197060 BP |
270 | OFPT_FLOW_MOD (OF1.2): ADD tcp,tp_src=123 actions=FLOOD |
271 | OFPT_FLOW_MOD (OF1.2): ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=set_field:4103->vlan_vid,set_field:2->vlan_pcp | |
272 | OFPT_FLOW_MOD (OF1.2): ADD udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0 | |
273 | OFPT_FLOW_MOD (OF1.2): ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
274 | OFPT_FLOW_MOD (OF1.2): ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
275 | OFPT_FLOW_MOD (OF1.2): ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 | |
276 | OFPT_FLOW_MOD (OF1.2): 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 | |
277 | OFPT_FLOW_MOD (OF1.2): ADD ipv6 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src | |
278 | OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:3334->sctp_src | |
279 | OFPT_FLOW_MOD (OF1.2): ADD sctp actions=set_field:4445->sctp_dst | |
280 | OFPT_FLOW_MOD (OF1.2): ADD tcp actions=set_field:1234->tcp_dst | |
281 | OFPT_FLOW_MOD (OF1.2): ADD udp actions=set_field:1111->udp_src | |
282 | OFPT_FLOW_MOD (OF1.2): ADD ip actions=set_field:10.1.1.2->ip_src,set_field:192.168.10.1->ip_dst,mod_nw_ttl:1,set_field:4->ip_dscp,set_field:2->nw_ecn | |
283 | OFPT_FLOW_MOD (OF1.2): ADD in_port=0 actions=set_field:11:22:33:44:55:66->eth_src,set_field:10:20:30:40:50:60->eth_dst | |
284 | OFPT_FLOW_MOD (OF1.2): ADD in_port=0 actions=resubmit:0 | |
285 | OFPT_FLOW_MOD (OF1.2): ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) | |
27527aa0 BP |
286 | ]]) |
287 | AT_CLEANUP | |
288 | ||
3634dff8 BP |
289 | AT_SETUP([ovs-ofctl parse-flow with invalid mask]) |
290 | for test_case in \ | |
291 | 'tun_tos 1/1' \ | |
292 | 'tun_ttl 1/1' \ | |
293 | 'skb_priority 1/1' \ | |
294 | 'eth_type 0x1234/0x1' \ | |
295 | 'dl_vlan 9/0x1' \ | |
296 | 'dl_vlan_pcp 6/0x1' \ | |
297 | 'vlan_pcp 5/0x1' \ | |
298 | 'mpls mpls_label 5/0x1' \ | |
299 | 'mpls mpls_tc 1/0x1' \ | |
300 | 'mpls mpls_bos 1/0x1' \ | |
301 | 'ip nw_proto 1/1' \ | |
302 | 'ipv6 nw_proto 1/1' \ | |
303 | 'ip nw_tos 0xf0/0xf0' \ | |
304 | 'ipv6 nw_tos 0xf0/0xf0' \ | |
44a7e26d JR |
305 | 'ip ip_dscp 0x3c/0xf0' \ |
306 | 'ipv6 ip_dscp 0x3c/0xf0' \ | |
3634dff8 BP |
307 | 'ip nw_ecn 1/1' \ |
308 | 'ipv6 nw_ecn 1/1' \ | |
309 | 'ip nw_ttl 5/1' \ | |
310 | 'ipv6 nw_ttl 5/1' \ | |
311 | 'arp arp_op 0/1' \ | |
312 | 'icmp icmp_type 1/1' \ | |
313 | 'icmp icmp_code 2/1' \ | |
314 | 'icmp6 icmpv6_code 2/1' | |
315 | do | |
316 | set $test_case | |
317 | if test $# = 3; then | |
318 | prereq=$1, field=$2 value=$3 | |
319 | else | |
320 | prereq= field=$1 value=$2 | |
321 | fi | |
322 | AT_CHECK_UNQUOTED([ovs-ofctl parse-flow "$prereq$field=$value,actions=drop"], [1], [], | |
323 | [ovs-ofctl: $value: invalid mask for field $field | |
324 | ]) | |
325 | done | |
326 | AT_CLEANUP | |
327 | ||
8621547c JR |
328 | AT_SETUP([ovs-ofctl action inconsistency (OpenFlow 1.1)]) |
329 | AT_CHECK([ovs-ofctl --protocols OpenFlow11 add-flow br0 'ip actions=mod_tp_dst:1234' | |
ba2fe8e9 | 330 | ], [1], [stdout], [ovs-ofctl: none of the usable flow formats (OpenFlow10,NXM) is among the allowed flow formats (OpenFlow11) |
8621547c JR |
331 | ]) |
332 | AT_CLEANUP | |
333 | ||
ac923e91 | 334 | AT_SETUP([ovs-ofctl parse-flows (skb_priority)]) |
1b567fb9 | 335 | AT_DATA([flows.txt], [[ |
ac923e91 | 336 | skb_priority=0x12341234,tcp,tp_src=123,actions=flood |
1b567fb9 AA |
337 | ]]) |
338 | ||
339 | AT_CHECK([ovs-ofctl parse-flows flows.txt | |
a805558c | 340 | ], [1], [dnl |
1b567fb9 AA |
341 | ], [stderr]) |
342 | ||
343 | AT_CLEANUP | |
344 | ||
345 | ||
27527aa0 | 346 | AT_SETUP([ovs-ofctl parse-flows (NXM)]) |
53ddd40a | 347 | AT_DATA([flows.txt], [[ |
0e581146 BP |
348 | # comment |
349 | tcp,tp_src=123,actions=flood | |
350 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop | |
ac923e91 | 351 | pkt_mark=0xbb,actions=set_field:0xaa->pkt_mark |
0e581146 | 352 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 |
eedc0097 JP |
353 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 |
354 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
0e581146 | 355 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller |
96fc46e8 | 356 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note |
73f33563 | 357 | tcp,tp_src=0x1230/0xfff0,tun_id=0x1234,cookie=0x5678,actions=flood |
b9298d3f | 358 | actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel:0x123456789 |
53ddd40a | 359 | 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]) |
6c1491fb | 360 | table=1,actions=drop |
8368c090 | 361 | tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop |
7525e578 | 362 | metadata=0x1234ffff5678ffff/0xffff0000ffff0000,actions=drop |
daff3353 EJ |
363 | actions=bundle(eth_src,50,active_backup,ofport,slaves:1) |
364 | actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3) | |
365 | actions=bundle(symmetric_l4,60,hrw,ofport,slaves:) | |
366 | actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2 | |
a368bb53 EJ |
367 | actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1) |
368 | actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) | |
db968317 | 369 | actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:[2,3]) |
a368bb53 EJ |
370 | actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:) |
371 | actions=output:1,bundle_load(eth_src,0,hrw,ofport,NXM_NX_REG0[16..31],slaves:1),output:2 | |
29901626 | 372 | actions=resubmit:1,resubmit(2),resubmit(,3),resubmit(2,3) |
a993007b BP |
373 | send_flow_rem,actions=output:1,output:NXM_NX_REG0[],output:2,output:NXM_NX_REG1[16..31],output:3 |
374 | check_overlap,actions=output:1,exit,output:2 | |
8621547c | 375 | tcp,actions=fin_timeout(idle_timeout=5,hard_timeout=15) |
a7349929 | 376 | actions=controller(max_len=123,reason=invalid_ttl,id=555) |
29089a54 | 377 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
07659514 | 378 | ip,actions=ct(commit,zone=5) |
8e53fe8c | 379 | ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[]))) |
9daf2348 JS |
380 | ip,actions=ct(commit,exec(load(0x1->NXM_NX_CT_LABEL[]))) |
381 | ip,actions=ct(commit,exec(load(0x1234567890ABCDEF->NXM_NX_CT_LABEL[32..95]))) | |
382 | ip,actions=ct(commit,exec(set_field(0x1->ct_label))) | |
383 | ip,ct_state=+trk,ct_label=0x1234567890abcdef12345678,actions=ct(commit) | |
53ddd40a | 384 | ]]) |
29901626 | 385 | |
53ddd40a | 386 | AT_CHECK([ovs-ofctl parse-flows flows.txt |
f1f41fb6 | 387 | ], [0], [stdout]) |
27527aa0 | 388 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], |
aa233d57 | 389 | [[usable protocols: OXM,NXM+table_id |
27527aa0 BP |
390 | chosen protocol: NXM+table_id |
391 | NXT_FLOW_MOD: ADD table:255 tcp,tp_src=123 actions=FLOOD | |
576ec803 | 392 | NXT_FLOW_MOD: ADD table:255 in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop |
ac923e91 | 393 | NXT_FLOW_MOD: ADD table:255 pkt_mark=0xbb actions=load:0xaa->NXM_NX_PKT_MARK[] |
27527aa0 BP |
394 | NXT_FLOW_MOD: ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 |
395 | NXT_FLOW_MOD: ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
396 | NXT_FLOW_MOD: ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
397 | NXT_FLOW_MOD: ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 | |
398 | 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 | |
399 | NXT_FLOW_MOD: ADD table:255 tcp,tun_id=0x1234,tp_src=0x1230/0xfff0 cookie:0x5678 actions=FLOOD | |
400 | NXT_FLOW_MOD: ADD table:255 actions=set_tunnel:0x1234,set_tunnel64:0x9876,set_tunnel64:0x123456789 | |
401 | 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]) | |
e896c2d4 BP |
402 | NXT_FLOW_MOD: ADD table:1 actions=drop |
403 | NXT_FLOW_MOD: ADD table:255 tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop | |
7525e578 | 404 | NXT_FLOW_MOD: ADD table:255 metadata=0x1234000056780000/0xffff0000ffff0000 actions=drop |
daff3353 EJ |
405 | NXT_FLOW_MOD: ADD table:255 actions=bundle(eth_src,50,active_backup,ofport,slaves:1) |
406 | NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:2,3) | |
407 | NXT_FLOW_MOD: ADD table:255 actions=bundle(symmetric_l4,60,hrw,ofport,slaves:) | |
408 | NXT_FLOW_MOD: ADD table:255 actions=output:1,bundle(eth_src,0,hrw,ofport,slaves:1),output:2 | |
a368bb53 EJ |
409 | NXT_FLOW_MOD: ADD table:255 actions=bundle_load(eth_src,50,active_backup,ofport,NXM_NX_REG0[],slaves:1) |
410 | NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) | |
db968317 | 411 | NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..15],slaves:2,3) |
a368bb53 EJ |
412 | NXT_FLOW_MOD: ADD table:255 actions=bundle_load(symmetric_l4,60,hrw,ofport,NXM_NX_REG0[0..30],slaves:) |
413 | 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 | |
29901626 | 414 | NXT_FLOW_MOD: ADD table:255 actions=resubmit:1,resubmit:2,resubmit(,3),resubmit(2,3) |
a993007b BP |
415 | 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 |
416 | NXT_FLOW_MOD: ADD table:255 check_overlap actions=output:1,exit,output:2 | |
8621547c | 417 | NXT_FLOW_MOD: ADD table:255 tcp actions=fin_timeout(idle_timeout=5,hard_timeout=15) |
a7349929 | 418 | NXT_FLOW_MOD: ADD table:255 actions=controller(reason=invalid_ttl,max_len=123,id=555) |
29089a54 | 419 | NXT_FLOW_MOD: ADD table:255 actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
07659514 | 420 | NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,zone=5) |
8e53fe8c | 421 | NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[])) |
9daf2348 JS |
422 | NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127])) |
423 | NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1234567890abcdef->NXM_NX_CT_LABEL[32..95])) | |
424 | NXT_FLOW_MOD: ADD table:255 ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127])) | |
425 | NXT_FLOW_MOD: ADD table:255 ct_state=+trk,ct_label=0x1234567890abcdef12345678,ip actions=ct(commit) | |
53ddd40a | 426 | ]]) |
88ca35ee BP |
427 | AT_CLEANUP |
428 | ||
429 | AT_SETUP([ovs-ofctl -F nxm parse-flows]) | |
430 | AT_DATA([flows.txt], [ | |
431 | # comment | |
432 | tcp,tp_src=123,actions=flood | |
433 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop | |
bad68a99 | 434 | arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop |
fa8223b7 | 435 | ipv6,ipv6_label=0x12345 actions=2 |
d31f1109 JP |
436 | ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3 |
437 | ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4 | |
438 | ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5 | |
439 | tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop | |
440 | udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop | |
441 | in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop | |
88ca35ee BP |
442 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 |
443 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
444 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
685a51a5 | 445 | icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop |
47284b1f | 446 | icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4F:0571/112 actions=drop |
685a51a5 JP |
447 | icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop |
448 | icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop | |
47284b1f | 449 | icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE00:0000/96,nd_tll=00:0A:E4:25:6B:B1 actions=drop |
88ca35ee BP |
450 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller |
451 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
452 | tun_id=0x1234,cookie=0x5678,actions=flood | |
453 | actions=drop | |
8368c090 | 454 | tun_id=0x1234000056780000/0xffff0000ffff0000,actions=drop |
cb8ca532 BP |
455 | dl_dst=01:00:00:00:00:00/01:00:00:00:00:00,actions=drop |
456 | dl_dst=00:00:00:00:00:00/01:00:00:00:00:00,actions=drop | |
457 | dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff,actions=drop | |
458 | dl_dst=aa:bb:cc:dd:ee:ff/00:00:00:00:00:00,actions=drop | |
29089a54 | 459 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
07659514 | 460 | ip,actions=ct(commit,zone=5) |
8e53fe8c | 461 | ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[[]]))) |
9daf2348 | 462 | ip,actions=ct(commit,exec(load(0x1->NXM_NX_CT_LABEL[[]]))) |
88ca35ee BP |
463 | ]) |
464 | AT_CHECK([ovs-ofctl -F nxm parse-flows flows.txt], [0], [stdout]) | |
465 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], [dnl | |
aa233d57 | 466 | usable protocols: NXM,OXM |
27527aa0 | 467 | chosen protocol: NXM-table_id |
88ca35ee | 468 | NXT_FLOW_MOD: ADD tcp,tp_src=123 actions=FLOOD |
576ec803 | 469 | NXT_FLOW_MOD: ADD in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop |
bad68a99 | 470 | NXT_FLOW_MOD: ADD arp,dl_src=00:0a:e4:25:6b:b0,arp_sha=00:0a:e4:25:6b:b0 actions=drop |
fa8223b7 | 471 | NXT_FLOW_MOD: ADD ipv6,ipv6_label=0x12345 actions=output:2 |
d31f1109 JP |
472 | NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output:3 |
473 | NXT_FLOW_MOD: ADD ipv6,ipv6_src=2001:db8:3c4d:1::/64 actions=output:4 | |
474 | NXT_FLOW_MOD: ADD ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:4/127 actions=output:5 | |
475 | NXT_FLOW_MOD: ADD tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop | |
476 | NXT_FLOW_MOD: ADD udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop | |
477 | NXT_FLOW_MOD: ADD icmp6,in_port=3,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop | |
88ca35ee BP |
478 | NXT_FLOW_MOD: ADD udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 |
479 | NXT_FLOW_MOD: ADD tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
480 | NXT_FLOW_MOD: ADD udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
685a51a5 | 481 | NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4e:571 actions=drop |
47284b1f | 482 | NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_target=fec0:0:1234:f045:8fff:1111:fe4f:0/112 actions=drop |
685a51a5 JP |
483 | NXT_FLOW_MOD: ADD icmp6,icmp_type=135,nd_sll=00:0a:e4:25:6b:b0 actions=drop |
484 | 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 | |
47284b1f | 485 | 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 |
88ca35ee BP |
486 | NXT_FLOW_MOD: ADD priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 |
487 | 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 | |
488 | NXT_FLOW_MOD: ADD tun_id=0x1234 cookie:0x5678 actions=FLOOD | |
489 | NXT_FLOW_MOD: ADD actions=drop | |
8368c090 | 490 | NXT_FLOW_MOD: ADD tun_id=0x1234000056780000/0xffff0000ffff0000 actions=drop |
cb8ca532 BP |
491 | NXT_FLOW_MOD: ADD dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=drop |
492 | NXT_FLOW_MOD: ADD dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=drop | |
493 | NXT_FLOW_MOD: ADD dl_dst=aa:bb:cc:dd:ee:ff/fe:ff:ff:ff:ff:ff actions=drop | |
494 | NXT_FLOW_MOD: ADD actions=drop | |
29089a54 | 495 | NXT_FLOW_MOD: ADD actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
07659514 | 496 | NXT_FLOW_MOD: ADD ip actions=ct(commit,zone=5) |
8e53fe8c | 497 | NXT_FLOW_MOD: ADD ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[[]])) |
9daf2348 | 498 | NXT_FLOW_MOD: ADD ip actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[[0..63]],load:0->NXM_NX_CT_LABEL[[64..127]])) |
0e581146 BP |
499 | ]) |
500 | AT_CLEANUP | |
09246b99 | 501 | |
4f564f8d | 502 | AT_SETUP([ovs-ofctl -F nxm -mmm parse-flows]) |
f393f81e | 503 | AT_DATA([flows.txt], [[ |
4f564f8d BP |
504 | # comment |
505 | tcp,tp_src=123,actions=flood | |
506 | in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop | |
bad68a99 | 507 | arp,dl_src=00:0A:E4:25:6B:B0,arp_sha=00:0A:E4:25:6B:B0 actions=drop |
fa8223b7 | 508 | ipv6,ipv6_label=0x12345 actions=2 |
d31f1109 JP |
509 | ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=3 |
510 | ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5/64 actions=4 | |
511 | ipv6,ipv6_dst=2001:db8:3c4d:1:2:3:4:5/127 actions=5 | |
0d56eaf2 JS |
512 | tcp6,ipv6_src=2001:db8:3c4d:1::1,tp_dst=80 actions=drop |
513 | udp6,ipv6_src=2001:db8:3c4d:1::3,tp_dst=53 actions=drop | |
514 | sctp6,ipv6_src=2001:db8:3c4d:1::5,tp_dst=309 actions=drop | |
d31f1109 | 515 | in_port=3 icmp6,ipv6_src=2001:db8:3c4d:1::1,icmp_type=134 actions=drop |
4f564f8d BP |
516 | udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 |
517 | tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 | |
518 | udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 | |
0d56eaf2 | 519 | sctp,nw_src=192.168.0.3,tp_dst=309 actions=pop_queue,output:1 |
685a51a5 JP |
520 | icmp6,icmp_type=135,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571 actions=drop |
521 | icmp6,icmp_type=135,nd_sll=00:0A:E4:25:6B:B0 actions=drop | |
522 | icmp6,icmp_type=136,nd_target=FEC0::1234:F045:8FFF:1111:FE4E:0571,nd_tll=00:0A:E4:25:6B:B1 actions=drop | |
4f564f8d BP |
523 | cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller |
524 | actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note | |
525 | tun_id=0x1234,cookie=0x5678,actions=flood | |
526 | actions=drop | |
f393f81e | 527 | 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[] |
b5e5143b | 528 | actions=move:OXM_OF_ETH_DST[]->OXM_OF_ETH_SRC[] |
bd85dac1 | 529 | actions=push:NXM_NX_REG0[0..31],pop:NXM_NX_REG0[] |
33d8c6b4 | 530 | vlan_tci=0x1123/0x1fff,actions=drop |
29089a54 | 531 | actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
07659514 | 532 | ip,actions=ct(commit,zone=5) |
8e53fe8c | 533 | ip,actions=ct(commit,exec(load(1->NXM_NX_CT_MARK[]))) |
9daf2348 JS |
534 | ip,actions=ct(commit,exec(load(1->NXM_NX_CT_LABEL[]))) |
535 | ip,actions=ct(commit,exec(set_field(1->ct_label))) | |
f393f81e | 536 | ]]) |
ad7c0437 | 537 | AT_CHECK([ovs-ofctl -F nxm -mmm parse-flows flows.txt], [0], [stdout], [stderr]) |
f393f81e | 538 | AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], |
aa233d57 | 539 | [[usable protocols: NXM,OXM |
27527aa0 BP |
540 | chosen protocol: NXM-table_id |
541 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(007b) actions=FLOOD | |
4f564f8d | 542 | NXT_FLOW_MOD: ADD NXM_OF_IN_PORT(fffe), NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_VLAN_TCI_W(1009/1fff) actions=drop |
bad68a99 | 543 | NXT_FLOW_MOD: ADD NXM_OF_ETH_SRC(000ae4256bb0), NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(000ae4256bb0) actions=drop |
fa8223b7 | 544 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(00012345) actions=output:2 |
d31f1109 JP |
545 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) actions=output:3 |
546 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) actions=output:4 | |
547 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST_W(20010db83c4d00010002000300040004/fffffffffffffffffffffffffffffffe) actions=output:5 | |
548 | 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 | |
549 | 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 | |
0d56eaf2 | 550 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000005), NXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(0135) actions=drop |
d31f1109 | 551 | 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 |
4f564f8d BP |
552 | 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 |
553 | 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 | |
554 | 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 | |
0d56eaf2 | 555 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80003), NXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(0135) actions=pop_queue,output:1 |
685a51a5 JP |
556 | 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 |
557 | 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 | |
558 | 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 | |
4f564f8d BP |
559 | NXT_FLOW_MOD: ADD <any> cookie:0x123456789abcdef hard:10 pri:60000 actions=CONTROLLER:65535 |
560 | 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 | |
561 | NXT_FLOW_MOD: ADD NXM_NX_TUN_ID(0000000000001234) cookie:0x5678 actions=FLOOD | |
562 | NXT_FLOW_MOD: ADD <any> actions=drop | |
d90611f1 | 563 | 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[] |
b5e5143b | 564 | NXT_FLOW_MOD: ADD <any> actions=move:NXM_OF_ETH_DST[]->NXM_OF_ETH_SRC[] |
bd85dac1 | 565 | NXT_FLOW_MOD: ADD <any> actions=push:NXM_NX_REG0[],pop:NXM_NX_REG0[] |
33d8c6b4 | 566 | NXT_FLOW_MOD: ADD NXM_OF_VLAN_TCI_W(1123/1fff) actions=drop |
29089a54 | 567 | NXT_FLOW_MOD: ADD <any> actions=sample(probability=12345,collector_set_id=23456,obs_domain_id=34567,obs_point_id=45678) |
07659514 | 568 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,zone=5) |
8e53fe8c | 569 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,exec(load:0x1->NXM_NX_CT_MARK[])) |
9daf2348 JS |
570 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127])) |
571 | NXT_FLOW_MOD: ADD NXM_OF_ETH_TYPE(0800) actions=ct(commit,exec(load:0x1->NXM_NX_CT_LABEL[0..63],load:0->NXM_NX_CT_LABEL[64..127])) | |
f393f81e | 572 | ]]) |
4f564f8d BP |
573 | AT_CLEANUP |
574 | ||
09246b99 BP |
575 | AT_SETUP([ovs-ofctl parse-nx-match]) |
576 | AT_KEYWORDS([nx-match]) | |
577 | AT_DATA([nx-match.txt], [dnl | |
578 | <any> | |
579 | ||
580 | # in port | |
581 | NXM_OF_IN_PORT(0000) | |
582 | NXM_OF_IN_PORT(fffe) | |
583 | ||
584 | # eth dst | |
585 | NXM_OF_ETH_DST(0002e30f80a4) | |
1e37a2d7 BP |
586 | NXM_OF_ETH_DST_W(010000000000/010000000000) |
587 | NXM_OF_ETH_DST_W(000000000000/010000000000) | |
06da29ee | 588 | NXM_OF_ETH_DST_W(ffffffffffff/010000000000) |
1e37a2d7 | 589 | NXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff) |
fbcbc814 | 590 | NXM_OF_ETH_DST_W(60175619848f/000000000000) |
1e37a2d7 | 591 | NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) |
73c0ce34 | 592 | NXM_OF_ETH_DST_W(60175619848f/5a5a5a5a5a5a) |
09246b99 BP |
593 | |
594 | # eth src | |
595 | NXM_OF_ETH_SRC(020898456ddb) | |
73c0ce34 JS |
596 | NXM_OF_ETH_SRC_W(012345abcdef/ffffff555555) |
597 | NXM_OF_ETH_SRC_W(020898456ddb/ffffffffffff) | |
fbcbc814 | 598 | NXM_OF_ETH_SRC_W(020898456ddb/000000000000) |
09246b99 BP |
599 | |
600 | # eth type | |
601 | NXM_OF_ETH_TYPE(0800) | |
602 | NXM_OF_ETH_TYPE(0800) NXM_OF_IN_PORT(0012) | |
603 | ||
604 | # vlan tci | |
605 | NXM_OF_VLAN_TCI(f009) | |
606 | NXM_OF_VLAN_TCI(f009) NXM_OF_VLAN_TCI(f009) | |
607 | NXM_OF_VLAN_TCI(0000) # Packets without 802.1Q header. | |
608 | NXM_OF_VLAN_TCI(3123) # Packets with VID=123, PCP=1. | |
66642cb4 | 609 | NXM_OF_VLAN_TCI(0123) # Does not make sense (but supported anyway) |
09246b99 | 610 | NXM_OF_VLAN_TCI_W(1123/1fff) # Packets with VID=123, any PCP. |
fbcbc814 SH |
611 | NXM_OF_VLAN_TCI_W(1123/ffff) # Packets with VID=123, PCP=0 |
612 | NXM_OF_VLAN_TCI_W(1123/0000) # Packets with or without 802.1Q header | |
09246b99 | 613 | NXM_OF_VLAN_TCI_W(f000/f000) # Packets with any VID, PCP=7. |
66642cb4 | 614 | NXM_OF_VLAN_TCI_W(0000/e000) # No 802.1Q or with VID=0 |
09246b99 BP |
615 | |
616 | # IP TOS | |
617 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(f0) | |
530180fd | 618 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_TOS(41) |
09246b99 BP |
619 | NXM_OF_IP_TOS(f0) |
620 | ||
530180fd JP |
621 | # IP ECN |
622 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(03) | |
623 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_ECN(06) | |
624 | NXM_NX_IP_ECN(03) | |
625 | ||
09246b99 BP |
626 | # IP protocol |
627 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) | |
628 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(05) | |
629 | NXM_OF_IP_PROTO(05) | |
630 | ||
a61680c6 JP |
631 | # IP TTL |
632 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_TTL(80) | |
633 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_TTL(ff) | |
634 | NXM_NX_IP_TTL(80) | |
635 | ||
09246b99 BP |
636 | # IP source |
637 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC(ac100014) | |
638 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/FFFF0000) | |
c08201d6 | 639 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/5a5a5a5a) |
fbcbc814 | 640 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_SRC_W(C0a80000/ffffffff) |
09246b99 BP |
641 | NXM_OF_ETH_TYPE(0806) NXM_OF_IP_SRC(ac100014) |
642 | NXM_OF_IP_SRC_W(C0D80000/FFFF0000) | |
643 | ||
644 | # IP destination | |
645 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST(ac100014) | |
06da29ee | 646 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a88012/FFFF0000) |
c08201d6 | 647 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/5a5a5a5a) |
fbcbc814 | 648 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_DST_W(C0a80000/ffffffff) |
09246b99 BP |
649 | NXM_OF_IP_DST(ac100014) |
650 | NXM_OF_ETH_TYPE(0806) NXM_OF_IP_DST_W(C0D80000/FFFF0000) | |
651 | ||
652 | # TCP source port | |
653 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC(4231) | |
73f33563 | 654 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/F0F0) |
fbcbc814 | 655 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_SRC_W(5050/ffff) |
09246b99 BP |
656 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_SRC(4231) |
657 | ||
658 | # TCP destination port | |
659 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST(4231) | |
73f33563 | 660 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/FFF0) |
fbcbc814 | 661 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_TCP_DST_W(FDE0/ffff) |
09246b99 BP |
662 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_OF_TCP_DST(4231) |
663 | ||
dc235f7f JR |
664 | # TCP flags |
665 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS(0131) | |
666 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(00F0/0FF0) | |
667 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_NX_TCP_FLAGS_W(01E2/ffff) | |
178742f9 | 668 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(07) NXM_NX_TCP_FLAGS(0fff) |
dc235f7f | 669 | |
09246b99 BP |
670 | # UDP source port |
671 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC(8732) | |
73f33563 | 672 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/01FF) |
fbcbc814 | 673 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_SRC_W(0132/ffff) |
09246b99 BP |
674 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(06) NXM_OF_UDP_SRC(7823) |
675 | ||
676 | # UDP destination port | |
677 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST(1782) | |
73f33563 | 678 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/F00F) |
fbcbc814 | 679 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(11) NXM_OF_UDP_DST_W(5005/FFFF) |
09246b99 BP |
680 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(02) NXM_OF_UDP_DST(1293) |
681 | ||
682 | # ICMP type | |
683 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_TYPE(12) | |
684 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_TYPE(10) | |
685 | ||
686 | # ICMP code | |
687 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(01) NXM_OF_ICMP_CODE(12) | |
688 | NXM_OF_ETH_TYPE(0800) NXM_OF_IP_PROTO(00) NXM_OF_ICMP_CODE(10) | |
689 | NXM_OF_ETH_TYPE(0800) NXM_OF_ICMP_CODE(10) | |
690 | NXM_OF_ICMP_CODE(00) | |
691 | ||
692 | # ARP opcode | |
693 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) | |
694 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(1111) | |
695 | NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0001) | |
696 | NXM_OF_ARP_OP(0001) | |
697 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_OP(0001) NXM_OF_ARP_OP(0001) | |
698 | ||
bad68a99 | 699 | # ARP source protocol address |
09246b99 | 700 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA(ac100014) |
06da29ee | 701 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/FFFFFF00) |
c08201d6 | 702 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00) |
fbcbc814 | 703 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_SPA_W(C0a81234/ffffffff) |
09246b99 | 704 | NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014) |
178742f9 | 705 | NXM_OF_ARP_SPA_W(C0D80000/FFFF0000) |
09246b99 | 706 | |
bad68a99 | 707 | # ARP destination protocol address |
09246b99 | 708 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA(ac100014) |
06da29ee | 709 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a812fe/FFFFFF00) |
c08201d6 | 710 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/77777777) |
fbcbc814 | 711 | NXM_OF_ETH_TYPE(0806) NXM_OF_ARP_TPA_W(C0a81234/ffffffff) |
09246b99 BP |
712 | NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014) |
713 | NXM_OF_ARP_TPA_W(C0D80000/FFFF0000) | |
714 | ||
bad68a99 JP |
715 | # ARP source hardware address |
716 | NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_SHA(0002e30f80a4) | |
717 | NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4) | |
718 | NXM_NX_ARP_SHA(0002e30f80a4) | |
719 | ||
720 | # ARP destination hardware address | |
721 | NXM_OF_ETH_TYPE(0806) NXM_NX_ARP_THA(0002e30f80a4) | |
722 | NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4) | |
723 | NXM_NX_ARP_THA(0002e30f80a4) | |
724 | ||
8087f5ff MM |
725 | # RARP opcode |
726 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003) | |
727 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(1111) | |
728 | NXM_OF_ETH_TYPE(0000) NXM_OF_ARP_OP(0003) | |
729 | NXM_OF_ARP_OP(0003) | |
730 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_OP(0003) NXM_OF_ARP_OP(0003) | |
731 | ||
732 | # RARP source protocol address | |
733 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA(ac100014) | |
3947cc76 | 734 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81200/FFFFFF00) |
8087f5ff MM |
735 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/aaaaaa00) |
736 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_SPA_W(C0a81234/ffffffff) | |
8087f5ff | 737 | NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_SPA(ac100014) |
178742f9 | 738 | NXM_OF_ARP_SPA_W(C0D80000/FFFF0000) |
8087f5ff MM |
739 | |
740 | # RARP destination protocol address | |
741 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA(ac100014) | |
3947cc76 | 742 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81200/FFFFFF00) |
8087f5ff MM |
743 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/77777777) |
744 | NXM_OF_ETH_TYPE(8035) NXM_OF_ARP_TPA_W(C0a81234/ffffffff) | |
8087f5ff MM |
745 | NXM_OF_ETH_TYPE(0800) NXM_OF_ARP_TPA(ac100014) |
746 | NXM_OF_ARP_TPA_W(C0D80000/FFFF0000) | |
747 | ||
748 | # RARP source hardware address | |
749 | NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_SHA(0002e30f80a4) | |
750 | NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_SHA(0002e30f80a4) | |
751 | NXM_NX_ARP_SHA(0002e30f80a4) | |
752 | ||
753 | # RARP destination hardware address | |
754 | NXM_OF_ETH_TYPE(8035) NXM_NX_ARP_THA(0002e30f80a4) | |
755 | NXM_OF_ETH_TYPE(0800) NXM_NX_ARP_THA(0002e30f80a4) | |
756 | NXM_NX_ARP_THA(0002e30f80a4) | |
757 | ||
d31f1109 JP |
758 | # IPv6 source |
759 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) | |
760 | NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) | |
761 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
ff0b06ee | 762 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/5a5a5a5a5a5a5a5a0000000000000000) |
fbcbc814 SH |
763 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) |
764 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/00000000000000000000000000000000) | |
178742f9 | 765 | NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffff000000000000) |
d31f1109 JP |
766 | |
767 | # IPv6 destination | |
768 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) | |
769 | NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) | |
ff0b06ee | 770 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/77777777777777777777777777777777) |
fbcbc814 | 771 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) |
3947cc76 | 772 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000) |
d31f1109 JP |
773 | NXM_OF_ETH_TYPE(0800) NXM_NX_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) |
774 | ||
626186c3 SH |
775 | # IPv6 Flow Label |
776 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(1000000f) | |
777 | NXM_NX_IPV6_LABEL(0000000f) | |
778 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IPV6_LABEL(0000000f) | |
779 | ||
ff0b06ee BP |
780 | # ND target address |
781 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) | |
782 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) | |
783 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/0123456789abcdeffedcba9876543210) | |
fbcbc814 | 784 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/ffffffffffffffffffffffffffffffff) |
3947cc76 | 785 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(87) NXM_NX_ND_TARGET_W(00000000000000000000000000000000/00000000000000000000000000000000) |
ff0b06ee BP |
786 | NXM_OF_ETH_TYPE(86dd) NXM_OF_IP_PROTO(3a) NXM_NX_ICMPV6_TYPE(88) NXM_NX_ND_TARGET_W(20010db83c4d00010002000300040005/fedcba98765432100123456789abcdef) |
787 | ||
685a51a5 JP |
788 | # ND source hardware address |
789 | 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) | |
790 | 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) | |
791 | 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) | |
792 | 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) | |
793 | ||
794 | # ND destination hardware address | |
795 | 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) | |
796 | 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) | |
797 | 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) | |
798 | 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) | |
799 | ||
7257b535 BP |
800 | # IPv4 fragments. |
801 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(00) | |
802 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(01) | |
803 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(02) | |
804 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(03) | |
805 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/03) | |
806 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/fd) | |
807 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(00/02) | |
808 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(01/01) | |
809 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(02/02) | |
810 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/03) | |
fbcbc814 SH |
811 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/ff) |
812 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG_W(03/00) | |
7257b535 BP |
813 | NXM_OF_ETH_TYPE(0800) NXM_NX_IP_FRAG(f3) |
814 | ||
815 | # IPv6 fragments. | |
816 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(00) | |
817 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(01) | |
818 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(02) | |
819 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(03) | |
820 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/03) | |
821 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/01) | |
822 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(00/02) | |
823 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(01/01) | |
824 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(02/02) | |
825 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/03) | |
fbcbc814 SH |
826 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/00) |
827 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG_W(03/ff) | |
7257b535 BP |
828 | NXM_OF_ETH_TYPE(86dd) NXM_NX_IP_FRAG(f3) |
829 | ||
e729e793 JP |
830 | # Flow cookie. |
831 | NXM_NX_COOKIE(00000000abcdef01) | |
832 | NXM_NX_COOKIE_W(84200000abcdef01/84200000FFFFFFFF) | |
fbcbc814 | 833 | NXM_NX_COOKIE_W(84200000abcdef01/ffffffffffffffff) |
178742f9 | 834 | NXM_NX_COOKIE_W(0000000000000000/0000000000000000) |
e729e793 | 835 | |
09246b99 BP |
836 | # Tunnel ID. |
837 | NXM_NX_TUN_ID(00000000abcdef01) | |
8368c090 | 838 | NXM_NX_TUN_ID_W(84200000abcdef01/84200000FFFFFFFF) |
fbcbc814 | 839 | NXM_NX_TUN_ID_W(84200000abcdef01/FFFFFFFFFFFFFFFF) |
3947cc76 | 840 | NXM_NX_TUN_ID_W(0000000000000000/0000000000000000) |
b6c9e612 BP |
841 | |
842 | # Register 0. | |
843 | NXM_NX_REG0(acebdf56) | |
844 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
fbcbc814 | 845 | NXM_NX_REG0_W(a0e0d050/ffffffff) |
3947cc76 | 846 | NXM_NX_REG0_W(00000000/00000000) |
558d80cb | 847 | |
07659514 | 848 | # Connection tracking fields, |
63bc9fb1 | 849 | NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE(00000020) |
07659514 | 850 | NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE(00001080) |
63bc9fb1 JR |
851 | NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE_W(00000020/00000020) |
852 | NXM_OF_ETH_TYPE(0800) NXM_NX_CT_STATE_W(00000020/000000F0) | |
07659514 | 853 | NXM_OF_ETH_TYPE(0800) NXM_NX_CT_ZONE(5a5a) |
8e53fe8c JS |
854 | NXM_OF_ETH_TYPE(0800) NXM_NX_CT_MARK(5a5a5a5a) |
855 | NXM_OF_ETH_TYPE(0800) NXM_NX_CT_MARK_W(5a5a5a5a/fefefefe) | |
9daf2348 JS |
856 | NXM_OF_ETH_TYPE(0800) NXM_NX_CT_LABEL(1234567890abcdef1234567890abcdef) |
857 | NXM_OF_ETH_TYPE(0800) NXM_NX_CT_LABEL_W(10203040506070809000a0b0c0d0e0f0/f1f2f3f4f5f6f7f8f9f0fafbfcfdfeff) | |
07659514 | 858 | |
508a9338 BP |
859 | # dp_hash (testing experimenter OXM). |
860 | NXM_NX_DP_HASH(01234567) | |
861 | NXOXM_ET_DP_HASH(01234567) | |
862 | ||
558d80cb | 863 | # Invalid field number. |
178742f9 | 864 | 01020304(1111/3333) |
558d80cb | 865 | |
508a9338 BP |
866 | # Invalid field numbers (experimenter OXM). |
867 | ffff020800002320(11112222) | |
868 | ffff030800002320(1111/3333) | |
869 | ||
558d80cb BP |
870 | # Unimplemented registers. |
871 | # | |
872 | # This test assumes that at least two registers, but fewer than 16, | |
873 | # registers are implemented. | |
874 | 00010004(12345678) | |
875 | 00010108(12345678/12345678) | |
876 | 00011e04(12345678) | |
877 | 00011f08(12345678/12345678) | |
09246b99 | 878 | ]) |
e1cfc4e4 | 879 | AT_CHECK([ovs-ofctl -vPATTERN:'console:%c|%p|%m' --strict parse-nx-match < nx-match.txt], [0], [dnl |
09246b99 BP |
880 | <any> |
881 | ||
882 | # in port | |
abe529af | 883 | NXM_OF_IN_PORT(0000) |
09246b99 BP |
884 | NXM_OF_IN_PORT(fffe) |
885 | ||
886 | # eth dst | |
887 | NXM_OF_ETH_DST(0002e30f80a4) | |
1e37a2d7 BP |
888 | NXM_OF_ETH_DST_W(010000000000/010000000000) |
889 | NXM_OF_ETH_DST_W(000000000000/010000000000) | |
3947cc76 | 890 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
1e37a2d7 | 891 | NXM_OF_ETH_DST(0002e30f80a4) |
3947cc76 | 892 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
1e37a2d7 | 893 | NXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) |
3947cc76 | 894 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
09246b99 BP |
895 | |
896 | # eth src | |
897 | NXM_OF_ETH_SRC(020898456ddb) | |
3947cc76 | 898 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
73c0ce34 | 899 | NXM_OF_ETH_SRC(020898456ddb) |
3947cc76 | 900 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
09246b99 BP |
901 | |
902 | # eth type | |
903 | NXM_OF_ETH_TYPE(0800) | |
904 | NXM_OF_IN_PORT(0012), NXM_OF_ETH_TYPE(0800) | |
905 | ||
906 | # vlan tci | |
907 | NXM_OF_VLAN_TCI(f009) | |
2e0525bc | 908 | nx_pull_match() returned error OFPBMC_DUP_FIELD |
09246b99 BP |
909 | NXM_OF_VLAN_TCI(0000) |
910 | NXM_OF_VLAN_TCI(3123) | |
66642cb4 | 911 | NXM_OF_VLAN_TCI(0123) |
09246b99 | 912 | NXM_OF_VLAN_TCI_W(1123/1fff) |
fbcbc814 | 913 | NXM_OF_VLAN_TCI(1123) |
3947cc76 | 914 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
09246b99 | 915 | NXM_OF_VLAN_TCI_W(f000/f000) |
66642cb4 | 916 | NXM_OF_VLAN_TCI_W(0000/e000) |
09246b99 BP |
917 | |
918 | # IP TOS | |
919 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_TOS(f0) | |
2e0525bc SH |
920 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
921 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
530180fd JP |
922 | |
923 | # IP ECN | |
924 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_ECN(03) | |
2e0525bc SH |
925 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
926 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 BP |
927 | |
928 | # IP protocol | |
929 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01) | |
930 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(05) | |
2e0525bc | 931 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
a61680c6 JP |
932 | |
933 | # IP TTL | |
934 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_TTL(80) | |
935 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_TTL(ff) | |
2e0525bc | 936 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
937 | |
938 | # IP source | |
939 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(ac100014) | |
940 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC_W(c0a80000/ffff0000) | |
3947cc76 | 941 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 | 942 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_SRC(c0a80000) |
2e0525bc SH |
943 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
944 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 BP |
945 | |
946 | # IP destination | |
947 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(ac100014) | |
3947cc76 BP |
948 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
949 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS | |
fbcbc814 | 950 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_DST(c0a80000) |
2e0525bc SH |
951 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
952 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 BP |
953 | |
954 | # TCP source port | |
955 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(4231) | |
73f33563 | 956 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC_W(5050/f0f0) |
fbcbc814 | 957 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_SRC(5050) |
2e0525bc | 958 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
959 | |
960 | # TCP destination port | |
961 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(4231) | |
73f33563 | 962 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST_W(fde0/fff0) |
fbcbc814 | 963 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_OF_TCP_DST(fde0) |
2e0525bc | 964 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 | 965 | |
dc235f7f JR |
966 | # TCP flags |
967 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0131) | |
968 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS_W(00f0/0ff0) | |
969 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(01e2) | |
dc235f7f JR |
970 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
971 | ||
09246b99 BP |
972 | # UDP source port |
973 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(8732) | |
73f33563 | 974 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC_W(0132/01ff) |
fbcbc814 | 975 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_SRC(0132) |
2e0525bc | 976 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
977 | |
978 | # UDP destination port | |
979 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(1782) | |
73f33563 | 980 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST_W(5005/f00f) |
fbcbc814 | 981 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(11), NXM_OF_UDP_DST(5005) |
2e0525bc | 982 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
983 | |
984 | # ICMP type | |
985 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_TYPE(12) | |
2e0525bc | 986 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
09246b99 BP |
987 | |
988 | # ICMP code | |
989 | NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(01), NXM_OF_ICMP_CODE(12) | |
2e0525bc SH |
990 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
991 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
992 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 BP |
993 | |
994 | # ARP opcode | |
995 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_OP(0001) | |
2e0525bc SH |
996 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
997 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
998 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
999 | nx_pull_match() returned error OFPBMC_DUP_FIELD | |
09246b99 | 1000 | |
bad68a99 | 1001 | # ARP source protocol address |
09246b99 | 1002 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(ac100014) |
3947cc76 BP |
1003 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
1004 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS | |
fbcbc814 | 1005 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_SPA(c0a81234) |
2e0525bc SH |
1006 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1007 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 | 1008 | |
bad68a99 | 1009 | # ARP destination protocol address |
09246b99 | 1010 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(ac100014) |
3947cc76 BP |
1011 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
1012 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS | |
fbcbc814 | 1013 | NXM_OF_ETH_TYPE(0806), NXM_OF_ARP_TPA(c0a81234) |
2e0525bc SH |
1014 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1015 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
09246b99 | 1016 | |
bad68a99 JP |
1017 | # ARP source hardware address |
1018 | NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_SHA(0002e30f80a4) | |
2e0525bc SH |
1019 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1020 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
bad68a99 JP |
1021 | |
1022 | # ARP destination hardware address | |
1023 | NXM_OF_ETH_TYPE(0806), NXM_NX_ARP_THA(0002e30f80a4) | |
2e0525bc | 1024 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
8087f5ff MM |
1025 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1026 | ||
1027 | # RARP opcode | |
1028 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_OP(0003) | |
1029 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
1030 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1031 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1032 | nx_pull_match() returned error OFPBMC_DUP_FIELD | |
1033 | ||
1034 | # RARP source protocol address | |
1035 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(ac100014) | |
1036 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA_W(c0a81200/ffffff00) | |
3947cc76 | 1037 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
8087f5ff | 1038 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_SPA(c0a81234) |
8087f5ff MM |
1039 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1040 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1041 | ||
1042 | # RARP destination protocol address | |
1043 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(ac100014) | |
1044 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA_W(c0a81200/ffffff00) | |
3947cc76 | 1045 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
8087f5ff | 1046 | NXM_OF_ETH_TYPE(8035), NXM_OF_ARP_TPA(c0a81234) |
8087f5ff MM |
1047 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1048 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1049 | ||
1050 | # RARP source hardware address | |
1051 | NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_SHA(0002e30f80a4) | |
1052 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1053 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1054 | ||
1055 | # RARP destination hardware address | |
1056 | NXM_OF_ETH_TYPE(8035), NXM_NX_ARP_THA(0002e30f80a4) | |
1057 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2e0525bc | 1058 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
bad68a99 | 1059 | |
d31f1109 JP |
1060 | # IPv6 source |
1061 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010002000300040005) | |
2e0525bc | 1062 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
d31f1109 | 1063 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) |
3947cc76 | 1064 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 | 1065 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_SRC(20010db83c4d00010000000000000000) |
3947cc76 | 1066 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
2e0525bc | 1067 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
d31f1109 JP |
1068 | |
1069 | # IPv6 destination | |
1070 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010002000300040005) | |
2e0525bc | 1071 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
3947cc76 | 1072 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 SH |
1073 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_DST(20010db83c4d00010000000000000000) |
1074 | NXM_OF_ETH_TYPE(86dd) | |
2e0525bc | 1075 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
d31f1109 | 1076 | |
626186c3 SH |
1077 | # IPv6 Flow Label |
1078 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
1079 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1080 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IPV6_LABEL(0000000f) | |
1081 | ||
ff0b06ee BP |
1082 | # ND target address |
1083 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) | |
1084 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(88), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) | |
3947cc76 | 1085 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 SH |
1086 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87), NXM_NX_ND_TARGET(20010db83c4d00010002000300040005) |
1087 | NXM_OF_ETH_TYPE(86dd), NXM_OF_IP_PROTO(3a), NXM_NX_ICMPV6_TYPE(87) | |
3947cc76 | 1088 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
ff0b06ee | 1089 | |
685a51a5 JP |
1090 | # ND source hardware address |
1091 | 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) | |
2e0525bc SH |
1092 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1093 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1094 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
685a51a5 JP |
1095 | |
1096 | # ND destination hardware address | |
1097 | 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) | |
2e0525bc SH |
1098 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
1099 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
1100 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
685a51a5 | 1101 | |
7257b535 BP |
1102 | # IPv4 fragments. |
1103 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00) | |
1104 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(01) | |
1105 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(02) | |
1106 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) | |
1107 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(00) | |
1108 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/01) | |
1109 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(00/02) | |
1110 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(01/01) | |
1111 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG_W(02/02) | |
1112 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) | |
fbcbc814 | 1113 | NXM_OF_ETH_TYPE(0800), NXM_NX_IP_FRAG(03) |
3947cc76 | 1114 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
2e0525bc | 1115 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
7257b535 BP |
1116 | |
1117 | # IPv6 fragments. | |
1118 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00) | |
1119 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(01) | |
1120 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(02) | |
1121 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) | |
1122 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(00) | |
1123 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/01) | |
1124 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(00/02) | |
1125 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(01/01) | |
1126 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG_W(02/02) | |
1127 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) | |
3947cc76 | 1128 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
fbcbc814 | 1129 | NXM_OF_ETH_TYPE(86dd), NXM_NX_IP_FRAG(03) |
2e0525bc | 1130 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
7257b535 | 1131 | |
e729e793 JP |
1132 | # Flow cookie. |
1133 | NXM_NX_COOKIE(00000000abcdef01) | |
1134 | NXM_NX_COOKIE_W(84200000abcdef01/84200000ffffffff) | |
fbcbc814 SH |
1135 | NXM_NX_COOKIE(84200000abcdef01) |
1136 | <any> | |
e729e793 | 1137 | |
09246b99 BP |
1138 | # Tunnel ID. |
1139 | NXM_NX_TUN_ID(00000000abcdef01) | |
8368c090 | 1140 | NXM_NX_TUN_ID_W(84200000abcdef01/84200000ffffffff) |
fbcbc814 SH |
1141 | NXM_NX_TUN_ID(84200000abcdef01) |
1142 | <any> | |
b6c9e612 BP |
1143 | |
1144 | # Register 0. | |
1145 | NXM_NX_REG0(acebdf56) | |
1146 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
fbcbc814 SH |
1147 | NXM_NX_REG0(a0e0d050) |
1148 | <any> | |
558d80cb | 1149 | |
07659514 JS |
1150 | # Connection tracking fields, |
1151 | dnl | |
1152 | dnl When re-serialising, bits 16-31 are wildcarded, because current OVS userspace | |
1153 | dnl doesn't understand (or store) those bits. | |
63bc9fb1 | 1154 | NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/0000ffff) |
07659514 | 1155 | nx_pull_match() returned error OFPBMC_BAD_VALUE |
63bc9fb1 JR |
1156 | NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/00000020) |
1157 | NXM_OF_ETH_TYPE(0800), NXM_NX_CT_STATE_W(00000020/000000f0) | |
07659514 | 1158 | NXM_OF_ETH_TYPE(0800), NXM_NX_CT_ZONE(5a5a) |
8e53fe8c JS |
1159 | NXM_OF_ETH_TYPE(0800), NXM_NX_CT_MARK(5a5a5a5a) |
1160 | NXM_OF_ETH_TYPE(0800), NXM_NX_CT_MARK_W(5a5a5a5a/fefefefe) | |
9daf2348 JS |
1161 | NXM_OF_ETH_TYPE(0800), NXM_NX_CT_LABEL(1234567890abcdef1234567890abcdef) |
1162 | NXM_OF_ETH_TYPE(0800), NXM_NX_CT_LABEL_W(10203040506070809000a0b0c0d0e0f0/f1f2f3f4f5f6f7f8f9f0fafbfcfdfeff) | |
07659514 | 1163 | |
508a9338 BP |
1164 | # dp_hash (testing experimenter OXM). |
1165 | NXM_NX_DP_HASH(01234567) | |
1166 | NXM_NX_DP_HASH(01234567) | |
1167 | ||
558d80cb | 1168 | # Invalid field number. |
2e0525bc | 1169 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
558d80cb | 1170 | |
508a9338 BP |
1171 | # Invalid field numbers (experimenter OXM). |
1172 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
1173 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
1174 | ||
558d80cb BP |
1175 | # Unimplemented registers. |
1176 | # | |
1177 | # This test assumes that at least two registers, but fewer than 16, | |
1178 | # registers are implemented. | |
1179 | NXM_NX_REG0(12345678) | |
1180 | NXM_NX_REG0_W(12345678/12345678) | |
2e0525bc SH |
1181 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
1182 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
e1cfc4e4 BP |
1183 | ], [stderr]) |
1184 | ||
1185 | # Check that at least the first warning made it. (It's rate-limited | |
1186 | # so a variable number could show up, especially under valgrind etc.) | |
3947cc76 | 1187 | AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl |
508a9338 | 1188 | nx_match|WARN|Rejecting NXM/OXM entry 0:0:1:1:12 with 1-bits in value for bits wildcarded by the mask. |
09246b99 | 1189 | ]) |
e1cfc4e4 BP |
1190 | |
1191 | # Check that there wasn't any other stderr output. | |
3947cc76 | 1192 | AT_CHECK([grep -v '1-bits in value' stderr], [1]) |
09246b99 | 1193 | AT_CLEANUP |
0fbc9f11 | 1194 | |
96628ae8 BP |
1195 | AT_SETUP([ovs-ofctl parse-ofp10-match]) |
1196 | AT_KEYWORDS([OF1.0]) | |
1197 | AT_DATA([test-data], [dnl | |
576ec803 | 1198 | # in_port=LOCAL |
8812ec2c BP |
1199 | 003820fe fffe xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl |
1200 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1201 | |
1202 | # dl_src=00:01:02:03:04:05 | |
8812ec2c BP |
1203 | 003820fb xxxx 000102030405 xxxxxxxxxxxx xxxx xx xx xxxx xx xx xxxx dnl |
1204 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1205 | |
1206 | # dl_dst=10:20:30:40:50:60 | |
8812ec2c BP |
1207 | 003820f7 xxxx xxxxxxxxxxxx 102030405060 xxxx xx xx xxxx xx xx xxxx dnl |
1208 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1209 | |
1210 | # dl_vlan=291 | |
8812ec2c BP |
1211 | 003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 xx xx xxxx xx xx xxxx dnl |
1212 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1213 | |
1214 | # dl_vlan_pcp=5 | |
8812ec2c BP |
1215 | 002820ff xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx 05 xx xxxx xx xx xxxx dnl |
1216 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1217 | |
1218 | # dl_vlan=291,dl_vlan_pcp=4 | |
8812ec2c BP |
1219 | 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx 0123 04 xx xxxx xx xx xxxx dnl |
1220 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 | 1221 | |
053df7bd BP |
1222 | dnl dl_vlan_pcp doesn't make sense when 802.1Q is not present, so |
1223 | dnl OVS ignores it and drops it on output. | |
96628ae8 | 1224 | # vlan_tci=0x0000 |
053df7bd | 1225 | # 1: 38 -> 28 |
8812ec2c BP |
1226 | 003820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff xx xx xxxx xx xx xxxx dnl |
1227 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 | 1228 | |
053df7bd | 1229 | dnl dl_vlan_pcp doesn't make sense when 802.1Q is not present, so |
96628ae8 BP |
1230 | dnl OVS ignores it and drops it on output. |
1231 | # vlan_tci=0x0000 | |
96628ae8 | 1232 | # 20: 05 -> 00 |
8812ec2c BP |
1233 | 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx ffff 05 xx xxxx xx xx xxxx dnl |
1234 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1235 | |
1236 | dnl Invalid VID and PCP discards out-of-range bits: | |
1237 | # dl_vlan=256,dl_vlan_pcp=7 | |
1238 | # 18: f1 -> 01 | |
1239 | # 20: ff -> 07 | |
8812ec2c BP |
1240 | 002820fd xxxx xxxxxxxxxxxx xxxxxxxxxxxx f100 ff xx xxxx xx xx xxxx dnl |
1241 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1242 | |
1243 | # dl_type=0x1234 | |
8812ec2c BP |
1244 | 003820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl |
1245 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1246 | |
1247 | # ip,nw_proto=5 | |
8812ec2c BP |
1248 | 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 05 xxxx dnl |
1249 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1250 | |
1251 | dnl Ignore nw_proto if not IP or ARP: | |
1252 | # dl_type=0x1234,nw_proto=5 | |
1253 | # normal: 3: cf -> ef | |
1254 | # normal: 25: 05 -> 00 | |
1255 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1256 | & ofp_util|INFO| pre: dl_type=0x1234,nw_proto=5 | |
1257 | & ofp_util|INFO|post: dl_type=0x1234 | |
8812ec2c BP |
1258 | 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx 05 xxxx dnl |
1259 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1260 | |
1261 | # ip,nw_tos=252 | |
8812ec2c BP |
1262 | 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 fc xx xxxx dnl |
1263 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1264 | |
1265 | dnl Ignore nw_tos if not IP: | |
1266 | # arp,nw_tos=4 | |
1267 | # 24: 05 -> 04 | |
1268 | # normal: 1: 18 -> 38 | |
1269 | # normal: 24: 04 -> 00 | |
1270 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1271 | & ofp_util|INFO| pre: arp,nw_tos=4 | |
1272 | & ofp_util|INFO|post: arp | |
8812ec2c BP |
1273 | 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 05 xx xxxx dnl |
1274 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1275 | |
1276 | dnl Low 2 bits of invalid TOS are forced to 0: | |
1277 | # ip,nw_tos=48 | |
1278 | # 24: 31 -> 30 | |
8812ec2c BP |
1279 | 001820ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 31 xx xxxx dnl |
1280 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1281 | |
1282 | # arp,arp_op=2 | |
8812ec2c BP |
1283 | 003820cf xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx 02 xxxx dnl |
1284 | xxxxxxxx xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1285 | |
1286 | # ip,nw_src=192.168.128.85 | |
8812ec2c BP |
1287 | 003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl |
1288 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1289 | |
1290 | # ip,nw_src=192.168.128.0/24 | |
1291 | # 31: 55 -> 00 | |
8812ec2c BP |
1292 | 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl |
1293 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1294 | |
1295 | # ip,nw_dst=192.168.128.85 | |
8812ec2c BP |
1296 | 003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl |
1297 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 BP |
1298 | |
1299 | # ip,nw_dst=192.168.128.0/24 | |
1300 | # 35: 55 -> 00 | |
8812ec2c BP |
1301 | 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx xx xxxx dnl |
1302 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 | 1303 | |
666d0863 | 1304 | # arp,arp_spa=192.168.128.85 |
8812ec2c BP |
1305 | 003800ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl |
1306 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 | 1307 | |
666d0863 | 1308 | # arp,arp_spa=192.168.128.0/24 |
96628ae8 | 1309 | # 31: 55 -> 00 |
8812ec2c BP |
1310 | 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl |
1311 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 | 1312 | |
666d0863 | 1313 | # arp,arp_tpa=192.168.128.85 |
8812ec2c BP |
1314 | 003020ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl |
1315 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 | 1316 | |
666d0863 | 1317 | # arp,arp_tpa=192.168.128.0/24 |
96628ae8 | 1318 | # 35: 55 -> 00 |
8812ec2c BP |
1319 | 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0806 xx xx xxxx dnl |
1320 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 BP |
1321 | |
1322 | dnl Ignore nw_src if not IP or ARP: | |
1323 | # dl_type=0x1234,nw_src=192.168.128.0/24 | |
1324 | # 31: 55 -> 00 | |
1325 | # normal: 2: 08 -> 20 | |
1326 | # normal: 28: c0 -> 00 | |
1327 | # normal: 29: a8 -> 00 | |
1328 | # normal: 30: 80 -> 00 | |
1329 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1330 | & ofp_util|INFO| pre: dl_type=0x1234,nw_src=192.168.128.0/24 | |
1331 | & ofp_util|INFO|post: dl_type=0x1234 | |
8812ec2c BP |
1332 | 003808ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl |
1333 | c0a88055 xxxxxxxx xxxx xxxx | |
96628ae8 BP |
1334 | |
1335 | dnl Ignore nw_dst if not IP or ARP: | |
1336 | # dl_type=0x1234,nw_dst=192.168.128.0/24 | |
1337 | # 35: 55 -> 00 | |
1338 | # normal: 1: 32 -> 38 | |
1339 | # normal: 32: c0 -> 00 | |
1340 | # normal: 33: a8 -> 00 | |
1341 | # normal: 34: 80 -> 00 | |
1342 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1343 | & ofp_util|INFO| pre: dl_type=0x1234,nw_dst=192.168.128.0/24 | |
1344 | & ofp_util|INFO|post: dl_type=0x1234 | |
8812ec2c BP |
1345 | 003220ef xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 1234 xx xx xxxx dnl |
1346 | xxxxxxxx c0a88055 xxxx xxxx | |
96628ae8 BP |
1347 | |
1348 | # tcp,tp_src=443 | |
8812ec2c BP |
1349 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl |
1350 | xxxxxxxx xxxxxxxx 01bb xxxx | |
96628ae8 BP |
1351 | |
1352 | # tcp,tp_dst=443 | |
8812ec2c BP |
1353 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 06 xxxx dnl |
1354 | xxxxxxxx xxxxxxxx xxxx 01bb | |
96628ae8 BP |
1355 | |
1356 | # udp,tp_src=443 | |
8812ec2c BP |
1357 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl |
1358 | xxxxxxxx xxxxxxxx 01bb xxxx | |
96628ae8 BP |
1359 | |
1360 | # udp,tp_dst=443 | |
8812ec2c BP |
1361 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 11 xxxx dnl |
1362 | xxxxxxxx xxxxxxxx xxxx 01bb | |
96628ae8 | 1363 | |
0d56eaf2 JS |
1364 | # sctp,tp_src=443 |
1365 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx dnl | |
1366 | xxxxxxxx xxxxxxxx 01bb xxxx | |
1367 | ||
1368 | # sctp,tp_dst=443 | |
1369 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 84 xxxx dnl | |
1370 | xxxxxxxx xxxxxxxx xxxx 01bb | |
1371 | ||
96628ae8 | 1372 | # icmp,icmp_type=5 |
8812ec2c BP |
1373 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl |
1374 | xxxxxxxx xxxxxxxx 0005 xxxx | |
96628ae8 BP |
1375 | |
1376 | # icmp,icmp_code=8 | |
8812ec2c BP |
1377 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 01 xxxx dnl |
1378 | xxxxxxxx xxxxxxxx xxxx 0008 | |
96628ae8 | 1379 | |
0d56eaf2 | 1380 | dnl Ignore tp_src if not TCP/UDP/SCTP: |
96628ae8 BP |
1381 | # ip,nw_proto=21,tp_src=443 |
1382 | # normal: 3: 8f -> cf | |
1383 | # normal: 36: 01 -> 00 | |
1384 | # normal: 37: bb -> 00 | |
1385 | & ofp_util|INFO|normalization changed ofp_match, details: | |
1386 | & ofp_util|INFO| pre: ip,nw_proto=21,tp_src=443 | |
1387 | & ofp_util|INFO|post: ip,nw_proto=21 | |
8812ec2c BP |
1388 | 0038208f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl |
1389 | xxxxxxxx xxxxxxxx 01bb xxxx | |
96628ae8 | 1390 | |
0d56eaf2 | 1391 | dnl Ignore tp_dst if not TCP/UDP/SCTP: |
96628ae8 BP |
1392 | # ip,nw_proto=21,tp_dst=443 |
1393 | # normal: 3: 4f -> cf | |
1394 | # normal: 38: 01 -> 00 | |
1395 | # normal: 39: bb -> 00 | |
1396 | dnl The normalization details are suppressed here due to rate-limiting. | |
8812ec2c BP |
1397 | 0038204f xxxx xxxxxxxxxxxx xxxxxxxxxxxx xxxx xx xx 0800 xx 15 xxxx dnl |
1398 | xxxxxxxx xxxxxxxx xxxx 01bb | |
96628ae8 BP |
1399 | |
1400 | ]) | |
1401 | sed '/^[[#&]]/d' < test-data > input.txt | |
1402 | sed -n 's/^# //p; /^$/p' < test-data > expout | |
1403 | sed -n 's/^& //p' < test-data > experr | |
1404 | AT_CAPTURE_FILE([input.txt]) | |
1405 | AT_CAPTURE_FILE([expout]) | |
1406 | AT_CAPTURE_FILE([experr]) | |
1407 | AT_CHECK( | |
1408 | [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp10-match < input.txt], | |
1409 | [0], [expout], [experr]) | |
1410 | AT_CLEANUP | |
1411 | ||
410698cf BP |
1412 | AT_SETUP([ovs-ofctl parse-ofp11-match]) |
1413 | AT_KEYWORDS([OF1.1]) | |
1414 | AT_DATA([test-data], [dnl | |
576ec803 | 1415 | # in_port=LOCAL |
410698cf BP |
1416 | 0000 0058 fffffffe 000003fe dnl |
1417 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1418 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1419 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1420 | ||
1421 | # bad ofp11_match: OFPBMC_BAD_VALUE | |
1422 | & ofp_util|WARN|port 305419896 is outside the supported range 0 through 65279 or 0xffffff00 through 0xffffffff | |
1423 | 0000 0058 12345678 000003fe dnl | |
1424 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1425 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1426 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1427 | ||
1428 | # dl_src=00:01:02:03:04:05 | |
1429 | 0000 0058 00000000 000003ff dnl | |
1430 | 000102030405000000000000 000000000000ffffffffffff dnl | |
1431 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1432 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1433 | ||
1434 | # dl_src=55:55:55:55:55:55/55:55:55:55:55:55 | |
1435 | 0000 0058 00000000 000003ff dnl | |
1436 | 555555555555aaaaaaaaaaaa 000000000000ffffffffffff dnl | |
1437 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1438 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1439 | ||
1440 | # dl_dst=00:01:02:03:04:05 | |
1441 | 0000 0058 00000000 000003ff dnl | |
1442 | 000000000000ffffffffffff 000102030405000000000000 dnl | |
1443 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1444 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1445 | ||
1446 | # dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 | |
1447 | 0000 0058 00000000 000003ff dnl | |
1448 | 000000000000ffffffffffff 010000000000feffffffffff dnl | |
1449 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1450 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1451 | ||
1452 | # dl_dst=00:01:02:03:04:05/fe:ff:ff:ff:ff:ff | |
1453 | 0000 0058 00000000 000003ff dnl | |
1454 | 000000000000ffffffffffff 000102030405010000000000 dnl | |
1455 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1456 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1457 | ||
1458 | # dl_dst=55:55:55:55:55:55/55:55:55:55:55:55 | |
1459 | 0000 0058 00000000 000003ff dnl | |
1460 | 000000000000ffffffffffff 555555555555aaaaaaaaaaaa dnl | |
1461 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1462 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1463 | ||
1464 | dnl dl_vlan_pcp is ignored if dl_vlan is wildcarded, which causes the | |
1465 | dnl the wildcard bit and the dl_vlan_pcp to be dropped for output: | |
1466 | # in_port=1 | |
1467 | # 11: fa -> fe | |
1468 | # 38: 03 -> 00 | |
1469 | 0000 0058 00000001 000003fa dnl | |
1470 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1471 | 0000 03 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1472 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1473 | ||
1474 | # dl_vlan=291 | |
1475 | 0000 0058 00000000 000003fd dnl | |
1476 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1477 | 0123 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1478 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1479 | ||
1480 | dnl OFPVID_NONE: | |
1481 | # vlan_tci=0x0000 | |
1482 | 0000 0058 00000000 000003fd dnl | |
1483 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1484 | ffff 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1485 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1486 | ||
1487 | dnl OFPVID_NONE ignores dl_vlan_pcp even if not wildcarded, which causes | |
1488 | dnl the wildcard bit and the dl_vlan_pcp to be dropped for output: | |
1489 | # vlan_tci=0x0000 | |
1490 | # 11: f9 -> fd | |
1491 | # 38: 05 -> 00 | |
1492 | 0000 0058 00000000 000003f9 dnl | |
1493 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1494 | ffff 05 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1495 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1496 | ||
1497 | # vlan_tci=0x1000/0x1000 | |
1498 | 0000 0058 00000000 000003fd dnl | |
1499 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1500 | fffe 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1501 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1502 | ||
1503 | dnl Try invalid VID: | |
1504 | # bad ofp11_match: OFPBMC_BAD_VALUE | |
1505 | 0000 0058 00000000 000003fd dnl | |
1506 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1507 | 1234 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1508 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1509 | ||
1510 | # dl_vlan_pcp=4 | |
1511 | 0000 0058 00000000 000003f9 dnl | |
1512 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1513 | fffe 04 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1514 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1515 | ||
1516 | # dl_vlan=10,dl_vlan_pcp=6 | |
1517 | 0000 0058 00000000 000003f9 dnl | |
1518 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1519 | 000a 06 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1520 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1521 | ||
1522 | # dl_type=0x1234 | |
1523 | 0000 0058 00000000 000003f7 dnl | |
1524 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1525 | 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1526 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1527 | ||
1528 | # ip,nw_tos=252 | |
1529 | 0000 0058 00000000 000003e7 dnl | |
1530 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1531 | 0000 00 00 0800 fc 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1532 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1533 | ||
1534 | dnl Try invalid TOS: | |
1535 | # bad ofp11_match: OFPBMC_BAD_VALUE | |
1536 | 0000 0058 00000000 000003e7 dnl | |
1537 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1538 | 0000 00 00 0800 01 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1539 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1540 | ||
1541 | # ip,nw_proto=5 | |
1542 | 0000 0058 00000000 000003d7 dnl | |
1543 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1544 | 0000 00 00 0800 00 05 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1545 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1546 | ||
1547 | # arp,arp_op=2 | |
1548 | 0000 0058 00000000 000003d7 dnl | |
1549 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1550 | 0000 00 00 0806 00 02 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1551 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1552 | ||
1553 | # ip,nw_src=192.168.128.0/24 | |
1554 | 0000 0058 00000000 000003f7 dnl | |
1555 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1556 | 0000 00 00 0800 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl | |
1557 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1558 | ||
c08201d6 BP |
1559 | # ip,nw_src=128.160.128.0/165.165.165.165 |
1560 | # 44: c0 -> 80 | |
1561 | # 45: a8 -> a0 | |
410698cf BP |
1562 | 0000 0058 00000000 000003f7 dnl |
1563 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1564 | 0000 00 00 0800 00 00 c0a880005a5a5a5a 00000000ffffffff 0000 0000 dnl | |
1565 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1566 | ||
1567 | # ip,nw_dst=192.168.128.0/24 | |
1568 | 0000 0058 00000000 000003f7 dnl | |
1569 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1570 | 0000 00 00 0800 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl | |
1571 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1572 | ||
c08201d6 BP |
1573 | # ip,nw_dst=128.160.128.0/165.165.165.165 |
1574 | # 52: c0 -> 80 | |
1575 | # 53: a8 -> a0 | |
410698cf BP |
1576 | 0000 0058 00000000 000003f7 dnl |
1577 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1578 | 0000 00 00 0800 00 00 00000000ffffffff c0a880005a5a5a5a 0000 0000 dnl | |
1579 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1580 | ||
666d0863 | 1581 | # arp,arp_spa=192.168.128.0/24 |
410698cf BP |
1582 | 0000 0058 00000000 000003f7 dnl |
1583 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1584 | 0000 00 00 0806 00 00 c0a88000000000ff 00000000ffffffff 0000 0000 dnl | |
1585 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1586 | ||
666d0863 | 1587 | # arp,arp_tpa=192.168.128.0/24 |
410698cf BP |
1588 | 0000 0058 00000000 000003f7 dnl |
1589 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1590 | 0000 00 00 0806 00 00 00000000ffffffff c0a88000000000ff 0000 0000 dnl | |
1591 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1592 | ||
1593 | # tcp,tp_src=443 | |
1594 | 0000 0058 00000000 00000397 dnl | |
1595 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1596 | 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1597 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1598 | ||
1599 | # tcp,tp_dst=443 | |
1600 | 0000 0058 00000000 00000357 dnl | |
1601 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1602 | 0000 00 00 0800 00 06 00000000ffffffff 00000000ffffffff 0000 01bb dnl | |
1603 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1604 | ||
1605 | # udp,tp_src=443 | |
1606 | 0000 0058 00000000 00000397 dnl | |
1607 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1608 | 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1609 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1610 | ||
1611 | # icmp,icmp_type=5 | |
1612 | 0000 0058 00000000 00000397 dnl | |
1613 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1614 | 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0005 0000 dnl | |
1615 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1616 | ||
1617 | # icmp,icmp_code=8 | |
1618 | 0000 0058 00000000 00000357 dnl | |
1619 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1620 | 0000 00 00 0800 00 01 00000000ffffffff 00000000ffffffff 0000 0008 dnl | |
1621 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1622 | ||
1623 | # udp,tp_src=443 | |
1624 | 0000 0058 00000000 00000397 dnl | |
1625 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1626 | 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1627 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1628 | ||
1629 | # udp,tp_dst=443 | |
1630 | 0000 0058 00000000 00000357 dnl | |
1631 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1632 | 0000 00 00 0800 00 11 00000000ffffffff 00000000ffffffff 0000 01bb dnl | |
1633 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1634 | ||
0d56eaf2 | 1635 | # sctp |
410698cf BP |
1636 | 0000 0058 00000000 000003d7 dnl |
1637 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1638 | 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1639 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1640 | ||
0d56eaf2 | 1641 | # sctp,tp_src=443 |
410698cf BP |
1642 | 0000 0058 00000000 00000397 dnl |
1643 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1644 | 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1645 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1646 | ||
0d56eaf2 | 1647 | # sctp,tp_dst=443 |
410698cf BP |
1648 | 0000 0058 00000000 00000357 dnl |
1649 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1650 | 0000 00 00 0800 00 84 00000000ffffffff 00000000ffffffff 0000 01bb dnl | |
1651 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1652 | ||
0d56eaf2 | 1653 | dnl Ignore tp_src if not TCP/UDP/SCTP: |
410698cf BP |
1654 | # ip,nw_proto=21 |
1655 | # 11: 97 -> d7 | |
1656 | # 60: 01 -> 00 | |
1657 | # 61: bb -> 00 | |
1658 | 0000 0058 00000000 00000397 dnl | |
1659 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1660 | 0000 00 00 0800 00 15 00000000ffffffff 00000000ffffffff 01bb 0000 dnl | |
1661 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1662 | ||
0d56eaf2 | 1663 | dnl Ignore tp_dst if not TCP/UDP/SCTP: |
410698cf BP |
1664 | # ip,nw_proto=22 |
1665 | # 11: 57 -> d7 | |
1666 | # 62: 01 -> 00 | |
1667 | # 63: bb -> 00 | |
1668 | 0000 0058 00000000 00000357 dnl | |
1669 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1670 | 0000 00 00 0800 00 16 00000000ffffffff 00000000ffffffff 0000 01bb dnl | |
1671 | 00000000 00 000000 0000000000000000ffffffffffffffff | |
1672 | ||
097d4939 JR |
1673 | # mpls,mpls_label=284280 |
1674 | # 64: 12 -> 00 | |
1675 | # 65: 34 -> 04 | |
410698cf BP |
1676 | 0000 0058 00000000 000002f7 dnl |
1677 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1678 | 0000 00 00 8847 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1679 | 12345678 00 000000 0000000000000000ffffffffffffffff | |
1680 | ||
097d4939 JR |
1681 | # mplsm,mpls_tc=2 |
1682 | # 68: 5a -> 02 | |
410698cf BP |
1683 | 0000 0058 00000000 000001f7 dnl |
1684 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1685 | 0000 00 00 8848 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1686 | 00000000 5a 000000 0000000000000000ffffffffffffffff | |
1687 | ||
1688 | dnl mpls_label and mpls_tc must be ignored if dl_type is not MPLS: | |
1689 | # dl_type=0x1234 | |
1690 | # 10: 00 -> 03 | |
1691 | # 64: 12 -> 00 | |
1692 | # 65: 34 -> 00 | |
1693 | # 66: 56 -> 00 | |
1694 | # 67: 78 -> 00 | |
1695 | # 68: 5a -> 00 | |
1696 | 0000 0058 00000000 000000f7 dnl | |
1697 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1698 | 0000 00 00 1234 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1699 | 12345678 5a 000000 0000000000000000ffffffffffffffff | |
1700 | ||
969fc56c JS |
1701 | dnl metadata match: |
1702 | # metadata=0x1234567890abcdef | |
1703 | 0000 0058 00000000 000003ff dnl | |
1704 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1705 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1706 | 00000000 00 000000 1234567890abcdef0000000000000000 | |
1707 | ||
1708 | dnl metadata match: | |
1709 | # metadata=0x5555555555555555/0x5555555555555555 | |
410698cf BP |
1710 | 0000 0058 00000000 000003ff dnl |
1711 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1712 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
969fc56c JS |
1713 | 00000000 00 000000 5555555555555555aaaaaaaaaaaaaaaa |
1714 | ||
1715 | dnl metadata match: | |
1716 | # metadata=0x1234000090ab0000/0xffff0000ffff0000 | |
1717 | # 74: 56 -> 00 | |
1718 | # 75: 78 -> 00 | |
1719 | # 78: cd -> 00 | |
1720 | # 79: ef -> 00 | |
1721 | 0000 0058 00000000 000003ff dnl | |
1722 | 000000000000ffffffffffff 000000000000ffffffffffff dnl | |
1723 | 0000 00 00 0000 00 00 00000000ffffffff 00000000ffffffff 0000 0000 dnl | |
1724 | 00000000 00 000000 1234567890abcdef0000ffff0000ffff | |
410698cf BP |
1725 | |
1726 | ]) | |
1727 | sed '/^[[#&]]/d' < test-data > input.txt | |
1728 | sed -n 's/^# //p; /^$/p' < test-data > expout | |
1729 | sed -n 's/^& //p' < test-data > experr | |
1730 | AT_CAPTURE_FILE([input.txt]) | |
1731 | AT_CAPTURE_FILE([expout]) | |
1732 | AT_CAPTURE_FILE([experr]) | |
1733 | AT_CHECK( | |
1734 | [ovs-ofctl '-vPATTERN:console:%c|%p|%m' parse-ofp11-match < input.txt], | |
1735 | [0], [expout], [experr]) | |
1736 | AT_CLEANUP | |
1737 | ||
102ce766 EJ |
1738 | AT_SETUP([ovs-ofctl parse-nx-match loose]) |
1739 | AT_KEYWORDS([nx-match]) | |
1740 | AT_DATA([nx-match.txt], [dnl | |
178742f9 | 1741 | NXM_OF_IN_PORT(0001), 01020304(1111/3333), NXM_OF_ETH_TYPE(0800) |
508a9338 BP |
1742 | NXM_OF_IN_PORT(0001), ffff020800002320(11112222), NXM_OF_ETH_TYPE(0800) |
1743 | NXM_OF_IN_PORT(0001), ffff030800002320(1111/3333), NXM_OF_ETH_TYPE(0800) | |
102ce766 EJ |
1744 | ]) |
1745 | ||
1746 | AT_CHECK([ovs-ofctl --strict parse-nx-match < nx-match.txt], [0], [dnl | |
2e0525bc | 1747 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
508a9338 BP |
1748 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
1749 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
102ce766 EJ |
1750 | ]) |
1751 | ||
508a9338 BP |
1752 | AT_CHECK([ovs-ofctl parse-nx-match < nx-match.txt], [0], [dnl |
1753 | NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) | |
1754 | NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) | |
102ce766 EJ |
1755 | NXM_OF_IN_PORT(0001), NXM_OF_ETH_TYPE(0800) |
1756 | ]) | |
1757 | AT_CLEANUP | |
1758 | ||
c61f3870 | 1759 | AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.2)]) |
b5ae8913 SH |
1760 | AT_KEYWORDS([oxm]) |
1761 | AT_DATA([oxm.txt], [dnl | |
1762 | <any> | |
1763 | ||
1764 | # in port | |
1765 | OXM_OF_IN_PORT(00000000) | |
1766 | OXM_OF_IN_PORT(fffffffe) | |
1767 | ||
969fc56c JS |
1768 | # metadata |
1769 | OXM_OF_METADATA(5a5a5a5a5a5a5a5a) | |
1770 | OXM_OF_METADATA_W(0000000000000000/00000000ffffffff) | |
1771 | OXM_OF_METADATA_W(1234567890abcdef/ffff0000ffff0000) | |
1772 | OXM_OF_METADATA_W(1234567890abcdef/ffffffffffffffff) | |
fbcbc814 | 1773 | OXM_OF_METADATA_W(1234567890abcdef/0000000000000000) |
969fc56c | 1774 | |
b5ae8913 SH |
1775 | # eth dst |
1776 | OXM_OF_ETH_DST(0002e30f80a4) | |
1777 | OXM_OF_ETH_DST_W(010000000000/010000000000) | |
1778 | OXM_OF_ETH_DST_W(000000000000/010000000000) | |
1779 | OXM_OF_ETH_DST_W(ffffffffffff/010000000000) | |
1780 | OXM_OF_ETH_DST_W(0002e30f80a4/ffffffffffff) | |
fbcbc814 | 1781 | OXM_OF_ETH_DST_W(0002e30f80a4/000000000000) |
b5ae8913 SH |
1782 | OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) |
1783 | ||
1784 | # eth src | |
1785 | OXM_OF_ETH_SRC(020898456ddb) | |
1786 | ||
1787 | # eth type | |
1788 | OXM_OF_ETH_TYPE(0800) | |
1789 | OXM_OF_ETH_TYPE(0800) OXM_OF_IN_PORT(00000012) | |
1790 | ||
95f61ba8 SH |
1791 | # vlan |
1792 | OXM_OF_VLAN_VID(1009) OXM_OF_VLAN_VID(1009) # Duplicate Field | |
1793 | OXM_OF_VLAN_VID(f009) # Bad Value | |
8069b0da | 1794 | OXM_OF_VLAN_PCP(00) # Bad Pre-Requisite |
95f61ba8 SH |
1795 | OXM_OF_VLAN_VID(0000) # Packets without 802.1Q header or with VID=0 |
1796 | OXM_OF_VLAN_VID(1123) # Packets with VID=123, any PCP | |
1797 | OXM_OF_VLAN_VID(1123) OXM_OF_VLAN_PCP(01) # Packets with VID=123, PCP=1. | |
1798 | OXM_OF_VLAN_VID(0123) # Does not make sense (but supported anyway) | |
4b9f9232 SH |
1799 | OXM_OF_VLAN_VID_W(0123/0123) # Does not make sense (but supported anyway) |
1800 | OXM_OF_VLAN_VID_W(1123/0123) # Does not make sense (but supported anyway) | |
1801 | OXM_OF_VLAN_VID_W(0123/1123) # Does not make sense (but supported anyway) | |
8069b0da | 1802 | OXM_OF_VLAN_VID(0123) OXM_OF_VLAN_PCP(01) #Bad Pre-Requisite |
4b9f9232 SH |
1803 | OXM_OF_VLAN_VID_W(1123/1fff) # Packets with VID=123, any PCP. |
1804 | OXM_OF_VLAN_VID_W(1123/ffff) # Packets with VID=123, any PCP. | |
3947cc76 BP |
1805 | OXM_OF_VLAN_VID_W(0000/0000) # Packets with or without 802.1Q header |
1806 | OXM_OF_VLAN_VID_W(1103/1f0f), # Packets with # VID=123 (masked) | |
1807 | OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01) # Packets with VID=123 (masked), any PCP. | |
4b9f9232 SH |
1808 | OXM_OF_VLAN_VID_W(1000/1000) # Packets with any VID, any PCP |
1809 | OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) # Packets with any VID, PCP=1. | |
95f61ba8 | 1810 | |
1638b906 BP |
1811 | # IP TOS |
1812 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(f0) | |
1813 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(41) | |
1814 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_DSCP(3f) | |
178742f9 | 1815 | OXM_OF_IP_DSCP(3f) |
1638b906 | 1816 | |
b5ae8913 SH |
1817 | # IP ECN |
1818 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(03) | |
1819 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(06) | |
1820 | OXM_OF_IP_ECN(03) | |
1821 | ||
1822 | # IP protocol | |
1823 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) | |
1824 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(05) | |
1825 | OXM_OF_IP_PROTO(05) | |
1826 | ||
1827 | # IP source | |
1828 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC(ac100014) | |
1829 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFF0000) | |
fbcbc814 | 1830 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(C0a80000/FFFFFFFF) |
3947cc76 | 1831 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_SRC_W(00000000/00000000) |
b5ae8913 SH |
1832 | OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_SRC(ac100014) |
1833 | OXM_OF_IPV4_SRC_W(C0D80000/FFFF0000) | |
1834 | ||
1835 | # IP destination | |
1836 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST(ac100014) | |
3947cc76 | 1837 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a80000/FFFF0000) |
fbcbc814 | 1838 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(C0a88012/FFFFFFFF) |
3947cc76 | 1839 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV4_DST_W(00000000/00000000) |
b5ae8913 SH |
1840 | OXM_OF_IPV4_DST(ac100014) |
1841 | OXM_OF_ETH_TYPE(0806) OXM_OF_IPV4_DST_W(C0D80000/FFFF0000) | |
1842 | ||
1843 | # TCP source port | |
1844 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC(4231) | |
1845 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/F0F0) | |
fbcbc814 | 1846 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(5050/FFFF) |
3947cc76 | 1847 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_SRC_W(0000/0000) |
b5ae8913 SH |
1848 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_SRC(4231) |
1849 | ||
1850 | # TCP destination port | |
1851 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST(4231) | |
1852 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFF0) | |
fbcbc814 | 1853 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(FDE0/FFFF) |
3947cc76 | 1854 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_TCP_DST_W(0000/0000) |
b5ae8913 SH |
1855 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(07) OXM_OF_TCP_DST(4231) |
1856 | ||
1857 | # UDP source port | |
1858 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC(8732) | |
1859 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/01FF) | |
fbcbc814 | 1860 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0132/FFFF) |
3947cc76 | 1861 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_SRC_W(0000/0000) |
b5ae8913 SH |
1862 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_UDP_SRC(7823) |
1863 | ||
1864 | # UDP destination port | |
1865 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST(1782) | |
1866 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/F00F) | |
fbcbc814 | 1867 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(5005/FFFF) |
3947cc76 | 1868 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(11) OXM_OF_UDP_DST_W(0000/0000) |
b5ae8913 SH |
1869 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_UDP_DST(1293) |
1870 | ||
0d56eaf2 JS |
1871 | # SCTP source port |
1872 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC(8732) | |
1873 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/01FF) | |
1874 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0132/FFFF) | |
3947cc76 | 1875 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_SRC_W(0000/0000) |
0d56eaf2 JS |
1876 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(06) OXM_OF_SCTP_SRC(7823) |
1877 | ||
1878 | # SCTP destination port | |
1879 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST(1782) | |
1880 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/F00F) | |
1881 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(5005/FFFF) | |
3947cc76 | 1882 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(84) OXM_OF_SCTP_DST_W(0000/0000) |
0d56eaf2 JS |
1883 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(02) OXM_OF_SCTP_DST(1293) |
1884 | ||
b5ae8913 SH |
1885 | # ICMP type |
1886 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_TYPE(12) | |
1887 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_TYPE(10) | |
1888 | ||
1889 | # ICMP code | |
1890 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(01) OXM_OF_ICMPV4_CODE(12) | |
1891 | OXM_OF_ETH_TYPE(0800) OXM_OF_IP_PROTO(00) OXM_OF_ICMPV4_CODE(10) | |
1892 | OXM_OF_ETH_TYPE(0800) OXM_OF_ICMPV4_CODE(10) | |
1893 | OXM_OF_ICMPV4_CODE(00) | |
1894 | ||
1895 | # ARP opcode | |
1896 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) | |
1897 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(1111) | |
1898 | OXM_OF_ETH_TYPE(0000) OXM_OF_ARP_OP(0001) | |
1899 | OXM_OF_ARP_OP(0001) | |
1900 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_OP(0001) OXM_OF_ARP_OP(0001) | |
1901 | ||
1902 | # ARP source protocol address | |
1903 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA(ac100014) | |
3947cc76 | 1904 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81200/FFFFFF00) |
fbcbc814 | 1905 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(C0a81234/FFFFFFFF) |
3947cc76 | 1906 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SPA_W(00000000/00000000) |
b5ae8913 | 1907 | OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SPA(ac100014) |
178742f9 | 1908 | OXM_OF_ARP_SPA_W(C0D80000/FFFF0000) |
b5ae8913 SH |
1909 | |
1910 | # ARP destination protocol address | |
1911 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA(ac100014) | |
3947cc76 | 1912 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a81200/FFFFFF00) |
fbcbc814 | 1913 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(C0a812fe/FFFFFFFF) |
3947cc76 | 1914 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_TPA_W(00000000/00000000) |
b5ae8913 SH |
1915 | OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_TPA(ac100014) |
1916 | OXM_OF_ARP_TPA_W(C0D80000/FFFF0000) | |
1917 | ||
1918 | # ARP source hardware address | |
1919 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA(0002e30f80a4) | |
1920 | OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_SHA(0002e30f80a4) | |
1921 | OXM_OF_ARP_SHA(0002e30f80a4) | |
e878338b | 1922 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(0002e30f80a4/ffffffffffff) |
3947cc76 BP |
1923 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000000/000000000000) |
1924 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_SHA_W(000000000004/00000000000f) | |
b5ae8913 SH |
1925 | |
1926 | # ARP destination hardware address | |
1927 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA(0002e30f80a4) | |
1928 | OXM_OF_ETH_TYPE(0800) OXM_OF_ARP_THA(0002e30f80a4) | |
1929 | OXM_OF_ARP_THA(0002e30f80a4) | |
e878338b | 1930 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(0002e30f80a4/ffffffffffff) |
3947cc76 BP |
1931 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000000/000000000000) |
1932 | OXM_OF_ETH_TYPE(0806) OXM_OF_ARP_THA_W(000000000004/00000000000f) | |
b5ae8913 SH |
1933 | |
1934 | # IPv6 source | |
1935 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) | |
1936 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) | |
1937 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
fbcbc814 | 1938 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) |
3947cc76 | 1939 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_SRC_W(00000000000000000000000000000000/00000000000000000000000000000000) |
b5ae8913 SH |
1940 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) |
1941 | ||
1942 | # IPv6 destination | |
1943 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) | |
1944 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) | |
1945 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
fbcbc814 | 1946 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffffffffffffffffffff) |
3947cc76 | 1947 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_DST_W(00000000000000000000000000000000/00000000000000000000000000000000) |
b5ae8913 SH |
1948 | OXM_OF_ETH_TYPE(0800) OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) |
1949 | ||
626186c3 SH |
1950 | # IPv6 Flow Label |
1951 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(1000000f) | |
1952 | OXM_OF_IPV6_FLABEL(0000000f) | |
1953 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL(0000000f) | |
32455024 SH |
1954 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/0000000f) |
1955 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/000fffff) | |
3947cc76 | 1956 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/000ffff0) |
32455024 SH |
1957 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/100fffff) |
1958 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(0000000f/ffffffff) | |
3947cc76 | 1959 | OXM_OF_ETH_TYPE(86dd) OXM_OF_IPV6_FLABEL_W(00000000/00000000) |
626186c3 | 1960 | |
b5ae8913 SH |
1961 | # ND source hardware address |
1962 | 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) | |
1963 | 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) | |
1964 | 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) | |
1965 | 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) | |
1966 | ||
1967 | # ND destination hardware address | |
1968 | 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) | |
1969 | 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) | |
1970 | 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) | |
1971 | 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) | |
1972 | ||
a678b23e BP |
1973 | # Registers 0, 1, and 2. |
1974 | NXM_NX_REG0(acebdf56) | |
1975 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
1976 | NXM_NX_REG0(a0e0d050) | |
1977 | NXM_NX_REG1(acebdf56) | |
1978 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) | |
1979 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) | |
1980 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) | |
1981 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) | |
1982 | ||
1983 | # Extended registers 0, 1, and 2. | |
1984 | # (For OpenFlow 1.2, OVS transforms these into its extension registers.) | |
1985 | OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) | |
1986 | OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) | |
1987 | OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) | |
1988 | OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) | |
1989 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) | |
1990 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) | |
1991 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) | |
1992 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) | |
1993 | ||
b5ae8913 | 1994 | # Invalid field number. |
178742f9 | 1995 | 01020304(1111/3333) |
508a9338 BP |
1996 | |
1997 | # Invalid field numbers (experimenter OXM). | |
1998 | ffff020800002320(11112222) | |
1999 | ffff030800002320(1111/3333) | |
b5ae8913 | 2000 | ]) |
9d84066c | 2001 | AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow12 < oxm.txt], |
e1cfc4e4 | 2002 | [0], [dnl |
b5ae8913 SH |
2003 | <any> |
2004 | ||
2005 | # in port | |
2006 | OXM_OF_IN_PORT(00000000) | |
2007 | OXM_OF_IN_PORT(fffffffe) | |
2008 | ||
969fc56c JS |
2009 | # metadata |
2010 | OXM_OF_METADATA(5a5a5a5a5a5a5a5a) | |
2011 | OXM_OF_METADATA_W(0000000000000000/00000000ffffffff) | |
3947cc76 | 2012 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
969fc56c | 2013 | OXM_OF_METADATA(1234567890abcdef) |
3947cc76 | 2014 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
969fc56c | 2015 | |
b5ae8913 SH |
2016 | # eth dst |
2017 | OXM_OF_ETH_DST(0002e30f80a4) | |
2018 | OXM_OF_ETH_DST_W(010000000000/010000000000) | |
2019 | OXM_OF_ETH_DST_W(000000000000/010000000000) | |
3947cc76 | 2020 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
b5ae8913 | 2021 | OXM_OF_ETH_DST(0002e30f80a4) |
3947cc76 | 2022 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
b5ae8913 SH |
2023 | OXM_OF_ETH_DST_W(0002e30f80a4/feffffffffff) |
2024 | ||
2025 | # eth src | |
2026 | OXM_OF_ETH_SRC(020898456ddb) | |
2027 | ||
2028 | # eth type | |
2029 | OXM_OF_ETH_TYPE(0800) | |
2030 | OXM_OF_IN_PORT(00000012), OXM_OF_ETH_TYPE(0800) | |
2031 | ||
95f61ba8 SH |
2032 | # vlan |
2033 | nx_pull_match() returned error OFPBMC_DUP_FIELD | |
2034 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
8069b0da | 2035 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
95f61ba8 SH |
2036 | OXM_OF_VLAN_VID(0000) |
2037 | OXM_OF_VLAN_VID(1123) | |
2038 | OXM_OF_VLAN_VID(1123), OXM_OF_VLAN_PCP(01) | |
2039 | OXM_OF_VLAN_VID(0123) | |
4b9f9232 | 2040 | OXM_OF_VLAN_VID_W(0123/0123) |
3947cc76 | 2041 | nx_pull_match() returned error OFPBMC_BAD_WILDCARDS |
4b9f9232 | 2042 | OXM_OF_VLAN_VID_W(0123/1123) |
8069b0da | 2043 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
4b9f9232 SH |
2044 | OXM_OF_VLAN_VID(1123) |
2045 | OXM_OF_VLAN_VID(1123) | |
2046 | <any> | |
2047 | OXM_OF_VLAN_VID_W(1103/1f0f) | |
2048 | OXM_OF_VLAN_VID_W(1103/1f0f), OXM_OF_VLAN_PCP(01) | |
2049 | OXM_OF_VLAN_VID_W(1000/1000) | |
2050 | OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) | |
95f61ba8 | 2051 | |
1638b906 BP |
2052 | # IP TOS |
2053 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
2054 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
2055 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_DSCP(3f) | |
2056 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2057 | ||
b5ae8913 SH |
2058 | # IP ECN |
2059 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_ECN(03) | |
2060 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
2061 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2062 | ||
2063 | # IP protocol | |
2064 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01) | |
2065 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(05) | |
2066 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2067 | ||
2068 | # IP source | |
2069 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(ac100014) | |
2070 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC_W(c0a80000/ffff0000) | |
fbcbc814 SH |
2071 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_SRC(c0a80000) |
2072 | OXM_OF_ETH_TYPE(0800) | |
b5ae8913 SH |
2073 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2074 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2075 | ||
2076 | # IP destination | |
2077 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(ac100014) | |
2078 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST_W(c0a80000/ffff0000) | |
fbcbc814 SH |
2079 | OXM_OF_ETH_TYPE(0800), OXM_OF_IPV4_DST(c0a88012) |
2080 | OXM_OF_ETH_TYPE(0800) | |
b5ae8913 SH |
2081 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2082 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2083 | ||
2084 | # TCP source port | |
2085 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(4231) | |
2086 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC_W(5050/f0f0) | |
fbcbc814 SH |
2087 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_SRC(5050) |
2088 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06) | |
b5ae8913 SH |
2089 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2090 | ||
2091 | # TCP destination port | |
2092 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(4231) | |
2093 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST_W(fde0/fff0) | |
fbcbc814 SH |
2094 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_DST(fde0) |
2095 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06) | |
b5ae8913 SH |
2096 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2097 | ||
2098 | # UDP source port | |
2099 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(8732) | |
2100 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC_W(0132/01ff) | |
fbcbc814 SH |
2101 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_SRC(0132) |
2102 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11) | |
b5ae8913 SH |
2103 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2104 | ||
2105 | # UDP destination port | |
2106 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(1782) | |
2107 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST_W(5005/f00f) | |
fbcbc814 SH |
2108 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11), OXM_OF_UDP_DST(5005) |
2109 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(11) | |
b5ae8913 SH |
2110 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2111 | ||
0d56eaf2 JS |
2112 | # SCTP source port |
2113 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(8732) | |
2114 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC_W(0132/01ff) | |
2115 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_SRC(0132) | |
2116 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84) | |
2117 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2118 | ||
2119 | # SCTP destination port | |
2120 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(1782) | |
2121 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST_W(5005/f00f) | |
2122 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84), OXM_OF_SCTP_DST(5005) | |
2123 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(84) | |
2124 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2125 | ||
b5ae8913 SH |
2126 | # ICMP type |
2127 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_TYPE(12) | |
2128 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2129 | ||
2130 | # ICMP code | |
2131 | OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(01), OXM_OF_ICMPV4_CODE(12) | |
2132 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2133 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2134 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2135 | ||
2136 | # ARP opcode | |
2137 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_OP(0001) | |
2138 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
2139 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2140 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2141 | nx_pull_match() returned error OFPBMC_DUP_FIELD | |
2142 | ||
2143 | # ARP source protocol address | |
2144 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(ac100014) | |
2145 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA_W(c0a81200/ffffff00) | |
fbcbc814 SH |
2146 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SPA(c0a81234) |
2147 | OXM_OF_ETH_TYPE(0806) | |
b5ae8913 SH |
2148 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2149 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2150 | ||
2151 | # ARP destination protocol address | |
2152 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(ac100014) | |
2153 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA_W(c0a81200/ffffff00) | |
fbcbc814 SH |
2154 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_TPA(c0a812fe) |
2155 | OXM_OF_ETH_TYPE(0806) | |
b5ae8913 SH |
2156 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2157 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2158 | ||
2159 | # ARP source hardware address | |
2160 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4) | |
2161 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2162 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
e878338b SH |
2163 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA(0002e30f80a4) |
2164 | OXM_OF_ETH_TYPE(0806) | |
2165 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_SHA_W(000000000004/00000000000f) | |
b5ae8913 SH |
2166 | |
2167 | # ARP destination hardware address | |
2168 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4) | |
2169 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2170 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
e878338b SH |
2171 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA(0002e30f80a4) |
2172 | OXM_OF_ETH_TYPE(0806) | |
2173 | OXM_OF_ETH_TYPE(0806), OXM_OF_ARP_THA_W(000000000004/00000000000f) | |
b5ae8913 SH |
2174 | |
2175 | # IPv6 source | |
2176 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010002000300040005) | |
2177 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2178 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
fbcbc814 SH |
2179 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_SRC(20010db83c4d00010000000000000000) |
2180 | OXM_OF_ETH_TYPE(86dd) | |
b5ae8913 SH |
2181 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2182 | ||
2183 | # IPv6 destination | |
2184 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010002000300040005) | |
2185 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2186 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST_W(20010db83c4d00010000000000000000/ffffffffffffffff0000000000000000) | |
fbcbc814 SH |
2187 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_DST(20010db83c4d00010000000000000000) |
2188 | OXM_OF_ETH_TYPE(86dd) | |
b5ae8913 SH |
2189 | nx_pull_match() returned error OFPBMC_BAD_PREREQ |
2190 | ||
626186c3 SH |
2191 | # IPv6 Flow Label |
2192 | nx_pull_match() returned error OFPBMC_BAD_VALUE | |
2193 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2194 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) | |
32455024 SH |
2195 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(0000000f/0000000f) |
2196 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) | |
2197 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL_W(00000000/000ffff0) | |
2198 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) | |
2199 | OXM_OF_ETH_TYPE(86dd), OXM_OF_IPV6_FLABEL(0000000f) | |
2200 | OXM_OF_ETH_TYPE(86dd) | |
626186c3 | 2201 | |
b5ae8913 SH |
2202 | # ND source hardware address |
2203 | 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) | |
2204 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2205 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2206 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2207 | ||
2208 | # ND destination hardware address | |
2209 | 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) | |
2210 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2211 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2212 | nx_pull_match() returned error OFPBMC_BAD_PREREQ | |
2213 | ||
a678b23e BP |
2214 | # Registers 0, 1, and 2. |
2215 | NXM_NX_REG0(acebdf56) | |
2216 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
2217 | NXM_NX_REG0(a0e0d050) | |
2218 | NXM_NX_REG1(acebdf56) | |
2219 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) | |
2220 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) | |
2221 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) | |
2222 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) | |
2223 | ||
2224 | # Extended registers 0, 1, and 2. | |
2225 | # (For OpenFlow 1.2, OVS transforms these into its extension registers.) | |
2226 | NXM_NX_REG0(acebdf56) | |
2227 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
2228 | NXM_NX_REG0(a0e0d050) | |
2229 | NXM_NX_REG1(acebdf56) | |
2230 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) | |
2231 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) | |
2232 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) | |
2233 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) | |
2234 | ||
b5ae8913 SH |
2235 | # Invalid field number. |
2236 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
508a9338 BP |
2237 | |
2238 | # Invalid field numbers (experimenter OXM). | |
2239 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
2240 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
e1cfc4e4 BP |
2241 | ], [stderr]) |
2242 | ||
2243 | # Check that at least the first warning made it. (It's rate-limited | |
2244 | # so a variable number could show up, especially under valgrind etc.) | |
3947cc76 | 2245 | AT_CHECK([grep '1-bits in value' stderr | sed 1q], [0], [dnl |
508a9338 | 2246 | nx_match|WARN|Rejecting NXM/OXM entry 0:32768:2:1:16 with 1-bits in value for bits wildcarded by the mask. |
b5ae8913 | 2247 | ]) |
e1cfc4e4 BP |
2248 | |
2249 | # Check that there wasn't any other stderr output. | |
3947cc76 | 2250 | AT_CHECK([grep -v '1-bits in value' stderr], [1]) |
b5ae8913 SH |
2251 | AT_CLEANUP |
2252 | ||
c61f3870 BP |
2253 | AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.3)]) |
2254 | AT_KEYWORDS([oxm]) | |
2255 | AT_DATA([oxm.txt], [dnl | |
2256 | # actset_output | |
2257 | ONFOXM_ET_ACTSET_OUTPUT(00000000) | |
2258 | ONFOXM_ET_ACTSET_OUTPUT(fffffffe) | |
2259 | ONFOXM_ET_ACTSET_OUTPUT(fffffff7) | |
2260 | OXM_OF_ACTSET_OUTPUT(00000000) | |
2261 | OXM_OF_ACTSET_OUTPUT(fffffffe) | |
2262 | OXM_OF_ACTSET_OUTPUT(fffffff7) | |
2263 | ]) | |
2264 | AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow13 < oxm.txt], | |
2265 | [0], [dnl | |
2266 | # actset_output | |
2267 | ONFOXM_ET_ACTSET_OUTPUT(00000000) | |
2268 | ONFOXM_ET_ACTSET_OUTPUT(fffffffe) | |
2269 | ONFOXM_ET_ACTSET_OUTPUT(fffffff7) | |
2270 | ONFOXM_ET_ACTSET_OUTPUT(00000000) | |
2271 | ONFOXM_ET_ACTSET_OUTPUT(fffffffe) | |
2272 | ONFOXM_ET_ACTSET_OUTPUT(fffffff7) | |
2273 | ], []) | |
2274 | AT_CLEANUP | |
2275 | ||
a678b23e BP |
2276 | AT_SETUP([ovs-ofctl parse-oxm (OpenFlow 1.5)]) |
2277 | AT_KEYWORDS([oxm]) | |
2278 | AT_DATA([oxm.txt], [dnl | |
2279 | # Extended registers 0 and 1. | |
2280 | OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) | |
2281 | OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) | |
2282 | OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) | |
2283 | OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) | |
2284 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) | |
2285 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) | |
2286 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) | |
2287 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) | |
2288 | ||
2289 | # Registers 0, 1, and 2. | |
2290 | # (OpenFlow 1.5 transforms these into the standard "xregs".) | |
2291 | NXM_NX_REG0(acebdf56) | |
2292 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0) | |
2293 | NXM_NX_REG0(a0e0d050) | |
2294 | NXM_NX_REG1(acebdf56) | |
2295 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1_W(a0e0d050/f0f0f0f0) | |
2296 | NXM_NX_REG0_W(a0e0d050/f0f0f0f0), NXM_NX_REG1(a0e0d050) | |
2297 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2_W(a0e0d050/f0f0f0f0) | |
2298 | NXM_NX_REG1_W(a0e0d050/f0f0f0f0), NXM_NX_REG2(a0e0d050) | |
c61f3870 BP |
2299 | |
2300 | # actset_output | |
2301 | ONFOXM_ET_ACTSET_OUTPUT(00000000) | |
2302 | ONFOXM_ET_ACTSET_OUTPUT(fffffffe) | |
2303 | ONFOXM_ET_ACTSET_OUTPUT(fffffff7) | |
2304 | OXM_OF_ACTSET_OUTPUT(00000000) | |
2305 | OXM_OF_ACTSET_OUTPUT(fffffffe) | |
2306 | OXM_OF_ACTSET_OUTPUT(fffffff7) | |
a678b23e BP |
2307 | ]) |
2308 | AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' --strict parse-oxm OpenFlow15 < oxm.txt], | |
2309 | [0], [dnl | |
2310 | # Extended registers 0 and 1. | |
2311 | OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) | |
2312 | OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) | |
2313 | OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) | |
2314 | OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) | |
2315 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) | |
2316 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) | |
2317 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) | |
2318 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) | |
2319 | ||
2320 | # Registers 0, 1, and 2. | |
2321 | # (OpenFlow 1.5 transforms these into the standard "xregs".) | |
2322 | OXM_OF_PKT_REG0_W(acebdf5600000000/ffffffff00000000) | |
2323 | OXM_OF_PKT_REG0_W(a0e0d05000000000/f0f0f0f000000000) | |
2324 | OXM_OF_PKT_REG0_W(a0e0d05000000000/ffffffff00000000) | |
2325 | OXM_OF_PKT_REG0_W(00000000acebdf56/00000000ffffffff) | |
2326 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0f0f0f0f0) | |
2327 | OXM_OF_PKT_REG0_W(a0e0d050a0e0d050/f0f0f0f0ffffffff) | |
2328 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/f0f0f0f000000000) | |
2329 | OXM_OF_PKT_REG0_W(00000000a0e0d050/00000000f0f0f0f0), OXM_OF_PKT_REG1_W(a0e0d05000000000/ffffffff00000000) | |
c61f3870 BP |
2330 | |
2331 | # actset_output | |
2332 | OXM_OF_ACTSET_OUTPUT(00000000) | |
2333 | OXM_OF_ACTSET_OUTPUT(fffffffe) | |
2334 | OXM_OF_ACTSET_OUTPUT(fffffff7) | |
2335 | OXM_OF_ACTSET_OUTPUT(00000000) | |
2336 | OXM_OF_ACTSET_OUTPUT(fffffffe) | |
2337 | OXM_OF_ACTSET_OUTPUT(fffffff7) | |
a678b23e BP |
2338 | ], []) |
2339 | AT_CLEANUP | |
2340 | ||
b5ae8913 SH |
2341 | AT_SETUP([ovs-ofctl parse-oxm loose]) |
2342 | AT_KEYWORDS([oxm]) | |
2343 | AT_DATA([oxm.txt], [dnl | |
178742f9 | 2344 | OXM_OF_IN_PORT(00000001), 01020304(1111/3333), OXM_OF_ETH_TYPE(0800) |
508a9338 BP |
2345 | OXM_OF_IN_PORT(00000001), ffff020800002320(11112222), OXM_OF_ETH_TYPE(0800) |
2346 | OXM_OF_IN_PORT(00000001), ffff030800002320(1111/3333), OXM_OF_ETH_TYPE(0800) | |
b5ae8913 SH |
2347 | ]) |
2348 | ||
9d84066c | 2349 | AT_CHECK([ovs-ofctl --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl |
b5ae8913 | 2350 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
508a9338 BP |
2351 | nx_pull_match() returned error OFPBMC_BAD_FIELD |
2352 | nx_pull_match() returned error OFPBMC_BAD_FIELD | |
b5ae8913 SH |
2353 | ]) |
2354 | ||
9d84066c | 2355 | AT_CHECK([ovs-ofctl parse-oxm OpenFlow12 < oxm.txt], [0], [dnl |
b5ae8913 | 2356 | OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) |
508a9338 BP |
2357 | OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) |
2358 | OXM_OF_IN_PORT(00000001), OXM_OF_ETH_TYPE(0800) | |
2359 | ]) | |
2360 | AT_CLEANUP | |
2361 | ||
2362 | AT_SETUP([experimenter OXM encoding]) | |
2363 | AT_DATA([oxm.txt], [dnl | |
2364 | NXM_NX_DP_HASH(01234567) | |
2365 | NXOXM_ET_DP_HASH(01234567) | |
2366 | ||
2367 | NXM_NX_DP_HASH_W(01234567/0fffffff) | |
2368 | NXOXM_ET_DP_HASH_W(01234567/0fffffff) | |
2369 | ]) | |
2370 | ||
2371 | # To allow for testing experimenter OXM, which doesn't really have many | |
2372 | # examples in the wild, we've defined a variant of NXM_NX_DP_HASH that uses | |
2373 | # the experimenter OXM mechanism, called NXOXM_ET_DP_HASH. We've defined | |
2374 | # it as if it were introduced with OpenFlow 1.5, which gives us the | |
2375 | # opportunity to see that both forms are accepted in all OpenFlow versions | |
2376 | # but the experimenter form is used for encoding in OF1.5+. | |
2377 | # | |
2378 | # First verify that both forms are accepted and NXOXM_ET_DP_HASH is encoded | |
2379 | # in OF1.5. | |
2380 | AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow15 < oxm.txt], [0], [dnl | |
2381 | NXOXM_ET_DP_HASH(01234567) | |
2382 | 00000000 00 01 00 10 ff ff 00 08-00 00 23 20 01 23 45 67 @&t@ | |
2383 | NXOXM_ET_DP_HASH(01234567) | |
2384 | 00000000 00 01 00 10 ff ff 00 08-00 00 23 20 01 23 45 67 @&t@ | |
2385 | ||
2386 | NXOXM_ET_DP_HASH_W(01234567/0fffffff) | |
2387 | 00000000 00 01 00 14 ff ff 01 0c-00 00 23 20 01 23 45 67 @&t@ | |
2388 | 00000010 0f ff ff ff 00 00 00 00- | |
2389 | NXOXM_ET_DP_HASH_W(01234567/0fffffff) | |
2390 | 00000000 00 01 00 14 ff ff 01 0c-00 00 23 20 01 23 45 67 @&t@ | |
2391 | 00000010 0f ff ff ff 00 00 00 00- | |
2392 | ]) | |
2393 | ||
2394 | # Then verify that both forms are accepted and NXM_NX_DP_HASH is encoded | |
2395 | # in OF1.2. | |
2396 | AT_CHECK([ovs-ofctl -m --strict parse-oxm OpenFlow12 < oxm.txt], [0], [dnl | |
2397 | NXM_NX_DP_HASH(01234567) | |
2398 | 00000000 00 01 00 0c 00 01 46 04-01 23 45 67 00 00 00 00 @&t@ | |
2399 | NXM_NX_DP_HASH(01234567) | |
2400 | 00000000 00 01 00 0c 00 01 46 04-01 23 45 67 00 00 00 00 @&t@ | |
2401 | ||
2402 | NXM_NX_DP_HASH_W(01234567/0fffffff) | |
2403 | 00000000 00 01 00 10 00 01 47 08-01 23 45 67 0f ff ff ff @&t@ | |
2404 | NXM_NX_DP_HASH_W(01234567/0fffffff) | |
2405 | 00000000 00 01 00 10 00 01 47 08-01 23 45 67 0f ff ff ff @&t@ | |
b5ae8913 SH |
2406 | ]) |
2407 | AT_CLEANUP | |
2408 | ||
52ca734e BP |
2409 | AT_SETUP([check TCP flags expression in OXM and NXM]) |
2410 | # NXM/OXM input for matching on TCP flags. | |
2411 | tcp_flags='OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff)' | |
2412 | ||
2413 | # Check that marshaling into NXM gives all NXM headers. | |
2414 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-nxm], [0], | |
2415 | [NXM_OF_ETH_TYPE(0800), NXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff) | |
2416 | ]) | |
2417 | ||
ff057509 BP |
2418 | # Check that marshaling in OXM for OF1.2 gives OXM headers except for |
2419 | # TCP flags, which didn't have an OXM definition. | |
2420 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow12], [0], | |
2421 | [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), NXM_NX_TCP_FLAGS(0fff) | |
2422 | ]) | |
2423 | ||
2424 | # Check that marshaling in OXM for OF1.3 and OF1.4 gives OXM headers, | |
2425 | # including the ONF extension for TCP flags introduced in OF1.3. | |
2426 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow13], [0], | |
2427 | [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff) | |
2428 | ]) | |
2429 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow14], [0], | |
2430 | [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), ONFOXM_ET_TCP_FLAGS(0fff) | |
52ca734e | 2431 | ]) |
52ca734e BP |
2432 | |
2433 | # OpenFlow 1.5 added an OXM header for TCP flags: | |
2434 | AT_CHECK([echo "$tcp_flags" | ovs-ofctl parse-oxm OpenFlow15], [0], | |
2435 | [OXM_OF_ETH_TYPE(0800), OXM_OF_IP_PROTO(06), OXM_OF_TCP_FLAGS(0fff) | |
2436 | ]) | |
2437 | AT_CLEANUP | |
2438 | ||
df778240 BP |
2439 | dnl Check all of the patterns mentioned in the "VLAN Matching" section |
2440 | dnl in the DESIGN file at top level. | |
2441 | AT_SETUP([ovs-ofctl check-vlan]) | |
2442 | AT_KEYWORDS([VLAN]) | |
2443 | ||
2444 | dnl [1] | |
2445 | AT_CHECK([ovs-ofctl check-vlan 0000 0000], [0], [dnl | |
2446 | -> 0000/0000 | |
2447 | NXM: <any> -> 0000/0000 | |
476a0e9e | 2448 | OXM: <any> -> 0000/0000,-- |
df778240 BP |
2449 | OF1.0: 0000/1,00/1 -> 0000/0000 |
2450 | OF1.1: 0000/1,00/1 -> 0000/0000 | |
2451 | ]) | |
2452 | ||
2453 | dnl [2] | |
2454 | AT_CHECK([ovs-ofctl check-vlan 0000 ffff], [0], [dnl | |
2455 | vlan_tci=0x0000 -> 0000/ffff | |
2456 | NXM: NXM_OF_VLAN_TCI(0000) -> 0000/ffff | |
476a0e9e | 2457 | OXM: OXM_OF_VLAN_VID(0000) -> 0000/1fff,-- |
053df7bd | 2458 | OF1.0: ffff/0,00/0 -> 0000/ffff |
df778240 BP |
2459 | OF1.1: ffff/0,00/1 -> 0000/ffff |
2460 | ]) | |
2461 | ||
2462 | dnl [3] | |
2463 | AT_CHECK([ovs-ofctl check-vlan 1abc 1fff], [0], [dnl | |
2464 | dl_vlan=2748 -> 1abc/1fff | |
2465 | NXM: NXM_OF_VLAN_TCI_W(1abc/1fff) -> 1abc/1fff | |
476a0e9e | 2466 | OXM: OXM_OF_VLAN_VID(1abc) -> 1abc/1fff,-- |
df778240 BP |
2467 | OF1.0: 0abc/0,00/1 -> 1abc/1fff |
2468 | OF1.1: 0abc/0,00/1 -> 1abc/1fff | |
2469 | ]) | |
2470 | ||
2471 | dnl [4] | |
2472 | AT_CHECK([ovs-ofctl check-vlan b000 f000], [0], [dnl | |
2473 | dl_vlan_pcp=5 -> b000/f000 | |
2474 | NXM: NXM_OF_VLAN_TCI_W(b000/f000) -> b000/f000 | |
476a0e9e | 2475 | OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(05) -> 1000/1000,05 |
df778240 BP |
2476 | OF1.0: 0000/1,05/0 -> b000/f000 |
2477 | OF1.1: fffe/0,05/0 -> b000/f000 | |
2478 | ]) | |
2479 | ||
2480 | dnl [5] | |
2481 | AT_CHECK([ovs-ofctl check-vlan babc ffff], [0], [dnl | |
2482 | dl_vlan=2748,dl_vlan_pcp=5 -> babc/ffff | |
2483 | NXM: NXM_OF_VLAN_TCI(babc) -> babc/ffff | |
476a0e9e | 2484 | OXM: OXM_OF_VLAN_VID(1abc), OXM_OF_VLAN_PCP(05) -> 1abc/1fff,05 |
df778240 BP |
2485 | OF1.0: 0abc/0,05/0 -> babc/ffff |
2486 | OF1.1: 0abc/0,05/0 -> babc/ffff | |
2487 | ]) | |
2488 | ||
2489 | dnl [6] | |
2490 | AT_CHECK([ovs-ofctl check-vlan 0000 0fff], [0], [dnl | |
2491 | vlan_tci=0x0000/0x0fff -> 0000/0fff | |
2492 | NXM: NXM_OF_VLAN_TCI_W(0000/0fff) -> 0000/0fff | |
476a0e9e | 2493 | OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,-- |
df778240 BP |
2494 | OF1.0: 0000/0,00/1 -> 1000/1fff |
2495 | OF1.1: 0000/0,00/1 -> 1000/1fff | |
2496 | ]) | |
2497 | ||
2498 | dnl [7] | |
2499 | AT_CHECK([ovs-ofctl check-vlan 0000 f000], [0], [dnl | |
2500 | vlan_tci=0x0000/0xf000 -> 0000/f000 | |
2501 | NXM: NXM_OF_VLAN_TCI_W(0000/f000) -> 0000/f000 | |
476a0e9e | 2502 | OXM: OXM_OF_VLAN_VID_W(0000/1000) -> 0000/1000,-- |
053df7bd | 2503 | OF1.0: ffff/0,00/0 -> 0000/ffff |
df778240 BP |
2504 | OF1.1: ffff/0,00/1 -> 0000/ffff |
2505 | ]) | |
2506 | ||
2507 | dnl [8] | |
2508 | AT_CHECK([ovs-ofctl check-vlan 0000 efff], [0], [dnl | |
2509 | vlan_tci=0x0000/0xefff -> 0000/efff | |
2510 | NXM: NXM_OF_VLAN_TCI_W(0000/efff) -> 0000/efff | |
476a0e9e | 2511 | OXM: OXM_OF_VLAN_VID_W(0000/0fff) -> 0000/0fff,-- |
df778240 BP |
2512 | OF1.0: 0000/0,00/0 -> 1000/ffff |
2513 | OF1.1: 0000/0,00/0 -> 1000/ffff | |
2514 | ]) | |
2515 | ||
2516 | dnl [9] | |
2517 | AT_CHECK([ovs-ofctl check-vlan 1001 1001], [0], [dnl | |
2518 | vlan_tci=0x1001/0x1001 -> 1001/1001 | |
2519 | NXM: NXM_OF_VLAN_TCI_W(1001/1001) -> 1001/1001 | |
476a0e9e | 2520 | OXM: OXM_OF_VLAN_VID_W(1001/1001) -> 1001/1001,-- |
df778240 BP |
2521 | OF1.0: 0001/0,00/1 -> 1001/1fff |
2522 | OF1.1: 0001/0,00/1 -> 1001/1fff | |
2523 | ]) | |
2524 | ||
2525 | dnl [10] | |
2526 | AT_CHECK([ovs-ofctl check-vlan 3000 3000], [0], [dnl | |
2527 | vlan_tci=0x3000/0x3000 -> 3000/3000 | |
2528 | NXM: NXM_OF_VLAN_TCI_W(3000/3000) -> 3000/3000 | |
476a0e9e | 2529 | OXM: OXM_OF_VLAN_VID_W(1000/1000), OXM_OF_VLAN_PCP(01) -> 1000/1000,01 |
df778240 BP |
2530 | OF1.0: 0000/1,01/0 -> 3000/f000 |
2531 | OF1.1: fffe/0,01/0 -> 3000/f000 | |
2532 | ]) | |
2533 | AT_CHECK | |
2534 | AT_CLEANUP | |
2535 | ||
7525e578 JS |
2536 | dnl Check that "-F openflow10" rejects a flow_mod with unsupported features, |
2537 | dnl such as tunnels and metadata. | |
2538 | AT_SETUP([ovs-ofctl -F option and NXM features]) | |
0fbc9f11 | 2539 | AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy tun_id=123,actions=drop], |
aa233d57 | 2540 | [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10) |
0fbc9f11 | 2541 | ]) |
7525e578 | 2542 | AT_CHECK([ovs-ofctl -F openflow10 add-flow dummy metadata=123,actions=drop], |
aa233d57 | 2543 | [1], [], [ovs-ofctl: none of the usable flow formats (NXM,OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10) |
7525e578 | 2544 | ]) |
0fbc9f11 BP |
2545 | AT_CLEANUP |
2546 | ||
2547 | dnl Check that "-F nxm" really forces add-flow to use the NXM flow format. | |
2548 | dnl (If it doesn't, then either the tun_id won't show up at all, or it will | |
2549 | dnl additionally show up as the top 32 bits of the cookie.) This checks | |
2550 | dnl for regression against bug #4566. | |
2551 | AT_SETUP([ovs-ofctl -F option with flow_mods]) | |
023e1e0a | 2552 | OVS_VSWITCHD_START |
0fbc9f11 | 2553 | AT_CHECK([ovs-ofctl -F nxm add-flow br0 tun_id=0x12345678,actions=drop]) |
ef0ce8ae | 2554 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [dnl |
0fbc9f11 | 2555 | NXST_FLOW reply: |
ef0ce8ae | 2556 | tun_id=0x12345678 actions=drop |
0fbc9f11 | 2557 | ]) |
023e1e0a | 2558 | OVS_VSWITCHD_STOP |
0fbc9f11 | 2559 | AT_CLEANUP |
f9cbfbe4 BP |
2560 | |
2561 | dnl Check that "-F openflow10" is really honored on dump-flows. | |
2562 | dnl (If it isn't, then dump-flows will show the register match.) | |
2563 | AT_SETUP([ovs-ofctl dump-flows honors -F option]) | |
023e1e0a | 2564 | OVS_VSWITCHD_START |
f9cbfbe4 | 2565 | AT_CHECK([ovs-ofctl add-flow br0 reg0=0x12345,actions=drop]) |
ef0ce8ae | 2566 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [dnl |
f9cbfbe4 | 2567 | OFPST_FLOW reply: |
ef0ce8ae | 2568 | actions=drop |
f9cbfbe4 | 2569 | ]) |
023e1e0a | 2570 | OVS_VSWITCHD_STOP |
f9cbfbe4 BP |
2571 | AT_CLEANUP |
2572 | ||
2573 | dnl Check that "-F openflow10" fails on dump-flows if the requested match | |
2574 | dnl can't be represented in OpenFlow 1.0. | |
2575 | AT_SETUP([ovs-ofctl dump-flows rejects bad -F option]) | |
023e1e0a | 2576 | OVS_VSWITCHD_START |
f9cbfbe4 | 2577 | AT_CHECK([ovs-ofctl -F openflow10 dump-flows unix:br0.mgmt reg0=0xabcdef], [1], [], |
aa233d57 | 2578 | [ovs-ofctl: none of the usable flow formats (NXM,OXM) is among the allowed flow formats (OpenFlow10) |
f9cbfbe4 | 2579 | ]) |
023e1e0a | 2580 | OVS_VSWITCHD_STOP |
f9cbfbe4 | 2581 | AT_CLEANUP |
01b389b1 BP |
2582 | |
2583 | dnl Check that add-flow reports non-normalized flows (feature #5029). | |
2584 | AT_SETUP([ovs-ofctl add-flow reports non-normalized flows]) | |
023e1e0a | 2585 | OVS_VSWITCHD_START |
01b389b1 BP |
2586 | AT_CHECK([ovs-ofctl TESTABLE_LOG add-flow br0 nw_src=1.2.3.4,actions=5], |
2587 | [0], [], [dnl | |
2588 | ofp_util|INFO|normalization changed ofp_match, details: | |
2589 | ofp_util|INFO| pre: nw_src=1.2.3.4 | |
2590 | ofp_util|INFO|post: @&t@ | |
2591 | ]) | |
023e1e0a | 2592 | OVS_VSWITCHD_STOP |
01b389b1 | 2593 | AT_CLEANUP |
410698cf | 2594 | |
bdcc5925 BP |
2595 | dnl Check that --sort and --rsort works with dump-flows |
2596 | dnl Default field is 'priority'. Flow entries are displayed based | |
2597 | dnl on field to sort. | |
2598 | AT_SETUP([ovs-ofctl dump-flows with sorting]) | |
2599 | OVS_VSWITCHD_START | |
2600 | AT_KEYWORDS([sort]) | |
2601 | AT_DATA([allflows.txt], [[ | |
2602 | priority=4,in_port=23213 actions=output:42 | |
2603 | priority=5,in_port=1029 actions=output:43 | |
2604 | priority=7,in_port=1029 actions=output:43 | |
2605 | priority=3,in_port=1028 actions=output:44 | |
2606 | priority=1,in_port=1026 actions=output:45 | |
2607 | priority=6,in_port=1027 actions=output:64 | |
2608 | priority=2,in_port=1025 actions=output:47 | |
2609 | priority=8,tcp,tp_src=5 actions=drop | |
2610 | priority=9,tcp,tp_src=6 actions=drop | |
2611 | ]]) | |
2612 | ||
2613 | AT_CHECK([ovs-ofctl add-flows br0 allflows.txt | |
2614 | ], [0], [ignore]) | |
2615 | AT_CHECK([ovs-ofctl --sort dump-flows br0 | ofctl_strip], [0], [dnl | |
2616 | priority=1,in_port=1026 actions=output:45 | |
2617 | priority=2,in_port=1025 actions=output:47 | |
2618 | priority=3,in_port=1028 actions=output:44 | |
2619 | priority=4,in_port=23213 actions=output:42 | |
2620 | priority=5,in_port=1029 actions=output:43 | |
2621 | priority=6,in_port=1027 actions=output:64 | |
2622 | priority=7,in_port=1029 actions=output:43 | |
2623 | priority=8,tcp,tp_src=5 actions=drop | |
2624 | priority=9,tcp,tp_src=6 actions=drop | |
2625 | ]) | |
2626 | AT_CHECK([ovs-ofctl --rsort dump-flows br0 | ofctl_strip], [0], [dnl | |
2627 | priority=9,tcp,tp_src=6 actions=drop | |
2628 | priority=8,tcp,tp_src=5 actions=drop | |
2629 | priority=7,in_port=1029 actions=output:43 | |
2630 | priority=6,in_port=1027 actions=output:64 | |
2631 | priority=5,in_port=1029 actions=output:43 | |
2632 | priority=4,in_port=23213 actions=output:42 | |
2633 | priority=3,in_port=1028 actions=output:44 | |
2634 | priority=2,in_port=1025 actions=output:47 | |
2635 | priority=1,in_port=1026 actions=output:45 | |
2636 | ]) | |
2637 | AT_CHECK([ovs-ofctl --sort=in_port dump-flows br0 | ofctl_strip], [0], [dnl | |
2638 | priority=2,in_port=1025 actions=output:47 | |
2639 | priority=1,in_port=1026 actions=output:45 | |
2640 | priority=6,in_port=1027 actions=output:64 | |
2641 | priority=3,in_port=1028 actions=output:44 | |
2642 | priority=7,in_port=1029 actions=output:43 | |
2643 | priority=5,in_port=1029 actions=output:43 | |
2644 | priority=4,in_port=23213 actions=output:42 | |
2645 | priority=9,tcp,tp_src=6 actions=drop | |
2646 | priority=8,tcp,tp_src=5 actions=drop | |
2647 | ]) | |
2648 | AT_CHECK([ovs-ofctl --rsort=in_port dump-flows br0 | ofctl_strip], [0], [dnl | |
2649 | priority=4,in_port=23213 actions=output:42 | |
2650 | priority=7,in_port=1029 actions=output:43 | |
2651 | priority=5,in_port=1029 actions=output:43 | |
2652 | priority=3,in_port=1028 actions=output:44 | |
2653 | priority=6,in_port=1027 actions=output:64 | |
2654 | priority=1,in_port=1026 actions=output:45 | |
2655 | priority=2,in_port=1025 actions=output:47 | |
2656 | priority=9,tcp,tp_src=6 actions=drop | |
2657 | priority=8,tcp,tp_src=5 actions=drop | |
2658 | ]) | |
2659 | AT_CHECK([ovs-ofctl --sort=tcp_src dump-flows br0 | ofctl_strip], [0], [dnl | |
2660 | priority=8,tcp,tp_src=5 actions=drop | |
2661 | priority=9,tcp,tp_src=6 actions=drop | |
2662 | priority=7,in_port=1029 actions=output:43 | |
2663 | priority=6,in_port=1027 actions=output:64 | |
2664 | priority=5,in_port=1029 actions=output:43 | |
2665 | priority=4,in_port=23213 actions=output:42 | |
2666 | priority=3,in_port=1028 actions=output:44 | |
2667 | priority=2,in_port=1025 actions=output:47 | |
2668 | priority=1,in_port=1026 actions=output:45 | |
2669 | ]) | |
2670 | AT_CHECK( | |
2671 | [ovs-ofctl --sort=in_port --sort=tcp_src dump-flows br0 | ofctl_strip], [0], | |
2672 | [ priority=2,in_port=1025 actions=output:47 | |
2673 | priority=1,in_port=1026 actions=output:45 | |
2674 | priority=6,in_port=1027 actions=output:64 | |
2675 | priority=3,in_port=1028 actions=output:44 | |
2676 | priority=7,in_port=1029 actions=output:43 | |
2677 | priority=5,in_port=1029 actions=output:43 | |
2678 | priority=4,in_port=23213 actions=output:42 | |
2679 | priority=8,tcp,tp_src=5 actions=drop | |
2680 | priority=9,tcp,tp_src=6 actions=drop | |
2681 | ]) | |
2682 | OVS_VSWITCHD_STOP | |
2683 | AT_CLEANUP | |
296ed880 BP |
2684 | |
2685 | AT_SETUP([ovs-ofctl diff-flows]) | |
2686 | OVS_VSWITCHD_START | |
2687 | ||
296ed880 BP |
2688 | # Add tons of flows to br0. |
2689 | for i in `seq 0 1023`; do echo "dl_vlan=$i,actions=drop"; done > add-flows.txt | |
2690 | AT_CHECK([ovs-ofctl add-flows br0 add-flows.txt]) | |
2691 | ||
2692 | # Dump them and compare against what we expect by hand, then with diff-flows. | |
2693 | for i in `seq 0 1023`; do echo " dl_vlan=$i actions=drop"; done | sort > expout | |
2694 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/NXST_FLOW/d' | sort], | |
2695 | [0], [expout]) | |
2696 | AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt]) | |
2697 | ||
2698 | # Remove even-numbered flows, compare again. | |
2699 | for i in `seq 0 1023 2`; do echo "dl_vlan=$i"; done > del-flows.txt | |
2700 | AT_CHECK([ovs-ofctl del-flows br0 - < del-flows.txt]) | |
2701 | for i in `seq 0 1023 2`; do echo "+dl_vlan=$i actions=drop"; done | sort > expout | |
2702 | AT_CHECK([ovs-ofctl diff-flows br0 add-flows.txt | sort], [0], [expout]) | |
2703 | for i in `seq 0 1023 2`; do echo "-dl_vlan=$i actions=drop"; done | sort > expout | |
2704 | AT_CHECK([ovs-ofctl diff-flows add-flows.txt br0 | sort], [0], [expout]) | |
2705 | ||
2706 | OVS_VSWITCHD_STOP | |
2707 | AT_CLEANUP | |
98f7f427 BP |
2708 | |
2709 | dnl ofpacts that differ bytewise don't necessarily differ when | |
2710 | dnl converted to another representation, such as OpenFlow 1.0 | |
2711 | dnl or to a string. "resubmit(,1)" is an example of an action | |
2712 | dnl of this type: "ofpact_resubmit"s can differ in their "compat" | |
2713 | dnl values even though this doesn't affect the string format. | |
2714 | dnl | |
2715 | dnl This test checks that "ovs-ofctl diff-flows" doesn't report | |
2716 | dnl false ofpacts differences. | |
2717 | AT_SETUP([ovs-ofctl diff-flows - suppress false differences]) | |
2718 | OVS_VSWITCHD_START | |
2719 | AT_DATA([flows.txt], [actions=resubmit(,1) | |
2720 | ]) | |
2721 | AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) | |
2722 | AT_CHECK([ovs-ofctl diff-flows br0 flows.txt]) | |
2723 | AT_CHECK([ovs-ofctl add-flow br0 idle_timeout=60,dl_vlan=9,actions=output:1]) | |
2724 | AT_CHECK([ovs-ofctl diff-flows br0 flows.txt], [2], [dnl | |
2725 | -dl_vlan=9 idle_timeout=60 actions=output:1 | |
2726 | ]) | |
2727 | AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=120,cookie=1234,dl_vlan=9,actions=output:1]) | |
2728 | AT_CHECK([ovs-ofctl diff-flows flows.txt br0], [2], [dnl | |
2729 | +dl_vlan=9 cookie=0x4d2 hard_timeout=120 actions=output:1 | |
2730 | ]) | |
2731 | OVS_VSWITCHD_STOP | |
2732 | AT_CLEANUP | |
37923ac7 BP |
2733 | |
2734 | AT_SETUP([ovs-ofctl -F and -O interaction]) | |
2735 | AT_CHECK([ovs-ofctl -F oxm -O openflow10], [1], [], | |
2736 | [ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow10) supports any of the enabled flow formats (OXM). (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.) | |
2737 | ]) | |
2738 | AT_CHECK([ovs-ofctl -F oxm -O openflow11], [1], [], | |
2739 | [ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow11) supports any of the enabled flow formats (OXM). (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.) | |
2740 | ]) | |
2741 | AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow11], [1], [], | |
2742 | [ovs-ofctl: None of the enabled OpenFlow versions (OpenFlow10, OpenFlow11) supports any of the enabled flow formats (OXM). (Use -O to enable additional OpenFlow versions or -F to enable additional flow formats.) | |
2743 | ]) | |
2744 | AT_CHECK([ovs-ofctl -F oxm -O openflow10,openflow12], [1], [], | |
2745 | [ovs-ofctl: missing command name; use --help for help | |
2746 | ]) | |
2747 | AT_CHECK([ovs-ofctl -F oxm -O openflow12], [1], [], | |
2748 | [ovs-ofctl: missing command name; use --help for help | |
2749 | ]) | |
2750 | AT_CHECK([ovs-ofctl -F oxm -O openflow13], [1], [], | |
2751 | [ovs-ofctl: missing command name; use --help for help | |
2752 | ]) | |
2753 | AT_CLEANUP | |
1ac0e975 BP |
2754 | |
2755 | AT_SETUP([ovs-ofctl ofp-parse]) | |
2756 | # Test the echo request/reply messages (0 payload). | |
2757 | AT_CHECK([printf '\1\2\0\10\0\0\0\0\1\3\0\10\0\0\0\0' > binary_ofp_msg]) | |
2758 | AT_CHECK([ovs-ofctl ofp-parse binary_ofp_msg], [0], [dnl | |
2759 | OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload | |
2760 | OFPT_ECHO_REPLY (xid=0x0): 0 bytes of payload | |
2761 | ]) | |
2762 | ||
2763 | # Test the hello (xid:1 3-byte payload). | |
2764 | AT_CHECK([printf '\1\0\0\13\0\0\0\1\101\102\103' > binary_ofp_msg]) | |
2765 | AT_CHECK([ovs-ofctl ofp-parse - < binary_ofp_msg], [0], [dnl | |
2766 | OFPT_HELLO (xid=0x1): | |
2767 | version bitmap: 0x01 | |
2768 | unknown data in hello: | |
2769 | 00000000 01 00 00 0b 00 00 00 01-41 42 43 |........ABC | | |
2770 | ]) | |
2771 | AT_CLEANUP | |
dc235f7f JR |
2772 | |
2773 | AT_SETUP([tcp flags - filtering]) | |
2774 | OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 \ | |
2775 | -- add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2]) | |
2776 | AT_DATA([flows.txt], [dnl | |
61bf6666 JR |
2777 | in_port=1,tcp,tp_dst=80,tcp_flags=+syn-rst-ack-fin,action=2 # Allow outbound web traffic bare-SYN |
2778 | in_port=1,tcp,tp_dst=80,tcp_flags=+ack,action=2 # Allow outbound web traffic with ACK bit | |
2779 | in_port=1,tcp,tp_dst=80,tcp_flags=+rst,action=2 # Allow outbound web traffic with RST bit | |
2780 | in_port=2,tcp,tp_src=80,tcp_flags=+ack,action=1 # Allow inbound web traffic with ACK bit | |
2781 | in_port=2,tcp,tp_src=80,tcp_flags=+rst,action=1 # Allow inbound web traffic with RST bit | |
dc235f7f JR |
2782 | priority=0,in_port=1,action=drop # Default drop outbound |
2783 | priority=0,in_port=2,action=drop # Default drop inbound | |
2784 | ]) | |
2785 | ||
2786 | AT_CHECK([ovs-ofctl add-flows br0 flows.txt]) | |
2787 | ||
61bf6666 JR |
2788 | AT_CHECK([ovs-ofctl add-flow br0 "tcp,tcp_flags=+ack-ack,action="], [1], [], |
2789 | [ovs-ofctl: ack: Each TCP flag can be specified only once | |
2790 | ]) | |
2791 | ||
e79a6c83 | 2792 | AT_CHECK([ovs-appctl dpif/show | tail -n +4], [0], [dnl |
dc235f7f JR |
2793 | p1 1/1: (dummy) |
2794 | p2 2/2: (dummy) | |
2795 | ]) | |
2796 | ||
61bf6666 | 2797 | dnl Outbound web traffic with bare-SYN |
dc235f7f JR |
2798 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x002)'], [0], [stdout]) |
2799 | AT_CHECK([tail -1 stdout], [0], | |
2800 | [Datapath actions: 2 | |
2801 | ]) | |
2802 | ||
2803 | dnl Outbopund web traffic with ACK bit | |
2804 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x110)'], [0], [stdout]) | |
2805 | AT_CHECK([tail -1 stdout], [0], | |
2806 | [Datapath actions: 2 | |
2807 | ]) | |
2808 | ||
2809 | dnl Outbound web traffic with RST bit | |
2810 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=80),tcp_flags(0x104)'], [0], [stdout]) | |
2811 | AT_CHECK([tail -1 stdout], [0], | |
2812 | [Datapath actions: 2 | |
2813 | ]) | |
2814 | ||
2815 | dnl Inbound web traffic with ACK bit | |
2816 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0x010)'], [0], [stdout]) | |
2817 | AT_CHECK([tail -1 stdout], [0], | |
2818 | [Datapath actions: 1 | |
2819 | ]) | |
2820 | ||
2821 | dnl Inbound web traffic with RST bit | |
2822 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0x014)'], [0], [stdout]) | |
2823 | AT_CHECK([tail -1 stdout], [0], | |
2824 | [Datapath actions: 1 | |
2825 | ]) | |
2826 | ||
2827 | dnl Inbound web traffic with SYN bit without ACK or RST bits | |
2828 | AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=8),tcp_flags(0xfeb)'], [0], [stdout]) | |
2829 | AT_CHECK([tail -1 stdout], [0], | |
2830 | [Datapath actions: drop | |
2831 | ]) | |
2832 | ||
2833 | OVS_VSWITCHD_STOP | |
2834 | AT_CLEANUP | |
ca26eb44 RB |
2835 | |
2836 | dnl Check importance parameter added in OF1.4. | |
2837 | dnl It validates whether importance set via add-flow via OpenFlow1.4+ gets | |
de1b46de | 2838 | dnl set or not by validating it against the dump-flows output via OpenFlow1.4+ |
ca26eb44 RB |
2839 | dnl If add-flow or dump-flows is used with later version of OpenFlow prior to 1.4+ |
2840 | dnl then the importance will be considered zero whether provided as an argument. | |
2841 | ||
2842 | AT_SETUP([ovs-ofctl rule with importance]) | |
2843 | OVS_VSWITCHD_START | |
2844 | dnl Flow with importance parameter added via OF1.4+ and later version | |
2845 | AT_CHECK([ovs-ofctl -O OpenFlow14 add-flow br0 priority=21,importance=21,actions=normal]) | |
2846 | AT_CHECK([ovs-ofctl add-flow br0 priority=22,importance=22,actions=normal]) | |
2847 | ||
2848 | dnl Importance parameter will only be visible of flows that are added via OF1.4+ if dumped via OF1.4+ | |
a56dd713 | 2849 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl |
ca26eb44 | 2850 | importance=21, priority=21 actions=NORMAL |
13327b8e | 2851 | reset_counts priority=22 actions=NORMAL |
ca26eb44 RB |
2852 | ]) |
2853 | ||
2854 | dnl Importance parameter will not be visible if flow is dumped with previous version prior to OF1.4+ whether added via OF1.4+ | |
a56dd713 | 2855 | AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sed '/ST_FLOW reply/d' | sort], [0], [dnl |
ca26eb44 | 2856 | priority=21 actions=NORMAL |
a56dd713 | 2857 | priority=22 actions=NORMAL |
ca26eb44 RB |
2858 | ]) |
2859 | ||
2860 | OVS_VSWITCHD_STOP | |
2861 | AT_CLEANUP | |
2862 | ||
2863 | ||
2864 | dnl Importance parameter added in OF1.4. | |
2865 | dnl This validates whether flows with importance | |
2866 | dnl parameter are getting replaced with "replace-flows" or | |
2867 | dnl not by validating dump-flows output after replace with the expected output. | |
2868 | ||
2869 | AT_SETUP([ovs-ofctl replace-flows with importance]) | |
2870 | OVS_VSWITCHD_START | |
2871 | ||
2872 | dnl Add flows to br0 with importance via OF1.4+. For more details refer "ovs-ofctl rule with importance" test case. | |
c453c5af | 2873 | for i in 1 2 3 4 5 6 7 8; do echo "dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt |
ca26eb44 RB |
2874 | AT_CHECK([ovs-ofctl -O OpenFlow14 add-flows br0 add-flows.txt]) |
2875 | ||
4b69263d JR |
2876 | dnl Replace the flows in the bridge. |
2877 | for i in 1 3 5 7; do echo " importance=`expr $i + 10`, dl_vlan=$i actions=drop"; done > replace-flows.txt | |
ca26eb44 RB |
2878 | AT_CHECK([ovs-ofctl -O OpenFlow14 replace-flows br0 replace-flows.txt]) |
2879 | ||
2880 | dnl Dump them and compare the dump flows output against the expected output. | |
4b69263d | 2881 | cat replace-flows.txt > expout |
ca26eb44 RB |
2882 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort], |
2883 | [0], [expout]) | |
2884 | ||
2885 | OVS_VSWITCHD_STOP | |
2886 | AT_CLEANUP | |
db5076ee JR |
2887 | |
2888 | AT_SETUP([ovs-ofctl replace-flows with --bundle]) | |
2889 | OVS_VSWITCHD_START | |
2890 | ||
2891 | AT_CHECK([ovs-appctl vlog/set vconn:dbg]) | |
2892 | ||
2893 | dnl Add flows to br0 with importance via OF1.4+, using an OF1.4+ bundle. For more details refer "ovs-ofctl rule with importance" test case. | |
00da1ac5 | 2894 | for i in 1 2 3 4 5 6 7 8; do echo "table=$i,dl_vlan=$i,importance=$i,actions=drop"; done > add-flows.txt |
db5076ee JR |
2895 | AT_CHECK([ovs-ofctl --bundle add-flows br0 add-flows.txt]) |
2896 | ||
2897 | dnl Replace some flows in the bridge. | |
00da1ac5 | 2898 | for i in 1 3 5 7; do echo " table=$i, importance=`expr $i + 10`, dl_vlan=$i actions=drop"; done > replace-flows.txt |
db5076ee JR |
2899 | AT_CHECK([ovs-ofctl --bundle replace-flows br0 replace-flows.txt]) |
2900 | ||
2901 | dnl Dump them and compare the dump flows output against the expected output. | |
4b69263d | 2902 | cat replace-flows.txt > expout |
db5076ee JR |
2903 | AT_CHECK([ovs-ofctl -O OpenFlow14 dump-flows br0 | ofctl_strip | sed '/OFPST_FLOW/d' | sort], |
2904 | [0], [expout]) | |
2905 | ||
2906 | dnl Check logs for OpenFlow trace | |
2907 | # Prevent race. | |
38b0b29f | 2908 | OVS_WAIT_UNTIL([vconn_sub < ovs-vswitchd.log | test `grep -- "|vconn|DBG|unix: sent (Success): OFPST_FLOW reply" | wc -l` -ge 2]) |
db5076ee | 2909 | # AT_CHECK([sed -n "s/^.*\(|vconn|DBG|.*xid=.*:\).*$/\1/p" ovs-vswitchd.log], [0], [dnl |
12e2ba2e | 2910 | AT_CHECK([print_vconn_debug | vconn_sub | ofctl_strip], [0], [dnl |
db5076ee JR |
2911 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): |
2912 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 | |
2913 | vconn|DBG|unix: received: OFPT_HELLO (OF1.4): | |
5f8c05ad JR |
2914 | version bitmap: 0x05 |
2915 | vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05) | |
db5076ee | 2916 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 2917 | bundle_id=0 type=OPEN_REQUEST flags=atomic ordered |
db5076ee JR |
2918 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
2919 | bundle_id=0 type=OPEN_REPLY flags=0 | |
2920 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): | |
39c94593 | 2921 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2922 | OFPT_FLOW_MOD (OF1.4): ADD table:1 dl_vlan=1 importance:1 actions=drop |
db5076ee | 2923 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2924 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2925 | OFPT_FLOW_MOD (OF1.4): ADD table:2 dl_vlan=2 importance:2 actions=drop |
db5076ee | 2926 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2927 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2928 | OFPT_FLOW_MOD (OF1.4): ADD table:3 dl_vlan=3 importance:3 actions=drop |
db5076ee | 2929 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2930 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2931 | OFPT_FLOW_MOD (OF1.4): ADD table:4 dl_vlan=4 importance:4 actions=drop |
db5076ee | 2932 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2933 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2934 | OFPT_FLOW_MOD (OF1.4): ADD table:5 dl_vlan=5 importance:5 actions=drop |
db5076ee | 2935 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2936 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2937 | OFPT_FLOW_MOD (OF1.4): ADD table:6 dl_vlan=6 importance:6 actions=drop |
db5076ee | 2938 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2939 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2940 | OFPT_FLOW_MOD (OF1.4): ADD table:7 dl_vlan=7 importance:7 actions=drop |
db5076ee | 2941 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2942 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2943 | OFPT_FLOW_MOD (OF1.4): ADD table:8 dl_vlan=8 importance:8 actions=drop |
db5076ee | 2944 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 2945 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered |
db5076ee JR |
2946 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
2947 | bundle_id=0 type=COMMIT_REPLY flags=0 | |
2948 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): | |
2949 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 | |
2950 | vconn|DBG|unix: received: OFPT_HELLO (OF1.4): | |
5f8c05ad JR |
2951 | version bitmap: 0x05 |
2952 | vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05) | |
db5076ee JR |
2953 | vconn|DBG|unix: received: OFPST_FLOW request (OF1.4): |
2954 | vconn|DBG|unix: sent (Success): OFPST_FLOW reply (OF1.4): | |
00da1ac5 JR |
2955 | table=1, importance=1, dl_vlan=1 actions=drop |
2956 | table=2, importance=2, dl_vlan=2 actions=drop | |
2957 | table=3, importance=3, dl_vlan=3 actions=drop | |
2958 | table=4, importance=4, dl_vlan=4 actions=drop | |
2959 | table=5, importance=5, dl_vlan=5 actions=drop | |
2960 | table=6, importance=6, dl_vlan=6 actions=drop | |
2961 | table=7, importance=7, dl_vlan=7 actions=drop | |
2962 | table=8, importance=8, dl_vlan=8 actions=drop | |
db5076ee | 2963 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 2964 | bundle_id=0 type=OPEN_REQUEST flags=atomic ordered |
db5076ee JR |
2965 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
2966 | bundle_id=0 type=OPEN_REPLY flags=0 | |
4b69263d JR |
2967 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
2968 | bundle_id=0 flags=atomic ordered | |
00da1ac5 | 2969 | OFPT_FLOW_MOD (OF1.4): ADD table:1 dl_vlan=1 importance:11 actions=drop |
4b69263d JR |
2970 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
2971 | bundle_id=0 flags=atomic ordered | |
00da1ac5 | 2972 | OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:2 dl_vlan=2 actions=drop |
4b69263d JR |
2973 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
2974 | bundle_id=0 flags=atomic ordered | |
00da1ac5 | 2975 | OFPT_FLOW_MOD (OF1.4): ADD table:3 dl_vlan=3 importance:13 actions=drop |
4b69263d JR |
2976 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
2977 | bundle_id=0 flags=atomic ordered | |
00da1ac5 | 2978 | OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:4 dl_vlan=4 actions=drop |
db5076ee | 2979 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2980 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2981 | OFPT_FLOW_MOD (OF1.4): ADD table:5 dl_vlan=5 importance:15 actions=drop |
db5076ee | 2982 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2983 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2984 | OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:6 dl_vlan=6 actions=drop |
db5076ee | 2985 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2986 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2987 | OFPT_FLOW_MOD (OF1.4): ADD table:7 dl_vlan=7 importance:17 actions=drop |
db5076ee | 2988 | vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4): |
39c94593 | 2989 | bundle_id=0 flags=atomic ordered |
00da1ac5 | 2990 | OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:8 dl_vlan=8 actions=drop |
db5076ee | 2991 | vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4): |
39c94593 | 2992 | bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered |
db5076ee JR |
2993 | vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4): |
2994 | bundle_id=0 type=COMMIT_REPLY flags=0 | |
2995 | vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5): | |
2996 | version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 | |
2997 | vconn|DBG|unix: received: OFPT_HELLO (OF1.4): | |
2998 | version bitmap: 0x05 | |
2999 | vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports version 0x05) | |
3000 | vconn|DBG|unix: received: OFPST_FLOW request (OF1.4): | |
3001 | vconn|DBG|unix: sent (Success): OFPST_FLOW reply (OF1.4): | |
00da1ac5 JR |
3002 | table=1, importance=11, dl_vlan=1 actions=drop |
3003 | table=3, importance=13, dl_vlan=3 actions=drop | |
3004 | table=5, importance=15, dl_vlan=5 actions=drop | |
3005 | table=7, importance=17, dl_vlan=7 actions=drop | |
db5076ee JR |
3006 | ]) |
3007 | ||
3008 | OVS_VSWITCHD_STOP | |
3009 | AT_CLEANUP |