mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
node: add configPath member
we need the path of the config file in the nodes in case we want to parse a separate sub-config with relative path names. This is required for the fpga node type to parse the ips config file from Fpga::parse. Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
parent
08f109b924
commit
81ff679b41
3 changed files with 5 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <fmt/ostream.h>
|
||||
#include <iostream>
|
||||
#include <jansson.h>
|
||||
|
@ -65,6 +66,7 @@ public:
|
|||
PathSourceList sources; // A list of path sources which reference this node.
|
||||
PathDestinationList
|
||||
destinations; // A list of path destinations which reference this node.
|
||||
std::filesystem::path configPath;
|
||||
|
||||
#ifdef __linux__
|
||||
int fwmark; // Socket mark for netem, routing and filtering
|
||||
|
|
|
@ -44,7 +44,7 @@ using namespace villas::utils;
|
|||
Node::Node(const uuid_t &id, const std::string &name)
|
||||
: logger(logging.get("node")), sequence_init(0), sequence(0),
|
||||
in(NodeDirection::Direction::IN, this),
|
||||
out(NodeDirection::Direction::OUT, this),
|
||||
out(NodeDirection::Direction::OUT, this), configPath(),
|
||||
#ifdef __linux__
|
||||
fwmark(-1),
|
||||
#endif // __linux__
|
||||
|
|
|
@ -147,6 +147,8 @@ void SuperNode::parse(json_t *root) {
|
|||
if (!n)
|
||||
throw MemoryAllocationError();
|
||||
|
||||
n->configPath = getConfigPath();
|
||||
|
||||
ret = n->parse(json_node);
|
||||
if (ret) {
|
||||
auto config_id = fmt::format("node-config-node-{}", node_type);
|
||||
|
|
Loading…
Add table
Reference in a new issue