Extend FPM module to handle routes from multiple peers.
This has the side-effect of fixing a bug when the same peer changes its
route advertisement for a particular prefix.
Change-Id: I09af3baf0a7741919be2a2986112db6db2556666
diff --git a/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java
index 86dd44c..5a398b8 100644
--- a/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java
+++ b/apps/routing/fpm/src/main/java/org/onosproject/routing/fpm/cli/FpmConnectionsList.java
@@ -21,8 +21,6 @@
import org.onosproject.cli.AbstractShellCommand;
import org.onosproject.routing.fpm.FpmInfoService;
-import java.net.InetSocketAddress;
-
/**
* Displays the current FPM connections.
*/
@@ -36,14 +34,8 @@
protected void execute() {
FpmInfoService fpmInfo = AbstractShellCommand.get(FpmInfoService.class);
- fpmInfo.peers().forEach((socketAddress, timestamp) -> {
- if (socketAddress instanceof InetSocketAddress) {
- InetSocketAddress inet = (InetSocketAddress) socketAddress;
-
- print(FORMAT, inet.getHostString(), inet.getPort(), Tools.timeAgo(timestamp));
- } else {
- print("Unknown data format");
- }
+ fpmInfo.peers().forEach((peer, timestamp) -> {
+ print(FORMAT, peer.address(), peer.port(), Tools.timeAgo(timestamp));
});
}
}