Committed by
Priyankab-Huawei
[ONOS-4171] Proper Router ID format.
Change-Id: I97c714792e56cc92d761d1d7e85baa1ca8e78893
Showing
2 changed files
with
5 additions
and
3 deletions
| ... | @@ -70,7 +70,7 @@ public final class BgpDpid { | ... | @@ -70,7 +70,7 @@ public final class BgpDpid { |
| 70 | /* | 70 | /* |
| 71 | * Get iso node ID in specified string format. | 71 | * Get iso node ID in specified string format. |
| 72 | */ | 72 | */ |
| 73 | - private String isoNodeIdString(byte[] isoNodeId) { | 73 | + public String isoNodeIdString(byte[] isoNodeId) { |
| 74 | if (isoNodeId != null) { | 74 | if (isoNodeId != null) { |
| 75 | return String.format("%02x%02x.%02x%02x.%02x%02x", isoNodeId[0], isoNodeId[1], | 75 | return String.format("%02x%02x.%02x%02x.%02x%02x", isoNodeId[0], isoNodeId[1], |
| 76 | isoNodeId[2], isoNodeId[3], | 76 | isoNodeId[2], isoNodeId[3], | ... | ... |
| ... | @@ -243,13 +243,15 @@ public class BgpTopologyProvider extends AbstractProvider implements DeviceProvi | ... | @@ -243,13 +243,15 @@ public class BgpTopologyProvider extends AbstractProvider implements DeviceProvi |
| 243 | if (tlv.getType() == NodeDescriptors.IGP_ROUTERID_TYPE) { | 243 | if (tlv.getType() == NodeDescriptors.IGP_ROUTERID_TYPE) { |
| 244 | if (tlv instanceof IsIsPseudonode) { | 244 | if (tlv instanceof IsIsPseudonode) { |
| 245 | deviceType = VIRTUAL; | 245 | deviceType = VIRTUAL; |
| 246 | - newBuilder.set(AnnotationKeys.ROUTER_ID, new String(((IsIsPseudonode) tlv).getIsoNodeId())); | 246 | + newBuilder.set(AnnotationKeys.ROUTER_ID, nodeUri.isoNodeIdString(((IsIsPseudonode) tlv) |
| 247 | + .getIsoNodeId())); | ||
| 247 | } else if (tlv instanceof OspfPseudonode) { | 248 | } else if (tlv instanceof OspfPseudonode) { |
| 248 | deviceType = VIRTUAL; | 249 | deviceType = VIRTUAL; |
| 249 | newBuilder | 250 | newBuilder |
| 250 | .set(AnnotationKeys.ROUTER_ID, Integer.toString(((OspfPseudonode) tlv).getrouterID())); | 251 | .set(AnnotationKeys.ROUTER_ID, Integer.toString(((OspfPseudonode) tlv).getrouterID())); |
| 251 | } else if (tlv instanceof IsIsNonPseudonode) { | 252 | } else if (tlv instanceof IsIsNonPseudonode) { |
| 252 | - newBuilder.set(AnnotationKeys.ROUTER_ID, new String(((IsIsNonPseudonode) tlv).getIsoNodeId())); | 253 | + newBuilder.set(AnnotationKeys.ROUTER_ID, nodeUri.isoNodeIdString(((IsIsNonPseudonode) tlv) |
| 254 | + .getIsoNodeId())); | ||
| 253 | } else if (tlv instanceof OspfNonPseudonode) { | 255 | } else if (tlv instanceof OspfNonPseudonode) { |
| 254 | newBuilder.set(AnnotationKeys.ROUTER_ID, | 256 | newBuilder.set(AnnotationKeys.ROUTER_ID, |
| 255 | Integer.toString(((OspfNonPseudonode) tlv).getrouterID())); | 257 | Integer.toString(((OspfNonPseudonode) tlv).getrouterID())); | ... | ... |
-
Please register or login to post a comment