Avantika-Huawei
Committed by Gerrit Code Review

[ONOS-4707] GoldenEye - SR-TE LSPs setup issues

Change-Id: I03f169147227876323cac1315975b57f52d514b5
......@@ -254,6 +254,7 @@ public class PceManager implements PceService {
tunnelConsumerIdGen = coreService.getIdGenerator(TUNNEL_CONSUMER_ID_GEN_TOPIC);
localLspIdIdGen = coreService.getIdGenerator(LOCAL_LSP_ID_GEN_TOPIC);
localLspIdIdGen.getNewId(); // To prevent 0, the 1st value generated from being used in protocol.
localLspIdFreeList = storageService.<Short>setBuilder()
.withName("pcepLocalLspIdDeletedList")
.withSerializer(Serializer.using(KryoNamespaces.API))
......
......@@ -1091,15 +1091,6 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
pcepTunnelApiMapper.addToCoreTunnelRequestQueue(pcepTunnelData);
int srpId = SrpIdGenerators.create();
TunnelId tunnelId = tunnel.tunnelId();
int plspId = 0;
if (!(pcepTunnelApiMapper.checkFromTunnelDBQueue(tunnelId))) {
log.error("Tunnel doesnot exists. Tunnel id {}" + tunnelId.toString());
return;
} else {
PcepTunnelData pcepTunnelDbData = pcepTunnelApiMapper.getDataFromTunnelDBQueue(tunnelId);
plspId = pcepTunnelDbData.plspId();
}
PcepValueType tlv;
LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
......@@ -1121,8 +1112,11 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
String localLspIdString = tunnel.annotations().value(LOCAL_LSP_ID);
String pccTunnelIdString = tunnel.annotations().value(PCC_TUNNEL_ID);
String pLspIdString = tunnel.annotations().value(PLSP_ID);
short localLspId = 0;
short pccTunnelId = 0;
int plspId = 0;
if (localLspIdString != null) {
localLspId = Short.valueOf(localLspIdString);
......@@ -1132,6 +1126,10 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
pccTunnelId = Short.valueOf(pccTunnelIdString);
}
if (pLspIdString != null) {
plspId = Integer.valueOf(pLspIdString);
}
tlv = new StatefulIPv4LspIdentifiersTlv((((IpTunnelEndPoint) tunnel.src())
.ip().getIp4Address().toInt()),
localLspId, pccTunnelId, 0, (((IpTunnelEndPoint) tunnel.dst()).ip()
......