Priyanka B
Committed by Priyankab-Huawei

[ONOS-4171] Proper Router ID format.

Change-Id: I97c714792e56cc92d761d1d7e85baa1ca8e78893
......@@ -70,7 +70,7 @@ public final class BgpDpid {
/*
* Get iso node ID in specified string format.
*/
private String isoNodeIdString(byte[] isoNodeId) {
public String isoNodeIdString(byte[] isoNodeId) {
if (isoNodeId != null) {
return String.format("%02x%02x.%02x%02x.%02x%02x", isoNodeId[0], isoNodeId[1],
isoNodeId[2], isoNodeId[3],
......
......@@ -243,13 +243,15 @@ public class BgpTopologyProvider extends AbstractProvider implements DeviceProvi
if (tlv.getType() == NodeDescriptors.IGP_ROUTERID_TYPE) {
if (tlv instanceof IsIsPseudonode) {
deviceType = VIRTUAL;
newBuilder.set(AnnotationKeys.ROUTER_ID, new String(((IsIsPseudonode) tlv).getIsoNodeId()));
newBuilder.set(AnnotationKeys.ROUTER_ID, nodeUri.isoNodeIdString(((IsIsPseudonode) tlv)
.getIsoNodeId()));
} else if (tlv instanceof OspfPseudonode) {
deviceType = VIRTUAL;
newBuilder
.set(AnnotationKeys.ROUTER_ID, Integer.toString(((OspfPseudonode) tlv).getrouterID()));
} else if (tlv instanceof IsIsNonPseudonode) {
newBuilder.set(AnnotationKeys.ROUTER_ID, new String(((IsIsNonPseudonode) tlv).getIsoNodeId()));
newBuilder.set(AnnotationKeys.ROUTER_ID, nodeUri.isoNodeIdString(((IsIsNonPseudonode) tlv)
.getIsoNodeId()));
} else if (tlv instanceof OspfNonPseudonode) {
newBuilder.set(AnnotationKeys.ROUTER_ID,
Integer.toString(((OspfNonPseudonode) tlv).getrouterID()));
......