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 { ...@@ -406,15 +406,6 @@ public final class PceccSrTeBeHandler {
406 DeviceId deviceId = null; 406 DeviceId deviceId = null;
407 for (Iterator<Link> iterator = linkList.iterator(); iterator.hasNext();) { 407 for (Iterator<Link> iterator = linkList.iterator(); iterator.hasNext();) {
408 link = iterator.next(); 408 link = iterator.next();
409 - // Add source device label now
410 - deviceId = link.src().deviceId();
411 - nodeLabelId = pceStore.getGlobalNodeLabel(deviceId);
412 - if (nodeLabelId == null) {
413 - log.error("Unable to find node label for a device id {} in store.", deviceId.toString());
414 - return null;
415 - }
416 - labelStack.add(nodeLabelId);
417 -
418 // Add adjacency label for this link 409 // Add adjacency label for this link
419 adjLabelId = pceStore.getAdjLabel(link); 410 adjLabelId = pceStore.getAdjLabel(link);
420 if (adjLabelId == null) { 411 if (adjLabelId == null) {
...@@ -422,11 +413,7 @@ public final class PceccSrTeBeHandler { ...@@ -422,11 +413,7 @@ public final class PceccSrTeBeHandler {
422 return null; 413 return null;
423 } 414 }
424 labelStack.add(adjLabelId); 415 labelStack.add(adjLabelId);
425 - }
426 416
427 - // This is the last link in path
428 - // Add destination device label now.
429 - if (link != null) {
430 deviceId = link.dst().deviceId(); 417 deviceId = link.dst().deviceId();
431 nodeLabelId = pceStore.getGlobalNodeLabel(deviceId); 418 nodeLabelId = pceStore.getGlobalNodeLabel(deviceId);
432 if (nodeLabelId == null) { 419 if (nodeLabelId == null) {
......
...@@ -417,11 +417,8 @@ public class PceccSrTeBeHandlerTest { ...@@ -417,11 +417,8 @@ public class PceccSrTeBeHandlerTest {
417 // Compute label stack 417 // Compute label stack
418 LabelStack labelStack = srTeHandler.computeLabelStack(path1); 418 LabelStack labelStack = srTeHandler.computeLabelStack(path1);
419 419
420 - // check node-label of D1.deviceId()
421 List<LabelResourceId> labelList = labelStack.labelResources(); 420 List<LabelResourceId> labelList = labelStack.labelResources();
422 Iterator<LabelResourceId> iterator = labelList.iterator(); 421 Iterator<LabelResourceId> iterator = labelList.iterator();
423 - labelId = iterator.next();
424 - assertThat(labelId, is(LabelResourceId.labelResourceId(4097)));
425 422
426 // check adjacency label of D1.deviceId() 423 // check adjacency label of D1.deviceId()
427 labelId = iterator.next(); 424 labelId = iterator.next();
......
...@@ -59,6 +59,14 @@ public class PcepNaiIpv4Adjacency implements PcepNai { ...@@ -59,6 +59,14 @@ public class PcepNaiIpv4Adjacency implements PcepNai {
59 return ST_TYPE; 59 return ST_TYPE;
60 } 60 }
61 61
62 + public int getLocalIpv4Addr() {
63 + return localIpv4Addr;
64 + }
65 +
66 + public int getRemoteIpv4Addr() {
67 + return remoteIpv4Addr;
68 + }
69 +
62 @Override 70 @Override
63 public int write(ChannelBuffer bb) { 71 public int write(ChannelBuffer bb) {
64 int iLenStartIndex = bb.writerIndex(); 72 int iLenStartIndex = bb.writerIndex();
......
...@@ -84,7 +84,7 @@ public class SrEroSubObject implements PcepValueType { ...@@ -84,7 +84,7 @@ public class SrEroSubObject implements PcepValueType {
84 */ 84 */
85 protected static final Logger log = LoggerFactory.getLogger(SrEroSubObject.class); 85 protected static final Logger log = LoggerFactory.getLogger(SrEroSubObject.class);
86 86
87 - public static final short TYPE = 0x60; //TODO : type to be defined 87 + public static final short TYPE = 0x24; //TODO : type to be defined
88 public static final short LENGTH = 12; 88 public static final short LENGTH = 12;
89 public static final short VALUE_LENGTH = 10; 89 public static final short VALUE_LENGTH = 10;
90 public static final int SET = 1; 90 public static final int SET = 1;
...@@ -243,9 +243,10 @@ public class SrEroSubObject implements PcepValueType { ...@@ -243,9 +243,10 @@ public class SrEroSubObject implements PcepValueType {
243 @Override 243 @Override
244 public int write(ChannelBuffer c) { 244 public int write(ChannelBuffer c) {
245 int iLenStartIndex = c.writerIndex(); 245 int iLenStartIndex = c.writerIndex();
246 - 246 + c.writeByte(TYPE);
247 - c.writeShort(TYPE); 247 + // Store the position of object length
248 - c.writeShort(LENGTH); 248 + int objectLenIndex = c.writerIndex();
249 + c.writeByte(0);
249 250
250 short temp = 0; 251 short temp = 0;
251 if (bMFlag) { 252 if (bMFlag) {
...@@ -264,13 +265,14 @@ public class SrEroSubObject implements PcepValueType { ...@@ -264,13 +265,14 @@ public class SrEroSubObject implements PcepValueType {
264 temp = (short) (temp | tempST); 265 temp = (short) (temp | tempST);
265 c.writeShort(temp); 266 c.writeShort(temp);
266 if (bMFlag) { 267 if (bMFlag) {
267 - int tempSid = (int) sid << 12; 268 + int tempSid = sid << 12;
268 c.writeInt(tempSid); 269 c.writeInt(tempSid);
269 } else { 270 } else {
270 c.writeInt(sid); 271 c.writeInt(sid);
271 } 272 }
272 nai.write(c); 273 nai.write(c);
273 274
275 + c.setByte(objectLenIndex, (c.writerIndex() - iLenStartIndex));
274 return c.writerIndex() - iLenStartIndex; 276 return c.writerIndex() - iLenStartIndex;
275 } 277 }
276 278
......