X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=interfacemgr%2Finterfacemgr-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fvpnservice%2Finterfacemgr%2Fservicebindings%2Fflowbased%2Fconfighelpers%2FFlowBasedServicesConfigBindHelper.java;h=de503d1112a6e97024592584f1737abaa0875f92;hb=d470c0a64e59091c2e4f1fbdc8d64a10ac824c83;hp=e55da55ea63c42bf64c6546027f5046a7166aec5;hpb=d88b3328aef34af37b96c726277b740ad255a1ca;p=vpnservice.git diff --git a/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/servicebindings/flowbased/confighelpers/FlowBasedServicesConfigBindHelper.java b/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/servicebindings/flowbased/confighelpers/FlowBasedServicesConfigBindHelper.java index e55da55e..de503d11 100644 --- a/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/servicebindings/flowbased/confighelpers/FlowBasedServicesConfigBindHelper.java +++ b/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/servicebindings/flowbased/confighelpers/FlowBasedServicesConfigBindHelper.java @@ -47,11 +47,12 @@ public class FlowBasedServicesConfigBindHelper { org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState = InterfaceManagerCommonUtils.getInterfaceStateFromOperDS(interfaceName, dataBroker); if (ifState == null || ifState.getOperStatus() == OperStatus.Down) { - LOG.info("Not Binding Service since for Interface: {}", interfaceName); + LOG.warn("Interface not up, not Binding Service for Interface: {}", interfaceName); return futures; } // Get the Parent ServiceInfo + ServicesInfo servicesInfo = FlowBasedServicesUtils.getServicesInfoForInterface(interfaceName, dataBroker); if (servicesInfo == null) { LOG.error("Reached Impossible part 1 in the code during bind service for: {}", boundServiceNew); @@ -71,21 +72,23 @@ public class FlowBasedServicesConfigBindHelper { long portNo = Long.parseLong(IfmUtil.getPortNoFromNodeConnectorId(nodeConnectorId)); BigInteger dpId = new BigInteger(IfmUtil.getDpnFromNodeConnectorId(nodeConnectorId)); - Long lportTag = FlowBasedServicesUtils.getLPortTag(iface, dataBroker); if (allServices.size() == 1) { // If only one service present, install instructions in table 0. int vlanId = 0; List matches = null; if (iface.getType().isAssignableFrom(L2vlan.class)) { - vlanId = iface.getAugmentation(IfL2vlan.class).getVlanId().getValue(); + IfL2vlan l2vlan = iface.getAugmentation(IfL2vlan.class); + if( l2vlan != null){ + vlanId = l2vlan.getVlanId().getValue(); + } matches = FlowBasedServicesUtils.getMatchInfoForVlanPortAtIngressTable(dpId, portNo, vlanId); } else if (iface.getType().isAssignableFrom(Tunnel.class)){ matches = FlowBasedServicesUtils.getMatchInfoForTunnelPortAtIngressTable (dpId, portNo, iface); } if (matches != null) { - FlowBasedServicesUtils.installInterfaceIngressFlow(dpId, vlanId, boundServiceNew, - dataBroker, t, matches, lportTag.intValue(), IfmConstants.VLAN_INTERFACE_INGRESS_TABLE); + FlowBasedServicesUtils.installInterfaceIngressFlow(dpId, iface.getName(), vlanId, boundServiceNew, + dataBroker, t, matches, ifState.getIfIndex(), IfmConstants.VLAN_INTERFACE_INGRESS_TABLE); } if (t != null) { @@ -114,11 +117,11 @@ public class FlowBasedServicesConfigBindHelper { if (!isCurrentServiceHighestPriority) { FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, boundServiceNew, iface, dataBroker, t, - lportTag.intValue()); + ifState.getIfIndex()); } else { BoundServices serviceToReplace = tmpServicesMap.get(highestPriority); FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, serviceToReplace, iface, dataBroker, t, - lportTag.intValue()); + ifState.getIfIndex()); int vlanId = 0; List matches = null; if (iface.getType().isAssignableFrom(L2vlan.class)) { @@ -130,8 +133,8 @@ public class FlowBasedServicesConfigBindHelper { if (matches != null) { FlowBasedServicesUtils.removeIngressFlow(iface, serviceToReplace, dpId, dataBroker, t); - FlowBasedServicesUtils.installInterfaceIngressFlow(dpId, vlanId, boundServiceNew, dataBroker, t, - matches, lportTag.intValue(), IfmConstants.VLAN_INTERFACE_INGRESS_TABLE); + FlowBasedServicesUtils.installInterfaceIngressFlow(dpId, iface.getName(), vlanId, boundServiceNew, dataBroker, t, + matches, ifState.getIfIndex(), IfmConstants.VLAN_INTERFACE_INGRESS_TABLE); } }