Replaced IpPrefix and IpAddress in the following methods
and cleanup related code:
- Host.ipAddresses()
- DefaultHost.ipAddresses()
- HostDescription.ipAddress()
- DefaultHostDescription.ipAddress()
- HostService.getHostsByIp()
- HostManager.getHostsByIp()
- HostStore.getHosts()
- GossipHostStore.getHosts()
- SimpleHostStore.getHosts()
- ProxyArpService.known()
- ProxyArpManager.known()
As a result of the above cleanup, the "hosts" CLI command outputs
the IP addresses as "1.2.3.4" instead of "1.2.3.4/32".
Also, the following REST calls might be affected as well with
the above format replacement:
- REST POST: config/topology
- REST GET: topology/graph
diff --git a/core/api/src/main/java/org/onlab/onos/net/DefaultHost.java b/core/api/src/main/java/org/onlab/onos/net/DefaultHost.java
index cb2e292..d8d6c62 100644
--- a/core/api/src/main/java/org/onlab/onos/net/DefaultHost.java
+++ b/core/api/src/main/java/org/onlab/onos/net/DefaultHost.java
@@ -1,7 +1,7 @@
package org.onlab.onos.net;
import org.onlab.onos.net.provider.ProviderId;
-import org.onlab.packet.IpPrefix;
+import org.onlab.packet.IpAddress;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
@@ -20,8 +20,7 @@
private final MacAddress mac;
private final VlanId vlan;
private final HostLocation location;
- // FIXME: should be IpAddress
- private final Set<IpPrefix> ips;
+ private final Set<IpAddress> ips;
/**
* Creates an end-station host using the supplied information.
@@ -35,13 +34,13 @@
* @param annotations optional key/value annotations
*/
public DefaultHost(ProviderId providerId, HostId id, MacAddress mac,
- VlanId vlan, HostLocation location, Set<IpPrefix> ips,
+ VlanId vlan, HostLocation location, Set<IpAddress> ips,
Annotations... annotations) {
super(providerId, id, annotations);
this.mac = mac;
this.vlan = vlan;
this.location = location;
- this.ips = new HashSet<IpPrefix>(ips);
+ this.ips = new HashSet<>(ips);
}
@Override
@@ -55,7 +54,7 @@
}
@Override
- public Set<IpPrefix> ipAddresses() {
+ public Set<IpAddress> ipAddresses() {
return Collections.unmodifiableSet(ips);
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/Host.java b/core/api/src/main/java/org/onlab/onos/net/Host.java
index 3a9bfa5..9d08591 100644
--- a/core/api/src/main/java/org/onlab/onos/net/Host.java
+++ b/core/api/src/main/java/org/onlab/onos/net/Host.java
@@ -1,6 +1,6 @@
package org.onlab.onos.net;
-import org.onlab.packet.IpPrefix;
+import org.onlab.packet.IpAddress;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
@@ -38,8 +38,7 @@
*
* @return set of IP addresses; empty if no IP address is bound
*/
- // FIXME: Switch to IpAddress
- Set<IpPrefix> ipAddresses();
+ Set<IpAddress> ipAddresses();
/**
* Returns the most recent host location where the host attaches to the
diff --git a/core/api/src/main/java/org/onlab/onos/net/host/DefaultHostDescription.java b/core/api/src/main/java/org/onlab/onos/net/host/DefaultHostDescription.java
index 71a952e..ae548e1 100644
--- a/core/api/src/main/java/org/onlab/onos/net/host/DefaultHostDescription.java
+++ b/core/api/src/main/java/org/onlab/onos/net/host/DefaultHostDescription.java
@@ -6,7 +6,7 @@
import org.onlab.onos.net.AbstractDescription;
import org.onlab.onos.net.HostLocation;
import org.onlab.onos.net.SparseAnnotations;
-import org.onlab.packet.IpPrefix;
+import org.onlab.packet.IpAddress;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
@@ -23,7 +23,7 @@
private final MacAddress mac;
private final VlanId vlan;
private final HostLocation location;
- private final Set<IpPrefix> ip;
+ private final Set<IpAddress> ip;
/**
* Creates a host description using the supplied information.
@@ -36,7 +36,8 @@
public DefaultHostDescription(MacAddress mac, VlanId vlan,
HostLocation location,
SparseAnnotations... annotations) {
- this(mac, vlan, location, Collections.<IpPrefix>emptySet(), annotations);
+ this(mac, vlan, location, Collections.<IpAddress>emptySet(),
+ annotations);
}
/**
@@ -49,7 +50,7 @@
* @param annotations optional key/value annotations map
*/
public DefaultHostDescription(MacAddress mac, VlanId vlan,
- HostLocation location, IpPrefix ip,
+ HostLocation location, IpAddress ip,
SparseAnnotations... annotations) {
this(mac, vlan, location, ImmutableSet.of(ip), annotations);
}
@@ -64,7 +65,7 @@
* @param annotations optional key/value annotations map
*/
public DefaultHostDescription(MacAddress mac, VlanId vlan,
- HostLocation location, Set<IpPrefix> ip,
+ HostLocation location, Set<IpAddress> ip,
SparseAnnotations... annotations) {
super(annotations);
this.mac = mac;
@@ -89,7 +90,7 @@
}
@Override
- public Set<IpPrefix> ipAddress() {
+ public Set<IpAddress> ipAddress() {
return ip;
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/host/HostDescription.java b/core/api/src/main/java/org/onlab/onos/net/host/HostDescription.java
index 258ce3d..c42dc03 100644
--- a/core/api/src/main/java/org/onlab/onos/net/host/HostDescription.java
+++ b/core/api/src/main/java/org/onlab/onos/net/host/HostDescription.java
@@ -4,7 +4,7 @@
import org.onlab.onos.net.Description;
import org.onlab.onos.net.HostLocation;
-import org.onlab.packet.IpPrefix;
+import org.onlab.packet.IpAddress;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
@@ -39,7 +39,5 @@
*
* @return host IP address
*/
- // FIXME: Switch to IpAddress
- Set<IpPrefix> ipAddress();
-
+ Set<IpAddress> ipAddress();
}
diff --git a/core/api/src/main/java/org/onlab/onos/net/host/HostService.java b/core/api/src/main/java/org/onlab/onos/net/host/HostService.java
index 09034eb..f18569f 100644
--- a/core/api/src/main/java/org/onlab/onos/net/host/HostService.java
+++ b/core/api/src/main/java/org/onlab/onos/net/host/HostService.java
@@ -7,7 +7,6 @@
import org.onlab.onos.net.Host;
import org.onlab.onos.net.HostId;
import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
@@ -60,7 +59,7 @@
* @param ip ip address
* @return set of hosts with the given IP
*/
- Set<Host> getHostsByIp(IpPrefix ip);
+ Set<Host> getHostsByIp(IpAddress ip);
// TODO: consider adding Host getHostByIp(IpAddress ip, VlanId vlan);
diff --git a/core/api/src/main/java/org/onlab/onos/net/host/HostStore.java b/core/api/src/main/java/org/onlab/onos/net/host/HostStore.java
index b27b697..535479c8 100644
--- a/core/api/src/main/java/org/onlab/onos/net/host/HostStore.java
+++ b/core/api/src/main/java/org/onlab/onos/net/host/HostStore.java
@@ -6,7 +6,7 @@
import org.onlab.onos.net.HostId;
import org.onlab.onos.net.provider.ProviderId;
import org.onlab.onos.store.Store;
-import org.onlab.packet.IpPrefix;
+import org.onlab.packet.IpAddress;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
@@ -82,8 +82,7 @@
* @param ip ip address
* @return set of hosts with the given IP
*/
- // FIXME: Switch to IpAddress
- Set<Host> getHosts(IpPrefix ip);
+ Set<Host> getHosts(IpAddress ip);
/**
* Returns the set of hosts whose location falls on the given connection point.
diff --git a/core/api/src/main/java/org/onlab/onos/net/proxyarp/ProxyArpService.java b/core/api/src/main/java/org/onlab/onos/net/proxyarp/ProxyArpService.java
index 1e29a02..f49b5cf 100644
--- a/core/api/src/main/java/org/onlab/onos/net/proxyarp/ProxyArpService.java
+++ b/core/api/src/main/java/org/onlab/onos/net/proxyarp/ProxyArpService.java
@@ -3,7 +3,7 @@
import org.onlab.onos.net.ConnectPoint;
import org.onlab.onos.net.packet.PacketContext;
import org.onlab.packet.Ethernet;
-import org.onlab.packet.IpPrefix;
+import org.onlab.packet.IpAddress;
/**
* Service for processing arp requests on behalf of applications.
@@ -17,7 +17,7 @@
* @param addr a ip address
* @return true if know, false otherwise
*/
- boolean known(IpPrefix addr);
+ boolean known(IpAddress addr);
/**
* Sends a reply for a given request. If the host is not known then the arp