diff --git a/include/villas/node.h b/include/villas/node.h index b01c39d54..bea6b4528 100644 --- a/include/villas/node.h +++ b/include/villas/node.h @@ -91,8 +91,8 @@ struct vnode { #endif /* WITH_NETEM */ #endif /* __linux__ */ - struct vpath sources; /**< A list of path sources which reference this node (struct vpath_sources). */ - struct vpath destinations; /**< A list of path destinations which reference this node (struct vpath_destinations). */ + struct vlist sources; /**< A list of path sources which reference this node (struct vpath_sources). */ + struct vlist destinations; /**< A list of path destinations which reference this node (struct vpath_destinations). */ struct vnode_type *_vt; /**< Virtual functions (C++ OOP style) */ void *_vd; /**< Virtual data (used by struct vnode::_vt functions) */ diff --git a/lib/node.cpp b/lib/node.cpp index 31a653933..10945bf38 100644 --- a/lib/node.cpp +++ b/lib/node.cpp @@ -89,6 +89,14 @@ int node_init(struct vnode *n, struct vnode_type *vt) if (ret) return ret; + ret = vlist_init(&n->sources); + if (ret) + return ret; + + ret = vlist_init(&n->destinations); + if (ret) + return ret; + ret = vt->init ? vt->init(n) : 0; if (ret) return ret; @@ -392,6 +400,14 @@ int node_destroy(struct vnode *n) if (ret) return ret; + ret = vlist_destroy(&n->sources); + if (ret) + return ret; + + ret = vlist_destroy(&n->destinations); + if (ret) + return ret; + if (node_type(n)->destroy) { ret = (int) node_type(n)->destroy(n); if (ret)