@Immutable FlowEntity with FlowEntityBuilder
[netvirt.git] / vpnservice / aclservice / impl / src / test / java / org / opendaylight / netvirt / aclservice / tests / FlowEntryObjectsStateless.xtend
index 2313976547f931152907a6e4eafa86923f71e14f..ceee307c326d4f6fc73d5b42ed45e2797511cf92 100644 (file)
@@ -7,10 +7,12 @@
  */
 package org.opendaylight.netvirt.aclservice.tests
 
+import org.opendaylight.genius.mdsalutil.MetaDataUtil
 import org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack
 import org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit
-import org.opendaylight.genius.mdsalutil.FlowEntity
+import org.opendaylight.genius.mdsalutil.FlowEntityBuilder
 import org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions
+import org.opendaylight.genius.mdsalutil.matches.MatchArpSha
 import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType
 import org.opendaylight.genius.mdsalutil.matches.MatchIcmpv4
 import org.opendaylight.genius.mdsalutil.matches.MatchIcmpv6
@@ -22,9 +24,12 @@ import org.opendaylight.genius.mdsalutil.matches.MatchTcpFlags
 import org.opendaylight.genius.mdsalutil.matches.MatchUdpDestinationPort
 import org.opendaylight.genius.mdsalutil.matches.MatchUdpSourcePort
 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchCtState
+import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister
 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchTcpDestinationPort
 import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchUdpDestinationPort
-import org.opendaylight.genius.mdsalutil.MetaDataUtil
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg6
+import org.opendaylight.genius.mdsalutil.matches.MatchMetadata
 
 import static extension org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions.operator_doubleGreaterThan
 
@@ -39,6 +44,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
         + etherIngressFlowsPort2
         + fixedEgressFlowsPort2
         + etheregressFlowPort2
+        + remoteFlows
     }
 
     protected def tcpFlows() {
@@ -50,6 +56,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
         + tcpIngressFlowPort2
         + fixedEgressFlowsPort2
         + tcpEgressFlowPort2
+        + remoteFlows
     }
 
     protected def udpFlows() {
@@ -57,6 +64,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
         + fixedEgressFlowsPort1
         + fixedIngressFlowsPort2
         + fixedEgressFlowsPort2
+        + remoteFlows
     }
 
     protected def icmpFlows() {
@@ -64,6 +72,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
         + fixedEgressFlowsPort1
         + fixedIngressFlowsPort2
         + fixedEgressFlowsPort2
+        + remoteFlows
     }
 
     protected def dstRangeFlows() {
@@ -84,7 +93,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def etherFlowIngressPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
             cookie = 110100480bi
             flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
             flowName = "ACL_SYN_"
@@ -96,7 +106,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
             matchInfoList = #[
                 new MatchEthernetType(2048L),
                 new MatchEthernetType(2048L),
-                new MatchMetadata(1085217976614912bi, 1152920405095219200bi)
+                new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
             ]
             priority = 61005
             tableId = 241 as short
@@ -105,7 +115,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
  }
     protected def etherFlowEgressPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -117,7 +128,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 matchInfoList = #[
                     new MatchEthernetType(2048L),
                     new MatchEthernetType(2048L),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi)
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
                 ]
                 priority = 61005
                 tableId = 211 as short
@@ -126,7 +137,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
     }
     protected def etherIngressFlowsPort2() {
         #[
-               new FlowEntity(123bi) => [
+               new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL_SYN_"
@@ -138,12 +150,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 matchInfoList = #[
                     new MatchEthernetType(2048L),
                     new MatchEthernetType(2048L),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi)
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
                 ]
                 priority = 61005
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL_SYN_"
@@ -155,7 +168,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 matchInfoList = #[
                     new MatchEthernetType(2048L),
                     new MatchEthernetType(2048L),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi)
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
                 ]
                 priority = 61005
                 tableId = 241 as short
@@ -165,7 +178,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def etherEgressFlowsPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "[SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
         flowName = "ACL_SYN_"
@@ -177,7 +191,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
         matchInfoList = #[
             new MatchEthernetType(2048L),
             new MatchEthernetType(2048L),
-            new MatchMetadata(1085217976614912bi, 1152920405095219200bi)
+            new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
         ]
         priority = 61005
         tableId = 241 as short
@@ -187,7 +201,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def etheregressFlowPort2() {
         #[
-           new FlowEntity(123bi) => [
+           new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -199,7 +214,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 matchInfoList = #[
                     new MatchEthernetType(2048L),
                     new MatchEthernetType(2048L),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi)
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
                 ]
                 priority = 61005
                 tableId = 211 as short
@@ -209,7 +224,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpIngressFlowPort1() {
         #[
-                new FlowEntity(123bi) => [
+                new FlowEntityBuilder >> [
+                dpnId = 123bi
                     cookie = 110100480bi
                     flowId = "SYN_TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                     flowName = "ACL_SYN_"
@@ -223,7 +239,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                         new MatchEthernetType(2048L),
                         new NxMatchTcpDestinationPort(80, 65535),
                         new MatchIpProtocol(6 as short),
-                        new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                        new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                         new MatchTcpFlags(2)
                     ]
                     priority = 61005
@@ -234,7 +250,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpIngressFlowPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_80_65535Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL_SYN_"
@@ -248,7 +265,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(80, 65535),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
@@ -259,7 +276,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpEgressFlowPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -273,7 +291,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(80, 65535),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
@@ -284,7 +302,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpEgressFlowPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -298,13 +317,14 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(80, 65535),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -318,7 +338,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(80, 65535),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
@@ -329,7 +349,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def udpEgressFlowsPort1() {
         #[
-             new FlowEntity(123bi) => [
+             new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL"
@@ -355,7 +376,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def udpIngressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_80_65535_ipv4_remoteACL_interface_aap_AllowedAddressPairsKey "
                         +"[_macAddress=MacAddress [_value=0D:AA:D8:42:30:F3], _ipAddress=IpPrefixOrAddress "
@@ -375,13 +397,14 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchUdpDestinationPort(80, 65535),
                     new MatchIpProtocol(17 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
                 priority = 61010
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_80_65535_ipv4_remoteACL_interface_aap_AllowedAddressPairsKey [_macAddress=MacAddress [_value=0D:AA:D8:42:30:F4], _ipAddress=IpPrefixOrAddress [_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=10.0.0.2/24]]]]Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL"
@@ -398,7 +421,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchUdpDestinationPort(80, 65535),
                     new MatchIpProtocol(17 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
                 priority = 61010
@@ -409,7 +432,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def udpEgressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL"
@@ -435,7 +459,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def icmpIngressFlowsPort1() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL"
@@ -450,7 +475,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new MatchIcmpv4(2 as short, 3 as short),
                     new MatchIpProtocol(1 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
                 priority = 61010
@@ -461,7 +486,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def icmpIngressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL"
@@ -476,7 +502,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new MatchIcmpv4(2 as short, 3 as short),
                     new MatchIpProtocol(1 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
                 priority = 61010
@@ -487,7 +513,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def icmpEgressFlowsPort2() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "ICMP_V4_DESTINATION_23__ipv4_remoteACL_interface_aap_AllowedAddressPairsKey "
                         +"[_macAddress=MacAddress [_value=0D:AA:D8:42:30:F3], _ipAddress=IpPrefixOrAddress "
@@ -513,7 +540,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 61010
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "ICMP_V4_DESTINATION_23__ipv4_remoteACL_interface_aap_AllowedAddressPairsKey "
                         +"[_macAddress=MacAddress [_value=0D:AA:D8:42:30:F4], _ipAddress=IpPrefixOrAddress "
@@ -544,7 +572,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def udpIngressPortRangeFlows() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "UDP_DESTINATION_2000_65532Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
                 flowName = "ACL"
@@ -559,7 +588,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchUdpDestinationPort(2000, 65532),
                     new MatchIpProtocol(17 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
                 priority = 61010
@@ -570,7 +599,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
 
     protected def tcpEgressRangeFlows() {
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_776_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -584,13 +614,14 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(776, 65534),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_512_65280Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -604,13 +635,14 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(512, 65280),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_334_65534Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -624,13 +656,14 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(334, 65534),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_333_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -644,13 +677,14 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(333, 65535),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_336_65520Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -664,13 +698,14 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(336, 65520),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_352_65504Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -684,13 +719,14 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(352, 65504),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_384_65408Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -704,13 +740,14 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(384, 65408),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "SYN_TCP_DESTINATION_768_65528Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
                 flowName = "ACL_SYN_"
@@ -724,7 +761,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new NxMatchTcpDestinationPort(768, 65528),
                     new MatchIpProtocol(6 as short),
-                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi),
+                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new MatchTcpFlags(2)
                 ]
                 priority = 61005
@@ -734,10 +771,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
     }
 
    protected def icmpIngressFlowsPort3() {
+       val flowId1 = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+       val flowId2 = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426a22"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -750,15 +790,16 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new MatchIcmpv4(2 as short, 3 as short),
                     new MatchIpProtocol(1 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getFlowPriority(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 243 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426a22"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -771,20 +812,23 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(2048L),
                     new MatchIcmpv4(2 as short, 3 as short),
                     new MatchIpProtocol(1 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getFlowPriority(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 243 as short
             ]
         ]
     }
 
     protected def icmpEgressFlowsPort3() {
+        val flowId1 = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+        val flowId2 = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426a21"
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
+                flowId = flowId1
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -800,12 +844,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getFlowPriority(flowId)
+                priority = IdHelper.getId(flowId1)
                 tableId = 213 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
-                flowId = "ICMP_V4_DESTINATION_23_Egress98785cc3048-abc3-43cc-89b3-377341426a21"
+                flowId = flowId2
                 flowName = "ACL"
                 instructionInfoList = #[
                     new InstructionApplyActions(#[
@@ -821,7 +866,7 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
                     new NxMatchCtState(33L, 33L)
                 ]
-                priority = IdHelper.getFlowPriority(flowId)
+                priority = IdHelper.getId(flowId2)
                 tableId = 213 as short
             ]
         ]
@@ -830,7 +875,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
     override def expectedFlows(String mac) {
         // Code auto. generated by https://github.com/vorburger/xtendbeans
         #[
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v4123_987__Permit_"
                 flowName = "ACL"
@@ -844,12 +890,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchIpProtocol(17 as short),
                     new MatchUdpDestinationPort(68 as short),
                     new MatchUdpSourcePort(67 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
                 ]
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_DHCP_Server_v6_123_987___Permit_"
                 flowName = "ACL"
@@ -863,12 +910,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchIpProtocol(17 as short),
                     new MatchUdpDestinationPort(546 as short),
                     new MatchUdpSourcePort(547 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
                 ]
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_130_Permit_"
                 flowName = "ACL"
@@ -881,12 +929,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(34525L),
                     new MatchIpProtocol(58 as short),
                     new MatchIcmpv6(130 as short, 0 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
                 ]
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -899,12 +948,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(34525L),
                     new MatchIpProtocol(58 as short),
                     new MatchIcmpv6(135 as short, 0 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
                 ]
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -917,12 +967,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                     new MatchEthernetType(34525L),
                     new MatchIpProtocol(58 as short),
                     new MatchIcmpv6(136 as short, 0 as short),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
                 ]
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Ingress_ARP_123_987"
                 flowName = "ACL"
@@ -933,12 +984,13 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 ]
                 matchInfoList = #[
                     new MatchEthernetType(2054L),
-                    new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG)
+                    new NxMatchRegister(NxmNxReg6, 252672L, 268435200L)
                 ]
                 priority = 63010
                 tableId = 241 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v4123_987__Permit_"
                 flowName = "ACL"
@@ -957,7 +1009,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Client_v6_123_987__Permit_"
                 flowName = "ACL"
@@ -976,7 +1029,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v4123_987__Drop_"
                 flowName = "ACL"
@@ -992,7 +1046,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_DHCP_Server_v6_123_987__Drop_"
                 flowName = "ACL"
@@ -1008,7 +1063,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_134_Drop_"
                 flowName = "ACL"
@@ -1023,7 +1079,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63020
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_133_Permit_"
                 flowName = "ACL"
@@ -1041,7 +1098,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_135_Permit_"
                 flowName = "ACL"
@@ -1059,7 +1117,8 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 priority = 63010
                 tableId = 211 as short
             ],
-            new FlowEntity(123bi) => [
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
                 cookie = 110100480bi
                 flowId = "Egress_ICMPv6_123_987_136_Permit_"
                 flowName = "ACL"
@@ -1076,6 +1135,24 @@ class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
                 ]
                 priority = 63010
                 tableId = 211 as short
+            ],
+            new FlowEntityBuilder >> [
+                dpnId = 123bi
+                cookie = 110100480bi
+                flowId = "Egress_ARP_123_987_" + mac
+                flowName = "ACL"
+                instructionInfoList = #[
+                    new InstructionApplyActions(#[
+                        new ActionNxResubmit
+                    ])
+                ]
+                matchInfoList = #[
+                    new MatchEthernetType(2054L),
+                    new MatchArpSha(new MacAddress(mac)),
+                    new MatchMetadata(1085217976614912bi, 1152920405095219200bi)
+                ]
+                priority = 63010
+                tableId = 211 as short
             ]
         ]
     }