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