Preconditions.checkNotNull(vpnInstance.getVpnId(), "Vpn Instance with rd " + vpnInstance.getVrfId() + "has null vpnId!");
Collection<VpnToDpnList> vpnToDpnList = vpnInstance.getVpnToDpnList();
+ BigInteger localDpnId = createLocalFibEntry(vpnInstance.getVpnId(),
+ vrfTableKey.getRouteDistinguisher(), vrfEntry);
if (vpnToDpnList != null) {
- BigInteger localDpnId = createLocalFibEntry(vpnInstance.getVpnId(),
- vrfTableKey.getRouteDistinguisher(), vrfEntry);
for (VpnToDpnList curDpn : vpnToDpnList) {
if (!curDpn.getDpnId().equals(localDpnId)) {
createRemoteFibEntry(localDpnId, curDpn.getDpnId(), vpnInstance.getVpnId(),
LOG.info("create terminatingServiceAction on DpnId = {} and serviceId = {} and actions = {}", destDpId , label,actionsInfos);
// Matching metadata
- mkMatches.add(new MatchInfo(MatchFieldType.tunnel_id, new BigInteger[] {
- MetaDataUtil.getTunnelIdWithValidVniBitAndVniSet(label),
- MetaDataUtil.METADA_MASK_TUNNEL_ID }));
+ // FIXME vxlan vni bit set is not working properly with OVS.need to revisit
+ mkMatches.add(new MatchInfo(MatchFieldType.tunnel_id, new BigInteger[] {BigInteger.valueOf(label)}));
List<InstructionInfo> mkInstructions = new ArrayList<InstructionInfo>();
mkInstructions.add(new InstructionInfo(InstructionType.write_actions, actionsInfos));
vrfEntry.getDestPrefix(), rd);
return;
}
- List<ActionInfo> actionInfos = nextHopManager.getEgressActionsForInterface(tunnelInterface);
+ List<ActionInfo> actionInfos = new ArrayList<>();
Class<? extends TunnelTypeBase> tunnel_type = getTunnelType(tunnelInterface);
if (tunnel_type.equals(TunnelTypeMplsOverGre.class)) {
LOG.debug("Push label action for prefix {}", vrfEntry.getDestPrefix());
} else {
int label = vrfEntry.getLabel().intValue();
BigInteger tunnelId;
+ // FIXME vxlan vni bit set is not working properly with OVS.need to revisit
if(tunnel_type.equals(TunnelTypeVxlan.class)) {
- tunnelId = MetaDataUtil.getTunnelIdWithValidVniBitAndVniSet(label);
+ tunnelId = BigInteger.valueOf(label);
} else {
tunnelId = BigInteger.valueOf(label);
}
LOG.debug("adding set tunnel id action for label {}", label);
- actionInfos.add(new ActionInfo(ActionType.set_field_tunnel_id, new BigInteger[] {
- tunnelId}));
+ actionInfos.add(new ActionInfo(ActionType.set_field_tunnel_id, new BigInteger[]{
+ tunnelId}));
}
+ actionInfos.addAll(nextHopManager.getEgressActionsForInterface(tunnelInterface));
/*
List<ActionInfo> actionInfos = resolveAdjacency(localDpnId, remoteDpnId, vpnId, vrfEntry);
if(actionInfos == null) {
MetaDataUtil.METADA_MASK_VALID_TUNNEL_ID_BIT_AND_TUNNEL_ID }));
}
**/
- makeConnectedRoute(remoteDpnId, vpnId, vrfEntry, rd, actionInfos, NwConstants.ADD_FLOW);
+ makeConnectedRoute(remoteDpnId, vpnId, vrfEntry, rd, actionInfos, NwConstants.ADD_FLOW);
LOG.debug(
"Successfully added fib entry for " + vrfEntry.getDestPrefix() + " vpnId " + vpnId);
}
VpnInstanceOpDataEntry vpnInstance = getVpnInstance(vrfTableKey.getRouteDistinguisher());
Preconditions.checkNotNull(vpnInstance, "Vpn Instance not available!");
Collection<VpnToDpnList> vpnToDpnList = vpnInstance.getVpnToDpnList();
+ BigInteger localDpnId = deleteLocalFibEntry(vpnInstance.getVpnId(),
+ vrfTableKey.getRouteDistinguisher(), vrfEntry);
if (vpnToDpnList != null) {
- BigInteger localDpnId = deleteLocalFibEntry(vpnInstance.getVpnId(),
- vrfTableKey.getRouteDistinguisher(), vrfEntry);
for (VpnToDpnList curDpn : vpnToDpnList) {
if (!curDpn.getDpnId().equals(localDpnId)) {
deleteRemoteRoute(localDpnId, curDpn.getDpnId(), vpnInstance.getVpnId(), vrfTableKey, vrfEntry);
--- /dev/null
+/target/
+/target/
+/target/
+/target/
}
}
+ rpc get-internal-or-external-interface-name {
+ description "used to retrieve tunnel interface id with src Dpn and destination ip";
+ input {
+ leaf source-dpid {
+ type uint64;
+ }
+ leaf destination-ip {
+ type inet:ip-address;
+ }
+ }
+ output {
+ leaf interface-name {
+ type string;
+ }
+ }
+ }
+
rpc get-external-tunnel-interface-name {
description "used to retrieve tunnel interface id between Dpns";
input {
}
}
- rpc remove-external-tunnel-endpoint {
+ rpc remove-external-tunnel-endpoint {
description "used for building tunnels between teps on all Dpns and external node";
input {
leaf destination-ip {
description "used for programming the terminating service actions";
input {
leaf dpn-id {
- type uint64;
+ type uint64;
}
leaf service-id {
type uint16;
description "used for removing the terminating service actions";
input {
leaf dpn-id {
- type uint64;
+ type uint64;
}
leaf service-id {
type uint16;
container tunnel-list {
- list tunnel {
+ list internal-tunnel {
key "source-DPN destination-DPN";
}
}
}
-
+
container external-tunnel-list {
list external-tunnel {
}
}
-
+
notification itm-tunnel-build-complete{
}
IpAddress gwyIpAddress = (utils.getInfo().isInRange(dcGwyIpStr) ) ? null : firstEndPt.getGwIpAddress() ;
String ifDescription = tunType.getName();
logger.debug( " Creating Trunk Interface with parameters trunk I/f Name - {}, parent I/f name - {}, source IP - {}, DC Gateway IP - {} gateway IP - {}",trunkInterfaceName, interfaceName, firstEndPt.getIpAddress(), extIp, gwyIpAddress ) ;
- Interface iface = ItmUtils.buildTunnelInterface(teps.getDPNID(), trunkInterfaceName, String.format( "%s %s",ifDescription, "Trunk Interface"), true, tunType, firstEndPt.getIpAddress(), extIp, gwyIpAddress) ;
+ Interface iface = ItmUtils.buildTunnelInterface(teps.getDPNID(), trunkInterfaceName, String.format( "%s %s",ifDescription, "Trunk Interface"), true, tunType, firstEndPt.getIpAddress(), extIp, gwyIpAddress, false) ;
logger.debug( " Trunk Interface builder - {} ", iface ) ;
InstanceIdentifier<Interface> trunkIdentifier = ItmUtils.buildId(trunkInterfaceName);
logger.debug( " Trunk Interface Identifier - {} ", trunkIdentifier ) ;
logger.trace( " Writing Trunk Interface to Config DS {}, {} ", trunkIdentifier, iface ) ;
- //ItmUtils.asyncUpdate(LogicalDatastoreType.CONFIGURATION,trunkIdentifier, iface , dataBroker, ItmUtils.DEFAULT_CALLBACK);
t.merge(LogicalDatastoreType.CONFIGURATION, trunkIdentifier, iface, true);
- // update_external_tunnels_ds(teps.getDPNID(), extIp, trunkInterfaceName, tunType);
+ // update external_tunnel_list ds
InstanceIdentifier<ExternalTunnel> path = InstanceIdentifier.create(
ExternalTunnelList.class)
- .child(ExternalTunnel.class, new ExternalTunnelKey(extIp, teps.getDPNID()));
- ExternalTunnel tnl = new ExternalTunnelBuilder().setKey(new ExternalTunnelKey(extIp, teps.getDPNID()))
- .setDestinationIP(extIp)
- .setSourceDPN(teps.getDPNID())
- .setTunnelInterfaceName(trunkInterfaceName).build();
- ItmUtils.asyncUpdate(LogicalDatastoreType.CONFIGURATION, path, tnl, dataBroker, DEFAULT_CALLBACK);
+ .child(ExternalTunnel.class, new ExternalTunnelKey(extIp, teps.getDPNID()));
+ ExternalTunnel tnl = ItmUtils.buildExternalTunnel(teps.getDPNID(), extIp, trunkInterfaceName);
+ t.merge(LogicalDatastoreType.CONFIGURATION,path, tnl, true) ;
}
futures.add( t.submit()) ;
}
public static List<ListenableFuture<Void>> buildTunnelsFromDpnToExternalEndPoint(DataBroker dataBroker, IdManagerService idManagerService,
List<BigInteger> dpnId, IpAddress extIp, Class<? extends TunnelTypeBase> tunType) {
List<ListenableFuture<Void>> futures = new ArrayList<>();
- List<DPNTEPsInfo> cfgDpnList = new ArrayList<DPNTEPsInfo>() ;
- List<DPNTEPsInfo> meshedDpnList = ItmUtils.getTunnelMeshInfo(dataBroker) ;
- if( null != meshedDpnList) {
- for (BigInteger dpn : dpnId){
- for( DPNTEPsInfo teps : meshedDpnList ) {
- if( teps.getDPNID().equals(dpn)) {
- cfgDpnList.add(teps) ;
- }
- }
- }
+ List<DPNTEPsInfo> cfgDpnList =( dpnId == null ) ? ItmUtils.getTunnelMeshInfo(dataBroker) :ItmUtils.getDPNTEPListFromDPNId(dataBroker, dpnId) ;
futures = buildTunnelsToExternalEndPoint( dataBroker, idManagerService, cfgDpnList, extIp, tunType) ;
- }
return futures ;
}
}
import org.opendaylight.vpnservice.itm.impl.ItmUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.idmanager.rev150403.IdManagerService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.interfacemgr.rev150331.TunnelTypeBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.ExternalTunnelList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.dpn.endpoints.DPNTEPsInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.dpn.endpoints.dpn.teps.info.TunnelEndPoints;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnelKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.idmanager.rev150403.IdManagerService;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ItmExternalTunnelDeleteWorker {
private static final Logger logger = LoggerFactory.getLogger(ItmExternalTunnelDeleteWorker.class ) ;
- public static List<ListenableFuture<Void>> deleteTunnels(DataBroker dataBroker, IdManagerService idManagerService,
- List<DPNTEPsInfo> dpnTepsList, IpAddress extIp ) {
+ public static List<ListenableFuture<Void>> deleteTunnels(DataBroker dataBroker, IdManagerService idManagerService, List<DPNTEPsInfo> dpnTepsList,IpAddress extIp, Class<? extends TunnelTypeBase> tunType ) {
logger.trace( " Delete Tunnels towards DC Gateway with Ip {}", extIp ) ;
List<ListenableFuture<Void>> futures = new ArrayList<>();
WriteTransaction t = dataBroker.newWriteOnlyTransaction();
}
for( DPNTEPsInfo teps : dpnTepsList) {
TunnelEndPoints firstEndPt = teps.getTunnelEndPoints().get(0) ;
- String interfaceName = firstEndPt.getInterfaceName() ;
- String trunkInterfaceName = ItmUtils.getTrunkInterfaceName(idManagerService, interfaceName, firstEndPt.getIpAddress().getIpv4Address().getValue(), extIp.getIpv4Address().getValue()) ;
- InstanceIdentifier<Interface> trunkIdentifier = ItmUtils.buildId(trunkInterfaceName);
- t.delete(LogicalDatastoreType.CONFIGURATION, trunkIdentifier);
+ if( firstEndPt.getTunnelType().equals(tunType)) {
+ String interfaceName = firstEndPt.getInterfaceName() ;
+ String trunkInterfaceName = ItmUtils.getTrunkInterfaceName(idManagerService, interfaceName,firstEndPt.getIpAddress().getIpv4Address().getValue(), extIp.getIpv4Address().getValue()) ;
+ InstanceIdentifier<Interface> trunkIdentifier = ItmUtils.buildId(trunkInterfaceName);
+ t.delete(LogicalDatastoreType.CONFIGURATION, trunkIdentifier);
+
+ InstanceIdentifier<ExternalTunnel> path = InstanceIdentifier.create(
+ ExternalTunnelList.class)
+ .child(ExternalTunnel.class, new ExternalTunnelKey(extIp, teps.getDPNID()));
+ t.delete(LogicalDatastoreType.CONFIGURATION, path);
+ // Release the Ids for the trunk interface
+ ItmUtils.releaseId(idManagerService, trunkInterfaceName);
+ }
}
futures.add(t.submit()) ;
return futures ;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnel;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnelBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnelKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.Tunnel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.TunnelBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.TunnelKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.InternalTunnel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.InternalTunnelKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.slf4j.Logger;
String trunkInterfaceName = ItmUtils.getTrunkInterfaceName(idManagerService, interfaceName,srcte.getIpAddress().getIpv4Address().getValue(), dstte.getIpAddress().getIpv4Address().getValue()) ;
IpAddress gwyIpAddress = ( srcte.getSubnetMask().equals(dstte.getSubnetMask()) ) ? null : srcte.getGwIpAddress() ;
logger.debug( " Creating Trunk Interface with parameters trunk I/f Name - {}, parent I/f name - {}, source IP - {}, destination IP - {} gateway IP - {}",trunkInterfaceName, interfaceName, srcte.getIpAddress(), dstte.getIpAddress(), gwyIpAddress ) ;
- Interface iface = ItmUtils.buildTunnelInterface(srcDpnId, trunkInterfaceName, String.format( "%s %s",ifDescription, "Trunk Interface"), true, tunType, srcte.getIpAddress(), dstte.getIpAddress(), gwyIpAddress) ;
+ Interface iface = ItmUtils.buildTunnelInterface(srcDpnId, trunkInterfaceName, String.format( "%s %s",ifDescription, "Trunk Interface"), true, tunType, srcte.getIpAddress(), dstte.getIpAddress(), gwyIpAddress, true) ;
logger.debug( " Trunk Interface builder - {} ", iface ) ;
InstanceIdentifier<Interface> trunkIdentifier = ItmUtils.buildId(trunkInterfaceName);
logger.debug( " Trunk Interface Identifier - {} ", trunkIdentifier ) ;
logger.trace( " Writing Trunk Interface to Config DS {}, {} ", trunkIdentifier, iface ) ;
t.merge(LogicalDatastoreType.CONFIGURATION, trunkIdentifier, iface, true);
// also update itm-state ds?
- InstanceIdentifier<Tunnel> path = InstanceIdentifier.create(
+ InstanceIdentifier<InternalTunnel> path = InstanceIdentifier.create(
TunnelList.class)
- .child(Tunnel.class, new TunnelKey(dstDpnId, srcDpnId));
- Tunnel tnl = new TunnelBuilder().setKey(new TunnelKey(dstDpnId, srcDpnId))
- .setDestinationDPN(dstDpnId)
- .setSourceDPN(srcDpnId)
- .setTunnelInterfaceName(trunkInterfaceName).build();
- ItmUtils.asyncUpdate(LogicalDatastoreType.CONFIGURATION, path, tnl, dataBroker, DEFAULT_CALLBACK);
+ .child(InternalTunnel.class, new InternalTunnelKey( srcDpnId, dstDpnId));
+ InternalTunnel tnl = ItmUtils.buildInternalTunnel(srcDpnId, dstDpnId, trunkInterfaceName);
+ //ItmUtils.asyncUpdate(LogicalDatastoreType.CONFIGURATION, path, tnl, dataBroker, DEFAULT_CALLBACK);
+ t.merge(LogicalDatastoreType.CONFIGURATION,path, tnl, true) ;
return true;
}
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.idmanager.rev150403.IdManagerService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.DpnEndpoints;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.TunnelList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.dpn.endpoints.DPNTEPsInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.dpn.endpoints.dpn.teps.info.TunnelEndPoints;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.InternalTunnel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.InternalTunnelKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
InstanceIdentifier<Interface> trunkIdentifier = ItmUtils.buildId(trunkfwdIfName);
logger.debug( " Removing Trunk Interface Name - {} , Id - {} from Config DS {}, {} ", trunkfwdIfName, trunkIdentifier ) ;
t.delete(LogicalDatastoreType.CONFIGURATION, trunkIdentifier);
+
+ // also update itm-state ds -- Delete the forward tunnel-interface from the tunnel list
+ InstanceIdentifier<InternalTunnel> path = InstanceIdentifier.create(
+ TunnelList.class)
+ .child(InternalTunnel.class, new InternalTunnelKey( srcDpnId, dstDpnId));
+ t.delete(LogicalDatastoreType.CONFIGURATION,path) ;
+ // Release the Id for the forward trunk
+ ItmUtils.releaseId(idManagerService, trunkfwdIfName);
+
String trunkRevIfName =
ItmUtils.getTrunkInterfaceName(idManagerService, dstTep.getInterfaceName(), dstTep.getIpAddress()
.getIpv4Address().getValue(), srcTep.getIpAddress().getIpv4Address()
trunkIdentifier = ItmUtils.buildId(trunkfwdIfName);
logger.debug( " Removing Trunk Interface Name - {} , Id - {} from Config DS {}, {} ", trunkfwdIfName, trunkIdentifier ) ;
t.delete(LogicalDatastoreType.CONFIGURATION, trunkIdentifier);
+
+ // also update itm-state ds -- Delete the reverse tunnel-interface from the tunnel list
+ path = InstanceIdentifier.create(
+ TunnelList.class)
+ .child(InternalTunnel.class, new InternalTunnelKey(dstDpnId, srcDpnId));
+ t.delete(LogicalDatastoreType.CONFIGURATION,path) ;
+
+ // Release the Id for the Reverse trunk
+ ItmUtils.releaseId(idManagerService, trunkRevIfName);
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.dpn.endpoints.dpn.teps.info.TunnelEndPoints;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.dpn.endpoints.dpn.teps.info.TunnelEndPointsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.dpn.endpoints.dpn.teps.info.TunnelEndPointsKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnelBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnelKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.InternalTunnel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.InternalTunnelBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.InternalTunnelKey;
import org.opendaylight.vpnservice.itm.globals.ITMConstants;
import org.opendaylight.vpnservice.mdsalutil.MDSALUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
}
public static Interface buildTunnelInterface(BigInteger dpn, String ifName, String desc, boolean enabled, Class<? extends TunnelTypeBase> tunType,
- IpAddress localIp, IpAddress remoteIp, IpAddress gatewayIp) {
+ IpAddress localIp, IpAddress remoteIp, IpAddress gatewayIp, boolean internal) {
InterfaceBuilder builder = new InterfaceBuilder().setKey(new InterfaceKey(ifName)).setName(ifName)
.setDescription(desc).setEnabled(enabled).setType(Tunnel.class);
ParentRefs parentRefs = new ParentRefsBuilder().setDatapathNodeIdentifier(dpn).build();
builder.addAugmentation(ParentRefs.class, parentRefs);
IfTunnel tunnel = new IfTunnelBuilder().setTunnelDestination(remoteIp).setTunnelGateway(gatewayIp).setTunnelSource(localIp)
- .setTunnelInterfaceType( tunType).build();
+ .setTunnelInterfaceType( tunType).setInternal(internal).build();
builder.addAugmentation(IfTunnel.class, tunnel);
return builder.build();
}
+ public static InternalTunnel buildInternalTunnel( BigInteger srcDpnId, BigInteger dstDpnId, String trunkInterfaceName) {
+ InternalTunnel tnl = new InternalTunnelBuilder().setKey(new InternalTunnelKey(srcDpnId, dstDpnId))
+ .setDestinationDPN(dstDpnId)
+ .setSourceDPN(srcDpnId)
+ .setTunnelInterfaceName(trunkInterfaceName).build();
+ return tnl ;
+ }
+
+ public static ExternalTunnel buildExternalTunnel( BigInteger srcDpnId, IpAddress dstIp, String trunkInterfaceName) {
+ ExternalTunnel extTnl = new ExternalTunnelBuilder().setKey(new ExternalTunnelKey(dstIp, srcDpnId)).setSourceDPN(srcDpnId).setDestinationIP(dstIp).setTunnelInterfaceName(trunkInterfaceName).build();
+ return extTnl ;
+ }
+
public static List<DPNTEPsInfo> getTunnelMeshInfo(DataBroker dataBroker) {
List<DPNTEPsInfo> dpnTEPs= null ;
LOG.warn("Exception when getting Unique Id for key {}", idKey, e);
}
}
+
+ public static List<DPNTEPsInfo> getDPNTEPListFromDPNId(DataBroker dataBroker, List<BigInteger> dpnIds) {
+ List<DPNTEPsInfo> meshedDpnList = getTunnelMeshInfo(dataBroker) ;
+ List<DPNTEPsInfo> cfgDpnList = new ArrayList<DPNTEPsInfo>();
+ if( null != meshedDpnList) {
+ for(BigInteger dpnId : dpnIds) {
+ for( DPNTEPsInfo teps : meshedDpnList ) {
+ if( dpnId.equals(teps.getDPNID()))
+ cfgDpnList.add( teps) ;
+ }
+ }
+ }
+ return cfgDpnList;
+ }
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
import org.opendaylight.vpnservice.itm.confighelpers.ItmExternalTunnelAddWorker;
+import org.opendaylight.vpnservice.itm.confighelpers.ItmExternalTunnelDeleteWorker;
import org.opendaylight.vpnservice.itm.globals.ITMConstants;
import org.opendaylight.vpnservice.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.vpnservice.itm.impl.ItmUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.ExternalTunnelList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.TunnelList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.dpn.endpoints.DPNTEPsInfo;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.dpn.endpoints.dpn.teps.info.TunnelEndPoints;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnel;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.external.tunnel.list.ExternalTunnelKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.Tunnel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.TunnelKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.InternalTunnel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.op.rev150701.tunnel.list.InternalTunnelKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.AddExternalTunnelEndpointInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.BuildExternalTunnelFromDpnsInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.CreateTerminatingServiceActionsInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.GetExternalTunnelInterfaceNameInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.GetExternalTunnelInterfaceNameOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.GetExternalTunnelInterfaceNameOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.GetInternalOrExternalInterfaceNameInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.GetInternalOrExternalInterfaceNameOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.GetInternalOrExternalInterfaceNameOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.GetTunnelInterfaceNameInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.GetTunnelInterfaceNameOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.rpcs.rev151217.GetTunnelInterfaceNameOutputBuilder;
RpcResultBuilder<GetTunnelInterfaceNameOutput> resultBld = null;
BigInteger sourceDpn = input.getSourceDpid() ;
BigInteger destinationDpn = input.getDestinationDpid() ;
- InstanceIdentifier<Tunnel> path = InstanceIdentifier.create(
+ InstanceIdentifier<InternalTunnel> path = InstanceIdentifier.create(
TunnelList.class)
- .child(Tunnel.class, new TunnelKey(destinationDpn, sourceDpn));
+ .child(InternalTunnel.class, new InternalTunnelKey(destinationDpn, sourceDpn));
- Optional<Tunnel> tnl = ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path, dataBroker);
+ Optional<InternalTunnel> tnl = ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path, dataBroker);
if( tnl != null && tnl.isPresent())
{
- Tunnel tunnel = tnl.get();
+ InternalTunnel tunnel = tnl.get();
GetTunnelInterfaceNameOutputBuilder output = new GetTunnelInterfaceNameOutputBuilder() ;
output.setInterfaceName(tunnel.getTunnelInterfaceName()) ;
resultBld = RpcResultBuilder.success();
@Override
public Future<RpcResult<Void>> removeExternalTunnelEndpoint(
RemoveExternalTunnelEndpointInput input) {
- // TODO Auto-generated method stub
- return null;
+ //Ignore the Futures for now
+ final SettableFuture<RpcResult<Void>> result = SettableFuture.create();
+ List<DPNTEPsInfo> meshedDpnList = ItmUtils.getTunnelMeshInfo(dataBroker) ;
+ ItmExternalTunnelDeleteWorker.deleteTunnels(dataBroker, idManagerService,meshedDpnList , input.getDestinationIp(), input.getTunnelType());
+ result.set(RpcResultBuilder.<Void>success().build());
+ return result;
}
@Override
RemoveExternalTunnelFromDpnsInput input) {
//Ignore the Futures for now
final SettableFuture<RpcResult<Void>> result = SettableFuture.create();
-// ItmExternalTunnelDeleteWorker.buildTunnelsFromDpnToExternalEndPoint(dataBroker, input.getDpnId(), null, input.getDestinationIp());
+ List<DPNTEPsInfo> cfgDpnList = ItmUtils.getDPNTEPListFromDPNId(dataBroker, input.getDpnId()) ;
+ ItmExternalTunnelDeleteWorker.deleteTunnels(dataBroker, idManagerService, cfgDpnList, input.getDestinationIp(), input.getTunnelType());
result.set(RpcResultBuilder.<Void>success().build());
return result;
}
BuildExternalTunnelFromDpnsInput input) {
//Ignore the Futures for now
final SettableFuture<RpcResult<Void>> result = SettableFuture.create();
- List<ListenableFuture<Void>> extTunnelResultList = ItmExternalTunnelAddWorker.buildTunnelsFromDpnToExternalEndPoint(dataBroker, idManagerService, input.getDpnId(), input.getDestinationIp(), input.getTunnelType());
+ List<ListenableFuture<Void>> extTunnelResultList = ItmExternalTunnelAddWorker.buildTunnelsFromDpnToExternalEndPoint(dataBroker, idManagerService,input.getDpnId(), input.getDestinationIp(), input.getTunnelType());
for (ListenableFuture<Void> extTunnelResult : extTunnelResultList) {
Futures.addCallback(extTunnelResult, new FutureCallback<Void>(){
//Ignore the Futures for now
final SettableFuture<RpcResult<Void>> result = SettableFuture.create();
- // ItmExternalTunnelAddWorker.buildTunnelsToExternalEndPoint(dataBroker, null, input.getDestinationIp()) ;
+ List<DPNTEPsInfo> meshedDpnList = ItmUtils.getTunnelMeshInfo(dataBroker) ;
+ ItmExternalTunnelAddWorker.buildTunnelsToExternalEndPoint(dataBroker, idManagerService,meshedDpnList, input.getDestinationIp(), input.getTunnelType()) ;
result.set(RpcResultBuilder.<Void>success().build());
return result;
}
return new StringBuffer().append(termSvcTable).append(svcId).toString();
}
+ @Override
+ public Future<RpcResult<GetInternalOrExternalInterfaceNameOutput>> getInternalOrExternalInterfaceName(
+ GetInternalOrExternalInterfaceNameInput input) {
+ RpcResultBuilder<GetInternalOrExternalInterfaceNameOutput> resultBld = null;
+ BigInteger srcDpn = input.getSourceDpid() ;
+ IpAddress dstIp = input.getDestinationIp() ;
+ List<DPNTEPsInfo> meshedDpnList = ItmUtils.getTunnelMeshInfo(dataBroker) ;
+ // Look for external tunnels if not look for internal tunnel
+ for( DPNTEPsInfo teps : meshedDpnList) {
+ TunnelEndPoints firstEndPt = teps.getTunnelEndPoints().get(0) ;
+ if( dstIp.equals(firstEndPt.getIpAddress())) {
+ InstanceIdentifier<InternalTunnel> path = InstanceIdentifier.create(
+ TunnelList.class)
+ .child(InternalTunnel.class, new InternalTunnelKey(srcDpn, teps.getDPNID()));
+
+ Optional<InternalTunnel> tnl = ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path, dataBroker);
+ if( tnl != null && tnl.isPresent())
+ {
+ InternalTunnel tunnel = tnl.get();
+ GetInternalOrExternalInterfaceNameOutputBuilder output = new GetInternalOrExternalInterfaceNameOutputBuilder().setInterfaceName(tunnel.getTunnelInterfaceName() );
+ resultBld = RpcResultBuilder.success();
+ resultBld.withResult(output.build()) ;
+ }else {
+ //resultBld = RpcResultBuilder.failed();
+ InstanceIdentifier<ExternalTunnel> path1 = InstanceIdentifier.create(
+ ExternalTunnelList.class)
+ .child(ExternalTunnel.class, new ExternalTunnelKey(dstIp, srcDpn));
+
+ Optional<ExternalTunnel> ext = ItmUtils.read(LogicalDatastoreType.CONFIGURATION, path1, dataBroker);
+
+ if( ext != null && ext.isPresent())
+ {
+ ExternalTunnel extTunnel = ext.get();
+ GetInternalOrExternalInterfaceNameOutputBuilder output = new GetInternalOrExternalInterfaceNameOutputBuilder().setInterfaceName(extTunnel.getTunnelInterfaceName() );
+ resultBld = RpcResultBuilder.success();
+ resultBld.withResult(output.build()) ;
+ }else {
+ resultBld = RpcResultBuilder.failed();
+ }
+ }
+ }
+ }
+ return Futures.immediateFuture(resultBld.build());
+ }
+
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
-Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+<!--
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
<!--
-Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
package org.opendaylight.vpnservice.neutronvpn;
+import com.google.common.base.Optional;
+
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.vpnservice.mdsalutil.AbstractDataChangeListener;
+import org.opendaylight.vpnservice.mdsalutil.MDSALUtil;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.Ports;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
+ .PortFixedipToPortNameBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
+ .PortNameToPortUuidBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.subnetmaps.Subnetmap;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
if (LOG.isTraceEnabled()) {
LOG.trace("Adding Port : key: " + identifier + ", value=" + input);
}
- nvpnManager.handleNeutronPortCreated(input);
+ handleNeutronPortCreated(input);
}
if (LOG.isTraceEnabled()) {
LOG.trace("Removing Port : key: " + identifier + ", value=" + input);
}
- nvpnManager.handleNeutronPortDeleted(input);
+ handleNeutronPortDeleted(input);
}
iterator.remove();
}
}
- nvpnManager.handleNeutronPortUpdated(original, update);
+ handleNeutronPortUpdated(original, update);
+ }
+ }
+
+ private void handleNeutronPortCreated(Port port) {
+ LOG.info("Of-port-interface creation");
+ int portVlanId = NeutronvpnUtils.getVlanFromNeutronPort(port);
+ // Create of-port interface for this neutron port
+ createOfPortInterface(port, portVlanId);
+ LOG.debug("Add port to subnet");
+ // add port to local Subnets DS
+ Uuid vpnId = addPortToSubnets(port);
+
+ if (vpnId != null) {
+ // create vpn-interface on this neutron port
+ LOG.debug("Adding VPN Interface");
+ nvpnManager.createVpnInterface(vpnId, port);
+ }
+ }
+
+ private void handleNeutronPortDeleted(Port port) {
+ LOG.debug("Of-port-interface removal");
+ LOG.debug("Remove port from subnet");
+ // remove port from local Subnets DS
+ Uuid vpnId = removePortFromSubnets(port);
+
+ if (vpnId != null) {
+ // remove vpn-interface for this neutron port
+ LOG.debug("removing VPN Interface");
+ nvpnManager.deleteVpnInterface(port);
+ }
+ int portVlanId = NeutronvpnUtils.getVlanFromNeutronPort(port);
+ // Remove of-port interface for this neutron port
+ deleteOfPortInterface(port, portVlanId);
+
+ }
+
+ private void handleNeutronPortUpdated(Port portoriginal, Port portupdate) {
+ LOG.debug("Add port to subnet");
+ // add port FixedIPs to local Subnets DS
+ Uuid vpnIdup = addPortToSubnets(portupdate);
+
+ if (vpnIdup != null) {
+ nvpnManager.createVpnInterface(vpnIdup, portupdate);
+ }
+
+ // remove port FixedIPs from local Subnets DS
+ Uuid vpnIdor = removePortFromSubnets(portoriginal);
+
+ if (vpnIdor != null) {
+ nvpnManager.deleteVpnInterface(portoriginal);
+ }
+ }
+
+ private void createOfPortInterface(Port port, int portVlanId) {
+ String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
+ //String ifname = new StringBuilder(name).append(":").append(Integer.toString(portVlanId)).toString();
+ //Network network = NeutronvpnUtils.getNeutronNetwork(broker, port.getNetworkId());
+ //Boolean isVlanTransparent = network.isVlanTransparent();
+
+ LOG.debug("Creating OFPort Interface {}", name);
+ InstanceIdentifier interfaceIdentifier = NeutronvpnUtils.buildVlanInterfaceIdentifier(name);
+ try {
+ Optional<Interface> optionalInf = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ interfaceIdentifier);
+ if (!optionalInf.isPresent()) {
+ // handle these for trunkport extensions : portVlanId, isVlanTransparent
+ Interface inf = new InterfaceBuilder().setEnabled(true).setName(name).setType(L2vlan.class).build();
+ MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, interfaceIdentifier, inf);
+ } else {
+ LOG.error("Interface {} is already present", name);
+ }
+ } catch (Exception e) {
+ LOG.error("failed to create interface {} due to the exception {} ", name, e.getMessage());
+ }
+
+ InstanceIdentifier portIdentifier = NeutronvpnUtils.buildPortNameToPortUuidIdentifier(name);
+ PortNameToPortUuidBuilder builder = new PortNameToPortUuidBuilder().setPortName(name).setPortId(port.getUuid());
+ MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, portIdentifier, builder.build());
+ LOG.debug("name-uuid map for port with name: {}, uuid: {} added to NeutronPortData DS", name, port.getUuid
+ ());
+ }
+
+ private void deleteOfPortInterface(Port port, int portVlanId) {
+ String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
+ //String ifname = new StringBuilder(name).append(":").append(Integer.toString(portVlanId)).toString();
+ LOG.debug("Removing OFPort Interface {}", name);
+ InstanceIdentifier interfaceIdentifier = NeutronvpnUtils.buildVlanInterfaceIdentifier(name);
+ try {
+ Optional<Interface> optionalInf = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ interfaceIdentifier);
+ if (optionalInf.isPresent()) {
+ MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, interfaceIdentifier);
+ } else {
+ LOG.error("Interface {} is not present", name);
+ }
+ } catch (Exception e) {
+ LOG.error("Failed to delete interface {} due to the exception {}", name, e.getMessage());
+ }
+
+ InstanceIdentifier portIdentifier = NeutronvpnUtils.buildPortNameToPortUuidIdentifier(name);
+ MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, portIdentifier);
+ LOG.debug("name-uuid map for port with name: {}, uuid: {} deleted from NeutronPortData DS", name, port
+ .getUuid());
+ }
+
+ // adds port to subnet list and creates vpnInterface
+ private Uuid addPortToSubnets(Port port) {
+ Uuid subnetId = null;
+ Uuid vpnId = null;
+ String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
+
+ // find all subnets to which this port is associated
+ List<FixedIps> ips = port.getFixedIps();
+ for (FixedIps ip : ips) {
+ String ipValue = ip.getIpAddress().getIpv4Address().getValue();
+
+ InstanceIdentifier id = NeutronvpnUtils.buildFixedIpToPortNameIdentifier(ipValue);
+ PortFixedipToPortNameBuilder builder = new PortFixedipToPortNameBuilder().setPortFixedip(ipValue)
+ .setPortName(name);
+ MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, id, builder.build());
+ LOG.debug("fixedIp-name map for neutron port with fixedIp: {}, name: {} added to NeutronPortData DS",
+ ipValue, name);
+
+ subnetId = ip.getSubnetId();
+ Subnetmap subnetmap = nvpnManager.updateSubnetNode(subnetId, null, null, null, null, port.getUuid());
+ if (vpnId == null && subnetmap != null) {
+ vpnId = subnetmap.getVpnId();
+ }
+ }
+ return vpnId;
+ }
+
+ private Uuid removePortFromSubnets(Port port) {
+ Uuid subnetId = null;
+ Uuid vpnId = null;
+
+ // find all Subnets to which this port is associated
+ List<FixedIps> ips = port.getFixedIps();
+ for (FixedIps ip : ips) {
+ String ipValue = ip.getIpAddress().getIpv4Address().getValue();
+
+ InstanceIdentifier id = NeutronvpnUtils.buildFixedIpToPortNameIdentifier(ipValue);
+ MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, id);
+ LOG.debug("fixedIp-name map for neutron port with fixedIp: {} deleted from NeutronPortData DS", ipValue);
+
+ subnetId = ip.getSubnetId();
+ Subnetmap subnetmap = nvpnManager.removeFromSubnetNode(subnetId, null, null, null, port.getUuid());
+ if (vpnId == null && subnetmap != null) {
+ vpnId = subnetmap.getVpnId();
+ }
}
+ return vpnId;
}
}
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*/
package org.opendaylight.vpnservice.neutronvpn;
+import com.google.common.base.Optional;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.vpnservice.mdsalutil.AbstractDataChangeListener;
+import org.opendaylight.vpnservice.mdsalutil.MDSALUtil;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.Subnets;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.subnets.Subnet;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapKey;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.ArrayList;
+import java.util.List;
+
public class NeutronSubnetChangeListener extends AbstractDataChangeListener<Subnet> implements AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(NeutronSubnetChangeListener.class);
if (LOG.isTraceEnabled()) {
LOG.trace("Adding Subnet : key: " + identifier + ", value=" + input);
}
- nvpnManager.handleNeutronSubnetCreated(input.getUuid(), input.getNetworkId(), input.getTenantId());
+ handleNeutronSubnetCreated(input.getUuid(), input.getNetworkId(), input.getTenantId());
}
@Override
if (LOG.isTraceEnabled()) {
LOG.trace("Removing subnet : key: " + identifier + ", value=" + input);
}
- nvpnManager.handleNeutronSubnetDeleted(input.getUuid(), input.getNetworkId(), null);
+ handleNeutronSubnetDeleted(input.getUuid(), input.getNetworkId(), null);
}
@Override
LOG.trace("Updating Subnet : key: " + identifier + ", original value=" + original + ", update value=" +
update);
}
- nvpnManager.handleNeutronSubnetUpdated(update.getUuid(), update.getNetworkId(), update.getTenantId());
+ handleNeutronSubnetUpdated(update.getUuid(), update.getNetworkId(), update.getTenantId());
+ }
+
+ private void handleNeutronSubnetCreated(Uuid subnetId, Uuid networkId, Uuid tenantId) {
+ nvpnManager.updateSubnetNode(subnetId, tenantId, networkId, null, null, null);
+ if (networkId != null && NeutronvpnUtils.getNeutronNetwork(broker, networkId) != null) {
+ createSubnetToNetworkMapping(subnetId, networkId);
+ }
+ }
+
+ private void handleNeutronSubnetDeleted(Uuid subnetId, Uuid networkId, Uuid tenantId) {
+ Uuid vpnId = NeutronvpnUtils.getVpnForNetwork(broker, networkId);
+ if (vpnId != null) {
+ nvpnManager.removeSubnetFromVpn(vpnId, subnetId);
+ }
+ if (networkId != null) {
+ deleteSubnetToNetworkMapping(subnetId, networkId);
+ }
+ }
+
+ private void handleNeutronSubnetUpdated(Uuid subnetId, Uuid networkId, Uuid tenantId) {
+ Uuid oldNetworkId = NeutronvpnUtils.getSubnetmap(broker, subnetId).getNetworkId();
+ if (oldNetworkId != null && !oldNetworkId.equals(networkId)) {
+ deleteSubnetToNetworkMapping(subnetId, oldNetworkId);
+ }
+ if (networkId != null && !networkId.equals(oldNetworkId)) {
+ createSubnetToNetworkMapping(subnetId, networkId);
+ }
+ nvpnManager.updateSubnetNode(subnetId, tenantId, networkId, null, null, null);
+ }
+
+ private void createSubnetToNetworkMapping(Uuid subnetId, Uuid networkId) {
+ try {
+ InstanceIdentifier networkMapIdentifier = NeutronvpnUtils.buildNetworkMapIdentifier(networkId);
+ Optional<NetworkMap> optionalNetworkMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ networkMapIdentifier);
+ NetworkMapBuilder nwMapBuilder = null;
+ if (optionalNetworkMap.isPresent()) {
+ nwMapBuilder = new NetworkMapBuilder(optionalNetworkMap.get());
+ } else {
+ nwMapBuilder = new NetworkMapBuilder().setKey(new NetworkMapKey(networkId)).setNetworkId(networkId);
+ LOG.debug("Adding a new network node in NetworkMaps DS for network {}", networkId.getValue());
+ }
+ List<Uuid> subnetIdList = nwMapBuilder.getSubnetIdList();
+ if (subnetIdList == null) {
+ subnetIdList = new ArrayList<>();
+ }
+ subnetIdList.add(subnetId);
+ nwMapBuilder.setSubnetIdList(subnetIdList);
+ MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier, nwMapBuilder.build());
+ LOG.debug("Created subnet-network mapping for subnet {} network {}", subnetId.getValue(),
+ networkId.getValue());
+ } catch (Exception e) {
+ LOG.error("Create subnet-network mapping failed for subnet {} network {}", subnetId.getValue(),
+ networkId.getValue());
+ }
+ }
+
+ private void deleteSubnetToNetworkMapping(Uuid subnetId, Uuid networkId) {
+ try {
+ InstanceIdentifier networkMapIdentifier = NeutronvpnUtils.buildNetworkMapIdentifier(networkId);
+ Optional<NetworkMap> optionalNetworkMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ networkMapIdentifier);
+ if (optionalNetworkMap.isPresent()) {
+ NetworkMapBuilder nwMapBuilder = new NetworkMapBuilder(optionalNetworkMap.get());
+ List<Uuid> subnetIdList = nwMapBuilder.getSubnetIdList();
+ if (subnetIdList.remove(subnetId)) {
+ if (subnetIdList.size() == 0) {
+ MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier);
+ LOG.debug("Deleted network node in NetworkMaps DS for network {}", subnetId.getValue(),
+ networkId.getValue());
+ } else {
+ nwMapBuilder.setSubnetIdList(subnetIdList);
+ MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier,
+ nwMapBuilder.build());
+ LOG.debug("Deleted subnet-network mapping for subnet {} network {}", subnetId.getValue(),
+ networkId.getValue());
+ }
+ } else {
+ LOG.error("Subnet {} is not mapped to network {}", subnetId.getValue(), networkId.getValue());
+ }
+ } else {
+ LOG.error("network {} not present for subnet {} ", networkId, subnetId);
+ }
+ } catch (Exception e) {
+ LOG.error("Delete subnet-network mapping failed for subnet {} network {}", subnetId.getValue(),
+ networkId.getValue());
+ }
}
}
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import com.google.common.util.concurrent.SettableFuture;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.vpnservice.mdsalutil.MDSALUtil;
import org.opendaylight.vpnservice.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterface;
import org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterfaceBuilder;
import org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterfaceKey;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l3vpn.rev130911.Adjacencies;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l3vpn.rev130911.AdjacenciesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.getl3vpn.output.L3vpnInstances;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.getl3vpn.output
.L3vpnInstancesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
- .PortFixedipToPortNameBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
- .PortNameToPortUuidBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.subnetmaps.Subnetmap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.subnetmaps.SubnetmapBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.subnetmaps.SubnetmapKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.vpnmaps.VpnMap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.vpnmaps.VpnMapBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.vpnmaps.VpnMapKey;
-import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
InstanceIdentifier<Subnetmap> id = InstanceIdentifier.builder(Subnetmaps.class).
child(Subnetmap.class, new SubnetmapKey(subnetId)).build();
- Optional<Subnetmap> sn = read(LogicalDatastoreType.CONFIGURATION, id);
+ Optional<Subnetmap> sn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, id);
logger.debug("updating Subnet :read: ");
if (sn.isPresent()) {
builder = new SubnetmapBuilder(sn.get());
try {
InstanceIdentifier<Subnetmap> id = InstanceIdentifier.builder(Subnetmaps.class).
child(Subnetmap.class, new SubnetmapKey(subnetId)).build();
- Optional<Subnetmap> sn = read(LogicalDatastoreType.CONFIGURATION, id);
+ Optional<Subnetmap> sn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, id);
if (sn.isPresent()) {
SubnetmapBuilder builder = new SubnetmapBuilder(sn.get());
return subnetmap;
}
- private void createSubnetToNetworkMapping(Uuid subnetId, Uuid networkId) {
- try {
- InstanceIdentifier networkMapIdentifier = NeutronvpnUtils.buildNetworkMapIdentifier(networkId);
- Optional<NetworkMap> optionalNetworkMap = read(LogicalDatastoreType.CONFIGURATION, networkMapIdentifier);
- NetworkMapBuilder nwMapBuilder = null;
- if (optionalNetworkMap.isPresent()) {
- nwMapBuilder = new NetworkMapBuilder(optionalNetworkMap.get());
- } else {
- nwMapBuilder = new NetworkMapBuilder().setKey(new NetworkMapKey(networkId)).setNetworkId(networkId);
- logger.debug("Adding a new network node in NetworkMaps DS for network {}", networkId.getValue());
- }
- List<Uuid> subnetIdList = nwMapBuilder.getSubnetIdList();
- if (subnetIdList == null) {
- subnetIdList = new ArrayList<>();
- }
- subnetIdList.add(subnetId);
- nwMapBuilder.setSubnetIdList(subnetIdList);
- MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier, nwMapBuilder.build());
- logger.debug("Created subnet-network mapping for subnet {} network {}", subnetId.getValue(),
- networkId.getValue());
- } catch (Exception e) {
- logger.error("Create subnet-network mapping failed for subnet {} network {}", subnetId.getValue(),
- networkId.getValue());
- }
- }
-
- private void deleteSubnetToNetworkMapping(Uuid subnetId, Uuid networkId) {
- try {
- InstanceIdentifier networkMapIdentifier = NeutronvpnUtils.buildNetworkMapIdentifier(networkId);
- Optional<NetworkMap> optionalNetworkMap = read(LogicalDatastoreType.CONFIGURATION, networkMapIdentifier);
- if (optionalNetworkMap.isPresent()) {
- NetworkMapBuilder nwMapBuilder = new NetworkMapBuilder(optionalNetworkMap.get());
- List<Uuid> subnetIdList = nwMapBuilder.getSubnetIdList();
- if (subnetIdList.remove(subnetId)) {
- if (subnetIdList.size() == 0) {
- MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier);
- logger.debug("Deleted network node in NetworkMaps DS for network {}", subnetId.getValue(),
- networkId.getValue());
- } else {
- nwMapBuilder.setSubnetIdList(subnetIdList);
- MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, networkMapIdentifier,
- nwMapBuilder.build());
- logger.debug("Deleted subnet-network mapping for subnet {} network {}", subnetId.getValue(),
- networkId.getValue());
- }
- } else {
- logger.error("Subnet {} is not mapped to network {}", subnetId.getValue(), networkId.getValue());
- }
- } else {
- logger.error("network {} not present for subnet {} ", networkId, subnetId);
- }
- } catch (Exception e) {
- logger.error("Delete subnet-network mapping failed for subnet {} network {}", subnetId.getValue(),
- networkId.getValue());
- }
- }
-
private void updateVpnInstanceNode(String name, List<String> rd, List<String> irt, List<String> ert) {
try {
List<VpnTarget> vpnTargetList = new ArrayList<VpnTarget>();
InstanceIdentifier<VpnInstance> vpnIdentifier = InstanceIdentifier.builder(VpnInstances.class).
child(VpnInstance.class, new VpnInstanceKey(name)).build();
- Optional<VpnInstance> optionalVpn = read(LogicalDatastoreType.CONFIGURATION, vpnIdentifier);
+ Optional<VpnInstance> optionalVpn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ vpnIdentifier);
logger.debug("Creating/Updating a new vpn-instance node: {} ", name);
if (optionalVpn.isPresent()) {
builder = new VpnInstanceBuilder(optionalVpn.get());
VpnMapBuilder builder;
InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class)
.child(VpnMap.class, new VpnMapKey(vpnId)).build();
- Optional<VpnMap> optionalVpnMap = read(LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
+ Optional<VpnMap> optionalVpnMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ vpnMapIdentifier);
if (optionalVpnMap.isPresent()) {
builder = new VpnMapBuilder(optionalVpnMap.get());
} else {
private void clearFromVpnMaps(Uuid id, Uuid router, List<Uuid> networks) {
InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class)
.child(VpnMap.class, new VpnMapKey(id)).build();
- Optional<VpnMap> optionalVpnMap = read(LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
+ Optional<VpnMap> optionalVpnMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ vpnMapIdentifier);
if (optionalVpnMap.isPresent()) {
VpnMap vpnMap = optionalVpnMap.get();
VpnMapBuilder vpnMapBuilder = new VpnMapBuilder(vpnMap);
logger.debug("VPNMaps DS clear success for VPN {} ", id.getValue());
}
- private void createOfPortInterface(Port port, int portVlanId) {
- String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
- //String ifname = new StringBuilder(name).append(":").append(Integer.toString(portVlanId)).toString();
- //Network network = NeutronvpnUtils.getNeutronNetwork(broker, port.getNetworkId());
- //Boolean isVlanTransparent = network.isVlanTransparent();
-
- logger.debug("Creating OFPort Interface {}", name);
- InstanceIdentifier interfaceIdentifier = NeutronvpnUtils.buildVlanInterfaceIdentifier(name);
- try {
- Optional<Interface> optionalInf = read(LogicalDatastoreType.CONFIGURATION, interfaceIdentifier);
- if (!optionalInf.isPresent()) {
- // handle these for trunkport extensions : portVlanId, isVlanTransparent
- Interface inf = new InterfaceBuilder().setEnabled(true).setName(name).setType(L2vlan.class).build();
- MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, interfaceIdentifier, inf);
- } else {
- logger.error("Interface {} is already present", name);
- }
- } catch (Exception e) {
- logger.error("failed to create interface {} due to the exception {} ", name, e.getMessage());
- }
-
- InstanceIdentifier portIdentifier = NeutronvpnUtils.buildPortNameToPortUuidIdentifier(name);
- PortNameToPortUuidBuilder builder = new PortNameToPortUuidBuilder().setPortName(name).setPortId(port.getUuid());
- MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, portIdentifier, builder.build());
- logger.debug("name-uuid map for port with name: {}, uuid: {} added to NeutronPortData DS", name, port.getUuid
- ());
- }
-
- private void deleteOfPortInterface(Port port, int portVlanId) {
- String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
- //String ifname = new StringBuilder(name).append(":").append(Integer.toString(portVlanId)).toString();
- logger.debug("Removing OFPort Interface {}", name);
- InstanceIdentifier interfaceIdentifier = NeutronvpnUtils.buildVlanInterfaceIdentifier(name);
- try {
- Optional<Interface> optionalInf = read(LogicalDatastoreType.CONFIGURATION, interfaceIdentifier);
- if (optionalInf.isPresent()) {
- MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, interfaceIdentifier);
- } else {
- logger.error("Interface {} is not present", name);
- }
- } catch (Exception e) {
- logger.error("Failed to delete interface {} due to the exception {}", name, e.getMessage());
- }
-
- InstanceIdentifier portIdentifier = NeutronvpnUtils.buildPortNameToPortUuidIdentifier(name);
- MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, portIdentifier);
- logger.debug("name-uuid map for port with name: {}, uuid: {} deleted from NeutronPortData DS", name, port
- .getUuid());
- }
-
private void deleteVpnInstance(Uuid vpnId) {
InstanceIdentifier<VpnInstance> vpnIdentifier = InstanceIdentifier.builder(VpnInstances.class).
}
- private void createVpnInterface(Uuid vpnId, Port port) {
+ protected void createVpnInterface(Uuid vpnId, Port port) {
if (vpnId == null || port == null) {
return;
}
}
- private void deleteVpnInterface(Port port) {
+ protected void deleteVpnInterface(Port port) {
if (port != null) {
String pname = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
}
}
- // adds port to subnet list and creates vpnInterface
- private Uuid addPortToSubnets(Port port) {
- Uuid subnetId = null;
- Uuid vpnId = null;
- String name = NeutronvpnUtils.uuidToTapPortName(port.getUuid());
-
- // find all subnets to which this port is associated
- List<FixedIps> ips = port.getFixedIps();
- for (FixedIps ip : ips) {
- String ipValue = ip.getIpAddress().getIpv4Address().getValue();
-
- InstanceIdentifier id = NeutronvpnUtils.buildFixedIpToPortNameIdentifier(ipValue);
- PortFixedipToPortNameBuilder builder = new PortFixedipToPortNameBuilder().setPortFixedip(ipValue)
- .setPortName(name);
- MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, id, builder.build());
- logger.debug("fixedIp-name map for neutron port with fixedIp: {}, name: {} added to NeutronPortData DS",
- ipValue, name);
-
- subnetId = ip.getSubnetId();
- Subnetmap subnetmap = updateSubnetNode(subnetId, null, null, null, null, port.getUuid());
- if (vpnId == null && subnetmap != null) {
- vpnId = subnetmap.getVpnId();
- }
- }
- return vpnId;
- }
-
- private Uuid removePortFromSubnets(Port port) {
- Uuid subnetId = null;
- Uuid vpnId = null;
-
- // find all Subnets to which this port is associated
- List<FixedIps> ips = port.getFixedIps();
- for (FixedIps ip : ips) {
- String ipValue = ip.getIpAddress().getIpv4Address().getValue();
-
- InstanceIdentifier id = NeutronvpnUtils.buildFixedIpToPortNameIdentifier(ipValue);
- MDSALUtil.syncDelete(broker, LogicalDatastoreType.CONFIGURATION, id);
- logger.debug("fixedIp-name map for neutron port with fixedIp: {} deleted from NeutronPortData DS",
- ipValue);
-
- subnetId = ip.getSubnetId();
- Subnetmap subnetmap = removeFromSubnetNode(subnetId, null, null, null, port.getUuid());
- if (vpnId == null && subnetmap != null) {
- vpnId = subnetmap.getVpnId();
- }
- }
- return vpnId;
- }
-
- protected void handleNeutronSubnetCreated(Uuid subnetId, Uuid networkId, Uuid tenantId) {
- updateSubnetNode(subnetId, tenantId, networkId, null, null, null);
- if (networkId != null && NeutronvpnUtils.getNeutronNetwork(broker, networkId) != null) {
- createSubnetToNetworkMapping(subnetId, networkId);
- }
- }
-
- protected void handleNeutronSubnetDeleted(Uuid subnetId, Uuid networkId, Uuid tenantId) {
- Uuid vpnId = NeutronvpnUtils.getVpnForNetwork(broker, networkId);
- if (vpnId != null) {
- removeSubnetFromVpn(vpnId, subnetId);
- }
- if (networkId != null) {
- deleteSubnetToNetworkMapping(subnetId, networkId);
- }
- }
-
- protected void handleNeutronSubnetUpdated(Uuid subnetId, Uuid networkId, Uuid tenantId) {
- Uuid oldNetworkId = NeutronvpnUtils.getSubnetmap(broker, subnetId).getNetworkId();
- if (oldNetworkId != null && !oldNetworkId.equals(networkId)) {
- deleteSubnetToNetworkMapping(subnetId, oldNetworkId);
- }
- if (networkId != null && !networkId.equals(oldNetworkId)) {
- createSubnetToNetworkMapping(subnetId, networkId);
- }
- updateSubnetNode(subnetId, tenantId, networkId, null, null, null);
- }
-
- protected void handleNeutronPortCreated(Port port) {
- logger.info("Of-port-interface creation");
- int portVlanId = NeutronvpnUtils.getVlanFromNeutronPort(port);
- // Create of-port interface for this neutron port
- createOfPortInterface(port, portVlanId);
- logger.debug("Add port to subnet");
- // add port to local Subnets DS
- Uuid vpnId = addPortToSubnets(port);
-
- if (vpnId != null) {
- // create vpn-interface on this neutron port
- logger.debug("Adding VPN Interface");
- createVpnInterface(vpnId, port);
- }
- }
-
- protected void handleNeutronPortDeleted(Port port) {
- logger.debug("Of-port-interface removal");
- logger.debug("Remove port from subnet");
- // remove port from local Subnets DS
- Uuid vpnId = removePortFromSubnets(port);
-
- if (vpnId != null) {
- // remove vpn-interface for this neutron port
- logger.debug("removing VPN Interface");
- deleteVpnInterface(port);
- }
- int portVlanId = NeutronvpnUtils.getVlanFromNeutronPort(port);
- // Remove of-port interface for this neutron port
- deleteOfPortInterface(port, portVlanId);
-
- }
-
- protected void handleNeutronPortUpdated(Port portoriginal, Port portupdate) {
- logger.debug("Add port to subnet");
- // add port FixedIPs to local Subnets DS
- Uuid vpnIdup = addPortToSubnets(portupdate);
-
- if (vpnIdup != null) {
- createVpnInterface(vpnIdup, portupdate);
- }
-
- // remove port FixedIPs from local Subnets DS
- Uuid vpnIdor = removePortFromSubnets(portoriginal);
-
- if (vpnIdor != null) {
- deleteVpnInterface(portoriginal);
- }
- }
-
public void createL3Vpn(Uuid vpn, String name, Uuid tenant, List<String> rd, List<String> irt, List<String> ert,
Uuid router, List<Uuid> networks) {
// get all vpns
InstanceIdentifier<VpnInstances> vpnsIdentifier =
InstanceIdentifier.builder(VpnInstances.class).build();
- Optional<VpnInstances> optionalVpns = read(LogicalDatastoreType.CONFIGURATION, vpnsIdentifier);
+ Optional<VpnInstances> optionalVpns = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ vpnsIdentifier);
if (optionalVpns.isPresent()) {
for (VpnInstance vpn : optionalVpns.get().getVpnInstance()) {
vpns.add(vpn);
InstanceIdentifier.builder(VpnInstances.class)
.child(VpnInstance.class, new VpnInstanceKey(name)).build();
// read VpnInstance Info
- Optional<VpnInstance> optionalVpn = read(LogicalDatastoreType.CONFIGURATION, vpnIdentifier);
+ Optional<VpnInstance> optionalVpn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ vpnIdentifier);
if (optionalVpn.isPresent()) {
vpns.add(optionalVpn.get());
} else {
}
l3vpn.setId(vpnId).setRouteDistinguisher(rd).setImportRT(irtList).setExportRT(ertList);
- Optional<VpnMap> optionalVpnMap =
- read(LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
+ Optional<VpnMap> optionalVpnMap = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ vpnMapIdentifier);
if (optionalVpnMap.isPresent()) {
VpnMap vpnMap = optionalVpnMap.get();
l3vpn.setRouterId(vpnMap.getRouterId()).setNetworkIds(vpnMap.getNetworkIds())
InstanceIdentifier<VpnInstance> vpnIdentifier =
InstanceIdentifier.builder(VpnInstances.class)
.child(VpnInstance.class, new VpnInstanceKey(vpn.getValue())).build();
- Optional<VpnInstance> optionalVpn = read(LogicalDatastoreType.CONFIGURATION, vpnIdentifier);
+ Optional<VpnInstance> optionalVpn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ vpnIdentifier);
if (optionalVpn.isPresent()) {
removeL3Vpn(vpn);
} else {
}
InstanceIdentifier<VpnInterface> vpnIfIdentifier = InstanceIdentifier.builder(VpnInterfaces.class).
child(VpnInterface.class, new VpnInterfaceKey(ifname)).build();
- Optional<VpnInterface> optionalVpnInterface = read(LogicalDatastoreType.CONFIGURATION,
- vpnIfIdentifier);
+ Optional<VpnInterface> optionalVpnInterface = NeutronvpnUtils.read(broker, LogicalDatastoreType
+ .CONFIGURATION, vpnIfIdentifier);
if (optionalVpnInterface.isPresent()) {
Adjacencies erAdjs = new AdjacenciesBuilder().setAdjacency(Arrays.asList(erAdj)).build();
VpnInterface vpnIf = new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(ifname))
return result;
}
- private <T extends DataObject> Optional<T> read(LogicalDatastoreType datastoreType, InstanceIdentifier<T> path) {
-
- ReadOnlyTransaction tx = broker.newReadOnlyTransaction();
-
- Optional<T> result = Optional.absent();
- try {
- result = tx.read(datastoreType, path).get();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- return result;
- }
-
protected Subnet getNeutronSubnet(Uuid subnetId) {
InstanceIdentifier<Subnet> inst = InstanceIdentifier.create(Neutron.class).
child(Subnets.class).child(Subnet.class, new SubnetKey(subnetId));
- Optional<Subnet> sn = read(LogicalDatastoreType.CONFIGURATION, inst);
+ Optional<Subnet> sn = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, inst);
if (sn.isPresent()) {
return sn.get();
if (portId != null) {
InstanceIdentifier<Port> pid = InstanceIdentifier.create(Neutron.class).
child(Ports.class).child(Port.class, new PortKey(portId));
- Optional<Port> optPort = read(LogicalDatastoreType.CONFIGURATION, pid);
+ Optional<Port> optPort = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, pid);
if (optPort.isPresent()) {
return optPort.get();
}
protected Port getNeutronPort(Uuid portId) {
InstanceIdentifier<Port> pid = InstanceIdentifier.create(Neutron.class).
child(Ports.class).child(Port.class, new PortKey(portId));
- Optional<Port> optPort = read(LogicalDatastoreType.CONFIGURATION, pid);
+ Optional<Port> optPort = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, pid);
if (optPort.isPresent()) {
return optPort.get();
}
List<Uuid> subnets = new ArrayList<Uuid>();
//read subnetmaps
InstanceIdentifier<Subnetmaps> subnetmapsid = InstanceIdentifier.builder(Subnetmaps.class).build();
- Optional<Subnetmaps> subnetmaps = read(LogicalDatastoreType.CONFIGURATION, subnetmapsid);
+ Optional<Subnetmaps> subnetmaps = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION,
+ subnetmapsid);
if (subnetmaps.isPresent()) {
Subnetmaps smaps = subnetmaps.get();
List<Subnetmap> subnetMapList = smaps.getSubnetmap();
result.add("---------------------------------------------------------------------------------------");
InstanceIdentifier<Ports> portidentifier = InstanceIdentifier.create(Neutron.class).child(Ports.class);
try {
- Optional<Ports> ports = read(LogicalDatastoreType.CONFIGURATION, portidentifier);
+ Optional<Ports> ports = NeutronvpnUtils.read(broker, LogicalDatastoreType.CONFIGURATION, portidentifier);
if (ports.isPresent()) {
List<Port> portList = ports.get().getPort();
for (Port port : portList) {
result.add(String.format(" %-22s %-22s %-22s %-6s ", NeutronvpnUtils.uuidToTapPortName(port
.getUuid()), port.getMacAddress(), port.getFixedIps().get(0).getIpAddress().getIpv4Address()
- .getValue(), getIPPrefixFromPort(port)));
+ .getValue(), NeutronvpnUtils.getIPPrefixFromPort(broker, port)));
}
}
} catch (Exception e) {
return result;
}
- private Short getIPPrefixFromPort(Port port) {
- Short prefix = new Short((short) 0);
- String cidr = "";
- try {
- Uuid subnetUUID = port.getFixedIps().get(0).getSubnetId();
-
- org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.subnets
- .SubnetKey subnetkey = new org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets
- .rev150712.subnets.attributes.subnets.SubnetKey(subnetUUID);
- InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets
- .attributes.subnets.Subnet> subnetidentifier = InstanceIdentifier.create(Neutron.class).child(org
- .opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.Subnets
- .class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets
- .attributes.subnets.Subnet.class, subnetkey);
- Optional<org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes
- .subnets.Subnet> subnet = read(LogicalDatastoreType.CONFIGURATION, subnetidentifier);
-
- if (subnet.isPresent()) {
- cidr = subnet.get().getCidr();
- // Extract the prefix length from cidr
- String[] parts = cidr.split("/");
- if ((parts.length == 2)) {
- prefix = Short.valueOf(parts[1]);
- return prefix;
- } else {
- logger.trace("Could not retrieve prefix from subnet CIDR");
- System.out.println("Could not retrieve prefix from subnet CIDR");
- }
- } else {
- logger.trace("Unable to read on subnet datastore");
- }
- } catch (Exception e) {
- logger.trace("Failed to retrieve IP prefix from port : ", e);
- System.out.println("Failed to retrieve IP prefix from port : " + e.getMessage());
- }
- return null;
- }
-
public List<String> showVpnConfigCLI(Uuid vpnuuid) {
List<String> result = new ArrayList<String>();
if (vpnuuid == null) {
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.VpnMaps;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.networkmaps.NetworkMapKey;
-
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
.PortFixedipToPortName;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.neutronvpn.rev150602.neutron.port.data
}
protected static VpnMap getVpnMap(DataBroker broker, Uuid id) {
- InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class)
- .child(VpnMap.class, new VpnMapKey(id)).build();
- Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION,
- vpnMapIdentifier);
+ InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class).child(VpnMap.class,
+ new VpnMapKey(id)).build();
+ Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
if (optionalVpnMap.isPresent()) {
return optionalVpnMap.get();
}
protected static Uuid getVpnForNetwork(DataBroker broker, Uuid network) {
InstanceIdentifier<VpnMaps> vpnMapsIdentifier = InstanceIdentifier.builder(VpnMaps.class).build();
- Optional<VpnMaps> optionalVpnMaps = read(broker, LogicalDatastoreType.CONFIGURATION,
- vpnMapsIdentifier);
+ Optional<VpnMaps> optionalVpnMaps = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapsIdentifier);
if (optionalVpnMaps.isPresent()) {
VpnMaps vpnMaps = optionalVpnMaps.get();
List<VpnMap> allMaps = vpnMaps.getVpnMap();
protected static Uuid getVpnForRouter(DataBroker broker, Uuid router) {
InstanceIdentifier<VpnMaps> vpnMapsIdentifier = InstanceIdentifier.builder(VpnMaps.class).build();
- Optional<VpnMaps> optionalVpnMaps = read(broker, LogicalDatastoreType.CONFIGURATION,
- vpnMapsIdentifier);
+ Optional<VpnMaps> optionalVpnMaps = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapsIdentifier);
if (optionalVpnMaps.isPresent()) {
VpnMaps vpnNets = optionalVpnMaps.get();
List<VpnMap> allMaps = vpnNets.getVpnMap();
protected static Uuid getRouterforVpn(DataBroker broker, Uuid vpnId) {
InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class)
.child(VpnMap.class, new VpnMapKey(vpnId)).build();
- Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION,
- vpnMapIdentifier);
+ Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier);
if (optionalVpnMap.isPresent()) {
VpnMap vpnMap = optionalVpnMap.get();
return vpnMap.getRouterId();
protected static List<Uuid> getSubnetIdsFromNetworkId(DataBroker broker, Uuid networkId) {
InstanceIdentifier id = buildNetworkMapIdentifier(networkId);
- Optional<NetworkMap> optionalNetworkMap = read(broker, LogicalDatastoreType.CONFIGURATION,
- id);
+ Optional<NetworkMap> optionalNetworkMap = read(broker, LogicalDatastoreType.CONFIGURATION, id);
if (optionalNetworkMap.isPresent()) {
return optionalNetworkMap.get().getSubnetIdList();
}
protected static Router getNeutronRouter(DataBroker broker, Uuid routerId) {
- InstanceIdentifier<Router> inst = InstanceIdentifier.create(Neutron.class).
- child(Routers.class).child(Router.class, new RouterKey(routerId));
-
+ InstanceIdentifier<Router> inst = InstanceIdentifier.create(Neutron.class).child(Routers.class).child(Router
+ .class, new RouterKey(routerId));
Optional<Router> rtr = read(broker, LogicalDatastoreType.CONFIGURATION, inst);
if (rtr.isPresent()) {
return rtr.get();
protected static Network getNeutronNetwork(DataBroker broker, Uuid networkId) {
logger.debug("getNeutronNetwork for {}", networkId.getValue());
- InstanceIdentifier<Network> inst = InstanceIdentifier.create(Neutron.class).
- child(Networks.class).child(Network.class, new NetworkKey(networkId));
-
+ InstanceIdentifier<Network> inst = InstanceIdentifier.create(Neutron.class).child(Networks.class).child
+ (Network.class, new NetworkKey(networkId));
Optional<Network> net = read(broker, LogicalDatastoreType.CONFIGURATION, inst);
if (net.isPresent()) {
return net.get();
}
}
+ protected static Short getIPPrefixFromPort(DataBroker broker, Port port) {
+ Short prefix = new Short((short) 0);
+ String cidr = "";
+ try {
+ Uuid subnetUUID = port.getFixedIps().get(0).getSubnetId();
+
+ org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.subnets
+ .SubnetKey subnetkey = new org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets
+ .rev150712.subnets.attributes.subnets.SubnetKey(subnetUUID);
+ InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets
+ .attributes.subnets.Subnet> subnetidentifier = InstanceIdentifier.create(Neutron.class).child(org
+ .opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes.Subnets
+ .class).child(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets
+ .attributes.subnets.Subnet.class, subnetkey);
+ Optional<org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.subnets.rev150712.subnets.attributes
+ .subnets.Subnet> subnet = read(broker, LogicalDatastoreType.CONFIGURATION, subnetidentifier);
+
+ if (subnet.isPresent()) {
+ cidr = subnet.get().getCidr();
+ // Extract the prefix length from cidr
+ String[] parts = cidr.split("/");
+ if ((parts.length == 2)) {
+ prefix = Short.valueOf(parts[1]);
+ return prefix;
+ } else {
+ logger.trace("Could not retrieve prefix from subnet CIDR");
+ System.out.println("Could not retrieve prefix from subnet CIDR");
+ }
+ } else {
+ logger.trace("Unable to read on subnet datastore");
+ }
+ } catch (Exception e) {
+ logger.trace("Failed to retrieve IP prefix from port : ", e);
+ System.out.println("Failed to retrieve IP prefix from port : " + e.getMessage());
+ }
+ return null;
+ }
+
static InstanceIdentifier<PortNameToPortUuid> buildPortNameToPortUuidIdentifier(String portname) {
InstanceIdentifier<PortNameToPortUuid> id = InstanceIdentifier.builder(NeutronPortData.class).child
(PortNameToPortUuid.class, new PortNameToPortUuidKey(portname)).build();
/*
- * Copyright (c) 2015-2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*
* Generated from: yang module name: neutronvpn-impl yang module local name: neutronvpn-impl
* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Thu Jan 06 10:51:12 IST 2015
+* Generated at: Thu Jan 06 10:51:12 IST 2016
*
* Do not modify this file unless it is present under src/main directory
*/
<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
-Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+<!--
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
/*
- * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
-<!-- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
-and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+and is available at http://www.eclipse.org/legal/epl-v10.html
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">