A Module representing one OpenFlow switch.
More...
#include <SwitchAdapter.hpp>
|
| | SwitchAdapter (const uint64_t switchId, std::shared_ptr< Poco::Net::SocketStream > socketStream, std::shared_ptr< Poco::Net::StreamSocket > switchSocket, const of_version_t ofVersion) |
| |
| | ~SwitchAdapter () |
| |
| virtual zmf::data::ZmfOutReply | handleRequest (const zmf::data::ZmfMessage &message, const zmf::data::ModuleUniqueId &sender) override |
| |
A Module representing one OpenFlow switch.
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.
- Author
- Alexander Kicherer
-
Andre Kutzleb
-
Matthias Hoppe
- Date
- 28.06.2015
-
created on 28.6.2015
| SwitchAdapter::SwitchAdapter |
( |
const uint64_t |
switchId, |
|
|
std::shared_ptr< Poco::Net::SocketStream > |
socketStream, |
|
|
std::shared_ptr< Poco::Net::StreamSocket > |
switchSocket, |
|
|
const of_version_t |
ofVersion |
|
) |
| |
Constructs (but does not start) A SwitchAdapter.
- Parameters
-
| switchId | the switchId of the switch represented by this SwitchAdapter. |
| socketStream | the stream connected to the socket socket representing the connection to the switch. |
| switchSocket | the socket representing the connection to the switch. |
| ofVersion | the OpenFlow version used for communicating with the switch. |
| SwitchAdapter::~SwitchAdapter |
( |
| ) |
|
Destructor: In case this module is not correctly disabled by ZMF, disable is called so that no socket or thread is left behind by the SwitchAdapter.
| void SwitchAdapter::disable |
( |
| ) |
|
|
protectedvirtual |
Closes the socket to the switch and stops the thread listening on the connection from the switch.
| bool SwitchAdapter::enable |
( |
| ) |
|
|
protectedvirtual |
starts a subscription for topic TO.SWITCH_ADAPTER.SWITCH_INSTANCE(this.switchId).OPENFLOW.* which will be handled by handleOpenFlowFromZmf.
Also starts a thread listing on the connection to the switch.
- Returns
- true of enable successful, false if the socket to the switch is closed or startup otherwise failed.
| zmf::data::ZmfOutReply SwitchAdapter::handleRequest |
( |
const zmf::data::ZmfMessage & |
message, |
|
|
const zmf::data::ModuleUniqueId & |
sender |
|
) |
| |
|
overridevirtual |
Handles a ZMF request message - handles bundle deploy.
- Parameters
-
| message | the received ZMF message |
| sender | the ID of the sender of the received ZMF message |
- Returns
- a to the message
The documentation for this class was generated from the following files: