ONOS-2926 Remove IP instead of host when the IP mapping is released
Change-Id: Ifea3366ce8a18ea068e615636b3069e769221c0e
diff --git a/core/api/src/main/java/org/onosproject/net/host/HostProviderService.java b/core/api/src/main/java/org/onosproject/net/host/HostProviderService.java
index f7b7c49..bae9382 100644
--- a/core/api/src/main/java/org/onosproject/net/host/HostProviderService.java
+++ b/core/api/src/main/java/org/onosproject/net/host/HostProviderService.java
@@ -15,6 +15,7 @@
*/
package org.onosproject.net.host;
+import org.onlab.packet.IpAddress;
import org.onosproject.net.HostId;
import org.onosproject.net.provider.ProviderService;
@@ -52,4 +53,11 @@
*/
void hostVanished(HostId hostId);
+ /**
+ * Notifies the core when a host is no longer detected on a network.
+ *
+ * @param hostId id of the host that vanished
+ */
+ void removeIpFromHost(HostId hostId, IpAddress ipAddress);
+
}
diff --git a/core/api/src/main/java/org/onosproject/net/host/HostStore.java b/core/api/src/main/java/org/onosproject/net/host/HostStore.java
index 5894fe9..918ced4 100644
--- a/core/api/src/main/java/org/onosproject/net/host/HostStore.java
+++ b/core/api/src/main/java/org/onosproject/net/host/HostStore.java
@@ -55,6 +55,15 @@
HostEvent removeHost(HostId hostId);
/**
+ * Removes the specified ip from the host entry.
+ *
+ * @param hostId host identification
+ * @param ipAddress ipAddress to be removed
+ * @return remove event or null if host was not found
+ */
+ HostEvent removeIp(HostId hostId, IpAddress ipAddress);
+
+ /**
* Returns the number of hosts in the store.
*
* @return host count