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);
}