Avantika-Huawei
Committed by Gerrit Code Review

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

Change-Id: I96efb496577d4ccfbbb8f9957703b4a4da126d8a
......@@ -406,15 +406,6 @@ public final class PceccSrTeBeHandler {
DeviceId deviceId = null;
for (Iterator<Link> iterator = linkList.iterator(); iterator.hasNext();) {
link = iterator.next();
// Add source device label now
deviceId = link.src().deviceId();
nodeLabelId = pceStore.getGlobalNodeLabel(deviceId);
if (nodeLabelId == null) {
log.error("Unable to find node label for a device id {} in store.", deviceId.toString());
return null;
}
labelStack.add(nodeLabelId);
// Add adjacency label for this link
adjLabelId = pceStore.getAdjLabel(link);
if (adjLabelId == null) {
......@@ -422,11 +413,7 @@ public final class PceccSrTeBeHandler {
return null;
}
labelStack.add(adjLabelId);
}
// This is the last link in path
// Add destination device label now.
if (link != null) {
deviceId = link.dst().deviceId();
nodeLabelId = pceStore.getGlobalNodeLabel(deviceId);
if (nodeLabelId == null) {
......
......@@ -417,11 +417,8 @@ public class PceccSrTeBeHandlerTest {
// Compute label stack
LabelStack labelStack = srTeHandler.computeLabelStack(path1);
// check node-label of D1.deviceId()
List<LabelResourceId> labelList = labelStack.labelResources();
Iterator<LabelResourceId> iterator = labelList.iterator();
labelId = iterator.next();
assertThat(labelId, is(LabelResourceId.labelResourceId(4097)));
// check adjacency label of D1.deviceId()
labelId = iterator.next();
......
......@@ -59,6 +59,14 @@ public class PcepNaiIpv4Adjacency implements PcepNai {
return ST_TYPE;
}
public int getLocalIpv4Addr() {
return localIpv4Addr;
}
public int getRemoteIpv4Addr() {
return remoteIpv4Addr;
}
@Override
public int write(ChannelBuffer bb) {
int iLenStartIndex = bb.writerIndex();
......
......@@ -84,7 +84,7 @@ public class SrEroSubObject implements PcepValueType {
*/
protected static final Logger log = LoggerFactory.getLogger(SrEroSubObject.class);
public static final short TYPE = 0x60; //TODO : type to be defined
public static final short TYPE = 0x24; //TODO : type to be defined
public static final short LENGTH = 12;
public static final short VALUE_LENGTH = 10;
public static final int SET = 1;
......@@ -243,9 +243,10 @@ public class SrEroSubObject implements PcepValueType {
@Override
public int write(ChannelBuffer c) {
int iLenStartIndex = c.writerIndex();
c.writeShort(TYPE);
c.writeShort(LENGTH);
c.writeByte(TYPE);
// Store the position of object length
int objectLenIndex = c.writerIndex();
c.writeByte(0);
short temp = 0;
if (bMFlag) {
......@@ -264,13 +265,14 @@ public class SrEroSubObject implements PcepValueType {
temp = (short) (temp | tempST);
c.writeShort(temp);
if (bMFlag) {
int tempSid = (int) sid << 12;
int tempSid = sid << 12;
c.writeInt(tempSid);
} else {
c.writeInt(sid);
}
nai.write(c);
c.setByte(objectLenIndex, (c.writerIndex() - iLenStartIndex));
return c.writerIndex() - iLenStartIndex;
}
......