Skip to content
Snippets Groups Projects
Commit f8a51af7 authored by Volkan Yazıcı's avatar Volkan Yazıcı
Browse files

Add 'openflowhost' parameter for core.FloodlightProvider.

parent 548a2328
No related branches found
No related tags found
No related merge requests found
......@@ -174,6 +174,7 @@ public class Controller implements IFloodlightProviderService,
protected IThreadPoolService threadPool;
// Configuration options
protected String openFlowHost = null;
protected int openFlowPort = 6633;
protected int workerThreads = 0;
// The id for this controller node. Should be unique for each controller
......@@ -1704,7 +1705,10 @@ public class Controller implements IFloodlightProviderService,
ChannelPipelineFactory pfact =
new OpenflowPipelineFactory(this, null);
bootstrap.setPipelineFactory(pfact);
InetSocketAddress sa = new InetSocketAddress(openFlowPort);
InetSocketAddress sa =
(openFlowHost == null)
? new InetSocketAddress(openFlowPort)
: new InetSocketAddress(openFlowHost, openFlowPort);
final ChannelGroup cg = new DefaultChannelGroup();
cg.add(bootstrap.bind(sa));
......@@ -1745,6 +1749,11 @@ public class Controller implements IFloodlightProviderService,
}
public void setConfigParams(Map<String, String> configParams) {
String ofHost = configParams.get("openflowhost");
if (ofHost != null) {
this.openFlowHost = ofHost;
log.debug("OpenFlow host set to {}", this.openFlowHost);
}
String ofPort = configParams.get("openflowport");
if (ofPort != null) {
this.openFlowPort = Integer.parseInt(ofPort);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment