|
ZeroSDN Controller
1.0
A modular distributed Software-Defined Network Controller
|
A Module which accepts connections from Switches and spawns SwitchAdapter Modules for them. More...
#include <SwitchAdapterServer.hpp>
Public Member Functions | |
| SwitchAdapterServer (const uint64_t instanceId, const of_version_t openFlowVersion, const Poco::Net::SocketAddress serverAddress, const bool flushStreamToSwitchesEveryMessage, const bool startAsMock) | |
| ~SwitchAdapterServer () | |
| virtual bool | enable () |
| virtual void | disable () |
A Module which accepts connections from Switches and spawns SwitchAdapter Modules for them.
The SwitchAdapter wraps each OpenFlow capable switch as a ZMF Module instance. An OpenFlow switch connects to a SwitchAdapter instance as it would normally connect to a controller.
| SwitchAdapterServer::SwitchAdapterServer | ( | const uint64_t | instanceId, |
| const of_version_t | openFlowVersion, | ||
| const Poco::Net::SocketAddress | serverAddress, | ||
| const bool | flushStreamToSwitchesEveryMessage, | ||
| const bool | startAsMock | ||
| ) |
Constructs (but does not start) a SwitchAdapterServer.
| instanceId | unique id of this SwitchAdapterServer instance. |
| openFlowVersion | the OpenFlow version this runner and the spawned SwitchAdapters will speak with the switches. |
| serverAddress | the address on which a ServerSocket will be listening for switches. |
| flushStreamToSwitchesEveryMessage | if set to true, SwitchAdapters will flush the socket after every sent message. flushing may affect throughput negatively but can decrease latency. Flushing also prevents messages from waiting in the queue when no message follow after it. |
| SwitchAdapterServer::~SwitchAdapterServer | ( | ) |
Destructor. Stops all SwitchAdapters and closes the ServerSocket.
|
virtual |
closes the serverSocket, shuts down all child SwitchAdapter modules.
|
virtual |
starts a ServerSocket listening for incoming switchConnections. For each incoming connection, an OpenFlow handshake is attempted. If the handshake is successful, a SwitchAdapter(Module) is started.