Updated SDN-IP to use Ip4Address and Ip4Prefix instead of IpAddress and
IpPrefix, because so far we haven't implemented IPv6.
Also, some of the BGP-related attributes (e.g., BGP Speaker ID)
are IPv4 by definition.

The following components are updated:
 * BGP implementation
 * Router component and relevant state (e.g., RouteEntry)

Other components (e.g., configuration) will continue to use
the more generic IpAddress and IpPrefix.

Change-Id: I1936ca9871fd5a9709cb4f2c2850d78ebc1472c4
diff --git a/apps/sdnip/src/test/java/org/onlab/onos/sdnip/SdnIpTest.java b/apps/sdnip/src/test/java/org/onlab/onos/sdnip/SdnIpTest.java
index 5f18bca..348a62fd 100644
--- a/apps/sdnip/src/test/java/org/onlab/onos/sdnip/SdnIpTest.java
+++ b/apps/sdnip/src/test/java/org/onlab/onos/sdnip/SdnIpTest.java
@@ -207,7 +207,7 @@
         reset(intentService);
 
         for (RouteUpdate update : routeUpdates) {
-            IpAddress nextHopAddress = update.routeEntry().nextHop();
+            Ip4Address nextHopAddress = update.routeEntry().nextHop();
 
             // Find out the egress ConnectPoint
             ConnectPoint egressConnectPoint = getConnectPoint(nextHopAddress);
@@ -268,7 +268,7 @@
         reset(intentService);
 
         for (RouteUpdate update : routeUpdates) {
-            IpAddress nextHopAddress = update.routeEntry().nextHop();
+            Ip4Address nextHopAddress = update.routeEntry().nextHop();
 
             // Find out the egress ConnectPoint
             ConnectPoint egressConnectPoint = getConnectPoint(nextHopAddress);
@@ -342,11 +342,6 @@
                                       prefixLength);
                 // We have to ensure we don't generate the same prefix twice
                 // (this is quite easy to happen with small prefix lengths).
-                // TODO:
-                // The IpPrefix does the comparison using 32 bits length,
-                // but we need to compare only the prefix length. So I use
-                // Ip4Prefix for this moment and changed to IpPrefix. This
-                // can be improved in the future.
             } while (prefixes.contains(prefix));
 
             prefixes.add(prefix);
@@ -366,9 +361,9 @@
             assertNotNull(nextHop);
 
             RouteUpdate update =
-                    new RouteUpdate(RouteUpdate.Type.UPDATE,
-                                    new RouteEntry(prefix,
-                                                   nextHop.ipAddress()));
+                new RouteUpdate(RouteUpdate.Type.UPDATE,
+                        new RouteEntry(prefix,
+                                       nextHop.ipAddress().getIp4Address()));
 
             routeUpdates.add(update);
         }