4#include <condition_variable>
32 std::condition_variable
cv;
146 std::shared_ptr<common::NetconfSession>
getSession(
const std::string& nodeName);
157 std::function<
void(std::shared_ptr<common::NetconfSession>)> task);
Stores and provides lookup access to the controller's in-memory network topology.
Definition Topology.h:18
Coordinates NETCONF-based communication and TSN configuration workflows across topology nodes.
Definition NetworkManager.h:45
std::string buildInterfaceGclXml(const ietfInterface_t &iface)
void fetchOperationGcl()
Fetches operational GCL data from all connected nodes and updates their configurations....
Definition NetworkManager.cpp:255
Topology & topology_
Definition NetworkManager.h:149
void fetchInterfaces()
Fetches interface data from all connected nodes and updates the topology. Reads interface data via /i...
Definition NetworkManager.cpp:275
void discoverNetwork()
Discovers the network topology and populating the Topology structure.
Definition NetworkManager.cpp:300
std::shared_ptr< common::NetconfSession > getSession(const std::string &nodeName)
Retrieves the Netconf session for a given node by its hostname.
Definition NetworkManager.cpp:174
void fetchPtpData()
Fetches PTP data from all connected nodes and updates the topology. Reads PTP data via /ieee1588-ptp:...
Definition NetworkManager.cpp:265
static std::string buildGclXml(const CncNode_t &node)
Builds the XML configuration for GCL based on the node's TSN parameters.
Definition NetworkManager.cpp:419
bool executeOnNodeWorker(const std::string &nodeName, std::function< void(std::shared_ptr< common::NetconfSession >)> task)
Definition NetworkManager.cpp:38
void fetchLldpData()
Fetches LLDP data from all connected nodes and updates the topology. Reads LLDP data via /ietf-lldp:l...
Definition NetworkManager.cpp:245
bool connectAllNodes(const InventoryMap &inventory)
Connects to all nodes in the topology using the provided credentials.
Definition NetworkManager.cpp:85
void deployConfigToAll()
Configures all nodes in the topology with their respective TSN parameters.
Definition NetworkManager.cpp:400
bool fetchPtpDataForNode(const std::string &nodeName)
Fetches PTP data for a specific node and updates the topology.
Definition NetworkManager.cpp:202
bool deployInterfaceConfig(const std::string &nodeName, const std::string &ifaceName)
Configures a specific interface on a node with its TSN parameters.
Definition NetworkManager.cpp:313
bool deployConfigToNode(const std::string &nodeName)
Configures specific nodes with TSN parameters.
Definition NetworkManager.cpp:340
bool fetchOperationGclForNode(const std::string &nodeName)
Fetches operational GCL data for a specific node and updates the topology.
Definition NetworkManager.cpp:221
~NetworkManager()
Destructor for NetworkManager. Disconnects all active sessions.
Definition NetworkManager.cpp:24
std::map< std::string, std::shared_ptr< NodeWorker > > nodeWorkers_
Definition NetworkManager.h:154
bool fetchLldpDataForNode(const std::string &nodeName)
Fetches LLDP data for a specific node and updates the topology.
Definition NetworkManager.cpp:183
Definition GclParser.h:10
std::map< std::string, DeviceCredentials_t > InventoryMap
Definition Inventory.h:17
This struct is used on the CNC side to represent one host with all its interfaces as well as its PTP ...
Definition CncTypes.h:512
Worker structure for managing NETCONF sessions and job queues for individual nodes.
Definition NetworkManager.h:25
std::queue< std::function< void()> > jobQueue
Definition NetworkManager.h:30
std::condition_variable cv
Definition NetworkManager.h:32
std::mutex queueMutex
Definition NetworkManager.h:31
const size_t MAX_QUEUE_SIZE
Definition NetworkManager.h:35
std::shared_ptr< common::NetconfSession > opsSession
Definition NetworkManager.h:26
std::shared_ptr< common::NetconfSession > notifSession
Definition NetworkManager.h:27
std::thread workerThread
Definition NetworkManager.h:29
bool stop
Definition NetworkManager.h:33
Struct to hold information about an interface, inspired by the ietf-interfaces yang model.
Definition CncTypes.h:256