*/
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
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.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.genius.mdsalutil.nxmatches.NxMatchRegister
+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
+
class FlowEntryObjectsStateless extends FlowEntryObjectsBase {
protected def etherFlows() {
+ etherIngressFlowsPort2
+ fixedEgressFlowsPort2
+ etheregressFlowPort2
+ + remoteFlows
}
protected def tcpFlows() {
+ tcpIngressFlowPort2
+ fixedEgressFlowsPort2
+ tcpEgressFlowPort2
+ + remoteFlows
}
protected def udpFlows() {
+ fixedEgressFlowsPort1
+ fixedIngressFlowsPort2
+ fixedEgressFlowsPort2
+ + remoteFlows
}
protected def icmpFlows() {
+ fixedEgressFlowsPort1
+ fixedIngressFlowsPort2
+ fixedEgressFlowsPort2
+ + remoteFlows
}
protected def dstRangeFlows() {
protected def etherFlowIngressPort1() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
flowName = "ACL_SYN_"
}
protected def etherFlowEgressPort1() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "SYN_ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
flowName = "ACL_SYN_"
}
protected def etherIngressFlowsPort2() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
flowName = "ACL_SYN_"
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_"
protected def etherEgressFlowsPort1() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "[SYN_ETHERnullIngress98785cc3048-abc3-43cc-89b3-377341426ac7"
flowName = "ACL_SYN_"
protected def etheregressFlowPort2() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "SYN_ETHERnullEgress98785cc3048-abc3-43cc-89b3-377341426ac6"
flowName = "ACL_SYN_"
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_"
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_"
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_"
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_"
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_"
protected def udpEgressFlowsPort1() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
flowName = "ACL"
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 "
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"
protected def udpEgressFlowsPort2() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "UDP_DESTINATION_80_65535Egress98785cc3048-abc3-43cc-89b3-377341426ac6"
flowName = "ACL"
protected def icmpIngressFlowsPort1() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
flowName = "ACL"
protected def icmpIngressFlowsPort2() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "ICMP_V4_DESTINATION_23_Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
flowName = "ACL"
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 "
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 "
protected def udpIngressPortRangeFlows() {
#[
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "UDP_DESTINATION_2000_65532Ingress98785cc3048-abc3-43cc-89b3-377341426ac7"
flowName = "ACL"
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_"
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_"
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_"
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_"
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_"
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_"
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_"
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_"
}
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(#[
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(#[
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(#[
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(#[
new MatchMetadata(1085217976614912bi, MetaDataUtil.METADATA_MASK_LPORT_TAG),
new NxMatchCtState(33L, 33L)
]
- priority = IdHelper.getFlowPriority(flowId)
+ priority = IdHelper.getId(flowId2)
tableId = 213 as short
]
]
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"
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"
priority = 63010
tableId = 241 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Ingress_ICMPv6_123_987_130_Permit_"
flowName = "ACL"
priority = 63010
tableId = 241 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Ingress_ICMPv6_123_987_135_Permit_"
flowName = "ACL"
priority = 63010
tableId = 241 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Ingress_ICMPv6_123_987_136_Permit_"
flowName = "ACL"
priority = 63010
tableId = 241 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Ingress_ARP_123_987"
flowName = "ACL"
priority = 63010
tableId = 241 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Egress_DHCP_Client_v4123_987__Permit_"
flowName = "ACL"
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"
priority = 63010
tableId = 211 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Egress_DHCP_Server_v4123_987__Drop_"
flowName = "ACL"
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"
priority = 63010
tableId = 211 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Egress_ICMPv6_123_987_134_Drop_"
flowName = "ACL"
priority = 63020
tableId = 211 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Egress_ICMPv6_123_987_133_Permit_"
flowName = "ACL"
priority = 63010
tableId = 211 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Egress_ICMPv6_123_987_135_Permit_"
flowName = "ACL"
priority = 63010
tableId = 211 as short
],
- new FlowEntity(123bi) => [
+ new FlowEntityBuilder >> [
+ dpnId = 123bi
cookie = 110100480bi
flowId = "Egress_ICMPv6_123_987_136_Permit_"
flowName = "ACL"
]
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
]
]
}