Pulled ProxyArpManager out of the SDN-IP module. Most of the work is related to stubbing out an IConfigInfoService object that can provide default configuration to the ARP module when there's no SDN-IP config file to read it from
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
index 5e2cb05..a3c8f1f 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
@@ -34,6 +34,7 @@
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.ofcontroller.bgproute.RibUpdate.Operation;
import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoLinkService;
+import net.onrc.onos.ofcontroller.core.config.IConfigInfoService;
import net.onrc.onos.ofcontroller.core.internal.TopoLinkServiceImpl;
import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscovery;
import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscovery.LDUpdate;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/Configuration.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/Configuration.java
index 7fabc72..4c81d1b 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/Configuration.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/Configuration.java
@@ -47,7 +47,7 @@
public void setBgpdMacAddress(String strMacAddress) {
this.bgpdMacAddress = MACAddress.valueOf(strMacAddress);
}
-
+
public List<String> getSwitches() {
return Collections.unmodifiableList(switches);
}
@@ -65,7 +65,7 @@
public void setSwitches(List<String> switches) {
this.switches = switches;
}
-
+
public List<Interface> getInterfaces() {
return Collections.unmodifiableList(interfaces);
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/config/DefaultConfiguration.java b/src/main/java/net/onrc/onos/ofcontroller/core/config/DefaultConfiguration.java
new file mode 100644
index 0000000..d9a291f
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/config/DefaultConfiguration.java
@@ -0,0 +1,47 @@
+package net.onrc.onos.ofcontroller.core.config;
+
+import java.net.InetAddress;
+
+import net.floodlightcontroller.util.MACAddress;
+import net.onrc.onos.ofcontroller.bgproute.Interface;
+
+import org.openflow.util.HexString;
+
+public class DefaultConfiguration implements IConfigInfoService {
+
+ @Override
+ public boolean isInterfaceAddress(InetAddress address) {
+ return false;
+ }
+
+ @Override
+ public boolean inConnectedNetwork(InetAddress address) {
+ return false;
+ }
+
+ @Override
+ public boolean fromExternalNetwork(long inDpid, short inPort) {
+ return false;
+ }
+
+ @Override
+ public Interface getOutgoingInterface(InetAddress dstIpAddress) {
+ return null;
+ }
+
+ @Override
+ public boolean hasLayer3Configuration() {
+ return false;
+ }
+
+ @Override
+ public MACAddress getRouterMacAddress() {
+ return MACAddress.valueOf(HexString.fromHexString("000000000001"));
+ }
+
+ @Override
+ public short getVlan() {
+ return 0;
+ }
+
+}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/IConfigInfoService.java b/src/main/java/net/onrc/onos/ofcontroller/core/config/IConfigInfoService.java
similarity index 93%
rename from src/main/java/net/onrc/onos/ofcontroller/bgproute/IConfigInfoService.java
rename to src/main/java/net/onrc/onos/ofcontroller/core/config/IConfigInfoService.java
index 4d80894..7bbf483 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/IConfigInfoService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/config/IConfigInfoService.java
@@ -1,8 +1,9 @@
-package net.onrc.onos.ofcontroller.bgproute;
+package net.onrc.onos.ofcontroller.core.config;
import java.net.InetAddress;
import net.floodlightcontroller.util.MACAddress;
+import net.onrc.onos.ofcontroller.bgproute.Interface;
import net.onrc.onos.ofcontroller.core.module.IOnosService;
/**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/module/ONOSModuleLoader.java b/src/main/java/net/onrc/onos/ofcontroller/core/module/OnosModuleLoader.java
similarity index 90%
rename from src/main/java/net/onrc/onos/ofcontroller/core/module/ONOSModuleLoader.java
rename to src/main/java/net/onrc/onos/ofcontroller/core/module/OnosModuleLoader.java
index 6526827..81d6c1f 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/module/ONOSModuleLoader.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/module/OnosModuleLoader.java
@@ -13,11 +13,12 @@
import net.floodlightcontroller.core.module.IFloodlightService;
import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.topology.ITopologyService;
-import net.onrc.onos.ofcontroller.bgproute.IConfigInfoService;
+import net.onrc.onos.ofcontroller.core.config.DefaultConfiguration;
+import net.onrc.onos.ofcontroller.core.config.IConfigInfoService;
import net.onrc.onos.ofcontroller.proxyarp.IProxyArpService;
import net.onrc.onos.ofcontroller.proxyarp.ProxyArpManager;
-public class ONOSModuleLoader implements IFloodlightModule {
+public class OnosModuleLoader implements IFloodlightModule {
private IFloodlightProviderService floodlightProvider;
private ITopologyService topology;
private IConfigInfoService config;
@@ -25,7 +26,7 @@
private ProxyArpManager arpManager;
- public ONOSModuleLoader() {
+ public OnosModuleLoader() {
arpManager = new ProxyArpManager();
}
@@ -66,6 +67,9 @@
//This could be null because it's not mandatory to have an
//IConfigInfoService loaded.
config = context.getServiceImpl(IConfigInfoService.class);
+ if (config == null) {
+ config = new DefaultConfiguration();
+ }
arpManager.init(floodlightProvider, topology, config, restApi);
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java
index 5e5742d..c0ea064 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java
@@ -22,8 +22,8 @@
import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.topology.ITopologyService;
import net.floodlightcontroller.util.MACAddress;
-import net.onrc.onos.ofcontroller.bgproute.IConfigInfoService;
import net.onrc.onos.ofcontroller.bgproute.Interface;
+import net.onrc.onos.ofcontroller.core.config.IConfigInfoService;
import org.openflow.protocol.OFMessage;
import org.openflow.protocol.OFPacketIn;
diff --git a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
index 8cea5dc..7c4bc1a 100644
--- a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
+++ b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
@@ -24,4 +24,4 @@
net.onrc.onos.ofcontroller.bgproute.BgpRoute
net.onrc.onos.registry.controller.ZookeeperRegistry
net.onrc.onos.registry.controller.StandaloneRegistry
-net.onrc.onos.ofcontroller.core.module.ONOSModuleLoader
\ No newline at end of file
+net.onrc.onos.ofcontroller.core.module.OnosModuleLoader
\ No newline at end of file