|
Software TSN Switch
A software switch to connect VMs and Containers to a TSN network
|
Coordinates NETCONF-based communication and TSN configuration workflows across topology nodes. More...
#include <NetworkManager.h>

Public Member Functions | |
| NetworkManager (Topology &topology) | |
| Constructs a NetworkManager with the given topology reference. | |
| ~NetworkManager () | |
| Destructor for NetworkManager. Disconnects all active sessions. | |
| bool | connectAllNodes (const InventoryMap &inventory) |
| Connects to all nodes in the topology using the provided credentials. | |
| void | fetchLldpData () |
| Fetches LLDP data from all connected nodes and updates the topology. Reads LLDP data via /ietf-lldp:lldp-entries via Netconf <get>. | |
| void | fetchOperationGcl () |
| Fetches operational GCL data from all connected nodes and updates their configurations. Reads GCL data via /interfaces/interface/bridge-port/gate-parameter-table via Netconf <get>. | |
| void | fetchInterfaces () |
| Fetches interface data from all connected nodes and updates the topology. Reads interface data via /ietf-interfaces:interfaces/interface via Netconf <get>. | |
| void | fetchPtpData () |
| Fetches PTP data from all connected nodes and updates the topology. Reads PTP data via /ieee1588-ptp:ptp-data via Netconf <get>. | |
| void | discoverNetwork () |
| Discovers the network topology and populating the Topology structure. | |
| bool | fetchLldpDataForNode (const std::string &nodeName) |
| Fetches LLDP data for a specific node and updates the topology. | |
| bool | fetchOperationGclForNode (const std::string &nodeName) |
| Fetches operational GCL data for a specific node and updates the topology. | |
| bool | fetchPtpDataForNode (const std::string &nodeName) |
| Fetches PTP data for a specific node and updates the topology. | |
| bool | deployConfigToNode (const std::string &nodeName) |
| Configures specific nodes with TSN parameters. | |
| bool | deployInterfaceConfig (const std::string &nodeName, const std::string &ifaceName) |
| Configures a specific interface on a node with its TSN parameters. | |
| void | deployConfigToAll () |
| Configures all nodes in the topology with their respective TSN parameters. | |
| std::shared_ptr< common::NetconfSession > | getSession (const std::string &nodeName) |
| Retrieves the Netconf session for a given node by its hostname. | |
Private Member Functions | |
| bool | executeOnNodeWorker (const std::string &nodeName, std::function< void(std::shared_ptr< common::NetconfSession >)> task) |
| std::string | buildInterfaceGclXml (const ietfInterface_t &iface) |
Static Private Member Functions | |
| static std::string | buildGclXml (const CncNode_t &node) |
| Builds the XML configuration for GCL based on the node's TSN parameters. | |
Private Attributes | |
| Topology & | topology_ |
| std::map< std::string, std::shared_ptr< NodeWorker > > | nodeWorkers_ |
Coordinates NETCONF-based communication and TSN configuration workflows across topology nodes.
This class manages per-node NETCONF sessions, retrieves operational LLDP and GCL data, and applies generated TSN/GCL configuration back to devices. It serves as the orchestration layer between topology state, inventory credentials, XML builders/parsers, and device-facing NETCONF operations.
| cnc::NetworkManager::NetworkManager | ( | Topology & | topology | ) |
Constructs a NetworkManager with the given topology reference.
| topology | Reference to the Topology object managing network nodes. |
| cnc::NetworkManager::~NetworkManager | ( | ) |
Destructor for NetworkManager. Disconnects all active sessions.
|
staticprivate |
Builds the XML configuration for GCL based on the node's TSN parameters.
| node | The CncNode_t containing TSN parameters. |
|
private |
| bool cnc::NetworkManager::connectAllNodes | ( | const InventoryMap & | inventory | ) |
Connects to all nodes in the topology using the provided credentials.
| inventory | The inventory map containing device credentials (hostname to DeviceCredentials_t). |
| void cnc::NetworkManager::deployConfigToAll | ( | ) |
Configures all nodes in the topology with their respective TSN parameters.
| bool cnc::NetworkManager::deployConfigToNode | ( | const std::string & | nodeName | ) |
Configures specific nodes with TSN parameters.
| nodeName | The hostname of the node to configure. |
| bool cnc::NetworkManager::deployInterfaceConfig | ( | const std::string & | nodeName, |
| const std::string & | ifaceName | ||
| ) |
Configures a specific interface on a node with its TSN parameters.
| nodeName | The hostname of the node containing the interface to configure. |
| ifaceName | The name of the interface to configure. |
| void cnc::NetworkManager::discoverNetwork | ( | ) |
Discovers the network topology and populating the Topology structure.
|
private |
| void cnc::NetworkManager::fetchInterfaces | ( | ) |
Fetches interface data from all connected nodes and updates the topology. Reads interface data via /ietf-interfaces:interfaces/interface via Netconf <get>.
| void cnc::NetworkManager::fetchLldpData | ( | ) |
Fetches LLDP data from all connected nodes and updates the topology. Reads LLDP data via /ietf-lldp:lldp-entries via Netconf <get>.
| bool cnc::NetworkManager::fetchLldpDataForNode | ( | const std::string & | nodeName | ) |
Fetches LLDP data for a specific node and updates the topology.
| nodeName | The hostname of the node to fetch LLDP data from. |
| void cnc::NetworkManager::fetchOperationGcl | ( | ) |
Fetches operational GCL data from all connected nodes and updates their configurations. Reads GCL data via /interfaces/interface/bridge-port/gate-parameter-table via Netconf <get>.
| bool cnc::NetworkManager::fetchOperationGclForNode | ( | const std::string & | nodeName | ) |
Fetches operational GCL data for a specific node and updates the topology.
| nodeName | The hostname of the node to fetch GCL data from. |
| void cnc::NetworkManager::fetchPtpData | ( | ) |
Fetches PTP data from all connected nodes and updates the topology. Reads PTP data via /ieee1588-ptp:ptp-data via Netconf <get>.
| bool cnc::NetworkManager::fetchPtpDataForNode | ( | const std::string & | nodeName | ) |
Fetches PTP data for a specific node and updates the topology.
| nodeName | The hostname of the node to fetch PTP data from. |
| std::shared_ptr< common::NetconfSession > cnc::NetworkManager::getSession | ( | const std::string & | nodeName | ) |
Retrieves the Netconf session for a given node by its hostname.
| nodeName | The hostname of the node. |
|
private |
|
private |