X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=vpnservice%2Faclservice%2Fimpl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetvirt%2Faclservice%2Ftests%2FFlowEntryObjectsBase.xtend;h=ec1f65521cc97604cd792e6e420a9343d5a8f679;hb=d4f830d7a4d3c28d4fe7889d94354375a01105fe;hp=0a405b5c4f866b2721ef81ce12332c861be9bc09;hpb=d554f4a5c6505eb140834286526dc3b86c8b9cf9;p=netvirt.git diff --git a/vpnservice/aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/FlowEntryObjectsBase.xtend b/vpnservice/aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/FlowEntryObjectsBase.xtend index 0a405b5c4f..ec1f65521c 100644 --- a/vpnservice/aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/FlowEntryObjectsBase.xtend +++ b/vpnservice/aclservice/impl/src/test/java/org/opendaylight/netvirt/aclservice/tests/FlowEntryObjectsBase.xtend @@ -7,18 +7,29 @@ */ package org.opendaylight.netvirt.aclservice.tests -import org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit -import org.opendaylight.genius.mdsalutil.FlowEntity +import org.opendaylight.genius.mdsalutil.FlowEntityBuilder import org.opendaylight.genius.mdsalutil.MetaDataUtil +import org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit import org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions +import org.opendaylight.genius.mdsalutil.instructions.InstructionGotoTable +import org.opendaylight.genius.mdsalutil.instructions.InstructionWriteMetadata import org.opendaylight.genius.mdsalutil.matches.MatchArpSha +import org.opendaylight.genius.mdsalutil.matches.MatchArpSpa +import org.opendaylight.genius.mdsalutil.matches.MatchEthernetSource import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType import org.opendaylight.genius.mdsalutil.matches.MatchIcmpv6 import org.opendaylight.genius.mdsalutil.matches.MatchIpProtocol +import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Destination +import org.opendaylight.genius.mdsalutil.matches.MatchIpv4Source +import org.opendaylight.genius.mdsalutil.matches.MatchMetadata import org.opendaylight.genius.mdsalutil.matches.MatchUdpDestinationPort import org.opendaylight.genius.mdsalutil.matches.MatchUdpSourcePort -import org.opendaylight.genius.mdsalutil.matches.MatchMetadata +import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix 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 static extension org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions.operator_doubleGreaterThan class FlowEntryObjectsBase { @@ -28,26 +39,28 @@ class FlowEntryObjectsBase { protected def fixedIngressFlowsPort1() { #[ - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi flowId = "Ingress_DHCP_Server_v4123_987__Permit_" - flowName = "ACL" - instructionInfoList = #[ - new InstructionApplyActions(#[ - new ActionNxResubmit(220 as short) - ]) - ] + flowName = "ACL" + instructionInfoList = #[ + new InstructionApplyActions(#[ + new ActionNxResubmit(220 as short) + ]) + ] matchInfoList = #[ new MatchEthernetType(2048L), new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(68), new MatchUdpSourcePort(67), - 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" @@ -61,12 +74,13 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(546), new MatchUdpSourcePort(547), - 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" @@ -79,12 +93,13 @@ class 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" @@ -97,12 +112,13 @@ class 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" @@ -115,12 +131,13 @@ class 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" @@ -131,7 +148,7 @@ class FlowEntryObjectsBase { ] matchInfoList = #[ new MatchEthernetType(2054L), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new NxMatchRegister(NxmNxReg6, 252672L, 268435200L) ] priority = 63010 tableId = 241 as short @@ -143,9 +160,10 @@ class FlowEntryObjectsBase { protected def fixedEgressFlowsPort1() { #[ - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_DHCP_Client_v4123_987__Permit_" + flowId = "Egress_DHCP_Client_v4123_987_0D:AA:D8:42:30:F3_Permit_" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -157,14 +175,16 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(67), new MatchUdpSourcePort(68), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F3")) ] priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_DHCP_Client_v6_123_987__Permit_" + flowId = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F3_Permit_" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -176,12 +196,14 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(547), new MatchUdpSourcePort(546), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F3")) ] priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi flowId = "Egress_DHCP_Server_v4123_987__Drop_" flowName = "ACL" @@ -197,7 +219,8 @@ class 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" @@ -213,7 +236,8 @@ class 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" @@ -228,7 +252,8 @@ class 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" @@ -246,7 +271,8 @@ class 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" @@ -264,7 +290,8 @@ class 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" @@ -281,10 +308,17 @@ class FlowEntryObjectsBase { ] priority = 63010 tableId = 211 as short - ], - new FlowEntity(123bi) => [ + ] + ] + fixedEgressArpFlowsPort1 + + } + + protected def fixedEgressArpFlowsPort1() { + #[ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F3" + flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F310.0.0.1/32" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -294,18 +328,20 @@ class FlowEntryObjectsBase { matchInfoList = #[ new MatchEthernetType(2054L), new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F3")), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F3")), + new MatchArpSpa(new Ipv4Prefix("10.0.0.1/32")), new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) ] priority = 63010 tableId = 211 as short ] - ] + ] } - protected def fixedIngressFlowsPort2() { #[ - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi flowId = "Ingress_DHCP_Server_v4123_987__Permit_" flowName = "ACL" @@ -319,12 +355,13 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(68), new MatchUdpSourcePort(67), - 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" @@ -338,12 +375,13 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(546), new MatchUdpSourcePort(547), - 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" @@ -356,12 +394,13 @@ class 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" @@ -374,12 +413,13 @@ class 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" @@ -392,12 +432,13 @@ class 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" @@ -408,7 +449,7 @@ class FlowEntryObjectsBase { ] matchInfoList = #[ new MatchEthernetType(2054L), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new NxMatchRegister(NxmNxReg6, 252672L, 268435200L) ] priority = 63010 tableId = 241 as short @@ -418,9 +459,10 @@ class FlowEntryObjectsBase { protected def fixedEgressFlowsPort2 () { #[ - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_DHCP_Client_v4123_987__Permit_" + flowId = "Egress_DHCP_Client_v4123_987_0D:AA:D8:42:30:F4_Permit_" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -432,14 +474,16 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(67 as short), new MatchUdpSourcePort(68 as short), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F4")) ] priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_DHCP_Client_v6_123_987__Permit_" + flowId = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F4_Permit_" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -451,12 +495,14 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(547 as short), new MatchUdpSourcePort(546 as short), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F4")) ] priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi flowId = "Egress_DHCP_Server_v4123_987__Drop_" flowName = "ACL" @@ -472,7 +518,8 @@ class 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" @@ -488,7 +535,8 @@ class 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" @@ -503,7 +551,8 @@ class 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" @@ -521,7 +570,8 @@ class 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" @@ -539,7 +589,8 @@ class 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" @@ -556,10 +607,16 @@ class FlowEntryObjectsBase { ] priority = 63010 tableId = 211 as short - ], - new FlowEntity(123bi) => [ + ] + ] + fixedEgressArpFlowsPort2 + } + + protected def fixedEgressArpFlowsPort2() { + #[ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F4" + flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F410.0.0.2/32" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -569,18 +626,20 @@ class FlowEntryObjectsBase { matchInfoList = #[ new MatchEthernetType(2054L), new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F4")), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F4")), + new MatchArpSpa(new Ipv4Prefix("10.0.0.2/32")), new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) ] priority = 63010 tableId = 211 as short ] - ] - + ] } protected def fixedIngressFlowsPort3() { #[ - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi flowId = "Ingress_DHCP_Server_v4123_987__Permit_" flowName = "ACL" @@ -594,12 +653,13 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(68), new MatchUdpSourcePort(67), - 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" @@ -613,12 +673,13 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(546), new MatchUdpSourcePort(547), - 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" @@ -631,12 +692,13 @@ class 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" @@ -649,12 +711,13 @@ class 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" @@ -667,12 +730,13 @@ class 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" @@ -683,7 +747,7 @@ class FlowEntryObjectsBase { ] matchInfoList = #[ new MatchEthernetType(2054L), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new NxMatchRegister(NxmNxReg6, 252672L, 268435200L) ] priority = 63010 tableId = 241 as short @@ -693,9 +757,10 @@ class FlowEntryObjectsBase { protected def fixedEgressFlowsPort3 () { #[ - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_DHCP_Client_v4123_987__Permit_" + flowId = "Egress_DHCP_Client_v4123_987_0D:AA:D8:42:30:F5_Permit_" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -707,14 +772,16 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(67), new MatchUdpSourcePort(68), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F5")) ] priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_DHCP_Client_v6_123_987__Permit_" + flowId = "Egress_DHCP_Client_v6_123_987_0D:AA:D8:42:30:F5_Permit_" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -726,12 +793,14 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(547), new MatchUdpSourcePort(546), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F5")) ] priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi flowId = "Egress_DHCP_Server_v4123_987__Drop_" flowName = "ACL" @@ -747,7 +816,8 @@ class 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" @@ -763,7 +833,8 @@ class 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" @@ -778,7 +849,8 @@ class 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" @@ -796,7 +868,8 @@ class 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" @@ -814,7 +887,8 @@ class 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" @@ -832,9 +906,10 @@ class FlowEntryObjectsBase { priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F5" + flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F510.0.0.3/32" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -844,6 +919,8 @@ class FlowEntryObjectsBase { matchInfoList = #[ new MatchEthernetType(2054L), new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F5")), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F5")), + new MatchArpSpa(new Ipv4Prefix("10.0.0.3/32")), new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) ] priority = 63010 @@ -854,7 +931,8 @@ class FlowEntryObjectsBase { static def fixedIngressFlowsPort4() { #[ - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi flowId = "Ingress_DHCP_Server_v4123_987__Permit_" flowName = "ACL" @@ -868,12 +946,13 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(68), new MatchUdpSourcePort(67), - 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" @@ -887,12 +966,13 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(546), new MatchUdpSourcePort(547), - 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" @@ -905,12 +985,13 @@ class 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" @@ -923,12 +1004,13 @@ class 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" @@ -941,12 +1023,13 @@ class 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" @@ -957,7 +1040,7 @@ class FlowEntryObjectsBase { ] matchInfoList = #[ new MatchEthernetType(2054L), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new NxMatchRegister(NxmNxReg6, 252672L, 268435200L) ] priority = 63010 tableId = 241 as short @@ -967,7 +1050,8 @@ class FlowEntryObjectsBase { static def fixedEgressFlowsPort4 () { #[ - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi flowId = "Egress_DHCP_Client_v4123_987__Permit_" flowName = "ACL" @@ -986,7 +1070,8 @@ class 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" @@ -1005,7 +1090,8 @@ class 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" @@ -1021,7 +1107,8 @@ class 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" @@ -1037,7 +1124,8 @@ class 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" @@ -1052,7 +1140,8 @@ class 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" @@ -1070,7 +1159,8 @@ class 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" @@ -1088,7 +1178,8 @@ class 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" @@ -1106,9 +1197,10 @@ class FlowEntryObjectsBase { priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_ARP_123_0D:AA:D8:42:30:F6" + flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F6" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -1118,14 +1210,16 @@ class FlowEntryObjectsBase { matchInfoList = #[ new MatchEthernetType(2054L), new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F6")), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F6")), new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) ] priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_ARP_123_0D:AA:D8:42:30:F6" + flowId = "Egress_ARP_123_987_0D:AA:D8:42:30:F6" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -1135,6 +1229,7 @@ class FlowEntryObjectsBase { matchInfoList = #[ new MatchEthernetType(2054L), new MatchArpSha(new MacAddress("0D:AA:D8:42:30:F6")), + new MatchEthernetSource(new MacAddress("0D:AA:D8:42:30:F6")), new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) ] priority = 63010 @@ -1143,10 +1238,82 @@ class FlowEntryObjectsBase { ] } + protected def remoteFlows() { + remoteIngressFlowsPort1 + + remoteEgressFlowsPort1 + + remoteIngressFlowsPort2 + + remoteEgressFlowsPort2 + } + + protected def remoteIngressFlowsPort1() { + #[ + remoteIngressFlowsPort("10.0.0.1") + ] + } + + protected def remoteIngressFlowsPort2() { + #[ + remoteIngressFlowsPort("10.0.0.2") + ] + } + + protected def remoteEgressFlowsPort1() { + #[ + remoteEgressFlowsPort("10.0.0.1") + ] + } + + protected def remoteEgressFlowsPort2() { + #[ + remoteEgressFlowsPort("10.0.0.2") + ] + } + + protected def remoteIngressFlowsPort(String ip) { + new FlowEntityBuilder >> [ + dpnId = 123bi + cookie = 110100480bi + flowId = "Acl_Filter_Egress_" + ip + "/32_5000" + flowName = "ACL" + instructionInfoList = #[ + new InstructionWriteMetadata(4bi, 16777214bi), + new InstructionGotoTable(213 as short) + ] + matchInfoList = #[ + new MatchMetadata(83886080000bi, 1099494850560bi), + new MatchEthernetType(2048L), + new MatchIpv4Destination(ip, "32") + ] + priority = 50 + tableId = 212 as short + ] + } + + protected def remoteEgressFlowsPort(String ip) { + new FlowEntityBuilder >> [ + dpnId = 123bi + cookie = 110100480bi + flowId = "Acl_Filter_Ingress_" + ip + "/32_5000" + flowName = "ACL" + instructionInfoList = #[ + new InstructionWriteMetadata(4bi, 16777214bi), + new InstructionGotoTable(243 as short) + ] + matchInfoList = #[ + new MatchMetadata(83886080000bi, 1099494850560bi), + new MatchEthernetType(2048L), + new MatchIpv4Source(ip, "32") + ] + priority = 50 + tableId = 242 as short + ] + } + protected 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" @@ -1160,12 +1327,13 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(68), new MatchUdpSourcePort(67), - 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" @@ -1179,12 +1347,13 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(546), new MatchUdpSourcePort(547), - 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" @@ -1197,12 +1366,13 @@ class 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" @@ -1215,12 +1385,13 @@ class 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" @@ -1233,12 +1404,13 @@ class 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" @@ -1249,14 +1421,15 @@ class 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_" + flowId = "Egress_DHCP_Client_v4123_987_" + mac + "_Permit_" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -1268,14 +1441,16 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(67), new MatchUdpSourcePort(68), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG), + new MatchEthernetSource(new MacAddress(mac)) ] priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi - flowId = "Egress_DHCP_Client_v6_123_987__Permit_" + flowId = "Egress_DHCP_Client_v6_123_987_" + mac + "_Permit_" flowName = "ACL" instructionInfoList = #[ new InstructionApplyActions(#[ @@ -1287,12 +1462,14 @@ class FlowEntryObjectsBase { new MatchIpProtocol(17 as short), new MatchUdpDestinationPort(547), new MatchUdpSourcePort(546), - new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG) + new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG), + new MatchEthernetSource(new MacAddress(mac)) ] priority = 63010 tableId = 211 as short ], - new FlowEntity(123bi) => [ + new FlowEntityBuilder >> [ + dpnId = 123bi cookie = 110100480bi flowId = "Egress_DHCP_Server_v4123_987__Drop_" flowName = "ACL" @@ -1308,7 +1485,8 @@ class 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" @@ -1324,7 +1502,8 @@ class 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" @@ -1339,7 +1518,8 @@ class 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" @@ -1357,7 +1537,8 @@ class 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" @@ -1375,7 +1556,8 @@ class 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" @@ -1392,6 +1574,25 @@ class 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 MatchEthernetSource(new MacAddress(mac)), + new MatchMetadata(1085217976614912bi, 1152920405095219200bi) + ] + priority = 63010 + tableId = 211 as short ] ] }