#include <LinkDiscoveryModule.hpp>
|
| | LinkDevice (std::vector< uint32_t > availablePorts, uint64_t switchDpid, of_version_t ofVersion) |
| |
| | ~LinkDevice () |
| |
| InsertResult | insertLink (uint32_t port, std::shared_ptr< LinkDevice > linkedDevice, uint32_t endpointPort, uint64_t updateTime) |
| |
| void | flushOutDatedLinks (uint64_t borderDate, std::map< uint32_t, std::pair< std::shared_ptr< LinkDevice >, uint32_t >> &outDatedLinks) |
| |
std::map< uint32_t, std::pair
< std::shared_ptr< LinkDevice >
, uint32_t > > | eraseLinkToDevice (uint64_t deviceId) |
| |
| std::vector< uint32_t > | getAvailablePorts () |
| |
std::map< uint32_t,
LinkDeviceTimestampTupel > | getActiveLinks () |
| |
| uint64_t | getId () |
| |
| void | clearAll () |
| |
| of_version_t | getVersion () |
| |
| Enumerator |
|---|
| NO_VALID_PORT |
|
| SUCCESS_NEW |
|
| SUCCESS_MODIFY |
|
| SUCCESS_NO_CHANGE |
|
| LinkDiscoveryModule::LinkDevice::LinkDevice |
( |
std::vector< uint32_t > |
availablePorts, |
|
|
uint64_t |
switchDpid, |
|
|
of_version_t |
ofVersion |
|
) |
| |
|
inline |
Constructor of a LinkDevice to initialize it. Requires the available network ports an the network id.
- Parameters
-
| availablePorts | a inital list of available port of the represented LinkdDevice |
| switchDpid | the device id |
| LinkDiscoveryModule::LinkDevice::~LinkDevice |
( |
| ) |
|
|
inline |
| void LinkDiscoveryModule::LinkDevice::clearAll |
( |
| ) |
|
|
inline |
| std::map< uint32_t, std::pair< std::shared_ptr< LinkDiscoveryModule::LinkDevice >, uint32_t > > LinkDiscoveryModule::LinkDevice::eraseLinkToDevice |
( |
uint64_t |
deviceId | ) |
|
Threadsave function to erase links to a endpoint with the deviceId
- Parameters
-
| deviceId | the id of the link endpoint device which have to be erased. |
- Returns
- the erased links where the endpoint device his port of the link are mapped to the port of the source link device
| void LinkDiscoveryModule::LinkDevice::flushOutDatedLinks |
( |
uint64_t |
borderDate, |
|
|
std::map< uint32_t, std::pair< std::shared_ptr< LinkDevice >, uint32_t >> & |
outDatedLinks |
|
) |
| |
Threadsave function to erase out dated linkes. The function returns over the out param outDatedLinks the removed links.
- Parameters
-
| borderData | the time border to flush |
| outDatedLinks | Out param to access the removed links of the flush. The result contains the erased Link with its endpoint port maped to the flushed device port. |
Get a copy of the activeLinks inside the device. WARNING: the map is a copy but the shared pointers of the LinkDevices points to the original Objects
- Returns
- copy of the activeLinks, which maps the endpoint device with the endpoint port (contained inside the Tupel struct) to the port of the source device
| std::vector<uint32_t> LinkDiscoveryModule::LinkDevice::getAvailablePorts |
( |
| ) |
|
|
inline |
Returns a copy of the available ports of the device
- Parameters
-
| copy | of the available ports |
| uint64_t LinkDiscoveryModule::LinkDevice::getId |
( |
| ) |
|
|
inline |
Access the Id of the device
- Returns
- A copy of the device Id
| of_version_t LinkDiscoveryModule::LinkDevice::getVersion |
( |
| ) |
|
|
inline |
Threadsave function to insert a new link to the device. This requires a available port.
- Parameters
-
| port | the port of de device where the link is setup |
| linkDevice | the endpoint device which is connected to the port |
| endpointPort | the port at the endpoint device where the link is setup |
| updateTime | the timestamp of the link discovery. |
- Returns
- InsertResult type to specify the result of the insert action. This is used to represent the different situations PORT_NOT_AVAILABLE / NEW_INSERT / MODIFY_ENTRY / NO_CHANGES
The documentation for this class was generated from the following files: