move vpnservice and cleanup poms
[netvirt.git] / aclservice / impl / src / test / java / org / opendaylight / netvirt / aclservice / tests / FlowEntryObjectsBase.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.FlowEntityBuilder
11 import org.opendaylight.genius.mdsalutil.MetaDataUtil
12 import org.opendaylight.genius.mdsalutil.NwConstants
13 import org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit
14 import org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions
15 import org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable
16 import org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata
17 import org.opendaylight.genius.mdsalutil.matches.MatchArpSha
18 import org.opendaylight.genius.mdsalutil.matches.MatchArpSpa
19 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetSource
20 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType
21 import org.opendaylight.genius.mdsalutil.matches.MatchIcmpv6
22 import org.opendaylight.genius.mdsalutil.matches.MatchIpProtocol
23 import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination
24 import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Source
25 import org.opendaylight.genius.mdsalutil.matches.MatchMetadata
26 import org.opendaylight.genius.mdsalutil.matches.MatchUdpDestinationPort
27 import org.opendaylight.genius.mdsalutil.matches.MatchUdpSourcePort
28 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister
29 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix
30 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6
32
33 import static extension org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions.operator_doubleGreaterThan
34 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetDestination
35
36 class FlowEntryObjectsBase {
37
38     protected def fixedFlowsPort1() {
39         #[ fixedIngressFlowsPort1, fixedEgressFlowsPort1 ]
40     }
41
42     protected def fixedIngressFlowsPort1() {
43         #[
44             new FlowEntityBuilder >> [
45                 dpnId = 123bi
46                 cookie = 110100480bi
47                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
48                 flowName = "ACL"
49                 instructionInfoList = #[
50                     new InstructionApplyActions(#[
51                         new ActionNxResubmit(220 as short)
52                         ])
53                     ]
54                 matchInfoList = #[
55                     new MatchEthernetType(2048L),
56                     new MatchIpProtocol(17 as short),
57                     new MatchUdpDestinationPort(68),
58                     new MatchUdpSourcePort(67),
59                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
60                 ]
61                 priority = 63010
62                 tableId = NwConstants.EGRESS_ACL_TABLE
63             ],
64             new FlowEntityBuilder >> [
65                 dpnId = 123bi
66                 cookie = 110100480bi
67                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
68             flowName = "ACL"
69             instructionInfoList = #[
70                 new InstructionApplyActions(#[
71                     new ActionNxResubmit(220 as short)
72                     ])
73                 ]
74                 matchInfoList = #[
75                     new MatchEthernetType(34525L),
76                     new MatchIpProtocol(17 as short),
77                     new MatchUdpDestinationPort(546),
78                     new MatchUdpSourcePort(547),
79                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
80                 ]
81                 priority = 63010
82                 tableId = NwConstants.EGRESS_ACL_TABLE
83             ],
84             new FlowEntityBuilder >> [
85                 dpnId = 123bi
86                 cookie = 110100480bi
87                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
88             flowName = "ACL"
89             instructionInfoList = #[
90                 new InstructionApplyActions(#[
91                     new ActionNxResubmit(220 as short)
92                     ])
93                 ]
94                 matchInfoList = #[
95                     new MatchEthernetType(34525L),
96                     new MatchIpProtocol(58 as short),
97                     new MatchIcmpv6(130 as short, 0 as short),
98                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
99                 ]
100                 priority = 63010
101                 tableId = NwConstants.EGRESS_ACL_TABLE
102             ],
103             new FlowEntityBuilder >> [
104                 dpnId = 123bi
105                 cookie = 110100480bi
106                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
107             flowName = "ACL"
108             instructionInfoList = #[
109                 new InstructionApplyActions(#[
110                     new ActionNxResubmit(220 as short)
111                     ])
112                 ]
113                 matchInfoList = #[
114                     new MatchEthernetType(34525L),
115                     new MatchIpProtocol(58 as short),
116                     new MatchIcmpv6(135 as short, 0 as short),
117                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
118                 ]
119                 priority = 63010
120                 tableId = NwConstants.EGRESS_ACL_TABLE
121             ],
122             new FlowEntityBuilder >> [
123                 dpnId = 123bi
124                 cookie = 110100480bi
125                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
126             flowName = "ACL"
127             instructionInfoList = #[
128                 new InstructionApplyActions(#[
129                     new ActionNxResubmit(220 as short)
130                     ])
131                 ]
132                 matchInfoList = #[
133                     new MatchEthernetType(34525L),
134                     new MatchIpProtocol(58 as short),
135                     new MatchIcmpv6(136 as short, 0 as short),
136                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
137                 ]
138                 priority = 63010
139                 tableId = NwConstants.EGRESS_ACL_TABLE
140             ],
141             new FlowEntityBuilder >> [
142                 dpnId = 123bi
143                 cookie = 110100480bi
144                 flowId = "Ingress_ARP_123_987"
145             flowName = "ACL"
146             instructionInfoList = #[
147                 new InstructionApplyActions(#[
148                     new ActionNxResubmit(220 as short)
149                     ])
150                 ]
151                 matchInfoList = #[
152                     new MatchEthernetType(2054L),
153                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
154                 ]
155                 priority = 63010
156                 tableId = NwConstants.EGRESS_ACL_TABLE
157             ]
158
159             ]
160     }
161
162      protected def fixedEgressL2BroadcastFlowsPort1() {
163         #[
164             new FlowEntityBuilder >> [
165                 dpnId = 123bi
166                 cookie = 110100480bi
167                 flowId = "Egress_L2Broadcast_123_987_0D:AA:D8:42:30:F3"
168                 flowName = "ACL"
169                 instructionInfoList = #[
170                     new InstructionApplyActions(#[
171                         new ActionNxResubmit(17 as short)
172                     ])
173                 ]
174                 matchInfoList = #[
175                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F3")),
176                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
177                 ]
178                 priority = 61005
179                 tableId = NwConstants.INGRESS_ACL_TABLE
180             ]
181         ]
182      }
183
184      protected def fixedIngressL3BroadcastFlows() {
185         #[
186             new FlowEntityBuilder >> [
187                 cookie = 110100480bi
188                 dpnId = 123bi
189                 flowId = "Ingress_v4_Broadcast_123_987_10.0.0.255_Permit"
190                 flowName = "ACL"
191                 hardTimeOut = 0
192                 idleTimeOut = 0
193                 instructionInfoList = #[
194                     new InstructionGotoTable(NwConstants.EGRESS_ACL_REMOTE_ACL_TABLE)
195                 ]
196                 matchInfoList = #[
197                     new MatchEthernetDestination(new MacAddress("ff:ff:ff:ff:ff:ff")),
198                     new MatchEthernetType(2048L),
199                     new MatchIpv4Destination(new Ipv4Prefix("10.0.0.255/32")),
200                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
201                 ]
202                 priority = 61010
203                 sendFlowRemFlag = false
204                 strictFlag = false
205                 tableId = NwConstants.EGRESS_ACL_TABLE
206             ]
207         ]
208     }
209
210
211      protected def fixedEgressFlowsPort1() {
212         #[
213             new FlowEntityBuilder >> [
214                 dpnId = 123bi
215                 cookie = 110100480bi
216                 flowId = "Egress_DHCP_Client_v4123_987_0D:AA:D8:42:30:F3_Permit_"
217                 flowName = "ACL"
218                 instructionInfoList = #[
219                     new InstructionApplyActions(#[
220                         new ActionNxResubmit(17 as short)
221                     ])
222                 ]
223                 matchInfoList = #[
224                     new MatchEthernetType(2048L),
225                     new MatchIpProtocol(17 as short),
226                     new MatchUdpDestinationPort(67),
227                     new MatchUdpSourcePort(68),
228                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
229                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F3"))
230                 ]
231                 priority = 63010
232                 tableId = NwConstants.INGRESS_ACL_TABLE
233             ],
234             new FlowEntityBuilder >> [
235                 dpnId = 123bi
236                 cookie = 110100480bi
237                 flowId = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F3_Permit_"
238                 flowName = "ACL"
239                 instructionInfoList = #[
240                     new InstructionApplyActions(#[
241                         new ActionNxResubmit(17 as short)
242                     ])
243                 ]
244                 matchInfoList = #[
245                     new MatchEthernetType(34525L),
246                     new MatchIpProtocol(17 as short),
247                     new MatchUdpDestinationPort(547),
248                     new MatchUdpSourcePort(546),
249                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
250                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F3"))
251                 ]
252                 priority = 63010
253                 tableId = NwConstants.INGRESS_ACL_TABLE
254             ],
255             new FlowEntityBuilder >> [
256                 dpnId = 123bi
257                 cookie = 110100480bi
258                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
259                 flowName = "ACL"
260                 instructionInfoList = #[
261                 ]
262                 matchInfoList = #[
263                     new MatchEthernetType(2048L),
264                     new MatchIpProtocol(17 as short),
265                     new MatchUdpDestinationPort(68),
266                     new MatchUdpSourcePort(67),
267                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
268                 ]
269                 priority = 63010
270                 tableId = NwConstants.INGRESS_ACL_TABLE
271             ],
272             new FlowEntityBuilder >> [
273                 dpnId = 123bi
274                 cookie = 110100480bi
275                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
276                 flowName = "ACL"
277                 instructionInfoList = #[
278                 ]
279                 matchInfoList = #[
280                     new MatchEthernetType(34525L),
281                     new MatchIpProtocol(17 as short),
282                     new MatchUdpDestinationPort(546),
283                     new MatchUdpSourcePort(547),
284                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
285                 ]
286                 priority = 63010
287                 tableId = NwConstants.INGRESS_ACL_TABLE
288             ],
289             new FlowEntityBuilder >> [
290                 dpnId = 123bi
291                 cookie = 110100480bi
292                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
293                 flowName = "ACL"
294                 instructionInfoList = #[
295                 ]
296                 matchInfoList = #[
297                     new MatchEthernetType(34525L),
298                     new MatchIpProtocol(58 as short),
299                     new MatchIcmpv6(134 as short, 0 as short),
300                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
301                 ]
302                 priority = 63020
303                 tableId = NwConstants.INGRESS_ACL_TABLE
304             ],
305             new FlowEntityBuilder >> [
306                 dpnId = 123bi
307                 cookie = 110100480bi
308                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
309                 flowName = "ACL"
310                 instructionInfoList = #[
311                     new InstructionApplyActions(#[
312                         new ActionNxResubmit(17 as short)
313                     ])
314                 ]
315                 matchInfoList = #[
316                     new MatchEthernetType(34525L),
317                     new MatchIpProtocol(58 as short),
318                     new MatchIcmpv6(133 as short, 0 as short),
319                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
320                 ]
321                 priority = 63010
322                 tableId = NwConstants.INGRESS_ACL_TABLE
323             ],
324             new FlowEntityBuilder >> [
325                 dpnId = 123bi
326                 cookie = 110100480bi
327                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
328                 flowName = "ACL"
329                 instructionInfoList = #[
330                     new InstructionApplyActions(#[
331                         new ActionNxResubmit(17 as short)
332                     ])
333                 ]
334                 matchInfoList = #[
335                     new MatchEthernetType(34525L),
336                     new MatchIpProtocol(58 as short),
337                     new MatchIcmpv6(135 as short, 0 as short),
338                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
339                 ]
340                 priority = 63010
341                 tableId = NwConstants.INGRESS_ACL_TABLE
342             ],
343             new FlowEntityBuilder >> [
344                 dpnId = 123bi
345                 cookie = 110100480bi
346                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
347                 flowName = "ACL"
348                 instructionInfoList = #[
349                     new InstructionApplyActions(#[
350                         new ActionNxResubmit(17 as short)
351                     ])
352                 ]
353                 matchInfoList = #[
354                     new MatchEthernetType(34525L),
355                     new MatchIpProtocol(58 as short),
356                     new MatchIcmpv6(136 as short, 0 as short),
357                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
358                 ]
359                 priority = 63010
360                 tableId = NwConstants.INGRESS_ACL_TABLE
361             ]
362         ] + fixedEgressArpFlowsPort1
363
364     }
365
366      protected def fixedEgressArpFlowsPort1() {
367         #[
368             new FlowEntityBuilder >> [
369                 dpnId = 123bi
370                 cookie = 110100480bi
371                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F310.0.0.1/32"
372                 flowName = "ACL"
373                 instructionInfoList = #[
374                     new InstructionApplyActions(#[
375                         new ActionNxResubmit(17 as short)
376                     ])
377                 ]
378                 matchInfoList = #[
379                     new MatchEthernetType(2054L),
380                     new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F3")),
381                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F3")),
382                     new MatchArpSpa(new Ipv4Prefix("10.0.0.1/32")),
383                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
384                 ]
385                 priority = 63010
386                 tableId = NwConstants.INGRESS_ACL_TABLE
387             ]
388        ]
389     }
390
391      protected def fixedIngressFlowsPort2() {
392         #[
393             new FlowEntityBuilder >> [
394                 dpnId = 123bi
395                 cookie = 110100480bi
396                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
397                 flowName = "ACL"
398                 instructionInfoList = #[
399                     new InstructionApplyActions(#[
400                         new ActionNxResubmit(220 as short)
401                     ])
402                 ]
403                 matchInfoList = #[
404                     new MatchEthernetType(2048L),
405                     new MatchIpProtocol(17 as short),
406                     new MatchUdpDestinationPort(68),
407                     new MatchUdpSourcePort(67),
408                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
409                 ]
410                 priority = 63010
411                 tableId = NwConstants.EGRESS_ACL_TABLE
412             ],
413             new FlowEntityBuilder >> [
414                 dpnId = 123bi
415                 cookie = 110100480bi
416                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
417                 flowName = "ACL"
418                 instructionInfoList = #[
419                     new InstructionApplyActions(#[
420                         new ActionNxResubmit(220 as short)
421                     ])
422                 ]
423                 matchInfoList = #[
424                     new MatchEthernetType(34525L),
425                     new MatchIpProtocol(17 as short),
426                     new MatchUdpDestinationPort(546),
427                     new MatchUdpSourcePort(547),
428                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
429                 ]
430                 priority = 63010
431                 tableId = NwConstants.EGRESS_ACL_TABLE
432             ],
433             new FlowEntityBuilder >> [
434                 dpnId = 123bi
435                 cookie = 110100480bi
436                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
437                 flowName = "ACL"
438                 instructionInfoList = #[
439                     new InstructionApplyActions(#[
440                         new ActionNxResubmit(220 as short)
441                     ])
442                 ]
443                 matchInfoList = #[
444                     new MatchEthernetType(34525L),
445                     new MatchIpProtocol(58 as short),
446                     new MatchIcmpv6(130 as short, 0 as short),
447                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
448                 ]
449                 priority = 63010
450                 tableId = NwConstants.EGRESS_ACL_TABLE
451             ],
452             new FlowEntityBuilder >> [
453                 dpnId = 123bi
454                 cookie = 110100480bi
455                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
456                 flowName = "ACL"
457                 instructionInfoList = #[
458                     new InstructionApplyActions(#[
459                         new ActionNxResubmit(220 as short)
460                     ])
461                 ]
462                 matchInfoList = #[
463                     new MatchEthernetType(34525L),
464                     new MatchIpProtocol(58 as short),
465                     new MatchIcmpv6(135 as short, 0 as short),
466                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
467                 ]
468                 priority = 63010
469                 tableId = NwConstants.EGRESS_ACL_TABLE
470             ],
471             new FlowEntityBuilder >> [
472                 dpnId = 123bi
473                 cookie = 110100480bi
474                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
475                 flowName = "ACL"
476                 instructionInfoList = #[
477                     new InstructionApplyActions(#[
478                         new ActionNxResubmit(220 as short)
479                     ])
480                 ]
481                 matchInfoList = #[
482                     new MatchEthernetType(34525L),
483                     new MatchIpProtocol(58 as short),
484                     new MatchIcmpv6(136 as short, 0 as short),
485                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
486                 ]
487                 priority = 63010
488                 tableId = NwConstants.EGRESS_ACL_TABLE
489             ],
490             new FlowEntityBuilder >> [
491                 dpnId = 123bi
492                 cookie = 110100480bi
493                 flowId = "Ingress_ARP_123_987"
494                 flowName = "ACL"
495                 instructionInfoList = #[
496                     new InstructionApplyActions(#[
497                         new ActionNxResubmit(220 as short)
498                     ])
499                 ]
500                 matchInfoList = #[
501                     new MatchEthernetType(2054L),
502                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
503                 ]
504                 priority = 63010
505                 tableId = NwConstants.EGRESS_ACL_TABLE
506             ]
507         ]
508     }
509
510      protected def fixedEgressL2BroadcastFlowsPort2 () {
511         #[
512             new FlowEntityBuilder >> [
513                 dpnId = 123bi
514                 cookie = 110100480bi
515                 flowId = "Egress_L2Broadcast_123_987_0D:AA:D8:42:30:F4"
516                 flowName = "ACL"
517                 instructionInfoList = #[
518                     new InstructionApplyActions(#[
519                         new ActionNxResubmit(17 as short)
520                     ])
521                 ]
522                 matchInfoList = #[
523                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F4")),
524                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
525                 ]
526                 priority = 61005
527                 tableId = NwConstants.INGRESS_ACL_TABLE
528             ]
529          ]
530      }
531
532      protected def fixedEgressFlowsPort2 () {
533         #[
534             new FlowEntityBuilder >> [
535                 dpnId = 123bi
536                 cookie = 110100480bi
537                 flowId = "Egress_DHCP_Client_v4123_987_0D:AA:D8:42:30:F4_Permit_"
538                 flowName = "ACL"
539                 instructionInfoList = #[
540                     new InstructionApplyActions(#[
541                         new ActionNxResubmit(17 as short)
542                     ])
543                 ]
544                 matchInfoList = #[
545                     new MatchEthernetType(2048L),
546                     new MatchIpProtocol(17 as short),
547                     new MatchUdpDestinationPort(67 as short),
548                     new MatchUdpSourcePort(68 as short),
549                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
550                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F4"))
551                 ]
552                 priority = 63010
553                 tableId = NwConstants.INGRESS_ACL_TABLE
554             ],
555             new FlowEntityBuilder >> [
556                 dpnId = 123bi
557                 cookie = 110100480bi
558                 flowId = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F4_Permit_"
559                 flowName = "ACL"
560                 instructionInfoList = #[
561                     new InstructionApplyActions(#[
562                         new ActionNxResubmit(17 as short)
563                     ])
564                 ]
565                 matchInfoList = #[
566                     new MatchEthernetType(34525L),
567                     new MatchIpProtocol(17 as short),
568                     new MatchUdpDestinationPort(547 as short),
569                     new MatchUdpSourcePort(546 as short),
570                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
571                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F4"))
572                 ]
573                 priority = 63010
574                 tableId = NwConstants.INGRESS_ACL_TABLE
575             ],
576             new FlowEntityBuilder >> [
577                 dpnId = 123bi
578                 cookie = 110100480bi
579                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
580                 flowName = "ACL"
581                 instructionInfoList = #[
582                 ]
583                 matchInfoList = #[
584                     new MatchEthernetType(2048L),
585                     new MatchIpProtocol(17 as short),
586                     new MatchUdpDestinationPort(68 as short),
587                     new MatchUdpSourcePort(67 as short),
588                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
589                 ]
590                 priority = 63010
591                 tableId = NwConstants.INGRESS_ACL_TABLE
592             ],
593             new FlowEntityBuilder >> [
594                 dpnId = 123bi
595                 cookie = 110100480bi
596                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
597                 flowName = "ACL"
598                 instructionInfoList = #[
599                 ]
600                 matchInfoList = #[
601                     new MatchEthernetType(34525L),
602                     new MatchIpProtocol(17 as short),
603                     new MatchUdpDestinationPort(546 as short),
604                     new MatchUdpSourcePort(547 as short),
605                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
606                 ]
607                 priority = 63010
608                 tableId = NwConstants.INGRESS_ACL_TABLE
609             ],
610             new FlowEntityBuilder >> [
611                 dpnId = 123bi
612                 cookie = 110100480bi
613                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
614                 flowName = "ACL"
615                 instructionInfoList = #[
616                 ]
617                 matchInfoList = #[
618                     new MatchEthernetType(34525L),
619                     new MatchIpProtocol(58 as short),
620                     new MatchIcmpv6(134 as short, 0 as short),
621                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
622                 ]
623                 priority = 63020
624                 tableId = NwConstants.INGRESS_ACL_TABLE
625             ],
626             new FlowEntityBuilder >> [
627                 dpnId = 123bi
628                 cookie = 110100480bi
629                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
630                 flowName = "ACL"
631                 instructionInfoList = #[
632                     new InstructionApplyActions(#[
633                         new ActionNxResubmit(17 as short)
634                     ])
635                 ]
636                 matchInfoList = #[
637                     new MatchEthernetType(34525L),
638                     new MatchIpProtocol(58 as short),
639                     new MatchIcmpv6(133 as short, 0 as short),
640                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
641                 ]
642                 priority = 63010
643                 tableId = NwConstants.INGRESS_ACL_TABLE
644             ],
645             new FlowEntityBuilder >> [
646                 dpnId = 123bi
647                 cookie = 110100480bi
648                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
649                 flowName = "ACL"
650                 instructionInfoList = #[
651                     new InstructionApplyActions(#[
652                         new ActionNxResubmit(17 as short)
653                     ])
654                 ]
655                 matchInfoList = #[
656                     new MatchEthernetType(34525L),
657                     new MatchIpProtocol(58 as short),
658                     new MatchIcmpv6(135 as short, 0 as short),
659                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
660                 ]
661                 priority = 63010
662                 tableId = NwConstants.INGRESS_ACL_TABLE
663             ],
664             new FlowEntityBuilder >> [
665                 dpnId = 123bi
666                 cookie = 110100480bi
667                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
668                 flowName = "ACL"
669                 instructionInfoList = #[
670                     new InstructionApplyActions(#[
671                         new ActionNxResubmit(17 as short)
672                     ])
673                 ]
674                 matchInfoList = #[
675                     new MatchEthernetType(34525L),
676                     new MatchIpProtocol(58 as short),
677                     new MatchIcmpv6(136 as short, 0 as short),
678                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
679                 ]
680                 priority = 63010
681                 tableId = NwConstants.INGRESS_ACL_TABLE
682             ]
683         ] + fixedEgressArpFlowsPort2
684     }
685
686     protected def fixedEgressArpFlowsPort2() {
687         #[
688            new FlowEntityBuilder >> [
689                 dpnId = 123bi
690                 cookie = 110100480bi
691                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F410.0.0.2/32"
692                 flowName = "ACL"
693                 instructionInfoList = #[
694                     new InstructionApplyActions(#[
695                         new ActionNxResubmit(17 as short)
696                     ])
697                 ]
698                 matchInfoList = #[
699                     new MatchEthernetType(2054L),
700                     new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F4")),
701                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F4")),
702                     new MatchArpSpa(new Ipv4Prefix("10.0.0.2/32")),
703                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
704                 ]
705                 priority = 63010
706                 tableId = NwConstants.INGRESS_ACL_TABLE
707             ]
708        ]
709     }
710
711      protected def fixedIngressFlowsPort3() {
712         #[
713             new FlowEntityBuilder >> [
714                 dpnId = 123bi
715                 cookie = 110100480bi
716                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
717                 flowName = "ACL"
718                 instructionInfoList = #[
719                     new InstructionApplyActions(#[
720                         new ActionNxResubmit(220 as short)
721                     ])
722                 ]
723                 matchInfoList = #[
724                     new MatchEthernetType(2048L),
725                     new MatchIpProtocol(17 as short),
726                     new MatchUdpDestinationPort(68),
727                     new MatchUdpSourcePort(67),
728                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
729                 ]
730                 priority = 63010
731                 tableId = NwConstants.EGRESS_ACL_TABLE
732             ],
733             new FlowEntityBuilder >> [
734                 dpnId = 123bi
735                 cookie = 110100480bi
736                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
737                 flowName = "ACL"
738                 instructionInfoList = #[
739                     new InstructionApplyActions(#[
740                         new ActionNxResubmit(220 as short)
741                     ])
742                 ]
743                 matchInfoList = #[
744                     new MatchEthernetType(34525L),
745                     new MatchIpProtocol(17 as short),
746                     new MatchUdpDestinationPort(546),
747                     new MatchUdpSourcePort(547),
748                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
749                 ]
750                 priority = 63010
751                 tableId = NwConstants.EGRESS_ACL_TABLE
752             ],
753             new FlowEntityBuilder >> [
754                 dpnId = 123bi
755                 cookie = 110100480bi
756                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
757                 flowName = "ACL"
758                 instructionInfoList = #[
759                     new InstructionApplyActions(#[
760                         new ActionNxResubmit(220 as short)
761                     ])
762                 ]
763                 matchInfoList = #[
764                     new MatchEthernetType(34525L),
765                     new MatchIpProtocol(58 as short),
766                     new MatchIcmpv6(130 as short, 0 as short),
767                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
768                 ]
769                 priority = 63010
770                 tableId = NwConstants.EGRESS_ACL_TABLE
771             ],
772             new FlowEntityBuilder >> [
773                 dpnId = 123bi
774                 cookie = 110100480bi
775                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
776                 flowName = "ACL"
777                 instructionInfoList = #[
778                     new InstructionApplyActions(#[
779                         new ActionNxResubmit(220 as short)
780                     ])
781                 ]
782                 matchInfoList = #[
783                     new MatchEthernetType(34525L),
784                     new MatchIpProtocol(58 as short),
785                     new MatchIcmpv6(135 as short, 0 as short),
786                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
787                 ]
788                 priority = 63010
789                 tableId = NwConstants.EGRESS_ACL_TABLE
790             ],
791             new FlowEntityBuilder >> [
792                 dpnId = 123bi
793                 cookie = 110100480bi
794                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
795                 flowName = "ACL"
796                 instructionInfoList = #[
797                     new InstructionApplyActions(#[
798                         new ActionNxResubmit(220 as short)
799                     ])
800                 ]
801                 matchInfoList = #[
802                     new MatchEthernetType(34525L),
803                     new MatchIpProtocol(58 as short),
804                     new MatchIcmpv6(136 as short, 0 as short),
805                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
806                 ]
807                 priority = 63010
808                 tableId = NwConstants.EGRESS_ACL_TABLE
809             ],
810             new FlowEntityBuilder >> [
811                 dpnId = 123bi
812                 cookie = 110100480bi
813                 flowId = "Ingress_ARP_123_987"
814                 flowName = "ACL"
815                 instructionInfoList = #[
816                     new InstructionApplyActions(#[
817                         new ActionNxResubmit(220 as short)
818                     ])
819                 ]
820                 matchInfoList = #[
821                     new MatchEthernetType(2054L),
822                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
823                 ]
824                 priority = 63010
825                 tableId = NwConstants.EGRESS_ACL_TABLE
826             ]
827         ]
828     }
829
830     protected def fixedEgressL2BroadcastFlowsPort3 () {
831        #[
832            new FlowEntityBuilder >> [
833                dpnId = 123bi
834                cookie = 110100480bi
835                flowId = "Egress_L2Broadcast_123_987_0D:AA:D8:42:30:F5"
836                flowName = "ACL"
837                instructionInfoList = #[
838                    new InstructionApplyActions(#[
839                        new ActionNxResubmit(17 as short)
840                    ])
841                ]
842                matchInfoList = #[
843                    new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F5")),
844                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
845                ]
846                priority = 61005
847                tableId = NwConstants.INGRESS_ACL_TABLE
848            ]
849         ]
850     }
851
852      protected def fixedEgressFlowsPort3 () {
853         #[
854             new FlowEntityBuilder >> [
855                 dpnId = 123bi
856                 cookie = 110100480bi
857                 flowId = "Egress_DHCP_Client_v4123_987_0D:AA:D8:42:30:F5_Permit_"
858                 flowName = "ACL"
859                 instructionInfoList = #[
860                     new InstructionApplyActions(#[
861                         new ActionNxResubmit(17 as short)
862                     ])
863                 ]
864                 matchInfoList = #[
865                     new MatchEthernetType(2048L),
866                     new MatchIpProtocol(17 as short),
867                     new MatchUdpDestinationPort(67),
868                     new MatchUdpSourcePort(68),
869                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
870                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F5"))
871                 ]
872                 priority = 63010
873                 tableId = NwConstants.INGRESS_ACL_TABLE
874             ],
875             new FlowEntityBuilder >> [
876                 dpnId = 123bi
877                 cookie = 110100480bi
878                 flowId = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F5_Permit_"
879                 flowName = "ACL"
880                 instructionInfoList = #[
881                     new InstructionApplyActions(#[
882                         new ActionNxResubmit(17 as short)
883                     ])
884                 ]
885                 matchInfoList = #[
886                     new MatchEthernetType(34525L),
887                     new MatchIpProtocol(17 as short),
888                     new MatchUdpDestinationPort(547),
889                     new MatchUdpSourcePort(546),
890                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
891                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F5"))
892                 ]
893                 priority = 63010
894                 tableId = NwConstants.INGRESS_ACL_TABLE
895             ],
896             new FlowEntityBuilder >> [
897                 dpnId = 123bi
898                 cookie = 110100480bi
899                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
900                 flowName = "ACL"
901                 instructionInfoList = #[
902                 ]
903                 matchInfoList = #[
904                     new MatchEthernetType(2048L),
905                     new MatchIpProtocol(17 as short),
906                     new MatchUdpDestinationPort(68),
907                     new MatchUdpSourcePort(67),
908                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
909                 ]
910                 priority = 63010
911                 tableId = NwConstants.INGRESS_ACL_TABLE
912             ],
913             new FlowEntityBuilder >> [
914                 dpnId = 123bi
915                 cookie = 110100480bi
916                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
917                 flowName = "ACL"
918                 instructionInfoList = #[
919                 ]
920                 matchInfoList = #[
921                     new MatchEthernetType(34525L),
922                     new MatchIpProtocol(17 as short),
923                     new MatchUdpDestinationPort(546),
924                     new MatchUdpSourcePort(547),
925                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
926                 ]
927                 priority = 63010
928                 tableId = NwConstants.INGRESS_ACL_TABLE
929             ],
930             new FlowEntityBuilder >> [
931                 dpnId = 123bi
932                 cookie = 110100480bi
933                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
934                 flowName = "ACL"
935                 instructionInfoList = #[
936                 ]
937                 matchInfoList = #[
938                     new MatchEthernetType(34525L),
939                     new MatchIpProtocol(58 as short),
940                     new MatchIcmpv6(134 as short, 0 as short),
941                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
942                 ]
943                 priority = 63020
944                 tableId = NwConstants.INGRESS_ACL_TABLE
945             ],
946             new FlowEntityBuilder >> [
947                 dpnId = 123bi
948                 cookie = 110100480bi
949                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
950                 flowName = "ACL"
951                 instructionInfoList = #[
952                     new InstructionApplyActions(#[
953                         new ActionNxResubmit(17 as short)
954                     ])
955                 ]
956                 matchInfoList = #[
957                     new MatchEthernetType(34525L),
958                     new MatchIpProtocol(58 as short),
959                     new MatchIcmpv6(133 as short, 0 as short),
960                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
961                 ]
962                 priority = 63010
963                 tableId = NwConstants.INGRESS_ACL_TABLE
964             ],
965             new FlowEntityBuilder >> [
966                 dpnId = 123bi
967                 cookie = 110100480bi
968                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
969                 flowName = "ACL"
970                 instructionInfoList = #[
971                     new InstructionApplyActions(#[
972                         new ActionNxResubmit(17 as short)
973                     ])
974                 ]
975                 matchInfoList = #[
976                     new MatchEthernetType(34525L),
977                     new MatchIpProtocol(58 as short),
978                     new MatchIcmpv6(135 as short, 0 as short),
979                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
980                 ]
981                 priority = 63010
982                 tableId = NwConstants.INGRESS_ACL_TABLE
983             ],
984             new FlowEntityBuilder >> [
985                 dpnId = 123bi
986                 cookie = 110100480bi
987                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
988                 flowName = "ACL"
989                 instructionInfoList = #[
990                     new InstructionApplyActions(#[
991                         new ActionNxResubmit(17 as short)
992                     ])
993                 ]
994                 matchInfoList = #[
995                     new MatchEthernetType(34525L),
996                     new MatchIpProtocol(58 as short),
997                     new MatchIcmpv6(136 as short, 0 as short),
998                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
999                 ]
1000                 priority = 63010
1001                 tableId = NwConstants.INGRESS_ACL_TABLE
1002             ],
1003             new FlowEntityBuilder >> [
1004                 dpnId = 123bi
1005                 cookie = 110100480bi
1006                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F510.0.0.3/32"
1007                 flowName = "ACL"
1008                 instructionInfoList = #[
1009                     new InstructionApplyActions(#[
1010                         new ActionNxResubmit(17 as short)
1011                     ])
1012                 ]
1013                 matchInfoList = #[
1014                     new MatchEthernetType(2054L),
1015                     new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F5")),
1016                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F5")),
1017                     new MatchArpSpa(new Ipv4Prefix("10.0.0.3/32")),
1018                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1019                 ]
1020                 priority = 63010
1021                 tableId = NwConstants.INGRESS_ACL_TABLE
1022             ]
1023         ]
1024     }
1025
1026     static def fixedIngressFlowsPort4() {
1027         #[
1028             new FlowEntityBuilder >> [
1029                 dpnId = 123bi
1030                 cookie = 110100480bi
1031                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
1032                 flowName = "ACL"
1033                 instructionInfoList = #[
1034                     new InstructionApplyActions(#[
1035                         new ActionNxResubmit(220 as short)
1036                     ])
1037                 ]
1038                 matchInfoList = #[
1039                     new MatchEthernetType(2048L),
1040                     new MatchIpProtocol(17 as short),
1041                     new MatchUdpDestinationPort(68),
1042                     new MatchUdpSourcePort(67),
1043                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1044                 ]
1045                 priority = 63010
1046                 tableId = NwConstants.EGRESS_ACL_TABLE
1047             ],
1048             new FlowEntityBuilder >> [
1049                 dpnId = 123bi
1050                 cookie = 110100480bi
1051                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
1052                 flowName = "ACL"
1053                 instructionInfoList = #[
1054                     new InstructionApplyActions(#[
1055                         new ActionNxResubmit(220 as short)
1056                     ])
1057                 ]
1058                 matchInfoList = #[
1059                     new MatchEthernetType(34525L),
1060                     new MatchIpProtocol(17 as short),
1061                     new MatchUdpDestinationPort(546),
1062                     new MatchUdpSourcePort(547),
1063                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1064                 ]
1065                 priority = 63010
1066                 tableId = NwConstants.EGRESS_ACL_TABLE
1067             ],
1068             new FlowEntityBuilder >> [
1069                 dpnId = 123bi
1070                 cookie = 110100480bi
1071                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
1072                 flowName = "ACL"
1073                 instructionInfoList = #[
1074                     new InstructionApplyActions(#[
1075                         new ActionNxResubmit(220 as short)
1076                     ])
1077                 ]
1078                 matchInfoList = #[
1079                     new MatchEthernetType(34525L),
1080                     new MatchIpProtocol(58 as short),
1081                     new MatchIcmpv6(130 as short, 0 as short),
1082                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1083                 ]
1084                 priority = 63010
1085                 tableId = NwConstants.EGRESS_ACL_TABLE
1086             ],
1087             new FlowEntityBuilder >> [
1088                 dpnId = 123bi
1089                 cookie = 110100480bi
1090                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
1091                 flowName = "ACL"
1092                 instructionInfoList = #[
1093                     new InstructionApplyActions(#[
1094                         new ActionNxResubmit(220 as short)
1095                     ])
1096                 ]
1097                 matchInfoList = #[
1098                     new MatchEthernetType(34525L),
1099                     new MatchIpProtocol(58 as short),
1100                     new MatchIcmpv6(135 as short, 0 as short),
1101                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1102                 ]
1103                 priority = 63010
1104                 tableId = NwConstants.EGRESS_ACL_TABLE
1105             ],
1106             new FlowEntityBuilder >> [
1107                 dpnId = 123bi
1108                 cookie = 110100480bi
1109                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
1110                 flowName = "ACL"
1111                 instructionInfoList = #[
1112                     new InstructionApplyActions(#[
1113                         new ActionNxResubmit(220 as short)
1114                     ])
1115                 ]
1116                 matchInfoList = #[
1117                     new MatchEthernetType(34525L),
1118                     new MatchIpProtocol(58 as short),
1119                     new MatchIcmpv6(136 as short, 0 as short),
1120                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1121                 ]
1122                 priority = 63010
1123                 tableId = NwConstants.EGRESS_ACL_TABLE
1124             ],
1125             new FlowEntityBuilder >> [
1126                 dpnId = 123bi
1127                 cookie = 110100480bi
1128                 flowId = "Ingress_ARP_123_987"
1129                 flowName = "ACL"
1130                 instructionInfoList = #[
1131                     new InstructionApplyActions(#[
1132                         new ActionNxResubmit(220 as short)
1133                     ])
1134                 ]
1135                 matchInfoList = #[
1136                     new MatchEthernetType(2054L),
1137                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1138                 ]
1139                 priority = 63010
1140                 tableId = NwConstants.EGRESS_ACL_TABLE
1141             ]
1142         ]
1143     }
1144
1145     static def fixedEgressFlowsPort4 () {
1146         #[
1147             new FlowEntityBuilder >> [
1148                 dpnId = 123bi
1149                 cookie = 110100480bi
1150                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
1151                 flowName = "ACL"
1152                 instructionInfoList = #[
1153                     new InstructionApplyActions(#[
1154                         new ActionNxResubmit(17 as short)
1155                     ])
1156                 ]
1157                 matchInfoList = #[
1158                     new MatchEthernetType(2048L),
1159                     new MatchIpProtocol(17 as short),
1160                     new MatchUdpDestinationPort(67),
1161                     new MatchUdpSourcePort(68),
1162                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1163                 ]
1164                 priority = 63010
1165                 tableId = NwConstants.INGRESS_ACL_TABLE
1166             ],
1167             new FlowEntityBuilder >> [
1168                 dpnId = 123bi
1169                 cookie = 110100480bi
1170                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
1171                 flowName = "ACL"
1172                 instructionInfoList = #[
1173                     new InstructionApplyActions(#[
1174                         new ActionNxResubmit(17 as short)
1175                     ])
1176                 ]
1177                 matchInfoList = #[
1178                     new MatchEthernetType(34525L),
1179                     new MatchIpProtocol(17 as short),
1180                     new MatchUdpDestinationPort(547),
1181                     new MatchUdpSourcePort(546),
1182                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1183                 ]
1184                 priority = 63010
1185                 tableId = NwConstants.INGRESS_ACL_TABLE
1186             ],
1187             new FlowEntityBuilder >> [
1188                 dpnId = 123bi
1189                 cookie = 110100480bi
1190                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
1191                 flowName = "ACL"
1192                 instructionInfoList = #[
1193                 ]
1194                 matchInfoList = #[
1195                     new MatchEthernetType(2048L),
1196                     new MatchIpProtocol(17 as short),
1197                     new MatchUdpDestinationPort(68),
1198                     new MatchUdpSourcePort(67),
1199                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1200                 ]
1201                 priority = 63010
1202                 tableId = NwConstants.INGRESS_ACL_TABLE
1203             ],
1204             new FlowEntityBuilder >> [
1205                 dpnId = 123bi
1206                 cookie = 110100480bi
1207                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
1208                 flowName = "ACL"
1209                 instructionInfoList = #[
1210                 ]
1211                 matchInfoList = #[
1212                     new MatchEthernetType(34525L),
1213                     new MatchIpProtocol(17 as short),
1214                     new MatchUdpDestinationPort(546),
1215                     new MatchUdpSourcePort(547),
1216                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1217                 ]
1218                 priority = 63010
1219                 tableId = NwConstants.INGRESS_ACL_TABLE
1220             ],
1221             new FlowEntityBuilder >> [
1222                 dpnId = 123bi
1223                 cookie = 110100480bi
1224                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
1225                 flowName = "ACL"
1226                 instructionInfoList = #[
1227                 ]
1228                 matchInfoList = #[
1229                     new MatchEthernetType(34525L),
1230                     new MatchIpProtocol(58 as short),
1231                     new MatchIcmpv6(134 as short, 0 as short),
1232                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1233                 ]
1234                 priority = 63020
1235                 tableId = NwConstants.INGRESS_ACL_TABLE
1236             ],
1237             new FlowEntityBuilder >> [
1238                 dpnId = 123bi
1239                 cookie = 110100480bi
1240                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
1241                 flowName = "ACL"
1242                 instructionInfoList = #[
1243                     new InstructionApplyActions(#[
1244                         new ActionNxResubmit(17 as short)
1245                     ])
1246                 ]
1247                 matchInfoList = #[
1248                     new MatchEthernetType(34525L),
1249                     new MatchIpProtocol(58 as short),
1250                     new MatchIcmpv6(133 as short, 0 as short),
1251                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1252                 ]
1253                 priority = 63010
1254                 tableId = NwConstants.INGRESS_ACL_TABLE
1255             ],
1256             new FlowEntityBuilder >> [
1257                 dpnId = 123bi
1258                 cookie = 110100480bi
1259                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
1260                 flowName = "ACL"
1261                 instructionInfoList = #[
1262                     new InstructionApplyActions(#[
1263                         new ActionNxResubmit(17 as short)
1264                     ])
1265                 ]
1266                 matchInfoList = #[
1267                     new MatchEthernetType(34525L),
1268                     new MatchIpProtocol(58 as short),
1269                     new MatchIcmpv6(135 as short, 0 as short),
1270                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1271                 ]
1272                 priority = 63010
1273                 tableId = NwConstants.INGRESS_ACL_TABLE
1274             ],
1275             new FlowEntityBuilder >> [
1276                 dpnId = 123bi
1277                 cookie = 110100480bi
1278                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
1279                 flowName = "ACL"
1280                 instructionInfoList = #[
1281                     new InstructionApplyActions(#[
1282                         new ActionNxResubmit(17 as short)
1283                     ])
1284                 ]
1285                 matchInfoList = #[
1286                     new MatchEthernetType(34525L),
1287                     new MatchIpProtocol(58 as short),
1288                     new MatchIcmpv6(136 as short, 0 as short),
1289                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1290                 ]
1291                 priority = 63010
1292                 tableId = NwConstants.INGRESS_ACL_TABLE
1293             ],
1294             new FlowEntityBuilder >> [
1295                 dpnId = 123bi
1296                 cookie = 110100480bi
1297                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F6"
1298                 flowName = "ACL"
1299                 instructionInfoList = #[
1300                     new InstructionApplyActions(#[
1301                         new ActionNxResubmit(17 as short)
1302                     ])
1303                 ]
1304                 matchInfoList = #[
1305                     new MatchEthernetType(2054L),
1306                     new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F6")),
1307                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F6")),
1308                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1309                 ]
1310                 priority = 63010
1311                 tableId = NwConstants.INGRESS_ACL_TABLE
1312             ],
1313             new FlowEntityBuilder >> [
1314                 dpnId = 123bi
1315                 cookie = 110100480bi
1316                 flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F6"
1317                 flowName = "ACL"
1318                 instructionInfoList = #[
1319                     new InstructionApplyActions(#[
1320                         new ActionNxResubmit(17 as short)
1321                     ])
1322                 ]
1323                 matchInfoList = #[
1324                     new MatchEthernetType(2054L),
1325                     new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F6")),
1326                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F6")),
1327                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1328                 ]
1329                 priority = 63010
1330                 tableId = NwConstants.INGRESS_ACL_TABLE
1331             ]
1332         ]
1333     }
1334
1335     protected def remoteFlows() {
1336         remoteIngressFlowsPort1
1337         + remoteEgressFlowsPort1
1338         + remoteIngressFlowsPort2
1339         + remoteEgressFlowsPort2
1340     }
1341
1342     protected def remoteIngressFlowsPort1() {
1343         #[
1344             remoteIngressFlowsPort("10.0.0.1")
1345          ]
1346     }
1347
1348     protected def remoteIngressFlowsPort2() {
1349         #[
1350             remoteIngressFlowsPort("10.0.0.2")
1351          ]
1352     }
1353
1354     protected def remoteEgressFlowsPort1() {
1355         #[
1356             remoteEgressFlowsPort("10.0.0.1")
1357          ]
1358     }
1359
1360     protected def remoteEgressFlowsPort2() {
1361         #[
1362             remoteEgressFlowsPort("10.0.0.2")
1363          ]
1364     }
1365
1366     protected def remoteIngressFlowsPort(String ip) {
1367         new FlowEntityBuilder >> [
1368                 dpnId = 123bi
1369             cookie = 110100480bi
1370             flowId = "Acl_Filter_Egress_" + ip + "/32_5000"
1371             flowName = "ACL"
1372             instructionInfoList = #[
1373                 new InstructionWriteMetadata(4bi, 16777214bi),
1374                 new InstructionGotoTable(NwConstants.INGRESS_ACL_STATEFUL_APPLY_CHANGE_EXIST_TRAFFIC_TABLE)
1375             ]
1376             matchInfoList = #[
1377                 new MatchMetadata(83886080000bi, 1099494850560bi),
1378                 new MatchEthernetType(2048L),
1379                 new MatchIpv4Destination(ip, "32")
1380             ]
1381             priority = 50
1382             tableId = NwConstants.INGRESS_ACL_REMOTE_ACL_TABLE
1383         ]
1384     }
1385
1386     protected def remoteEgressFlowsPort(String ip) {
1387         new FlowEntityBuilder >> [
1388                 dpnId = 123bi
1389             cookie = 110100480bi
1390             flowId = "Acl_Filter_Ingress_" + ip + "/32_5000"
1391             flowName = "ACL"
1392             instructionInfoList = #[
1393                 new InstructionWriteMetadata(4bi, 16777214bi),
1394                 new InstructionGotoTable(NwConstants.EGRESS_ACL_STATEFUL_APPLY_CHANGE_EXIST_TRAFFIC_TABLE)
1395             ]
1396             matchInfoList = #[
1397                 new MatchMetadata(83886080000bi, 1099494850560bi),
1398                 new MatchEthernetType(2048L),
1399                 new MatchIpv4Source(ip, "32")
1400             ]
1401             priority = 50
1402             tableId = NwConstants.EGRESS_ACL_REMOTE_ACL_TABLE
1403         ]
1404     }
1405
1406     protected def expectedFlows(String mac) {
1407         // Code auto. generated by https://github.com/vorburger/xtendbeans
1408         #[
1409             new FlowEntityBuilder >> [
1410                 dpnId = 123bi
1411                 cookie = 110100480bi
1412                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
1413                 flowName = "ACL"
1414                 instructionInfoList = #[
1415                     new InstructionApplyActions(#[
1416                         new ActionNxResubmit(220 as short)
1417                     ])
1418                 ]
1419                 matchInfoList = #[
1420                     new MatchEthernetType(2048L),
1421                     new MatchIpProtocol(17 as short),
1422                     new MatchUdpDestinationPort(68),
1423                     new MatchUdpSourcePort(67),
1424                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1425                 ]
1426                 priority = 63010
1427                 tableId = NwConstants.EGRESS_ACL_TABLE
1428             ],
1429             new FlowEntityBuilder >> [
1430                 dpnId = 123bi
1431                 cookie = 110100480bi
1432                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
1433                 flowName = "ACL"
1434                 instructionInfoList = #[
1435                     new InstructionApplyActions(#[
1436                         new ActionNxResubmit(220 as short)
1437                     ])
1438                 ]
1439                 matchInfoList = #[
1440                     new MatchEthernetType(34525L),
1441                     new MatchIpProtocol(17 as short),
1442                     new MatchUdpDestinationPort(546),
1443                     new MatchUdpSourcePort(547),
1444                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1445                 ]
1446                 priority = 63010
1447                 tableId = NwConstants.EGRESS_ACL_TABLE
1448             ],
1449             new FlowEntityBuilder >> [
1450                 dpnId = 123bi
1451                 cookie = 110100480bi
1452                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
1453                 flowName = "ACL"
1454                 instructionInfoList = #[
1455                     new InstructionApplyActions(#[
1456                         new ActionNxResubmit(220 as short)
1457                     ])
1458                 ]
1459                 matchInfoList = #[
1460                     new MatchEthernetType(34525L),
1461                     new MatchIpProtocol(58 as short),
1462                     new MatchIcmpv6(130 as short, 0 as short),
1463                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1464                 ]
1465                 priority = 63010
1466                 tableId = NwConstants.EGRESS_ACL_TABLE
1467             ],
1468             new FlowEntityBuilder >> [
1469                 dpnId = 123bi
1470                 cookie = 110100480bi
1471                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
1472                 flowName = "ACL"
1473                 instructionInfoList = #[
1474                     new InstructionApplyActions(#[
1475                         new ActionNxResubmit(220 as short)
1476                     ])
1477                 ]
1478                 matchInfoList = #[
1479                     new MatchEthernetType(34525L),
1480                     new MatchIpProtocol(58 as short),
1481                     new MatchIcmpv6(135 as short, 0 as short),
1482                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1483                 ]
1484                 priority = 63010
1485                 tableId = NwConstants.EGRESS_ACL_TABLE
1486             ],
1487             new FlowEntityBuilder >> [
1488                 dpnId = 123bi
1489                 cookie = 110100480bi
1490                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
1491                 flowName = "ACL"
1492                 instructionInfoList = #[
1493                     new InstructionApplyActions(#[
1494                         new ActionNxResubmit(220 as short)
1495                     ])
1496                 ]
1497                 matchInfoList = #[
1498                     new MatchEthernetType(34525L),
1499                     new MatchIpProtocol(58 as short),
1500                     new MatchIcmpv6(136 as short, 0 as short),
1501                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1502                 ]
1503                 priority = 63010
1504                 tableId = NwConstants.EGRESS_ACL_TABLE
1505             ],
1506             new FlowEntityBuilder >> [
1507                 dpnId = 123bi
1508                 cookie = 110100480bi
1509                 flowId = "Ingress_ARP_123_987"
1510                 flowName = "ACL"
1511                 instructionInfoList = #[
1512                     new InstructionApplyActions(#[
1513                         new ActionNxResubmit(220 as short)
1514                     ])
1515                 ]
1516                 matchInfoList = #[
1517                     new MatchEthernetType(2054L),
1518                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1519                 ]
1520                 priority = 63010
1521                 tableId = NwConstants.EGRESS_ACL_TABLE
1522             ],
1523             new FlowEntityBuilder >> [
1524                 dpnId = 123bi
1525                 cookie = 110100480bi
1526                 flowId = "Egress_DHCP_Client_v4123_987_" + mac + "_Permit_"
1527                 flowName = "ACL"
1528                 instructionInfoList = #[
1529                     new InstructionApplyActions(#[
1530                         new ActionNxResubmit(17 as short)
1531                     ])
1532                 ]
1533                 matchInfoList = #[
1534                     new MatchEthernetType(2048L),
1535                     new MatchIpProtocol(17 as short),
1536                     new MatchUdpDestinationPort(67),
1537                     new MatchUdpSourcePort(68),
1538                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
1539                     new MatchEthernetSource(new MacAddress(mac))
1540                 ]
1541                 priority = 63010
1542                 tableId = NwConstants.INGRESS_ACL_TABLE
1543             ],
1544             new FlowEntityBuilder >> [
1545                 dpnId = 123bi
1546                 cookie = 110100480bi
1547                 flowId = "Egress_DHCP_Client_v6_123_987_" + mac + "_Permit_"
1548                 flowName = "ACL"
1549                 instructionInfoList = #[
1550                     new InstructionApplyActions(#[
1551                         new ActionNxResubmit(17 as short)
1552                     ])
1553                 ]
1554                 matchInfoList = #[
1555                     new MatchEthernetType(34525L),
1556                     new MatchIpProtocol(17 as short),
1557                     new MatchUdpDestinationPort(547),
1558                     new MatchUdpSourcePort(546),
1559                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
1560                     new MatchEthernetSource(new MacAddress(mac))
1561                 ]
1562                 priority = 63010
1563                 tableId = NwConstants.INGRESS_ACL_TABLE
1564             ],
1565             new FlowEntityBuilder >> [
1566                 dpnId = 123bi
1567                 cookie = 110100480bi
1568                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
1569                 flowName = "ACL"
1570                 instructionInfoList = #[
1571                 ]
1572                 matchInfoList = #[
1573                     new MatchEthernetType(2048L),
1574                     new MatchIpProtocol(17 as short),
1575                     new MatchUdpDestinationPort(68),
1576                     new MatchUdpSourcePort(67),
1577                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1578                 ]
1579                 priority = 63010
1580                 tableId = NwConstants.INGRESS_ACL_TABLE
1581             ],
1582             new FlowEntityBuilder >> [
1583                 dpnId = 123bi
1584                 cookie = 110100480bi
1585                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
1586                 flowName = "ACL"
1587                 instructionInfoList = #[
1588                 ]
1589                 matchInfoList = #[
1590                     new MatchEthernetType(34525L),
1591                     new MatchIpProtocol(17 as short),
1592                     new MatchUdpDestinationPort(546),
1593                     new MatchUdpSourcePort(547),
1594                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1595                 ]
1596                 priority = 63010
1597                 tableId = NwConstants.INGRESS_ACL_TABLE
1598             ],
1599             new FlowEntityBuilder >> [
1600                 dpnId = 123bi
1601                 cookie = 110100480bi
1602                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
1603                 flowName = "ACL"
1604                 instructionInfoList = #[
1605                 ]
1606                 matchInfoList = #[
1607                     new MatchEthernetType(34525L),
1608                     new MatchIpProtocol(58 as short),
1609                     new MatchIcmpv6(134 as short, 0 as short),
1610                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1611                 ]
1612                 priority = 63020
1613                 tableId = NwConstants.INGRESS_ACL_TABLE
1614             ],
1615             new FlowEntityBuilder >> [
1616                 dpnId = 123bi
1617                 cookie = 110100480bi
1618                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
1619                 flowName = "ACL"
1620                 instructionInfoList = #[
1621                     new InstructionApplyActions(#[
1622                         new ActionNxResubmit(17 as short)
1623                     ])
1624                 ]
1625                 matchInfoList = #[
1626                     new MatchEthernetType(34525L),
1627                     new MatchIpProtocol(58 as short),
1628                     new MatchIcmpv6(133 as short, 0 as short),
1629                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1630                 ]
1631                 priority = 63010
1632                 tableId = NwConstants.INGRESS_ACL_TABLE
1633             ],
1634             new FlowEntityBuilder >> [
1635                 dpnId = 123bi
1636                 cookie = 110100480bi
1637                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
1638                 flowName = "ACL"
1639                 instructionInfoList = #[
1640                     new InstructionApplyActions(#[
1641                         new ActionNxResubmit(17 as short)
1642                     ])
1643                 ]
1644                 matchInfoList = #[
1645                     new MatchEthernetType(34525L),
1646                     new MatchIpProtocol(58 as short),
1647                     new MatchIcmpv6(135 as short, 0 as short),
1648                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1649                 ]
1650                 priority = 63010
1651                 tableId = NwConstants.INGRESS_ACL_TABLE
1652             ],
1653             new FlowEntityBuilder >> [
1654                 dpnId = 123bi
1655                 cookie = 110100480bi
1656                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
1657                 flowName = "ACL"
1658                 instructionInfoList = #[
1659                     new InstructionApplyActions(#[
1660                         new ActionNxResubmit(17 as short)
1661                     ])
1662                 ]
1663                 matchInfoList = #[
1664                     new MatchEthernetType(34525L),
1665                     new MatchIpProtocol(58 as short),
1666                     new MatchIcmpv6(136 as short, 0 as short),
1667                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
1668                 ]
1669                 priority = 63010
1670                 tableId = NwConstants.INGRESS_ACL_TABLE
1671             ],
1672             new FlowEntityBuilder >> [
1673                 dpnId = 123bi
1674                 cookie = 110100480bi
1675                 flowId = "Egress_ARP_123_987_" + mac
1676                 flowName = "ACL"
1677                 instructionInfoList = #[
1678                     new InstructionApplyActions(#[
1679                         new ActionNxResubmit
1680                     ])
1681                 ]
1682                 matchInfoList = #[
1683                     new MatchEthernetType(2054L),
1684                     new MatchArpSha(new MacAddress(mac)),
1685                     new MatchEthernetSource(new MacAddress(mac)),
1686                     new MatchMetadata(1085217976614912bi, 1152920405095219200bi)
1687                 ]
1688                 priority = 63010
1689                 tableId = NwConstants.INGRESS_ACL_TABLE
1690             ]
1691         ]
1692     }
1693 }