Fixing null provider custom topo simulator
- properly deal with device mastership
- allow creation of multi-homed hosts
- made UI location parameters optional
- added a simulated fabric script
Change-Id: I8558cc06aa4c323fab898b02fba9659b202c5392
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/CustomTopologySimulator.java b/providers/null/src/main/java/org/onosproject/provider/nil/CustomTopologySimulator.java
index cf1e22d..52883a2 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/CustomTopologySimulator.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/CustomTopologySimulator.java
@@ -27,6 +27,7 @@
import org.onosproject.net.host.DefaultHostDescription;
import java.util.Map;
+import java.util.Set;
import static org.onlab.util.Tools.toHex;
import static org.onosproject.provider.nil.NullProviders.SCHEME;
@@ -96,6 +97,19 @@
hostProviderService.hostDetected(hostId, description, false);
}
+ /**
+ * Creates a simulated multi-homed host.
+ *
+ * @param hostId host identifier
+ * @param locations host locations
+ * @param hostIps host IP addresses
+ */
+ public void createHost(HostId hostId, Set<HostLocation> locations, Set<IpAddress> hostIps) {
+ DefaultHostDescription description =
+ new DefaultHostDescription(hostId.mac(), hostId.vlanId(), locations, hostIps, false);
+ hostProviderService.hostDetected(hostId, description, false);
+ }
+
@Override
protected void createDevices() {
}