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