Bump odlparent->6.0.0,mdsal->5.0.3
[netvirt.git] / aclservice / impl / src / test / java / org / opendaylight / netvirt / aclservice / tests / FlowEntryObjectsBaseIpv6.xtend
1 /*
2  * Copyright (c) 2018 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.matches.MatchEthernetSource
17 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType
18 import org.opendaylight.genius.mdsalutil.matches.MatchIcmpv6
19 import org.opendaylight.genius.mdsalutil.matches.MatchIpProtocol
20 import org.opendaylight.genius.mdsalutil.matches.MatchMetadata
21 import org.opendaylight.genius.mdsalutil.matches.MatchUdpDestinationPort
22 import org.opendaylight.genius.mdsalutil.matches.MatchUdpSourcePort
23 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister
24 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix
25 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6
27
28 import static extension org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions.operator_doubleGreaterThan
29 import org.opendaylight.genius.mdsalutil.matches.MatchIpv6Destination
30 import org.opendaylight.genius.mdsalutil.matches.MatchIpv6Source
31 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetDestination
32 import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination
33 import org.opendaylight.yangtools.yang.common.Uint64
34
35 class FlowEntryObjectsBaseIpv6 {
36
37     protected def fixedFlowsPort1(String ip1, String prefix) {
38         #[ fixedIngressFlowsPort1, fixedEgressFlowsPort1(ip1, prefix) ]
39     }
40
41     protected def fixedIngressFlowsPort1() {
42         #[
43             new FlowEntityBuilder >> [
44                 dpnId = Uint64.valueOf(123bi)
45                 cookie = Uint64.valueOf(110100480bi)
46                 flowId = "Ingress_DHCP_Server_v4123_987_Permit_"
47                 flowName = "Ingress_DHCP_Server_v4123_987_Permit_"
48                 instructionInfoList = #[
49                     new InstructionApplyActions(#[
50                         new ActionNxResubmit(220 as short)
51                         ])
52                     ]
53                 matchInfoList = #[
54                     new MatchEthernetType(2048L),
55                     new MatchIpProtocol(17 as short),
56                     new MatchUdpDestinationPort(68),
57                     new MatchUdpSourcePort(67),
58                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
59                 ]
60                 priority = 63010
61                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
62             ],
63             new FlowEntityBuilder >> [
64                 dpnId = Uint64.valueOf(123bi)
65                 cookie = Uint64.valueOf(110100480bi)
66                 flowId = "Ingress_DHCP_Server_v6_123_987_Permit_"
67             flowName = "Ingress_DHCP_Server_v6_123_987_Permit_"
68             instructionInfoList = #[
69                 new InstructionApplyActions(#[
70                     new ActionNxResubmit(220 as short)
71                     ])
72                 ]
73                 matchInfoList = #[
74                     new MatchEthernetType(34525L),
75                     new MatchIpProtocol(17 as short),
76                     new MatchUdpDestinationPort(546),
77                     new MatchUdpSourcePort(547),
78                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
79                 ]
80                 priority = 63010
81                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
82             ],
83             new FlowEntityBuilder >> [
84                 dpnId = Uint64.valueOf(123bi)
85                 cookie = Uint64.valueOf(110100480bi)
86                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
87             flowName = "Ingress_ICMPv6_123_987_130_Permit_"
88             instructionInfoList = #[
89                 new InstructionApplyActions(#[
90                     new ActionNxResubmit(220 as short)
91                     ])
92                 ]
93                 matchInfoList = #[
94                     new MatchEthernetType(34525L),
95                     new MatchIpProtocol(58 as short),
96                     new MatchIcmpv6(130 as short, 0 as short),
97                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
98                 ]
99                 priority = 63010
100                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
101             ],
102             new FlowEntityBuilder >> [
103                 dpnId = Uint64.valueOf(123bi)
104                 cookie = Uint64.valueOf(110100480bi)
105                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
106             flowName = "Ingress_ICMPv6_123_987_135_Permit_"
107             instructionInfoList = #[
108                 new InstructionApplyActions(#[
109                     new ActionNxResubmit(220 as short)
110                     ])
111                 ]
112                 matchInfoList = #[
113                     new MatchEthernetType(34525L),
114                     new MatchIpProtocol(58 as short),
115                     new MatchIcmpv6(135 as short, 0 as short),
116                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
117                 ]
118                 priority = 63010
119                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
120             ],
121             new FlowEntityBuilder >> [
122                 dpnId = Uint64.valueOf(123bi)
123                 cookie = Uint64.valueOf(110100480bi)
124                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
125             flowName = "Ingress_ICMPv6_123_987_136_Permit_"
126             instructionInfoList = #[
127                 new InstructionApplyActions(#[
128                     new ActionNxResubmit(220 as short)
129                     ])
130                 ]
131                 matchInfoList = #[
132                     new MatchEthernetType(34525L),
133                     new MatchIpProtocol(58 as short),
134                     new MatchIcmpv6(136 as short, 0 as short),
135                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
136                 ]
137                 priority = 63010
138                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
139             ],
140             new FlowEntityBuilder >> [
141                 dpnId = Uint64.valueOf(123bi)
142                 cookie = Uint64.valueOf(110100480bi)
143                 flowId = "Ingress_ARP_123_987"
144             flowName = "Ingress_ARP_123_987"
145             instructionInfoList = #[
146                 new InstructionApplyActions(#[
147                     new ActionNxResubmit(220 as short)
148                     ])
149                 ]
150                 matchInfoList = #[
151                     new MatchEthernetType(2054L),
152                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
153                 ]
154                 priority = 63010
155                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
156             ]
157
158             ]
159     }
160
161     protected def fixedEgressL2BroadcastFlowsPort1() {
162         #[
163             new FlowEntityBuilder >> [
164                 dpnId = Uint64.valueOf(123bi)
165                 cookie = Uint64.valueOf(110100480bi)
166                 flowId = "Egress_L2Broadcast_123_987_0D:AA:D8:42:30:F3"
167                 flowName = "Egress_L2Broadcast_123_987_0D:AA:D8:42:30:F3"
168                 instructionInfoList = #[
169                     new InstructionApplyActions(#[
170                         new ActionNxResubmit(17 as short)
171                     ])
172                 ]
173                 matchInfoList = #[
174                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F3")),
175                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
176                 ]
177                 priority = 61005
178                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
179             ]
180         ]
181      }
182
183     protected def fixedIngressL3BroadcastFlows() {
184         #[
185             new FlowEntityBuilder >> [
186                 cookie = Uint64.valueOf(110100480bi)
187                 dpnId = Uint64.valueOf(123bi)
188                 flowId = "Ingress_v4_Broadcast_123_987_10.0.0.255_Permit"
189                 flowName = "Ingress_v4_Broadcast_123_987_10.0.0.255_Permit"
190                 hardTimeOut = 0
191                 idleTimeOut = 0
192                 instructionInfoList = #[
193                     new InstructionGotoTable(NwConstants.EGRESS_ACL_CONNTRACK_CLASSIFIER_TABLE)
194                 ]
195                 matchInfoList = #[
196                     new MatchEthernetDestination(new MacAddress("ff:ff:ff:ff:ff:ff")),
197                     new MatchEthernetType(2048L),
198                     new MatchIpv4Destination(new Ipv4Prefix("10.0.0.255/32")),
199                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
200                 ]
201                 priority = 61010
202                 sendFlowRemFlag = false
203                 strictFlag = false
204                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
205             ]
206         ]
207     }
208      protected def fixedEgressFlowsPort1(String ip1, String prefix) {
209         #[
210             new FlowEntityBuilder >> [
211                 dpnId = Uint64.valueOf(123bi)
212                 cookie = Uint64.valueOf(110100480bi)
213                 flowId = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F3_Permit_"
214                 flowName = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F3_Permit_"
215                 instructionInfoList = #[
216                     new InstructionApplyActions(#[
217                         new ActionNxResubmit(17 as short)
218                     ])
219                 ]
220                 matchInfoList = #[
221                     new MatchEthernetType(34525L),
222                     new MatchIpProtocol(17 as short),
223                     new MatchUdpDestinationPort(547),
224                     new MatchUdpSourcePort(546),
225                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG),
226                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F3"))
227                 ]
228                 priority = 63010
229                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
230             ],
231             new FlowEntityBuilder >> [
232                 dpnId = Uint64.valueOf(123bi)
233                 cookie = Uint64.valueOf(110100480bi)
234                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
235                 flowName = "Egress_ICMPv6_123_987_133_Permit_"
236                 instructionInfoList = #[
237                     new InstructionApplyActions(#[
238                         new ActionNxResubmit(17 as short)
239                     ])
240                 ]
241                 matchInfoList = #[
242                     new MatchEthernetType(34525L),
243                     new MatchIpProtocol(58 as short),
244                     new MatchIcmpv6(133 as short, 0 as short),
245                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
246                 ]
247                 priority = 63010
248                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
249             ],
250             new FlowEntityBuilder >> [
251                 dpnId = Uint64.valueOf(123bi)
252                 cookie = Uint64.valueOf(110100480bi)
253                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
254                 flowName = "Egress_ICMPv6_123_987_135_Permit_"
255                 instructionInfoList = #[
256                     new InstructionApplyActions(#[
257                         new ActionNxResubmit(17 as short)
258                     ])
259                 ]
260                 matchInfoList = #[
261                     new MatchEthernetType(34525L),
262                     new MatchIpProtocol(58 as short),
263                     new MatchIcmpv6(135 as short, 0 as short),
264                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
265                 ]
266                 priority = 63010
267                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
268             ],
269             new FlowEntityBuilder >> [
270                 dpnId = Uint64.valueOf(123bi)
271                 cookie = Uint64.valueOf(110100480bi)
272                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
273                 flowName = "Egress_ICMPv6_123_987_136_Permit_"
274                 instructionInfoList = #[
275                     new InstructionApplyActions(#[
276                         new ActionNxResubmit(17 as short)
277                     ])
278                 ]
279                 matchInfoList = #[
280                     new MatchEthernetType(34525L),
281                     new MatchIpProtocol(58 as short),
282                     new MatchIcmpv6(136 as short, 0 as short),
283                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
284                 ]
285                 priority = 63010
286                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
287             ]
288         ]
289
290     }
291
292      protected def fixedIngressFlowsPort2() {
293         #[
294             new FlowEntityBuilder >> [
295                 dpnId = Uint64.valueOf(123bi)
296                 cookie = Uint64.valueOf(110100480bi)
297                 flowId = "Ingress_DHCP_Server_v4123_987_Permit_"
298                 flowName = "Ingress_DHCP_Server_v4123_987_Permit_"
299                 instructionInfoList = #[
300                     new InstructionApplyActions(#[
301                         new ActionNxResubmit(220 as short)
302                     ])
303                 ]
304                 matchInfoList = #[
305                     new MatchEthernetType(2048L),
306                     new MatchIpProtocol(17 as short),
307                     new MatchUdpDestinationPort(68),
308                     new MatchUdpSourcePort(67),
309                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
310                 ]
311                 priority = 63010
312                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
313             ],
314             new FlowEntityBuilder >> [
315                 dpnId = Uint64.valueOf(123bi)
316                 cookie = Uint64.valueOf(110100480bi)
317                 flowId = "Ingress_DHCP_Server_v6_123_987_Permit_"
318                 flowName = "Ingress_DHCP_Server_v6_123_987_Permit_"
319                 instructionInfoList = #[
320                     new InstructionApplyActions(#[
321                         new ActionNxResubmit(220 as short)
322                     ])
323                 ]
324                 matchInfoList = #[
325                     new MatchEthernetType(34525L),
326                     new MatchIpProtocol(17 as short),
327                     new MatchUdpDestinationPort(546),
328                     new MatchUdpSourcePort(547),
329                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
330                 ]
331                 priority = 63010
332                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
333             ],
334             new FlowEntityBuilder >> [
335                 dpnId = Uint64.valueOf(123bi)
336                 cookie = Uint64.valueOf(110100480bi)
337                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
338                 flowName = "Ingress_ICMPv6_123_987_130_Permit_"
339                 instructionInfoList = #[
340                     new InstructionApplyActions(#[
341                         new ActionNxResubmit(220 as short)
342                     ])
343                 ]
344                 matchInfoList = #[
345                     new MatchEthernetType(34525L),
346                     new MatchIpProtocol(58 as short),
347                     new MatchIcmpv6(130 as short, 0 as short),
348                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
349                 ]
350                 priority = 63010
351                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
352             ],
353             new FlowEntityBuilder >> [
354                 dpnId = Uint64.valueOf(123bi)
355                 cookie = Uint64.valueOf(110100480bi)
356                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
357                 flowName = "Ingress_ICMPv6_123_987_135_Permit_"
358                 instructionInfoList = #[
359                     new InstructionApplyActions(#[
360                         new ActionNxResubmit(220 as short)
361                     ])
362                 ]
363                 matchInfoList = #[
364                     new MatchEthernetType(34525L),
365                     new MatchIpProtocol(58 as short),
366                     new MatchIcmpv6(135 as short, 0 as short),
367                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
368                 ]
369                 priority = 63010
370                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
371             ],
372             new FlowEntityBuilder >> [
373                 dpnId = Uint64.valueOf(123bi)
374                 cookie = Uint64.valueOf(110100480bi)
375                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
376                 flowName = "Ingress_ICMPv6_123_987_136_Permit_"
377                 instructionInfoList = #[
378                     new InstructionApplyActions(#[
379                         new ActionNxResubmit(220 as short)
380                     ])
381                 ]
382                 matchInfoList = #[
383                     new MatchEthernetType(34525L),
384                     new MatchIpProtocol(58 as short),
385                     new MatchIcmpv6(136 as short, 0 as short),
386                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
387                 ]
388                 priority = 63010
389                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
390             ],
391             new FlowEntityBuilder >> [
392                 dpnId = Uint64.valueOf(123bi)
393                 cookie = Uint64.valueOf(110100480bi)
394                 flowId = "Ingress_ARP_123_987"
395                 flowName = "Ingress_ARP_123_987"
396                 instructionInfoList = #[
397                     new InstructionApplyActions(#[
398                         new ActionNxResubmit(220 as short)
399                     ])
400                 ]
401                 matchInfoList = #[
402                     new MatchEthernetType(2054L),
403                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
404                 ]
405                 priority = 63010
406                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
407             ]
408         ]
409     }
410
411      protected def fixedEgressL2BroadcastFlowsPort2 () {
412         #[
413             new FlowEntityBuilder >> [
414                 dpnId = Uint64.valueOf(123bi)
415                 cookie = Uint64.valueOf(110100480bi)
416                 flowId = "Egress_L2Broadcast_123_987_0D:AA:D8:42:30:F4"
417                 flowName = "Egress_L2Broadcast_123_987_0D:AA:D8:42:30:F4"
418                 instructionInfoList = #[
419                     new InstructionApplyActions(#[
420                         new ActionNxResubmit(17 as short)
421                     ])
422                 ]
423                 matchInfoList = #[
424                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F4")),
425                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
426                 ]
427                 priority = 61005
428                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
429             ]
430          ]
431      }
432
433      protected def fixedEgressFlowsPort2 (String ip2, String prefix) {
434         #[
435             new FlowEntityBuilder >> [
436                 dpnId = Uint64.valueOf(123bi)
437                 cookie = Uint64.valueOf(110100480bi)
438                 flowId = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F4_Permit_"
439                 flowName = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F4_Permit_"
440                 instructionInfoList = #[
441                     new InstructionApplyActions(#[
442                         new ActionNxResubmit(17 as short)
443                     ])
444                 ]
445                 matchInfoList = #[
446                     new MatchEthernetType(34525L),
447                     new MatchIpProtocol(17 as short),
448                     new MatchUdpDestinationPort(547 as short),
449                     new MatchUdpSourcePort(546 as short),
450                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG),
451                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F4"))
452                 ]
453                 priority = 63010
454                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
455             ],
456             new FlowEntityBuilder >> [
457                 dpnId = Uint64.valueOf(123bi)
458                 cookie = Uint64.valueOf(110100480bi)
459                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
460                 flowName = "Egress_ICMPv6_123_987_133_Permit_"
461                 instructionInfoList = #[
462                     new InstructionApplyActions(#[
463                         new ActionNxResubmit(17 as short)
464                     ])
465                 ]
466                 matchInfoList = #[
467                     new MatchEthernetType(34525L),
468                     new MatchIpProtocol(58 as short),
469                     new MatchIcmpv6(133 as short, 0 as short),
470                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
471                 ]
472                 priority = 63010
473                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
474             ],
475             new FlowEntityBuilder >> [
476                 dpnId = Uint64.valueOf(123bi)
477                 cookie = Uint64.valueOf(110100480bi)
478                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
479                 flowName = "Egress_ICMPv6_123_987_135_Permit_"
480                 instructionInfoList = #[
481                     new InstructionApplyActions(#[
482                         new ActionNxResubmit(17 as short)
483                     ])
484                 ]
485                 matchInfoList = #[
486                     new MatchEthernetType(34525L),
487                     new MatchIpProtocol(58 as short),
488                     new MatchIcmpv6(135 as short, 0 as short),
489                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
490                 ]
491                 priority = 63010
492                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
493             ],
494             new FlowEntityBuilder >> [
495                 dpnId = Uint64.valueOf(123bi)
496                 cookie = Uint64.valueOf(110100480bi)
497                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
498                 flowName = "Egress_ICMPv6_123_987_136_Permit_"
499                 instructionInfoList = #[
500                     new InstructionApplyActions(#[
501                         new ActionNxResubmit(17 as short)
502                     ])
503                 ]
504                 matchInfoList = #[
505                     new MatchEthernetType(34525L),
506                     new MatchIpProtocol(58 as short),
507                     new MatchIcmpv6(136 as short, 0 as short),
508                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
509                 ]
510                 priority = 63010
511                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
512             ]
513         ]
514     }
515
516      protected def fixedIngressFlowsPort3() {
517         #[
518             new FlowEntityBuilder >> [
519                 dpnId = Uint64.valueOf(123bi)
520                 cookie = Uint64.valueOf(110100480bi)
521                 flowId = "Ingress_DHCP_Server_v4123_987_Permit_"
522                 flowName = "Ingress_DHCP_Server_v4123_987_Permit_"
523                 instructionInfoList = #[
524                     new InstructionApplyActions(#[
525                         new ActionNxResubmit(220 as short)
526                     ])
527                 ]
528                 matchInfoList = #[
529                     new MatchEthernetType(2048L),
530                     new MatchIpProtocol(17 as short),
531                     new MatchUdpDestinationPort(68),
532                     new MatchUdpSourcePort(67),
533                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
534                 ]
535                 priority = 63010
536                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
537             ],
538             new FlowEntityBuilder >> [
539                 dpnId = Uint64.valueOf(123bi)
540                 cookie = Uint64.valueOf(110100480bi)
541                 flowId = "Ingress_DHCP_Server_v6_123_987_Permit_"
542                 flowName = "Ingress_DHCP_Server_v6_123_987_Permit_"
543                 instructionInfoList = #[
544                     new InstructionApplyActions(#[
545                         new ActionNxResubmit(220 as short)
546                     ])
547                 ]
548                 matchInfoList = #[
549                     new MatchEthernetType(34525L),
550                     new MatchIpProtocol(17 as short),
551                     new MatchUdpDestinationPort(546),
552                     new MatchUdpSourcePort(547),
553                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
554                 ]
555                 priority = 63010
556                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
557             ],
558             new FlowEntityBuilder >> [
559                 dpnId = Uint64.valueOf(123bi)
560                 cookie = Uint64.valueOf(110100480bi)
561                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
562                 flowName = "Ingress_ICMPv6_123_987_130_Permit_"
563                 instructionInfoList = #[
564                     new InstructionApplyActions(#[
565                         new ActionNxResubmit(220 as short)
566                     ])
567                 ]
568                 matchInfoList = #[
569                     new MatchEthernetType(34525L),
570                     new MatchIpProtocol(58 as short),
571                     new MatchIcmpv6(130 as short, 0 as short),
572                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
573                 ]
574                 priority = 63010
575                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
576             ],
577             new FlowEntityBuilder >> [
578                 dpnId = Uint64.valueOf(123bi)
579                 cookie = Uint64.valueOf(110100480bi)
580                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
581                 flowName = "Ingress_ICMPv6_123_987_135_Permit_"
582                 instructionInfoList = #[
583                     new InstructionApplyActions(#[
584                         new ActionNxResubmit(220 as short)
585                     ])
586                 ]
587                 matchInfoList = #[
588                     new MatchEthernetType(34525L),
589                     new MatchIpProtocol(58 as short),
590                     new MatchIcmpv6(135 as short, 0 as short),
591                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
592                 ]
593                 priority = 63010
594                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
595             ],
596             new FlowEntityBuilder >> [
597                 dpnId = Uint64.valueOf(123bi)
598                 cookie = Uint64.valueOf(110100480bi)
599                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
600                 flowName = "Ingress_ICMPv6_123_987_136_Permit_"
601                 instructionInfoList = #[
602                     new InstructionApplyActions(#[
603                         new ActionNxResubmit(220 as short)
604                     ])
605                 ]
606                 matchInfoList = #[
607                     new MatchEthernetType(34525L),
608                     new MatchIpProtocol(58 as short),
609                     new MatchIcmpv6(136 as short, 0 as short),
610                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
611                 ]
612                 priority = 63010
613                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
614             ],
615             new FlowEntityBuilder >> [
616                 dpnId = Uint64.valueOf(123bi)
617                 cookie = Uint64.valueOf(110100480bi)
618                 flowId = "Ingress_ARP_123_987"
619                 flowName = "Ingress_ARP_123_987"
620                 instructionInfoList = #[
621                     new InstructionApplyActions(#[
622                         new ActionNxResubmit(220 as short)
623                     ])
624                 ]
625                 matchInfoList = #[
626                     new MatchEthernetType(2054L),
627                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
628                 ]
629                 priority = 63010
630                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
631             ]
632         ]
633     }
634
635     protected def fixedEgressL2BroadcastFlowsPort3 () {
636        #[
637            new FlowEntityBuilder >> [
638                dpnId = Uint64.valueOf(123bi)
639                cookie = Uint64.valueOf(110100480bi)
640                flowId = "Egress_L2Broadcast_123_987_0D:AA:D8:42:30:F5"
641                flowName = "Egress_L2Broadcast_123_987_0D:AA:D8:42:30:F5"
642                instructionInfoList = #[
643                    new InstructionApplyActions(#[
644                        new ActionNxResubmit(17 as short)
645                    ])
646                ]
647                matchInfoList = #[
648                    new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F5")),
649                    new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
650                ]
651                priority = 61005
652                tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
653            ]
654         ]
655     }
656
657      protected def fixedEgressFlowsPort3 (String ip3, String prefix) {
658         #[
659             new FlowEntityBuilder >> [
660                 dpnId = Uint64.valueOf(123bi)
661                 cookie = Uint64.valueOf(110100480bi)
662                 flowId = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F5_Permit_"
663                 flowName = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F5_Permit_"
664                 instructionInfoList = #[
665                     new InstructionApplyActions(#[
666                         new ActionNxResubmit(17 as short)
667                     ])
668                 ]
669                 matchInfoList = #[
670                     new MatchEthernetType(34525L),
671                     new MatchIpProtocol(17 as short),
672                     new MatchUdpDestinationPort(547),
673                     new MatchUdpSourcePort(546),
674                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG),
675                     new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F5"))
676                 ]
677                 priority = 63010
678                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
679             ],
680             new FlowEntityBuilder >> [
681                 dpnId = Uint64.valueOf(123bi)
682                 cookie = Uint64.valueOf(110100480bi)
683                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
684                 flowName = "Egress_ICMPv6_123_987_133_Permit_"
685                 instructionInfoList = #[
686                     new InstructionApplyActions(#[
687                         new ActionNxResubmit(17 as short)
688                     ])
689                 ]
690                 matchInfoList = #[
691                     new MatchEthernetType(34525L),
692                     new MatchIpProtocol(58 as short),
693                     new MatchIcmpv6(133 as short, 0 as short),
694                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
695                 ]
696                 priority = 63010
697                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
698             ],
699             new FlowEntityBuilder >> [
700                 dpnId = Uint64.valueOf(123bi)
701                 cookie = Uint64.valueOf(110100480bi)
702                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
703                 flowName = "Egress_ICMPv6_123_987_135_Permit_"
704                 instructionInfoList = #[
705                     new InstructionApplyActions(#[
706                         new ActionNxResubmit(17 as short)
707                     ])
708                 ]
709                 matchInfoList = #[
710                     new MatchEthernetType(34525L),
711                     new MatchIpProtocol(58 as short),
712                     new MatchIcmpv6(135 as short, 0 as short),
713                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
714                 ]
715                 priority = 63010
716                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
717             ],
718             new FlowEntityBuilder >> [
719                 dpnId = Uint64.valueOf(123bi)
720                 cookie = Uint64.valueOf(110100480bi)
721                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
722                 flowName = "Egress_ICMPv6_123_987_136_Permit_"
723                 instructionInfoList = #[
724                     new InstructionApplyActions(#[
725                         new ActionNxResubmit(17 as short)
726                     ])
727                 ]
728                 matchInfoList = #[
729                     new MatchEthernetType(34525L),
730                     new MatchIpProtocol(58 as short),
731                     new MatchIcmpv6(136 as short, 0 as short),
732                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
733                 ]
734                 priority = 63010
735                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
736             ]
737         ]
738     }
739
740     static def fixedIngressFlowsPort4() {
741         #[
742             new FlowEntityBuilder >> [
743                 dpnId = Uint64.valueOf(123bi)
744                 cookie = Uint64.valueOf(110100480bi)
745                 flowId = "Ingress_DHCP_Server_v4123_987_Permit_"
746                 flowName = "Ingress_DHCP_Server_v4123_987_Permit_"
747                 instructionInfoList = #[
748                     new InstructionApplyActions(#[
749                         new ActionNxResubmit(220 as short)
750                     ])
751                 ]
752                 matchInfoList = #[
753                     new MatchEthernetType(2048L),
754                     new MatchIpProtocol(17 as short),
755                     new MatchUdpDestinationPort(68),
756                     new MatchUdpSourcePort(67),
757                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
758                 ]
759                 priority = 63010
760                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
761             ],
762             new FlowEntityBuilder >> [
763                 dpnId = Uint64.valueOf(123bi)
764                 cookie = Uint64.valueOf(110100480bi)
765                 flowId = "Ingress_DHCP_Server_v6_123_987_Permit_"
766                 flowName = "Ingress_DHCP_Server_v6_123_987_Permit_"
767                 instructionInfoList = #[
768                     new InstructionApplyActions(#[
769                         new ActionNxResubmit(220 as short)
770                     ])
771                 ]
772                 matchInfoList = #[
773                     new MatchEthernetType(34525L),
774                     new MatchIpProtocol(17 as short),
775                     new MatchUdpDestinationPort(546),
776                     new MatchUdpSourcePort(547),
777                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
778                 ]
779                 priority = 63010
780                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
781             ],
782             new FlowEntityBuilder >> [
783                 dpnId = Uint64.valueOf(123bi)
784                 cookie = Uint64.valueOf(110100480bi)
785                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
786                 flowName = "Ingress_ICMPv6_123_987_130_Permit_"
787                 instructionInfoList = #[
788                     new InstructionApplyActions(#[
789                         new ActionNxResubmit(220 as short)
790                     ])
791                 ]
792                 matchInfoList = #[
793                     new MatchEthernetType(34525L),
794                     new MatchIpProtocol(58 as short),
795                     new MatchIcmpv6(130 as short, 0 as short),
796                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
797                 ]
798                 priority = 63010
799                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
800             ],
801             new FlowEntityBuilder >> [
802                 dpnId = Uint64.valueOf(123bi)
803                 cookie = Uint64.valueOf(110100480bi)
804                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
805                 flowName = "Ingress_ICMPv6_123_987_135_Permit_"
806                 instructionInfoList = #[
807                     new InstructionApplyActions(#[
808                         new ActionNxResubmit(220 as short)
809                     ])
810                 ]
811                 matchInfoList = #[
812                     new MatchEthernetType(34525L),
813                     new MatchIpProtocol(58 as short),
814                     new MatchIcmpv6(135 as short, 0 as short),
815                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
816                 ]
817                 priority = 63010
818                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
819             ],
820             new FlowEntityBuilder >> [
821                 dpnId = Uint64.valueOf(123bi)
822                 cookie = Uint64.valueOf(110100480bi)
823                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
824                 flowName = "Ingress_ICMPv6_123_987_136_Permit_"
825                 instructionInfoList = #[
826                     new InstructionApplyActions(#[
827                         new ActionNxResubmit(220 as short)
828                     ])
829                 ]
830                 matchInfoList = #[
831                     new MatchEthernetType(34525L),
832                     new MatchIpProtocol(58 as short),
833                     new MatchIcmpv6(136 as short, 0 as short),
834                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
835                 ]
836                 priority = 63010
837                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
838             ],
839             new FlowEntityBuilder >> [
840                 dpnId = Uint64.valueOf(123bi)
841                 cookie = Uint64.valueOf(110100480bi)
842                 flowId = "Ingress_ARP_123_987"
843                 flowName = "Ingress_ARP_123_987"
844                 instructionInfoList = #[
845                     new InstructionApplyActions(#[
846                         new ActionNxResubmit(220 as short)
847                     ])
848                 ]
849                 matchInfoList = #[
850                     new MatchEthernetType(2054L),
851                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
852                 ]
853                 priority = 63010
854                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
855             ]
856         ]
857     }
858
859     static def fixedEgressFlowsPort4 () {
860         #[
861             new FlowEntityBuilder >> [
862                 dpnId = Uint64.valueOf(123bi)
863                 cookie = Uint64.valueOf(110100480bi)
864                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
865                 flowName = "Egress_DHCP_Client_v6_123_987__Permit_"
866                 instructionInfoList = #[
867                     new InstructionApplyActions(#[
868                         new ActionNxResubmit(17 as short)
869                     ])
870                 ]
871                 matchInfoList = #[
872                     new MatchEthernetType(34525L),
873                     new MatchIpProtocol(17 as short),
874                     new MatchUdpDestinationPort(547),
875                     new MatchUdpSourcePort(546),
876                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
877                 ]
878                 priority = 63010
879                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
880             ],
881             new FlowEntityBuilder >> [
882                 dpnId = Uint64.valueOf(123bi)
883                 cookie = Uint64.valueOf(110100480bi)
884                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
885                 flowName = "Egress_DHCP_Client_v6_123_987__Permit_"
886                 instructionInfoList = #[
887                     new InstructionApplyActions(#[
888                         new ActionNxResubmit(17 as short)
889                     ])
890                 ]
891                 matchInfoList = #[
892                     new MatchEthernetType(34525L),
893                     new MatchIpProtocol(17 as short),
894                     new MatchUdpDestinationPort(547),
895                     new MatchUdpSourcePort(546),
896                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
897                 ]
898                 priority = 63010
899                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
900             ],
901             new FlowEntityBuilder >> [
902                 dpnId = Uint64.valueOf(123bi)
903                 cookie = Uint64.valueOf(110100480bi)
904                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
905                 flowName = "Egress_ICMPv6_123_987_133_Permit_"
906                 instructionInfoList = #[
907                     new InstructionApplyActions(#[
908                         new ActionNxResubmit(17 as short)
909                     ])
910                 ]
911                 matchInfoList = #[
912                     new MatchEthernetType(34525L),
913                     new MatchIpProtocol(58 as short),
914                     new MatchIcmpv6(133 as short, 0 as short),
915                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
916                 ]
917                 priority = 63010
918                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
919             ],
920             new FlowEntityBuilder >> [
921                 dpnId = Uint64.valueOf(123bi)
922                 cookie = Uint64.valueOf(110100480bi)
923                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
924                 flowName = "Egress_ICMPv6_123_987_135_Permit_"
925                 instructionInfoList = #[
926                     new InstructionApplyActions(#[
927                         new ActionNxResubmit(17 as short)
928                     ])
929                 ]
930                 matchInfoList = #[
931                     new MatchEthernetType(34525L),
932                     new MatchIpProtocol(58 as short),
933                     new MatchIcmpv6(135 as short, 0 as short),
934                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
935                 ]
936                 priority = 63010
937                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
938             ],
939             new FlowEntityBuilder >> [
940                 dpnId = Uint64.valueOf(123bi)
941                 cookie = Uint64.valueOf(110100480bi)
942                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
943                 flowName = "Egress_ICMPv6_123_987_136_Permit_"
944                 instructionInfoList = #[
945                     new InstructionApplyActions(#[
946                         new ActionNxResubmit(17 as short)
947                     ])
948                 ]
949                 matchInfoList = #[
950                     new MatchEthernetType(34525L),
951                     new MatchIpProtocol(58 as short),
952                     new MatchIcmpv6(136 as short, 0 as short),
953                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
954                 ]
955                 priority = 63010
956                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
957             ]
958         ]
959     }
960
961     protected def remoteFlows(String ip1, String ip2, String prefix) {
962         remoteIngressFlowsPort1(ip1, prefix)
963         + remoteEgressFlowsPort1(ip1, prefix)
964         + remoteIngressFlowsPort2(ip2, prefix)
965         + remoteEgressFlowsPort2(ip2, prefix)
966     }
967
968     protected def remoteIngressFlowsPort1(String ip1, String prefix) {
969         #[
970             remoteIngressFlowsPort(ip1, prefix)
971          ]
972     }
973
974     protected def remoteIngressFlowsPort2(String ip2, String prefix) {
975         #[
976             remoteIngressFlowsPort(ip2, prefix)
977          ]
978     }
979
980
981     protected def remoteEgressFlowsPort1(String ip1, String prefix) {
982         #[
983             remoteEgressFlowsPort(ip1, prefix)
984          ]
985     }
986
987     protected def remoteEgressFlowsPort2(String ip2, String prefix) {
988         #[
989             remoteEgressFlowsPort(ip2, prefix)
990          ]
991     }
992
993     protected def remoteIngressFlowsPort(String ip, String prefix) {
994         new FlowEntityBuilder >> [
995             dpnId = Uint64.valueOf(123bi)
996             cookie = Uint64.valueOf(110100480bi)
997             flowId = "Acl_Filter_Egress_" + ip + "/" + prefix + "_2"
998             flowName = "Acl_Filter_Egress_" + ip + "/" + prefix + "_2"
999             instructionInfoList = #[
1000                new InstructionGotoTable(NwConstants.INGRESS_ACL_COMMITTER_TABLE)
1001             ]
1002             matchInfoList = #[
1003                 new MatchMetadata(Uint64.valueOf(32bi),Uint64.valueOf(16777200bi)),
1004                 new MatchEthernetType(34525L),
1005                 new MatchIpv6Destination(ip + "/"+ prefix)
1006             ]
1007             priority = 100
1008             tableId = NwConstants.INGRESS_REMOTE_ACL_TABLE
1009         ]
1010     }
1011
1012     protected def remoteIngressFlowsPortIpv4(String ip, String prefix) {
1013         new FlowEntityBuilder >> [
1014             dpnId = Uint64.valueOf(123bi)
1015             cookie = Uint64.valueOf(110100480bi)
1016             flowId = "Acl_Filter_Egress_" + ip + "/" + prefix + "_2"
1017             flowName = "Acl_Filter_Egress_" + ip + "/" + prefix + "_2"
1018             instructionInfoList = #[
1019                new InstructionGotoTable(NwConstants.INGRESS_ACL_COMMITTER_TABLE)
1020             ]
1021             matchInfoList = #[
1022                 new MatchMetadata(Uint64.valueOf(32bi),Uint64.valueOf(16777200bi)),
1023                 new MatchEthernetType(2048L),
1024                 new MatchIpv4Destination(ip, prefix)
1025             ]
1026             priority = 100
1027             tableId = NwConstants.INGRESS_REMOTE_ACL_TABLE
1028         ]
1029     }
1030
1031     protected def remoteEgressFlowsPort(String ip, String prefix) {
1032         new FlowEntityBuilder >> [
1033             dpnId = Uint64.valueOf(123bi)
1034             cookie = Uint64.valueOf(110100480bi)
1035             flowId = "Acl_Filter_Ingress_" + ip + "/" + prefix + "_2"
1036             flowName = "Acl_Filter_Ingress_" + ip + "/" + prefix + "_2"
1037             instructionInfoList = #[
1038                 new InstructionGotoTable(NwConstants.EGRESS_ACL_COMMITTER_TABLE)
1039             ]
1040             matchInfoList = #[
1041                 new MatchMetadata(Uint64.valueOf(32bi),Uint64.valueOf(16777200bi)),
1042                 new MatchEthernetType(34525L),
1043                 new MatchIpv6Source(ip + "/"+ prefix)
1044             ]
1045             priority = 100
1046             tableId = NwConstants.EGRESS_REMOTE_ACL_TABLE
1047         ]
1048     }
1049
1050     protected def remoteIngressFlowsPort3(String ip2, String prefix) {
1051         #[
1052             new FlowEntityBuilder >> [
1053                 dpnId = Uint64.valueOf(123bi)
1054                 cookie = Uint64.valueOf(110100480bi)
1055                 flowId = "Acl_Filter_Ingress_" + ip2 + "/" + prefix + "_4"
1056                 flowName = "Acl_Filter_Ingress_" + ip2 + "/" + prefix + "_4"
1057                 instructionInfoList = #[
1058                     new InstructionGotoTable(247 as short)
1059                 ]
1060                 matchInfoList = #[
1061                     new MatchMetadata(Uint64.valueOf(64bi), Uint64.valueOf(16777200bi)),
1062                     new MatchEthernetType(34525L),
1063                     new MatchIpv6Source(ip2 + "/"+ prefix)
1064                 ]
1065                 priority = 100
1066                 tableId = 246 as short
1067             ]
1068         ]
1069     }
1070
1071     protected def remoteEgressFlowsPort3(String ip2, String prefix) {
1072         #[
1073             new FlowEntityBuilder >> [
1074                 dpnId = Uint64.valueOf(123bi)
1075                 cookie = Uint64.valueOf(110100480bi)
1076                 flowId = "Acl_Filter_Egress_" + ip2 + "/" + prefix + "_4"
1077                 flowName = "Acl_Filter_Egress_" + ip2 + "/" + prefix + "_4"
1078                 instructionInfoList = #[
1079                     new InstructionGotoTable(217 as short)
1080                 ]
1081                 matchInfoList = #[
1082                     new MatchMetadata(Uint64.valueOf(64bi), Uint64.valueOf(16777200bi)),
1083                     new MatchEthernetType(34525L),
1084                     new MatchIpv6Destination(ip2 + "/"+ prefix)
1085                 ]
1086                 priority = 100
1087                 tableId = 216 as short
1088             ]
1089         ]
1090     }
1091
1092     protected def expectedFlows(String mac, String ip1, String prefix) {
1093         // Code auto. generated by https://github.com/vorburger/xtendbeans
1094         #[
1095             new FlowEntityBuilder >> [
1096                 dpnId = Uint64.valueOf(123bi)
1097                 cookie = Uint64.valueOf(110100480bi)
1098                 flowId = "Ingress_DHCP_Server_v4123_987_Permit_"
1099                 flowName = "Ingress_DHCP_Server_v4123_987_Permit_"
1100                 instructionInfoList = #[
1101                     new InstructionApplyActions(#[
1102                         new ActionNxResubmit(220 as short)
1103                     ])
1104                 ]
1105                 matchInfoList = #[
1106                     new MatchEthernetType(2048L),
1107                     new MatchIpProtocol(17 as short),
1108                     new MatchUdpDestinationPort(68),
1109                     new MatchUdpSourcePort(67),
1110                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1111                 ]
1112                 priority = 63010
1113                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
1114             ],
1115             new FlowEntityBuilder >> [
1116                 dpnId = Uint64.valueOf(123bi)
1117                 cookie = Uint64.valueOf(110100480bi)
1118                 flowId = "Ingress_DHCP_Server_v6_123_987_Permit_"
1119                 flowName = "Ingress_DHCP_Server_v6_123_987_Permit_"
1120                 instructionInfoList = #[
1121                     new InstructionApplyActions(#[
1122                         new ActionNxResubmit(220 as short)
1123                     ])
1124                 ]
1125                 matchInfoList = #[
1126                     new MatchEthernetType(34525L),
1127                     new MatchIpProtocol(17 as short),
1128                     new MatchUdpDestinationPort(546),
1129                     new MatchUdpSourcePort(547),
1130                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1131                 ]
1132                 priority = 63010
1133                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
1134             ],
1135             new FlowEntityBuilder >> [
1136                 dpnId = Uint64.valueOf(123bi)
1137                 cookie = Uint64.valueOf(110100480bi)
1138                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
1139                 flowName = "Ingress_ICMPv6_123_987_130_Permit_"
1140                 instructionInfoList = #[
1141                     new InstructionApplyActions(#[
1142                         new ActionNxResubmit(220 as short)
1143                     ])
1144                 ]
1145                 matchInfoList = #[
1146                     new MatchEthernetType(34525L),
1147                     new MatchIpProtocol(58 as short),
1148                     new MatchIcmpv6(130 as short, 0 as short),
1149                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1150                 ]
1151                 priority = 63010
1152                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
1153             ],
1154             new FlowEntityBuilder >> [
1155                 dpnId = Uint64.valueOf(123bi)
1156                 cookie = Uint64.valueOf(110100480bi)
1157                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
1158                 flowName = "Ingress_ICMPv6_123_987_135_Permit_"
1159                 instructionInfoList = #[
1160                     new InstructionApplyActions(#[
1161                         new ActionNxResubmit(220 as short)
1162                     ])
1163                 ]
1164                 matchInfoList = #[
1165                     new MatchEthernetType(34525L),
1166                     new MatchIpProtocol(58 as short),
1167                     new MatchIcmpv6(135 as short, 0 as short),
1168                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1169                 ]
1170                 priority = 63010
1171                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
1172             ],
1173             new FlowEntityBuilder >> [
1174                 dpnId = Uint64.valueOf(123bi)
1175                 cookie = Uint64.valueOf(110100480bi)
1176                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
1177                 flowName = "Ingress_ICMPv6_123_987_136_Permit_"
1178                 instructionInfoList = #[
1179                     new InstructionApplyActions(#[
1180                         new ActionNxResubmit(220 as short)
1181                     ])
1182                 ]
1183                 matchInfoList = #[
1184                     new MatchEthernetType(34525L),
1185                     new MatchIpProtocol(58 as short),
1186                     new MatchIcmpv6(136 as short, 0 as short),
1187                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1188                 ]
1189                 priority = 63010
1190                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
1191             ],
1192             new FlowEntityBuilder >> [
1193                 dpnId = Uint64.valueOf(123bi)
1194                 cookie = Uint64.valueOf(110100480bi)
1195                 flowId = "Ingress_ARP_123_987"
1196                 flowName = "Ingress_ARP_123_987"
1197                 instructionInfoList = #[
1198                     new InstructionApplyActions(#[
1199                         new ActionNxResubmit(220 as short)
1200                     ])
1201                 ]
1202                 matchInfoList = #[
1203                     new MatchEthernetType(2054L),
1204                     new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
1205                 ]
1206                 priority = 63010
1207                 tableId = NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE
1208             ],
1209             new FlowEntityBuilder >> [
1210                 dpnId = Uint64.valueOf(123bi)
1211                 cookie = Uint64.valueOf(110100480bi)
1212                 flowId = "Egress_DHCP_Client_v6_123_987_" + mac + "_Permit_"
1213                 flowName = "Egress_DHCP_Client_v6_123_987_" + mac + "_Permit_"
1214                 instructionInfoList = #[
1215                     new InstructionApplyActions(#[
1216                         new ActionNxResubmit(17 as short)
1217                     ])
1218                 ]
1219                 matchInfoList = #[
1220                     new MatchEthernetType(34525L),
1221                     new MatchIpProtocol(17 as short),
1222                     new MatchUdpDestinationPort(547),
1223                     new MatchUdpSourcePort(546),
1224                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG),
1225                     new MatchEthernetSource(new MacAddress(mac))
1226                 ]
1227                 priority = 63010
1228                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
1229             ],
1230             new FlowEntityBuilder >> [
1231                 dpnId = Uint64.valueOf(123bi)
1232                 cookie = Uint64.valueOf(110100480bi)
1233                 flowId = "Egress_DHCP_Client_v6_123_987_" + mac + "_Permit_"
1234                 flowName = "Egress_DHCP_Client_v6_123_987_" + mac + "_Permit_"
1235                 instructionInfoList = #[
1236                     new InstructionApplyActions(#[
1237                         new ActionNxResubmit(17 as short)
1238                     ])
1239                 ]
1240                 matchInfoList = #[
1241                     new MatchEthernetType(34525L),
1242                     new MatchIpProtocol(17 as short),
1243                     new MatchUdpDestinationPort(547),
1244                     new MatchUdpSourcePort(546),
1245                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG),
1246                     new MatchEthernetSource(new MacAddress(mac))
1247                 ]
1248                 priority = 63010
1249                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
1250             ],
1251             new FlowEntityBuilder >> [
1252                 dpnId = Uint64.valueOf(123bi)
1253                 cookie = Uint64.valueOf(110100480bi)
1254                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
1255                 flowName = "Egress_ICMPv6_123_987_133_Permit_"
1256                 instructionInfoList = #[
1257                     new InstructionApplyActions(#[
1258                         new ActionNxResubmit(17 as short)
1259                     ])
1260                 ]
1261                 matchInfoList = #[
1262                     new MatchEthernetType(34525L),
1263                     new MatchIpProtocol(58 as short),
1264                     new MatchIcmpv6(133 as short, 0 as short),
1265                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
1266                 ]
1267                 priority = 63010
1268                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
1269             ],
1270             new FlowEntityBuilder >> [
1271                 dpnId = Uint64.valueOf(123bi)
1272                 cookie = Uint64.valueOf(110100480bi)
1273                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
1274                 flowName = "Egress_ICMPv6_123_987_135_Permit_"
1275                 instructionInfoList = #[
1276                     new InstructionApplyActions(#[
1277                         new ActionNxResubmit(17 as short)
1278                     ])
1279                 ]
1280                 matchInfoList = #[
1281                     new MatchEthernetType(34525L),
1282                     new MatchIpProtocol(58 as short),
1283                     new MatchIcmpv6(135 as short, 0 as short),
1284                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
1285                 ]
1286                 priority = 63010
1287                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
1288             ],
1289             new FlowEntityBuilder >> [
1290                 dpnId = Uint64.valueOf(123bi)
1291                 cookie = Uint64.valueOf(110100480bi)
1292                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
1293                 flowName = "Egress_ICMPv6_123_987_136_Permit_"
1294                 instructionInfoList = #[
1295                     new InstructionApplyActions(#[
1296                         new ActionNxResubmit(17 as short)
1297                     ])
1298                 ]
1299                 matchInfoList = #[
1300                     new MatchEthernetType(34525L),
1301                     new MatchIpProtocol(58 as short),
1302                     new MatchIcmpv6(136 as short, 0 as short),
1303                     new MatchMetadata(Uint64.valueOf(1085217976614912bi), MetaDataUtil.METADATA_MASK_LPORT_TAG)
1304                 ]
1305                 priority = 63010
1306                 tableId = NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE
1307             ]
1308         ]
1309     }
1310 }