Implement remote ACL indirection table
[netvirt.git] / vpnservice / aclservice / impl / src / test / java / org / opendaylight / netvirt / aclservice / tests / FlowEntryObjectsStateless.xtend
1 /*
2  * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netvirt.aclservice.tests
9
10 import org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack
11 import org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit
12 import org.opendaylight.genius.mdsalutil.FlowEntity
13 import org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions
14 import org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata
15 import org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable
16 import org.opendaylight.genius.mdsalutil.matches.MatchArpSha
17 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType
18 import org.opendaylight.genius.mdsalutil.matches.MatchIcmpv4
19 import org.opendaylight.genius.mdsalutil.matches.MatchIcmpv6
20 import org.opendaylight.genius.mdsalutil.matches.MatchIpProtocol
21 import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination
22 import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Source
23 import org.opendaylight.genius.mdsalutil.matches.MatchTcpFlags
24 import org.opendaylight.genius.mdsalutil.matches.MatchUdpDestinationPort
25 import org.opendaylight.genius.mdsalutil.matches.MatchUdpSourcePort
26 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchCtState
27 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchTcpDestinationPort
28 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchUdpDestinationPort
29 import org.opendaylight.genius.mdsalutil.MetaDataUtil
30 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
31
32 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6
34 import org.opendaylight.genius.mdsalutil.matches.MatchMetadata
35
36 class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
37
38     protected def etherFlows() {
39         fixedIngressFlowsPort1
40         + etherFlowIngressPort1
41         + fixedEgressFlowsPort1
42         + etherFlowEgressPort1
43         + fixedIngressFlowsPort2
44         + etherIngressFlowsPort2
45         + fixedEgressFlowsPort2
46         + etheregressFlowPort2
47         + remoteFlows
48     }
49
50     protected def tcpFlows() {
51         fixedIngressFlowsPort1
52         + tcpIngressFlowPort1
53         + fixedEgressFlowsPort1
54         + tcpEgressFlowPort1
55         + fixedIngressFlowsPort2
56         + tcpIngressFlowPort2
57         + fixedEgressFlowsPort2
58         + tcpEgressFlowPort2
59         + remoteFlows
60     }
61
62     protected def udpFlows() {
63         fixedIngressFlowsPort1
64         + fixedEgressFlowsPort1
65         + fixedIngressFlowsPort2
66         + fixedEgressFlowsPort2
67         + remoteFlows
68     }
69
70     protected def icmpFlows() {
71         fixedIngressFlowsPort1
72         + fixedEgressFlowsPort1
73         + fixedIngressFlowsPort2
74         + fixedEgressFlowsPort2
75         + remoteFlows
76     }
77
78     protected def dstRangeFlows() {
79         fixedIngressFlowsPort1
80         + fixedEgressFlowsPort1
81         + tcpEgressRangeFlows
82     }
83
84     protected def dstAllFlows() {
85         fixedIngressFlowsPort1
86         + fixedEgressFlowsPort1
87     }
88
89     protected def icmpFlowsForTwoAclsHavingSameRules() {
90         fixedIngressFlowsPort3
91         + fixedEgressFlowsPort3
92     }
93
94     protected def etherFlowIngressPort1() {
95         #[
96             new FlowEntity(123bi) => [
97             cookie = 110100480bi
98             flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
99             flowName = "ACL_SYN_"
100             instructionInfoList = #[
101                 new InstructionApplyActions(#[
102                     new ActionNxResubmit(220 as short)
103                 ])
104             ]
105             matchInfoList = #[
106                 new MatchEthernetType(2048L),
107                 new MatchEthernetType(2048L),
108                 new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
109             ]
110             priority = 61005
111             tableId = 241 as short
112         ]
113      ]
114  }
115     protected def etherFlowEgressPort1() {
116         #[
117             new FlowEntity(123bi) => [
118                 cookie = 110100480bi
119                 flowId = "SYN_ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
120                 flowName = "ACL_SYN_"
121                 instructionInfoList = #[
122                     new InstructionApplyActions(#[
123                         new ActionNxResubmit(17 as short)
124                     ])
125                 ]
126                 matchInfoList = #[
127                     new MatchEthernetType(2048L),
128                     new MatchEthernetType(2048L),
129                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
130                 ]
131                 priority = 61005
132                 tableId = 211 as short
133             ]
134         ]
135     }
136     protected def etherIngressFlowsPort2() {
137         #[
138                new FlowEntity(123bi) => [
139                 cookie = 110100480bi
140                 flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
141                 flowName = "ACL_SYN_"
142                 instructionInfoList = #[
143                     new InstructionApplyActions(#[
144                         new ActionNxResubmit(220 as short)
145                     ])
146                 ]
147                 matchInfoList = #[
148                     new MatchEthernetType(2048L),
149                     new MatchEthernetType(2048L),
150                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
151                 ]
152                 priority = 61005
153                 tableId = 241 as short
154             ],
155             new FlowEntity(123bi) => [
156                 cookie = 110100480bi
157                 flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
158                 flowName = "ACL_SYN_"
159                 instructionInfoList = #[
160                     new InstructionApplyActions(#[
161                         new ActionNxResubmit(220 as short)
162                     ])
163                 ]
164                 matchInfoList = #[
165                     new MatchEthernetType(2048L),
166                     new MatchEthernetType(2048L),
167                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
168                 ]
169                 priority = 61005
170                 tableId = 241 as short
171             ]
172         ]
173     }
174
175     protected def etherEgressFlowsPort1() {
176         #[
177             new FlowEntity(123bi) => [
178                 cookie = 110100480bi
179                 flowId = "[SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
180         flowName = "ACL_SYN_"
181         instructionInfoList = #[
182             new InstructionApplyActions(#[
183                 new ActionNxResubmit(220 as short)
184             ])
185         ]
186         matchInfoList = #[
187             new MatchEthernetType(2048L),
188             new MatchEthernetType(2048L),
189             new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
190         ]
191         priority = 61005
192         tableId = 241 as short
193             ]
194         ]
195     }
196
197     protected def etheregressFlowPort2() {
198         #[
199            new FlowEntity(123bi) => [
200                 cookie = 110100480bi
201                 flowId = "SYN_ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
202                 flowName = "ACL_SYN_"
203                 instructionInfoList = #[
204                     new InstructionApplyActions(#[
205                         new ActionNxResubmit(17 as short)
206                     ])
207                 ]
208                 matchInfoList = #[
209                     new MatchEthernetType(2048L),
210                     new MatchEthernetType(2048L),
211                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
212                 ]
213                 priority = 61005
214                 tableId = 211 as short
215             ]
216         ]
217     }
218
219     protected def tcpIngressFlowPort1() {
220         #[
221                 new FlowEntity(123bi) => [
222                     cookie = 110100480bi
223                     flowId = "SYN_TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
224                     flowName = "ACL_SYN_"
225                     instructionInfoList = #[
226                         new InstructionApplyActions(#[
227                             new ActionNxResubmit(220 as short)
228                         ])
229                     ]
230                     matchInfoList = #[
231                         new MatchEthernetType(2048L),
232                         new MatchEthernetType(2048L),
233                         new NxMatchTcpDestinationPort(80, 65535),
234                         new MatchIpProtocol(6 as short),
235                         new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
236                         new MatchTcpFlags(2)
237                     ]
238                     priority = 61005
239                     tableId = 241 as short
240                 ]
241         ]
242     }
243
244     protected def tcpIngressFlowPort2() {
245         #[
246             new FlowEntity(123bi) => [
247                 cookie = 110100480bi
248                 flowId = "SYN_TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
249                 flowName = "ACL_SYN_"
250                 instructionInfoList = #[
251                     new InstructionApplyActions(#[
252                         new ActionNxResubmit(220 as short)
253                     ])
254                 ]
255                 matchInfoList = #[
256                     new MatchEthernetType(2048L),
257                     new MatchEthernetType(2048L),
258                     new NxMatchTcpDestinationPort(80, 65535),
259                     new MatchIpProtocol(6 as short),
260                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
261                     new MatchTcpFlags(2)
262                 ]
263                 priority = 61005
264                 tableId = 241 as short
265             ]
266         ]
267     }
268
269     protected def tcpEgressFlowPort1() {
270         #[
271             new FlowEntity(123bi) => [
272                 cookie = 110100480bi
273                 flowId = "SYN_TCP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
274                 flowName = "ACL_SYN_"
275                 instructionInfoList = #[
276                     new InstructionApplyActions(#[
277                         new ActionNxResubmit(17 as short)
278                     ])
279                 ]
280                 matchInfoList = #[
281                     new MatchEthernetType(2048L),
282                     new MatchEthernetType(2048L),
283                     new NxMatchTcpDestinationPort(80, 65535),
284                     new MatchIpProtocol(6 as short),
285                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
286                     new MatchTcpFlags(2)
287                 ]
288                 priority = 61005
289                 tableId = 211 as short
290             ]
291         ]
292     }
293
294     protected def tcpEgressFlowPort2() {
295         #[
296             new FlowEntity(123bi) => [
297                 cookie = 110100480bi
298                 flowId = "SYN_TCP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
299                 flowName = "ACL_SYN_"
300                 instructionInfoList = #[
301                     new InstructionApplyActions(#[
302                         new ActionNxResubmit(17 as short)
303                     ])
304                 ]
305                 matchInfoList = #[
306                     new MatchEthernetType(2048L),
307                     new MatchEthernetType(2048L),
308                     new NxMatchTcpDestinationPort(80, 65535),
309                     new MatchIpProtocol(6 as short),
310                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
311                     new MatchTcpFlags(2)
312                 ]
313                 priority = 61005
314                 tableId = 211 as short
315             ],
316             new FlowEntity(123bi) => [
317                 cookie = 110100480bi
318                 flowId = "SYN_TCP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
319                 flowName = "ACL_SYN_"
320                 instructionInfoList = #[
321                     new InstructionApplyActions(#[
322                         new ActionNxResubmit(17 as short)
323                     ])
324                 ]
325                 matchInfoList = #[
326                     new MatchEthernetType(2048L),
327                     new MatchEthernetType(2048L),
328                     new NxMatchTcpDestinationPort(80, 65535),
329                     new MatchIpProtocol(6 as short),
330                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
331                     new MatchTcpFlags(2)
332                 ]
333                 priority = 61005
334                 tableId = 211 as short
335             ]
336         ]
337     }
338
339     protected def udpEgressFlowsPort1() {
340         #[
341              new FlowEntity(123bi) => [
342                 cookie = 110100480bi
343                 flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
344                 flowName = "ACL"
345                 instructionInfoList = #[
346                     new InstructionApplyActions(#[
347                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
348                         new ActionNxResubmit(17 as short)
349                     ])
350                 ]
351                 matchInfoList = #[
352                     new MatchEthernetType(2048L),
353                     new MatchEthernetType(2048L),
354                     new NxMatchUdpDestinationPort(80, 65535),
355                     new MatchIpProtocol(17 as short),
356                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
357                     new NxMatchCtState(33L, 33L)
358                 ]
359                 priority = 61010
360                 tableId = 213 as short
361             ]
362         ]
363     }
364
365     protected def udpIngressFlowsPort2() {
366         #[
367             new FlowEntity(123bi) => [
368                 cookie = 110100480bi
369                 flowId = "UDP_DESTINATION_80_65535_ipv4_remoteACL_interface_aap_AllowedAddressPairsKey "
370                         +"[_macAddress=MacAddress [_value=0D:AA:D8:42:30:F3], _ipAddress=IpPrefixOrAddress "
371                         +"[_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.1/24]]]]"
372                         +"Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
373                 flowName = "ACL"
374                 instructionInfoList = #[
375                     new InstructionApplyActions(#[
376                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
377                         new ActionNxResubmit(220 as short)
378                     ])
379                 ]
380                 matchInfoList = #[
381                     new MatchEthernetType(2048L),
382                     new MatchIpv4Source("10.0.0.1", "24"),
383                     new MatchEthernetType(2048L),
384                     new MatchEthernetType(2048L),
385                     new NxMatchUdpDestinationPort(80, 65535),
386                     new MatchIpProtocol(17 as short),
387                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
388                     new NxMatchCtState(33L, 33L)
389                 ]
390                 priority = 61010
391                 tableId = 243 as short
392             ],
393             new FlowEntity(123bi) => [
394                 cookie = 110100480bi
395                 flowId = "UDP_DESTINATION_80_65535_ipv4_remoteACL_interface_aap_AllowedAddressPairsKey [_macAddress=MacAddress [_value=0D:AA:D8:42:30:F4], _ipAddress=IpPrefixOrAddress [_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.2/24]]]]Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
396                 flowName = "ACL"
397                 instructionInfoList = #[
398                     new InstructionApplyActions(#[
399                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
400                         new ActionNxResubmit(220 as short)
401                     ])
402                 ]
403                 matchInfoList = #[
404                     new MatchEthernetType(2048L),
405                     new MatchIpv4Source("10.0.0.2", "24"),
406                     new MatchEthernetType(2048L),
407                     new MatchEthernetType(2048L),
408                     new NxMatchUdpDestinationPort(80, 65535),
409                     new MatchIpProtocol(17 as short),
410                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
411                     new NxMatchCtState(33L, 33L)
412                 ]
413                 priority = 61010
414                 tableId = 243 as short
415             ]
416         ]
417     }
418
419     protected def udpEgressFlowsPort2() {
420         #[
421             new FlowEntity(123bi) => [
422                 cookie = 110100480bi
423                 flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
424                 flowName = "ACL"
425                 instructionInfoList = #[
426                     new InstructionApplyActions(#[
427                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
428                         new ActionNxResubmit(17 as short)
429                     ])
430                 ]
431                 matchInfoList = #[
432                     new MatchEthernetType(2048L),
433                     new MatchEthernetType(2048L),
434                     new NxMatchUdpDestinationPort(80, 65535),
435                     new MatchIpProtocol(17 as short),
436                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
437                     new NxMatchCtState(33L, 33L)
438                 ]
439                 priority = 61010
440                 tableId = 213 as short
441             ]
442         ]
443     }
444
445     protected def icmpIngressFlowsPort1() {
446         #[
447             new FlowEntity(123bi) => [
448                 cookie = 110100480bi
449                 flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
450                 flowName = "ACL"
451                 instructionInfoList = #[
452                     new InstructionApplyActions(#[
453                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
454                         new ActionNxResubmit(220 as short)
455                     ])
456                 ]
457                 matchInfoList = #[
458                     new MatchEthernetType(2048L),
459                     new MatchEthernetType(2048L),
460                     new MatchIcmpv4(2 as short, 3 as short),
461                     new MatchIpProtocol(1 as short),
462                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
463                     new NxMatchCtState(33L, 33L)
464                 ]
465                 priority = 61010
466                 tableId = 243 as short
467             ]
468         ]
469     }
470
471     protected def icmpIngressFlowsPort2() {
472         #[
473             new FlowEntity(123bi) => [
474                 cookie = 110100480bi
475                 flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
476                 flowName = "ACL"
477                 instructionInfoList = #[
478                     new InstructionApplyActions(#[
479                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
480                         new ActionNxResubmit(220 as short)
481                     ])
482                 ]
483                 matchInfoList = #[
484                     new MatchEthernetType(2048L),
485                     new MatchEthernetType(2048L),
486                     new MatchIcmpv4(2 as short, 3 as short),
487                     new MatchIpProtocol(1 as short),
488                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
489                     new NxMatchCtState(33L, 33L)
490                 ]
491                 priority = 61010
492                 tableId = 243 as short
493             ]
494         ]
495     }
496
497     protected def icmpEgressFlowsPort2() {
498         #[
499             new FlowEntity(123bi) => [
500                 cookie = 110100480bi
501                 flowId = "ICMP_V4_DESTINATION_23__ipv4_remoteACL_interface_aap_AllowedAddressPairsKey "
502                         +"[_macAddress=MacAddress [_value=0D:AA:D8:42:30:F3], _ipAddress=IpPrefixOrAddress "
503                         +"[_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.1/24]]]]"
504                         +"Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
505                 flowName = "ACL"
506                 instructionInfoList = #[
507                     new InstructionApplyActions(#[
508                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
509                         new ActionNxResubmit(17 as short)
510                     ])
511                 ]
512                 matchInfoList = #[
513                     new MatchEthernetType(2048L),
514                     new MatchIpv4Destination("10.0.0.1", "24"),
515                     new MatchEthernetType(2048L),
516                     new MatchEthernetType(2048L),
517                     new MatchIcmpv4(2 as short, 3 as short),
518                     new MatchIpProtocol(1 as short),
519                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
520                     new NxMatchCtState(33L, 33L)
521                 ]
522                 priority = 61010
523                 tableId = 213 as short
524             ],
525             new FlowEntity(123bi) => [
526                 cookie = 110100480bi
527                 flowId = "ICMP_V4_DESTINATION_23__ipv4_remoteACL_interface_aap_AllowedAddressPairsKey "
528                         +"[_macAddress=MacAddress [_value=0D:AA:D8:42:30:F4], _ipAddress=IpPrefixOrAddress "
529                         +"[_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.2/24]]]]"
530                         +"Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
531                 flowName = "ACL"
532                 instructionInfoList = #[
533                     new InstructionApplyActions(#[
534                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
535                         new ActionNxResubmit(17 as short)
536                     ])
537                 ]
538                 matchInfoList = #[
539                     new MatchEthernetType(2048L),
540                     new MatchIpv4Destination("10.0.0.2", "24"),
541                     new MatchEthernetType(2048L),
542                     new MatchEthernetType(2048L),
543                     new MatchIcmpv4(2 as short, 3 as short),
544                     new MatchIpProtocol(1 as short),
545                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
546                     new NxMatchCtState(33L, 33L)
547                 ]
548                 priority = 61010
549                 tableId = 213 as short
550             ]
551         ]
552     }
553
554     protected def udpIngressPortRangeFlows() {
555         #[
556             new FlowEntity(123bi) => [
557                 cookie = 110100480bi
558                 flowId = "UDP_DESTINATION_2000_65532Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
559                 flowName = "ACL"
560                 instructionInfoList = #[
561                     new InstructionApplyActions(#[
562                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
563                         new ActionNxResubmit(220 as short)
564                     ])
565                 ]
566                 matchInfoList = #[
567                     new MatchEthernetType(2048L),
568                     new MatchEthernetType(2048L),
569                     new NxMatchUdpDestinationPort(2000, 65532),
570                     new MatchIpProtocol(17 as short),
571                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
572                     new NxMatchCtState(33L, 33L)
573                 ]
574                 priority = 61010
575                 tableId = 243 as short
576             ]
577         ]
578     }
579
580     protected def tcpEgressRangeFlows() {
581         #[
582             new FlowEntity(123bi) => [
583                 cookie = 110100480bi
584                 flowId = "SYN_TCP_DESTINATION_776_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
585                 flowName = "ACL_SYN_"
586                 instructionInfoList = #[
587                     new InstructionApplyActions(#[
588                         new ActionNxResubmit(17 as short)
589                     ])
590                 ]
591                 matchInfoList = #[
592                     new MatchEthernetType(2048L),
593                     new MatchEthernetType(2048L),
594                     new NxMatchTcpDestinationPort(776, 65534),
595                     new MatchIpProtocol(6 as short),
596                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
597                     new MatchTcpFlags(2)
598                 ]
599                 priority = 61005
600                 tableId = 211 as short
601             ],
602             new FlowEntity(123bi) => [
603                 cookie = 110100480bi
604                 flowId = "SYN_TCP_DESTINATION_512_65280Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
605                 flowName = "ACL_SYN_"
606                 instructionInfoList = #[
607                     new InstructionApplyActions(#[
608                         new ActionNxResubmit(17 as short)
609                     ])
610                 ]
611                 matchInfoList = #[
612                     new MatchEthernetType(2048L),
613                     new MatchEthernetType(2048L),
614                     new NxMatchTcpDestinationPort(512, 65280),
615                     new MatchIpProtocol(6 as short),
616                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
617                     new MatchTcpFlags(2)
618                 ]
619                 priority = 61005
620                 tableId = 211 as short
621             ],
622             new FlowEntity(123bi) => [
623                 cookie = 110100480bi
624                 flowId = "SYN_TCP_DESTINATION_334_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
625                 flowName = "ACL_SYN_"
626                 instructionInfoList = #[
627                     new InstructionApplyActions(#[
628                         new ActionNxResubmit(17 as short)
629                     ])
630                 ]
631                 matchInfoList = #[
632                     new MatchEthernetType(2048L),
633                     new MatchEthernetType(2048L),
634                     new NxMatchTcpDestinationPort(334, 65534),
635                     new MatchIpProtocol(6 as short),
636                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
637                     new MatchTcpFlags(2)
638                 ]
639                 priority = 61005
640                 tableId = 211 as short
641             ],
642             new FlowEntity(123bi) => [
643                 cookie = 110100480bi
644                 flowId = "SYN_TCP_DESTINATION_333_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
645                 flowName = "ACL_SYN_"
646                 instructionInfoList = #[
647                     new InstructionApplyActions(#[
648                         new ActionNxResubmit(17 as short)
649                     ])
650                 ]
651                 matchInfoList = #[
652                     new MatchEthernetType(2048L),
653                     new MatchEthernetType(2048L),
654                     new NxMatchTcpDestinationPort(333, 65535),
655                     new MatchIpProtocol(6 as short),
656                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
657                     new MatchTcpFlags(2)
658                 ]
659                 priority = 61005
660                 tableId = 211 as short
661             ],
662             new FlowEntity(123bi) => [
663                 cookie = 110100480bi
664                 flowId = "SYN_TCP_DESTINATION_336_65520Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
665                 flowName = "ACL_SYN_"
666                 instructionInfoList = #[
667                     new InstructionApplyActions(#[
668                         new ActionNxResubmit(17 as short)
669                     ])
670                 ]
671                 matchInfoList = #[
672                     new MatchEthernetType(2048L),
673                     new MatchEthernetType(2048L),
674                     new NxMatchTcpDestinationPort(336, 65520),
675                     new MatchIpProtocol(6 as short),
676                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
677                     new MatchTcpFlags(2)
678                 ]
679                 priority = 61005
680                 tableId = 211 as short
681             ],
682             new FlowEntity(123bi) => [
683                 cookie = 110100480bi
684                 flowId = "SYN_TCP_DESTINATION_352_65504Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
685                 flowName = "ACL_SYN_"
686                 instructionInfoList = #[
687                     new InstructionApplyActions(#[
688                         new ActionNxResubmit(17 as short)
689                     ])
690                 ]
691                 matchInfoList = #[
692                     new MatchEthernetType(2048L),
693                     new MatchEthernetType(2048L),
694                     new NxMatchTcpDestinationPort(352, 65504),
695                     new MatchIpProtocol(6 as short),
696                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
697                     new MatchTcpFlags(2)
698                 ]
699                 priority = 61005
700                 tableId = 211 as short
701             ],
702             new FlowEntity(123bi) => [
703                 cookie = 110100480bi
704                 flowId = "SYN_TCP_DESTINATION_384_65408Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
705                 flowName = "ACL_SYN_"
706                 instructionInfoList = #[
707                     new InstructionApplyActions(#[
708                         new ActionNxResubmit(17 as short)
709                     ])
710                 ]
711                 matchInfoList = #[
712                     new MatchEthernetType(2048L),
713                     new MatchEthernetType(2048L),
714                     new NxMatchTcpDestinationPort(384, 65408),
715                     new MatchIpProtocol(6 as short),
716                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
717                     new MatchTcpFlags(2)
718                 ]
719                 priority = 61005
720                 tableId = 211 as short
721             ],
722             new FlowEntity(123bi) => [
723                 cookie = 110100480bi
724                 flowId = "SYN_TCP_DESTINATION_768_65528Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
725                 flowName = "ACL_SYN_"
726                 instructionInfoList = #[
727                     new InstructionApplyActions(#[
728                         new ActionNxResubmit(17 as short)
729                     ])
730                 ]
731                 matchInfoList = #[
732                     new MatchEthernetType(2048L),
733                     new MatchEthernetType(2048L),
734                     new NxMatchTcpDestinationPort(768, 65528),
735                     new MatchIpProtocol(6 as short),
736                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
737                     new MatchTcpFlags(2)
738                 ]
739                 priority = 61005
740                 tableId = 211 as short
741             ]
742         ]
743     }
744
745    protected def icmpIngressFlowsPort3() {
746         #[
747             new FlowEntity(123bi) => [
748                 cookie = 110100480bi
749                 flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
750                 flowName = "ACL"
751                 instructionInfoList = #[
752                     new InstructionApplyActions(#[
753                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
754                         new ActionNxResubmit(220 as short)
755                     ])
756                 ]
757                 matchInfoList = #[
758                     new MatchEthernetType(2048L),
759                     new MatchEthernetType(2048L),
760                     new MatchIcmpv4(2 as short, 3 as short),
761                     new MatchIpProtocol(1 as short),
762                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
763                     new NxMatchCtState(33L, 33L)
764                 ]
765                 priority = IdHelper.getId(flowId)
766                 tableId = 243 as short
767             ],
768             new FlowEntity(123bi) => [
769                 cookie = 110100480bi
770                 flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426a22"
771                 flowName = "ACL"
772                 instructionInfoList = #[
773                     new InstructionApplyActions(#[
774                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
775                         new ActionNxResubmit(220 as short)
776                     ])
777                 ]
778                 matchInfoList = #[
779                     new MatchEthernetType(2048L),
780                     new MatchEthernetType(2048L),
781                     new MatchIcmpv4(2 as short, 3 as short),
782                     new MatchIpProtocol(1 as short),
783                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
784                     new NxMatchCtState(33L, 33L)
785                 ]
786                 priority = IdHelper.getId(flowId)
787                 tableId = 243 as short
788             ]
789         ]
790     }
791
792     protected def icmpEgressFlowsPort3() {
793         #[
794             new FlowEntity(123bi) => [
795                 cookie = 110100480bi
796                 flowId = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
797                 flowName = "ACL"
798                 instructionInfoList = #[
799                     new InstructionApplyActions(#[
800                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
801                         new ActionNxResubmit(17 as short)
802                     ])
803                 ]
804                 matchInfoList = #[
805                     new MatchEthernetType(2048L),
806                     new MatchEthernetType(2048L),
807                     new MatchIcmpv4(2 as short, 3 as short),
808                     new MatchIpProtocol(1 as short),
809                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
810                     new NxMatchCtState(33L, 33L)
811                 ]
812                 priority = IdHelper.getId(flowId)
813                 tableId = 213 as short
814             ],
815             new FlowEntity(123bi) => [
816                 cookie = 110100480bi
817                 flowId = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426a21"
818                 flowName = "ACL"
819                 instructionInfoList = #[
820                     new InstructionApplyActions(#[
821                         new ActionNxConntrack(2, 1, 0, 5000, 255 as short),
822                         new ActionNxResubmit(17 as short)
823                     ])
824                 ]
825                 matchInfoList = #[
826                     new MatchEthernetType(2048L),
827                     new MatchEthernetType(2048L),
828                     new MatchIcmpv4(2 as short, 3 as short),
829                     new MatchIpProtocol(1 as short),
830                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
831                     new NxMatchCtState(33L, 33L)
832                 ]
833                 priority = IdHelper.getId(flowId)
834                 tableId = 213 as short
835             ]
836         ]
837     }
838
839     override def expectedFlows(String mac) {
840         // Code auto. generated by https://github.com/vorburger/xtendbeans
841         #[
842             new FlowEntity(123bi) => [
843                 cookie = 110100480bi
844                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
845                 flowName = "ACL"
846                 instructionInfoList = #[
847                     new InstructionApplyActions(#[
848                         new ActionNxResubmit(220 as short)
849                     ])
850                 ]
851                 matchInfoList = #[
852                     new MatchEthernetType(2048L),
853                     new MatchIpProtocol(17 as short),
854                     new MatchUdpDestinationPort(68 as short),
855                     new MatchUdpSourcePort(67 as short),
856                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
857                 ]
858                 priority = 63010
859                 tableId = 241 as short
860             ],
861             new FlowEntity(123bi) => [
862                 cookie = 110100480bi
863                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
864                 flowName = "ACL"
865                 instructionInfoList = #[
866                     new InstructionApplyActions(#[
867                         new ActionNxResubmit(220 as short)
868                     ])
869                 ]
870                 matchInfoList = #[
871                     new MatchEthernetType(34525L),
872                     new MatchIpProtocol(17 as short),
873                     new MatchUdpDestinationPort(546 as short),
874                     new MatchUdpSourcePort(547 as short),
875                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
876                 ]
877                 priority = 63010
878                 tableId = 241 as short
879             ],
880             new FlowEntity(123bi) => [
881                 cookie = 110100480bi
882                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
883                 flowName = "ACL"
884                 instructionInfoList = #[
885                     new InstructionApplyActions(#[
886                         new ActionNxResubmit(220 as short)
887                     ])
888                 ]
889                 matchInfoList = #[
890                     new MatchEthernetType(34525L),
891                     new MatchIpProtocol(58 as short),
892                     new MatchIcmpv6(130 as short, 0 as short),
893                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
894                 ]
895                 priority = 63010
896                 tableId = 241 as short
897             ],
898             new FlowEntity(123bi) => [
899                 cookie = 110100480bi
900                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
901                 flowName = "ACL"
902                 instructionInfoList = #[
903                     new InstructionApplyActions(#[
904                         new ActionNxResubmit(220 as short)
905                     ])
906                 ]
907                 matchInfoList = #[
908                     new MatchEthernetType(34525L),
909                     new MatchIpProtocol(58 as short),
910                     new MatchIcmpv6(135 as short, 0 as short),
911                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
912                 ]
913                 priority = 63010
914                 tableId = 241 as short
915             ],
916             new FlowEntity(123bi) => [
917                 cookie = 110100480bi
918                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
919                 flowName = "ACL"
920                 instructionInfoList = #[
921                     new InstructionApplyActions(#[
922                         new ActionNxResubmit(220 as short)
923                     ])
924                 ]
925                 matchInfoList = #[
926                     new MatchEthernetType(34525L),
927                     new MatchIpProtocol(58 as short),
928                     new MatchIcmpv6(136 as short, 0 as short),
929                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
930                 ]
931                 priority = 63010
932                 tableId = 241 as short
933             ],
934             new FlowEntity(123bi) => [
935                 cookie = 110100480bi
936                 flowId = "Ingress_ARP_123_987"
937                 flowName = "ACL"
938                 instructionInfoList = #[
939                     new InstructionApplyActions(#[
940                         new ActionNxResubmit(220 as short)
941                     ])
942                 ]
943                 matchInfoList = #[
944                     new MatchEthernetType(2054L),
945                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
946                 ]
947                 priority = 63010
948                 tableId = 241 as short
949             ],
950             new FlowEntity(123bi) => [
951                 cookie = 110100480bi
952                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
953                 flowName = "ACL"
954                 instructionInfoList = #[
955                     new InstructionApplyActions(#[
956                         new ActionNxResubmit(17 as short)
957                     ])
958                 ]
959                 matchInfoList = #[
960                     new MatchEthernetType(2048L),
961                     new MatchIpProtocol(17 as short),
962                     new MatchUdpDestinationPort(67 as short),
963                     new MatchUdpSourcePort(68 as short),
964                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
965                 ]
966                 priority = 63010
967                 tableId = 211 as short
968             ],
969             new FlowEntity(123bi) => [
970                 cookie = 110100480bi
971                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
972                 flowName = "ACL"
973                 instructionInfoList = #[
974                     new InstructionApplyActions(#[
975                         new ActionNxResubmit(17 as short)
976                     ])
977                 ]
978                 matchInfoList = #[
979                     new MatchEthernetType(34525L),
980                     new MatchIpProtocol(17 as short),
981                     new MatchUdpDestinationPort(547 as short),
982                     new MatchUdpSourcePort(546 as short),
983                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
984                 ]
985                 priority = 63010
986                 tableId = 211 as short
987             ],
988             new FlowEntity(123bi) => [
989                 cookie = 110100480bi
990                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
991                 flowName = "ACL"
992                 instructionInfoList = #[
993                 ]
994                 matchInfoList = #[
995                     new MatchEthernetType(2048L),
996                     new MatchIpProtocol(17 as short),
997                     new MatchUdpDestinationPort(68 as short),
998                     new MatchUdpSourcePort(67 as short),
999                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1000                 ]
1001                 priority = 63010
1002                 tableId = 211 as short
1003             ],
1004             new FlowEntity(123bi) => [
1005                 cookie = 110100480bi
1006                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
1007                 flowName = "ACL"
1008                 instructionInfoList = #[
1009                 ]
1010                 matchInfoList = #[
1011                     new MatchEthernetType(34525L),
1012                     new MatchIpProtocol(17 as short),
1013                     new MatchUdpDestinationPort(546 as short),
1014                     new MatchUdpSourcePort(547 as short),
1015                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1016                 ]
1017                 priority = 63010
1018                 tableId = 211 as short
1019             ],
1020             new FlowEntity(123bi) => [
1021                 cookie = 110100480bi
1022                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
1023                 flowName = "ACL"
1024                 instructionInfoList = #[
1025                 ]
1026                 matchInfoList = #[
1027                     new MatchEthernetType(34525L),
1028                     new MatchIpProtocol(58 as short),
1029                     new MatchIcmpv6(134 as short, 0 as short),
1030                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1031                 ]
1032                 priority = 63020
1033                 tableId = 211 as short
1034             ],
1035             new FlowEntity(123bi) => [
1036                 cookie = 110100480bi
1037                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
1038                 flowName = "ACL"
1039                 instructionInfoList = #[
1040                     new InstructionApplyActions(#[
1041                         new ActionNxResubmit(17 as short)
1042                     ])
1043                 ]
1044                 matchInfoList = #[
1045                     new MatchEthernetType(34525L),
1046                     new MatchIpProtocol(58 as short),
1047                     new MatchIcmpv6(133 as short, 0 as short),
1048                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1049                 ]
1050                 priority = 63010
1051                 tableId = 211 as short
1052             ],
1053             new FlowEntity(123bi) => [
1054                 cookie = 110100480bi
1055                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
1056                 flowName = "ACL"
1057                 instructionInfoList = #[
1058                     new InstructionApplyActions(#[
1059                         new ActionNxResubmit(17 as short)
1060                     ])
1061                 ]
1062                 matchInfoList = #[
1063                     new MatchEthernetType(34525L),
1064                     new MatchIpProtocol(58 as short),
1065                     new MatchIcmpv6(135 as short, 0 as short),
1066                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1067                 ]
1068                 priority = 63010
1069                 tableId = 211 as short
1070             ],
1071             new FlowEntity(123bi) => [
1072                 cookie = 110100480bi
1073                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
1074                 flowName = "ACL"
1075                 instructionInfoList = #[
1076                     new InstructionApplyActions(#[
1077                         new ActionNxResubmit(17 as short)
1078                     ])
1079                 ]
1080                 matchInfoList = #[
1081                     new MatchEthernetType(34525L),
1082                     new MatchIpProtocol(58 as short),
1083                     new MatchIcmpv6(136 as short, 0 as short),
1084                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1085                 ]
1086                 priority = 63010
1087                 tableId = 211 as short
1088             ],
1089             new FlowEntity(123bi) => [
1090                 cookie = 110100480bi
1091                 flowId = "Egress_ARP_123_987_" + mac
1092                 flowName = "ACL"
1093                 instructionInfoList = #[
1094                     new InstructionApplyActions(#[
1095                         new ActionNxResubmit
1096                     ])
1097                 ]
1098                 matchInfoList = #[
1099                     new MatchEthernetType(2054L),
1100                     new MatchArpSha(new MacAddress(mac)),
1101                     new MatchMetadata(1085217976614912bi, 1152920405095219200bi)
1102                 ]
1103                 priority = 63010
1104                 tableId = 211 as short
1105             ]
1106         ]
1107     }
1108 }