floodlight/floodlight — pull request #379 by vy (2013-02-22 12:19:22+00:00)
Title: Provide parameters for configuring the host addresses that Controller/REST/Jython listens on.

Introduce `openflowhost` parameter to `FloodlightProvider`, and `host` parameter to `RestApiServer` and `JythonDebugInterface` modules. Unless `host` parameter is specifically provided for `RestApiServer` and/or `JythonDebugInterface`, these modules fall back to `openflowhost` parameter, if it is available.

In order to access `FloodlightProvider.openflowhost` parameter within `RestApiServer` and `JythonDebugInterface` modules, I needed to add an alternative `FloodlightModuleContext#getConfigParams` method to make it work with class parameters in addition to class instances. Further, I found out that `debugserver.py` silently ignores the passed `host` parameter, this was fixed too.

Sample `floodlightdefault.properties` files are as follows.

Both 3 servers listen on 192.168.1.1:

net.floodlightcontroller.core.FloodlightProvider.openflowhost = 192.168.1.1

Both 3 servers listen on different hosts:

net.floodlightcontroller.restserver.RestApiServer.host = 192.168.1.1
net.floodlightcontroller.core.FloodlightProvider.openflowhost = 192.168.1.2
net.floodlightcontroller.jython.JythonDebugInterface.host = 192.168.1.3

Controller and REST API server listens on 192.168.1.1, Jython server listens on 192.168.1.2:

net.floodlightcontroller.core.FloodlightProvider.openflowhost = 192.168.1.1
net.floodlightcontroller.jython.JythonDebugInterface.host = 192.168.1.2