From 3c13f6793092371f4b3ef013adadb3f5b37bfe98 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Tue, 25 Aug 2020 21:00:52 +0200 Subject: [PATCH] refactor: struct node -> struct vnode --- include/villas/api/node_request.hpp | 8 +-- include/villas/hook.hpp | 10 ++-- include/villas/hook_list.hpp | 8 +-- include/villas/hooks/limit_rate.hpp | 2 +- include/villas/mapping.h | 4 +- include/villas/memory.h | 2 +- include/villas/memory_type.h | 4 +- include/villas/node.h | 56 ++++++++++---------- include/villas/node_direction.h | 20 ++++---- include/villas/node_type.h | 46 ++++++++--------- include/villas/nodes/amqp.hpp | 12 ++--- include/villas/nodes/can.hpp | 20 ++++---- include/villas/nodes/comedi.hpp | 12 ++--- include/villas/nodes/ethercat.hpp | 18 +++---- include/villas/nodes/example.hpp | 26 +++++----- include/villas/nodes/exec.hpp | 14 ++--- include/villas/nodes/file.hpp | 12 ++--- include/villas/nodes/fpga.hpp | 18 +++---- include/villas/nodes/iec61850_sv.hpp | 16 +++--- include/villas/nodes/infiniband.hpp | 16 +++--- include/villas/nodes/influxdb.hpp | 12 ++--- include/villas/nodes/loopback.hpp | 14 ++--- include/villas/nodes/mqtt.hpp | 16 +++--- include/villas/nodes/nanomsg.hpp | 12 ++--- include/villas/nodes/ngsi.hpp | 16 +++--- include/villas/nodes/opal.hpp | 12 ++--- include/villas/nodes/rtp.hpp | 12 ++--- include/villas/nodes/shmem.hpp | 12 ++--- include/villas/nodes/signal_generator.hpp | 12 ++--- include/villas/nodes/socket.hpp | 12 ++--- include/villas/nodes/stats.hpp | 12 ++--- include/villas/nodes/test_rtt.hpp | 14 ++--- include/villas/nodes/websocket.hpp | 12 ++--- include/villas/nodes/zeromq.hpp | 14 ++--- include/villas/path.h | 4 +- include/villas/path_destination.h | 2 +- include/villas/path_source.h | 2 +- include/villas/plugin.h | 2 +- include/villas/stats.hpp | 4 +- include/villas/super_node.hpp | 6 +-- lib/api/requests/node_action.cpp | 2 +- lib/api/requests/node_file.cpp | 2 +- lib/api/requests/node_stats.cpp | 4 +- lib/api/requests/node_stats_reset.cpp | 2 +- lib/api/requests/nodes.cpp | 2 +- lib/hook.cpp | 2 +- lib/hook_list.cpp | 4 +- lib/hooks/average.cpp | 2 +- lib/hooks/cast.cpp | 2 +- lib/hooks/dp.cpp | 2 +- lib/hooks/gate.cpp | 2 +- lib/hooks/jitter_calc.cpp | 2 +- lib/hooks/limit_value.cpp | 2 +- lib/hooks/pps_ts.cpp | 2 +- lib/hooks/print.cpp | 2 +- lib/hooks/scale.cpp | 2 +- lib/hooks/shift_ts.cpp | 2 +- lib/hooks/stats.cpp | 6 +-- lib/kernel/if.cpp | 4 +- lib/mapping.cpp | 2 +- lib/memory/ib.cpp | 2 +- lib/node.cpp | 62 +++++++++++------------ lib/node_direction.cpp | 16 +++--- lib/node_type.cpp | 8 +-- lib/nodes/amqp.cpp | 16 +++--- lib/nodes/can.cpp | 22 ++++---- lib/nodes/comedi.cpp | 26 +++++----- lib/nodes/ethercat.cpp | 24 ++++----- lib/nodes/example.cpp | 30 +++++------ lib/nodes/exec.cpp | 20 ++++---- lib/nodes/file.cpp | 18 +++---- lib/nodes/fpga.cpp | 22 ++++---- lib/nodes/iec61850_sv.cpp | 18 +++---- lib/nodes/infiniband.cpp | 34 ++++++------- lib/nodes/influxdb.cpp | 10 ++-- lib/nodes/loopback.cpp | 14 ++--- lib/nodes/mqtt.cpp | 30 +++++------ lib/nodes/nanomsg.cpp | 18 +++---- lib/nodes/ngsi.cpp | 24 ++++----- lib/nodes/opal.cpp | 12 ++--- lib/nodes/rtp.cpp | 30 +++++------ lib/nodes/shmem.cpp | 12 ++--- lib/nodes/signal_generator.cpp | 18 +++---- lib/nodes/socket.cpp | 20 ++++---- lib/nodes/stats.cpp | 18 +++---- lib/nodes/test_rtt.cpp | 20 ++++---- lib/nodes/uldaq.cpp | 20 ++++---- lib/nodes/websocket.cpp | 20 ++++---- lib/nodes/zeromq.cpp | 24 ++++----- lib/path.cpp | 8 +-- lib/stats.cpp | 2 +- lib/super_node.cpp | 16 +++--- src/villas-pipe.cpp | 10 ++-- src/villas-signal.cpp | 4 +- src/villas-test-rtt.cpp | 2 +- tests/unit/mapping.cpp | 14 ++--- 96 files changed, 620 insertions(+), 620 deletions(-) diff --git a/include/villas/api/node_request.hpp b/include/villas/api/node_request.hpp index 2988a59a0..4c48ace3e 100644 --- a/include/villas/api/node_request.hpp +++ b/include/villas/api/node_request.hpp @@ -26,7 +26,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; namespace villas { namespace node { @@ -42,7 +42,7 @@ class NodeRequest : public Request { public: using Request::Request; - struct node *node; + struct vnode *node; virtual void prepare() @@ -54,12 +54,12 @@ public: uuid_t uuid; ret = uuid_parse(matches[1].str().c_str(), uuid); if (ret) { - node = vlist_lookup_name(nodes, matches[1].str()); + node = vlist_lookup_name(nodes, matches[1].str()); if (!node) throw BadRequest("Unknown node"); } else { - node = vlist_lookup_uuid(nodes, uuid); + node = vlist_lookup_uuid(nodes, uuid); if (!node) throw BadRequest("No node found with with matching UUID"); } diff --git a/include/villas/hook.hpp b/include/villas/hook.hpp index 08c4df470..990e65748 100644 --- a/include/villas/hook.hpp +++ b/include/villas/hook.hpp @@ -35,7 +35,7 @@ /* Forward declarations */ struct vpath; -struct node; +struct vnode; struct sample; namespace villas { @@ -68,14 +68,14 @@ protected: int enabled; /**< Is this hook active? */ struct vpath *path; - struct node *node; + struct vnode *node; vlist signals; json_t *cfg; /**< A JSON object containing the configuration of the hook. */ public: - Hook(struct vpath *p, struct node *n, int fl, int prio, bool en = true); + Hook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true); virtual ~Hook(); virtual void parse(json_t *c); @@ -187,7 +187,7 @@ class HookFactory : public plugin::Plugin { public: using plugin::Plugin::Plugin; - virtual Hook *make(struct vpath *p, struct node *n) = 0; + virtual Hook *make(struct vpath *p, struct vnode *n) = 0; virtual int getFlags() const = 0; virtual int getPriority() const = 0; @@ -199,7 +199,7 @@ class HookPlugin : public HookFactory { public: using HookFactory::HookFactory; - virtual Hook *make(struct vpath *p, struct node *n) + virtual Hook *make(struct vpath *p, struct vnode *n) { return new T(p, n, getFlags(), getPriority()); } diff --git a/include/villas/hook_list.hpp b/include/villas/hook_list.hpp index 35e18d047..563e6366a 100644 --- a/include/villas/hook_list.hpp +++ b/include/villas/hook_list.hpp @@ -37,7 +37,7 @@ struct vlist; struct sample; struct vpath; -struct node; +struct vnode; int hook_list_init(struct vlist *hs); @@ -57,13 +57,13 @@ int hook_list_destroy(struct vlist *hs); * hooks = [ "print" ] * } */ -void hook_list_parse(struct vlist *hs, json_t *cfg, int mask, struct vpath *p, struct node *n); +void hook_list_parse(struct vlist *hs, json_t *cfg, int mask, struct vpath *p, struct vnode *n); -void hook_list_prepare(struct vlist *hs, struct vlist *sigs, int mask, struct vpath *p, struct node *n); +void hook_list_prepare(struct vlist *hs, struct vlist *sigs, int mask, struct vpath *p, struct vnode *n); int hook_list_prepare_signals(struct vlist *hs, struct vlist *signals); -int hook_list_add(struct vlist *hs, int mask, struct vpath *p, struct node *n); +int hook_list_add(struct vlist *hs, int mask, struct vpath *p, struct vnode *n); int hook_list_process(struct vlist *hs, struct sample *smps[], unsigned cnt); diff --git a/include/villas/hooks/limit_rate.hpp b/include/villas/hooks/limit_rate.hpp index 93011c5cb..ba401dba1 100644 --- a/include/villas/hooks/limit_rate.hpp +++ b/include/villas/hooks/limit_rate.hpp @@ -44,7 +44,7 @@ protected: timespec last; public: - LimitRateHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + LimitRateHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : LimitHook(p, n, fl, prio, en), mode(LIMIT_RATE_LOCAL) { diff --git a/include/villas/mapping.h b/include/villas/mapping.h index 7387400e7..427a9de28 100644 --- a/include/villas/mapping.h +++ b/include/villas/mapping.h @@ -29,7 +29,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; struct sample; struct signal; struct vlist; @@ -52,7 +52,7 @@ enum class MappingTimestampType { }; struct mapping_entry { - struct node *node; /**< The node to which this mapping refers. */ + struct vnode *node; /**< The node to which this mapping refers. */ enum MappingType type; /**< The mapping type. Selects one of the union fields below. */ diff --git a/include/villas/memory.h b/include/villas/memory.h index cb53d6534..f881789c3 100644 --- a/include/villas/memory.h +++ b/include/villas/memory.h @@ -30,7 +30,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; /** Descriptor of a memory block. Associated block always starts at * &m + sizeof(struct memory_block). */ diff --git a/include/villas/memory_type.h b/include/villas/memory_type.h index b6a0d66ba..9c2ec9fcc 100644 --- a/include/villas/memory_type.h +++ b/include/villas/memory_type.h @@ -28,7 +28,7 @@ /* Forward declarations */ struct memory_type; -struct node; +struct vnode; typedef struct memory_allocation * (*memory_allocator_t)(size_t len, size_t alignment, struct memory_type *mem); typedef int (*memory_deallocator_t)(struct memory_allocation * ma, struct memory_type *mem); @@ -57,7 +57,7 @@ extern struct memory_type memory_mmap; extern struct memory_type memory_mmap_hugetlb; extern struct memory_type *memory_default; -struct memory_type * memory_ib(struct node *n, struct memory_type *parent); +struct memory_type * memory_ib(struct vnode *n, struct memory_type *parent); struct memory_type * memory_managed(void *ptr, size_t len); int memory_mmap_init(int hugepages); diff --git a/include/villas/node.h b/include/villas/node.h index 8c428084d..c29453377 100644 --- a/include/villas/node.h +++ b/include/villas/node.h @@ -58,7 +58,7 @@ * Every entity which exchanges messages is represented by a node. * Nodes can be remote machines and simulators or locally running processes. */ -struct node { +struct vnode { char *name; /**< A short identifier of the node, only used for configuration and logging */ int enabled; @@ -80,7 +80,7 @@ struct node { struct vpath *output_path; std::shared_ptr stats; /**< Statistic counters. This is a pointer to the statistic hooks private data. */ - struct node_direction in, out; + struct vnode_direction in, out; #ifdef __linux__ int fwmark; /**< Socket mark for netem, routing and filtering */ @@ -91,17 +91,17 @@ struct node { #endif /* WITH_NETEM */ #endif /* __linux__ */ - struct node_type *_vt; /**< Virtual functions (C++ OOP style) */ - void *_vd; /**< Virtual data (used by struct node::_vt functions) */ + struct vnode_type *_vt; /**< Virtual functions (C++ OOP style) */ + void *_vd; /**< Virtual data (used by struct vnode::_vt functions) */ json_t *cfg; /**< A JSON object containing the configuration of the node. */ }; /** Initialize node with default values */ -int node_init(struct node *n, struct node_type *vt); +int node_init(struct vnode *n, struct vnode_type *vt); /** Do initialization after parsing the configuration */ -int node_prepare(struct node *n); +int node_prepare(struct vnode *n); /** Parse settings of a node. * @@ -109,7 +109,7 @@ int node_prepare(struct node *n); * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. */ -int node_parse(struct node *n, json_t *cfg, const char *name); +int node_parse(struct vnode *n, json_t *cfg, const char *name); /** Parse an array or single node and checks if they exist in the "nodes" section. * @@ -127,53 +127,53 @@ int node_list_parse(struct vlist *list, json_t *cfg, struct vlist *all); int node_parse_signals(struct vlist *list, json_t *cfg); /** Validate node configuration. */ -int node_check(struct node *n); +int node_check(struct vnode *n); /** Start operation of a node. * * @see node_type::start */ -int node_start(struct node *n); +int node_start(struct vnode *n); /** Stops operation of a node. * * @see node_type::stop */ -int node_stop(struct node *n); +int node_stop(struct vnode *n); /** Pauses operation of a node. * * @see node_type::stop */ -int node_pause(struct node *n); +int node_pause(struct vnode *n); /** Resumes operation of a node. * * @see node_type::stop */ -int node_resume(struct node *n); +int node_resume(struct vnode *n); /** Restarts operation of a node. * * @see node_type::stop */ -int node_restart(struct node *n); +int node_restart(struct vnode *n); /** Destroy node by freeing dynamically allocated memory. * * @see node_type::destroy */ -int node_destroy(struct node *n); +int node_destroy(struct vnode *n); /** Return a pointer to a string which should be used to print this node. * * @see node::_name‚ * @param n A pointer to the node structure. */ -const char * node_name_short(struct node *n); +const char * node_name_short(struct vnode *n); /** Return a pointer to a string which should be used to print this node. */ -char * node_name(struct node *n); +char * node_name(struct vnode *n); /** Return a pointer to a string which should be used to print this node. * @@ -181,42 +181,42 @@ char * node_name(struct node *n); * @see node_type::print * @param n A pointer to the node structure. */ -char * node_name_long(struct node *n); +char * node_name_long(struct vnode *n); /** Return a list of signals which are sent to this node. * * This list is derived from the path which uses the node as destination. */ -struct vlist * node_output_signals(struct node *n); +struct vlist * node_output_signals(struct vnode *n); /** Reverse local and remote socket address. * * @see node_type::reverse */ -int node_reverse(struct node *n); +int node_reverse(struct vnode *n); -int node_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int node_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); -int node_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int node_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); -int node_poll_fds(struct node *n, int fds[]); +int node_poll_fds(struct vnode *n, int fds[]); -int node_netem_fds(struct node *n, int fds[]); +int node_netem_fds(struct vnode *n, int fds[]); static inline -struct node_type * node_type(struct node *n) +struct vnode_type * node_type(struct vnode *n) { return n->_vt; } -struct memory_type * node_memory_type(struct node *n); +struct memory_type * node_memory_type(struct vnode *n); bool node_is_valid_name(const char *name); -bool node_is_enabled(const struct node *n); +bool node_is_enabled(const struct vnode *n); -struct vlist * node_get_signals(struct node *n, enum NodeDir dir); +struct vlist * node_get_signals(struct vnode *n, enum NodeDir dir); -json_t * node_to_json(struct node *); +json_t * node_to_json(struct vnode *); /** @} */ diff --git a/include/villas/node_direction.h b/include/villas/node_direction.h index 2147555a1..9e2faa8e4 100644 --- a/include/villas/node_direction.h +++ b/include/villas/node_direction.h @@ -34,14 +34,14 @@ #include /* Forward declarations */ -struct node; +struct vnode; enum class NodeDir { IN, /**< VILLASnode is receiving/reading */ OUT /**< VILLASnode is sending/writing */ }; -struct node_direction { +struct vnode_direction { enum State state; enum NodeDir direction; @@ -55,20 +55,20 @@ struct node_direction { json_t *cfg; /**< A JSON object containing the configuration of the node. */ }; -int node_direction_init(struct node_direction *nd, enum NodeDir dir, struct node *n); +int node_direction_init(struct vnode_direction *nd, enum NodeDir dir, struct vnode *n); -int node_direction_parse(struct node_direction *nd, struct node *n, json_t *cfg); +int node_direction_parse(struct vnode_direction *nd, struct vnode *n, json_t *cfg); -int node_direction_check(struct node_direction *nd, struct node *n); +int node_direction_check(struct vnode_direction *nd, struct vnode *n); -int node_direction_prepare(struct node_direction *nd, struct node *n); +int node_direction_prepare(struct vnode_direction *nd, struct vnode *n); -int node_direction_start(struct node_direction *nd, struct node *n); +int node_direction_start(struct vnode_direction *nd, struct vnode *n); -int node_direction_stop(struct node_direction *nd, struct node *n); +int node_direction_stop(struct vnode_direction *nd, struct vnode *n); -int node_direction_destroy(struct node_direction *nd, struct node *n); +int node_direction_destroy(struct vnode_direction *nd, struct vnode *n); -struct vlist * node_direction_get_signals(struct node_direction *nd); +struct vlist * node_direction_get_signals(struct vnode_direction *nd); /** @} */ diff --git a/include/villas/node_type.h b/include/villas/node_type.h index d8575b514..e4db5bc27 100644 --- a/include/villas/node_type.h +++ b/include/villas/node_type.h @@ -33,7 +33,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; struct sample; namespace villas { @@ -47,7 +47,7 @@ enum class NodeFlags { }; /** C++ like vtable construct for node_types */ -struct node_type { +struct vnode_type { unsigned vectorize; /**< Maximal vector length supported by this node type. Zero is unlimited. */ int flags; @@ -87,7 +87,7 @@ struct node_type { * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. */ - int (*init)(struct node *n); + int (*init)(struct vnode *n); /** Free memory of an instance of this type. * @@ -95,7 +95,7 @@ struct node_type { * * @param n A pointer to the node object. */ - int (*destroy)(struct node *n); + int (*destroy)(struct vnode *n); /** Parse node connection details. * @@ -106,7 +106,7 @@ struct node_type { * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. */ - int (*parse)(struct node *n, json_t *cfg); + int (*parse)(struct vnode *n, json_t *cfg); /** Check the current node configuration for plausability and errors. * @@ -116,9 +116,9 @@ struct node_type { * @retval 0 Success. Node configuration is good. * @retval <0 Error. The node configuration is bogus. */ - int (*check)(struct node *n); + int (*check)(struct vnode *n); - int (*prepare)(struct node *); + int (*prepare)(struct vnode *); /** Returns a string with a textual represenation of this node. * @@ -127,7 +127,7 @@ struct node_type { * @param n A pointer to the node object. * @return A pointer to a dynamically allocated string. Must be freed(). */ - char * (*print)(struct node *n); + char * (*print)(struct vnode *n); /** Start this node. * @@ -137,7 +137,7 @@ struct node_type { * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. */ - int (*start)(struct node *n); + int (*start)(struct vnode *n); /** Restart this node. * @@ -147,7 +147,7 @@ struct node_type { * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. */ - int (*restart)(struct node *n); + int (*restart)(struct vnode *n); /** Stop this node. * @@ -157,7 +157,7 @@ struct node_type { * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. */ - int (*stop)(struct node *n); + int (*stop)(struct vnode *n); /** Pause this node. * @@ -167,7 +167,7 @@ struct node_type { * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. */ - int (*pause)(struct node *n); + int (*pause)(struct vnode *n); /** Resume this node. * @@ -177,7 +177,7 @@ struct node_type { * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. */ - int (*resume)(struct node *n); + int (*resume)(struct vnode *n); /** Receive multiple messages at once. * @@ -195,7 +195,7 @@ struct node_type { * @param release The number of samples that should be released after read is called. * @return The number of messages actually received. */ - int (*read)(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); + int (*read)(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** Send multiple messages in a single datagram / packet. * @@ -212,7 +212,7 @@ struct node_type { * @param release The number of samples that should be released after write is called * @return The number of messages actually sent. */ - int (*write)(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); + int (*write)(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** Reverse source and destination of a node. * @@ -220,7 +220,7 @@ struct node_type { * * @param n A pointer to the node object. */ - int (*reverse)(struct node *n); + int (*reverse)(struct vnode *n); /** Get list of file descriptors which can be used by poll/select to detect the availability of new data. * @@ -228,7 +228,7 @@ struct node_type { * * @return The number of file descriptors which have been put into \p fds. */ - int (*poll_fds)(struct node *n, int fds[]); + int (*poll_fds)(struct vnode *n, int fds[]); /** Get list of socket file descriptors for configuring network emulation. * @@ -236,27 +236,27 @@ struct node_type { * * @return The number of file descriptors which have been put into \p sds. */ - int (*netem_fds)(struct node *n, int sds[]); + int (*netem_fds)(struct vnode *n, int sds[]); /** Return a memory allocator which should be used for sample pools passed to this node. */ - struct memory_type * (*memory_type)(struct node *n, struct memory_type *parent); + struct memory_type * (*memory_type)(struct vnode *n, struct memory_type *parent); }; /** Initialize all registered node type subsystems. * * @see node_type::init */ -int node_type_start(struct node_type *vt, villas::node::SuperNode *sn); +int node_type_start(struct vnode_type *vt, villas::node::SuperNode *sn); /** De-initialize node type subsystems. * * @see node_type::deinit */ -int node_type_stop(struct node_type *vt); +int node_type_stop(struct vnode_type *vt); /** Return a printable representation of the node-type. */ -const char * node_type_name(struct node_type *vt); +const char * node_type_name(struct vnode_type *vt); -struct node_type * node_type_lookup(const char *name); +struct vnode_type * node_type_lookup(const char *name); /** @} */ diff --git a/include/villas/nodes/amqp.hpp b/include/villas/nodes/amqp.hpp index 8536e95d6..35779b1fd 100644 --- a/include/villas/nodes/amqp.hpp +++ b/include/villas/nodes/amqp.hpp @@ -64,21 +64,21 @@ struct amqp { }; /** @see node_type::print */ -char * amqp_print(struct node *n); +char * amqp_print(struct vnode *n); /** @see node_type::parse */ -int amqp_parse(struct node *n, json_t *json); +int amqp_parse(struct vnode *n, json_t *json); /** @see node_type::start */ -int amqp_start(struct node *n); +int amqp_start(struct vnode *n); /** @see node_type::stop */ -int amqp_stop(struct node *n); +int amqp_stop(struct vnode *n); /** @see node_type::read */ -int amqp_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int amqp_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int amqp_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int amqp_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/can.hpp b/include/villas/nodes/can.hpp index 69e4ede72..34bb1a869 100644 --- a/include/villas/nodes/can.hpp +++ b/include/villas/nodes/can.hpp @@ -34,7 +34,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; union signal_data; struct can_signal { @@ -58,16 +58,16 @@ struct can { }; /** @see node_type::init */ -int can_init(struct node *n); +int can_init(struct vnode *n); /** @see node_type::destroy */ -int can_destroy(struct node *n); +int can_destroy(struct vnode *n); /** @see node_type::parse */ -int can_parse(struct node *n, json_t *cfg); +int can_parse(struct vnode *n, json_t *cfg); /** @see node_type::print */ -char * can_print(struct node *n); +char * can_print(struct vnode *n); /** @see node_type::check */ int can_check(); @@ -76,18 +76,18 @@ int can_check(); int can_prepare(); /** @see node_type::start */ -int can_start(struct node *n); +int can_start(struct vnode *n); /** @see node_type::stop */ -int can_stop(struct node *n); +int can_stop(struct vnode *n); /** @see node_type::write */ -int can_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int can_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::read */ -int can_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int can_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::poll_fds */ -int can_poll_fds(struct node *n, int fds[]); +int can_poll_fds(struct vnode *n, int fds[]); /** @} */ diff --git a/include/villas/nodes/comedi.hpp b/include/villas/nodes/comedi.hpp index 52fce8ecc..9ba6e399c 100644 --- a/include/villas/nodes/comedi.hpp +++ b/include/villas/nodes/comedi.hpp @@ -81,21 +81,21 @@ struct comedi { }; /** @see node_type::print */ -char * comedi_print(struct node *n); +char * comedi_print(struct vnode *n); /** @see node_type::parse */ -int comedi_parse(struct node *n, json_t *cfg); +int comedi_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int comedi_start(struct node *n); +int comedi_start(struct vnode *n); /** @see node_type::stop */ -int comedi_stop(struct node *n); +int comedi_stop(struct vnode *n); /** @see node_type::read */ -int comedi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int comedi_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int comedi_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int comedi_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/ethercat.hpp b/include/villas/nodes/ethercat.hpp index 3e86615b1..d4bafdda3 100644 --- a/include/villas/nodes/ethercat.hpp +++ b/include/villas/nodes/ethercat.hpp @@ -90,31 +90,31 @@ int ethercat_type_start(struct super_node *sn); int ethercat_type_stop(); /** @see node_type::init */ -int ethercat_init(struct node *n); +int ethercat_init(struct vnode *n); /** @see node_type::destroy */ -int ethercat_destroy(struct node *n); +int ethercat_destroy(struct vnode *n); /** @see node_type::parse */ -int ethercat_parse(struct node *n, json_t *cfg); +int ethercat_parse(struct vnode *n, json_t *cfg); /** @see node_type::check */ -int ethercat_check(struct node *n); +int ethercat_check(struct vnode *n); /** @see node_type::prepare */ -int ethercat_prepare(struct node *n); +int ethercat_prepare(struct vnode *n); /** @see node_type::open */ -int ethercat_start(struct node *n); +int ethercat_start(struct vnode *n); /** @see node_type::close */ -int ethercat_stop(struct node *n); +int ethercat_stop(struct vnode *n); /** @see node_type::read */ -int ethercat_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int ethercat_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int ethercat_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int ethercat_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/example.hpp b/include/villas/nodes/example.hpp index 442441201..074f88129 100644 --- a/include/villas/nodes/example.hpp +++ b/include/villas/nodes/example.hpp @@ -52,16 +52,16 @@ int example_type_start(villas::node::SuperNode *sn); int example_type_stop(); /** @see node_type::init */ -int example_init(struct node *n); +int example_init(struct vnode *n); /** @see node_type::destroy */ -int example_destroy(struct node *n); +int example_destroy(struct vnode *n); /** @see node_type::parse */ -int example_parse(struct node *n, json_t *cfg); +int example_parse(struct vnode *n, json_t *cfg); /** @see node_type::print */ -char * example_print(struct node *n); +char * example_print(struct vnode *n); /** @see node_type::check */ int example_check(); @@ -70,30 +70,30 @@ int example_check(); int example_prepare(); /** @see node_type::start */ -int example_start(struct node *n); +int example_start(struct vnode *n); /** @see node_type::stop */ -int example_stop(struct node *n); +int example_stop(struct vnode *n); /** @see node_type::pause */ -int example_pause(struct node *n); +int example_pause(struct vnode *n); /** @see node_type::resume */ -int example_resume(struct node *n); +int example_resume(struct vnode *n); /** @see node_type::write */ -int example_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int example_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::read */ -int example_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int example_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::reverse */ -int example_reverse(struct node *n); +int example_reverse(struct vnode *n); /** @see node_type::poll_fds */ -int example_poll_fds(struct node *n, int fds[]); +int example_poll_fds(struct vnode *n, int fds[]); /** @see node_type::netem_fds */ -int example_netem_fds(struct node *n, int fds[]); +int example_netem_fds(struct vnode *n, int fds[]); /** @} */ diff --git a/include/villas/nodes/exec.hpp b/include/villas/nodes/exec.hpp index a8a00bae6..7e6fd9c1b 100644 --- a/include/villas/nodes/exec.hpp +++ b/include/villas/nodes/exec.hpp @@ -33,7 +33,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; struct sample; struct format_type; @@ -54,21 +54,21 @@ struct exec { }; /** @see node_type::print */ -char * exec_print(struct node *n); +char * exec_print(struct vnode *n); /** @see node_type::parse */ -int exec_parse(struct node *n, json_t *cfg); +int exec_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int exec_open(struct node *n); +int exec_open(struct vnode *n); /** @see node_type::stop */ -int exec_close(struct node *n); +int exec_close(struct vnode *n); /** @see node_type::read */ -int exec_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int exec_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int exec_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int exec_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/file.hpp b/include/villas/nodes/file.hpp index 24b870734..65859f4f1 100644 --- a/include/villas/nodes/file.hpp +++ b/include/villas/nodes/file.hpp @@ -70,21 +70,21 @@ struct file { }; /** @see node_type::print */ -char * file_print(struct node *n); +char * file_print(struct vnode *n); /** @see node_type::parse */ -int file_parse(struct node *n, json_t *cfg); +int file_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int file_start(struct node *n); +int file_start(struct vnode *n); /** @see node_type::stop */ -int file_stop(struct node *n); +int file_stop(struct vnode *n); /** @see node_type::read */ -int file_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int file_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int file_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int file_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/fpga.hpp b/include/villas/nodes/fpga.hpp index dfb8db14d..0fff41236 100644 --- a/include/villas/nodes/fpga.hpp +++ b/include/villas/nodes/fpga.hpp @@ -71,16 +71,16 @@ int fpga_type_start(villas::node::SuperNode *sn); int fpga_type_stop(); /** @see node_type::init */ -int fpga_init(struct node *n); +int fpga_init(struct vnode *n); /** @see node_type::destroy */ -int fpga_destroy(struct node *n); +int fpga_destroy(struct vnode *n); /** @see node_type::parse */ -int fpga_parse(struct node *n, json_t *cfg); +int fpga_parse(struct vnode *n, json_t *cfg); /** @see node_type::print */ -char * fpga_print(struct node *n); +char * fpga_print(struct vnode *n); /** @see node_type::check */ int fpga_check(); @@ -89,18 +89,18 @@ int fpga_check(); int fpga_prepare(); /** @see node_type::start */ -int fpga_start(struct node *n); +int fpga_start(struct vnode *n); /** @see node_type::stop */ -int fpga_stop(struct node *n); +int fpga_stop(struct vnode *n); /** @see node_type::write */ -int fpga_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int fpga_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::read */ -int fpga_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int fpga_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::poll_fds */ -int fpga_poll_fds(struct node *n, int fds[]); +int fpga_poll_fds(struct vnode *n, int fds[]); /** @} */ diff --git a/include/villas/nodes/iec61850_sv.hpp b/include/villas/nodes/iec61850_sv.hpp index e6b5212b5..126808e61 100644 --- a/include/villas/nodes/iec61850_sv.hpp +++ b/include/villas/nodes/iec61850_sv.hpp @@ -81,27 +81,27 @@ struct iec61850_sv { int iec61850_sv_type_stop(); /** @see node_type::parse */ -int iec61850_sv_parse(struct node *n, json_t *json); +int iec61850_sv_parse(struct vnode *n, json_t *json); /** @see node_type::print */ -char * iec61850_sv_print(struct node *n); +char * iec61850_sv_print(struct vnode *n); /** @see node_type::start */ -int iec61850_sv_start(struct node *n); +int iec61850_sv_start(struct vnode *n); /** @see node_type::stop */ -int iec61850_sv_stop(struct node *n); +int iec61850_sv_stop(struct vnode *n); /** @see node_type::destroy */ -int iec61850_sv_destroy(struct node *n); +int iec61850_sv_destroy(struct vnode *n); /** @see node_type::read */ -int iec61850_sv_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int iec61850_sv_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int iec61850_sv_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int iec61850_sv_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::fd */ -int iec61850_sv_fd(struct node *n); +int iec61850_sv_fd(struct vnode *n); /** @} */ diff --git a/include/villas/nodes/infiniband.hpp b/include/villas/nodes/infiniband.hpp index 82fe0e2a2..caed9338b 100644 --- a/include/villas/nodes/infiniband.hpp +++ b/include/villas/nodes/infiniband.hpp @@ -110,27 +110,27 @@ struct infiniband { }; /** @see node_type::reverse */ -int ib_reverse(struct node *n); +int ib_reverse(struct vnode *n); /** @see node_type::print */ -char * ib_print(struct node *n); +char * ib_print(struct vnode *n); /** @see node_type::parse */ -int ib_parse(struct node *n, json_t *cfg); +int ib_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int ib_start(struct node *n); +int ib_start(struct vnode *n); /** @see node_type::destroy */ -int ib_destroy(struct node *n); +int ib_destroy(struct vnode *n); /** @see node_type::stop */ -int ib_stop(struct node *n); +int ib_stop(struct vnode *n); /** @see node_type::read */ -int ib_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int ib_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int ib_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int ib_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/influxdb.hpp b/include/villas/nodes/influxdb.hpp index 4ca00ee82..0e443a395 100644 --- a/include/villas/nodes/influxdb.hpp +++ b/include/villas/nodes/influxdb.hpp @@ -32,7 +32,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; struct sample; /** Node-type for signal generation. @@ -49,18 +49,18 @@ struct influxdb { }; /** @see node_type::print */ -char * influxdb_print(struct node *n); +char * influxdb_print(struct vnode *n); /** @see node_type::parse */ -int influxdb_parse(struct node *n, json_t *cfg); +int influxdb_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int influxdb_open(struct node *n); +int influxdb_open(struct vnode *n); /** @see node_type::stop */ -int influxdb_close(struct node *n); +int influxdb_close(struct vnode *n); /** @see node_type::write */ -int influxdb_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int influxdb_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/loopback.hpp b/include/villas/nodes/loopback.hpp index 60b6ac4f9..892c44c5f 100644 --- a/include/villas/nodes/loopback.hpp +++ b/include/villas/nodes/loopback.hpp @@ -33,7 +33,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; struct sample; /** Node-type for signal generation. @@ -47,21 +47,21 @@ struct loopback { }; /** @see node_type::print */ -char * loopback_print(struct node *n); +char * loopback_print(struct vnode *n); /** @see node_type::parse */ -int loopback_parse(struct node *n, json_t *cfg); +int loopback_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int loopback_open(struct node *n); +int loopback_open(struct vnode *n); /** @see node_type::stop */ -int loopback_close(struct node *n); +int loopback_close(struct vnode *n); /** @see node_type::read */ -int loopback_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int loopback_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int loopback_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int loopback_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/mqtt.hpp b/include/villas/nodes/mqtt.hpp index cb22a00d4..b06c757fc 100644 --- a/include/villas/nodes/mqtt.hpp +++ b/include/villas/nodes/mqtt.hpp @@ -67,22 +67,22 @@ struct mqtt { }; /** @see node_type::reverse */ -int mqtt_reverse(struct node *n); +int mqtt_reverse(struct vnode *n); /** @see node_type::print */ -char * mqtt_print(struct node *n); +char * mqtt_print(struct vnode *n); /** @see node_type::parse */ -int mqtt_parse(struct node *n, json_t *cfg); +int mqtt_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int mqtt_start(struct node *n); +int mqtt_start(struct vnode *n); /** @see node_type::destroy */ -int mqtt_destroy(struct node *n); +int mqtt_destroy(struct vnode *n); /** @see node_type::stop */ -int mqtt_stop(struct node *n); +int mqtt_stop(struct vnode *n); /** @see node_type::type_start */ int mqtt_type_start(villas::node::SuperNode *sn); @@ -91,9 +91,9 @@ int mqtt_type_start(villas::node::SuperNode *sn); int mqtt_type_stop(); /** @see node_type::read */ -int mqtt_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int mqtt_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int mqtt_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int mqtt_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/nanomsg.hpp b/include/villas/nodes/nanomsg.hpp index aab279e9e..9e43d0575 100644 --- a/include/villas/nodes/nanomsg.hpp +++ b/include/villas/nodes/nanomsg.hpp @@ -50,21 +50,21 @@ struct nanomsg { }; /** @see node_type::print */ -char * nanomsg_print(struct node *n); +char * nanomsg_print(struct vnode *n); /** @see node_type::parse */ -int nanomsg_parse(struct node *n, json_t *cfg); +int nanomsg_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int nanomsg_start(struct node *n); +int nanomsg_start(struct vnode *n); /** @see node_type::stop */ -int nanomsg_stop(struct node *n); +int nanomsg_stop(struct vnode *n); /** @see node_type::read */ -int nanomsg_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int nanomsg_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int nanomsg_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int nanomsg_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/ngsi.hpp b/include/villas/nodes/ngsi.hpp index a8557dd52..1b6020a0d 100644 --- a/include/villas/nodes/ngsi.hpp +++ b/include/villas/nodes/ngsi.hpp @@ -43,7 +43,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; struct ngsi { const char *endpoint; /**< The NGSI context broker endpoint URL. */ @@ -81,24 +81,24 @@ int ngsi_type_start(villas::node::SuperNode *sn); int ngsi_type_stop(); /** @see node_type::parse */ -int ngsi_parse(struct node *n, json_t *cfg); +int ngsi_parse(struct vnode *n, json_t *cfg); /** @see node_type::print */ -char * ngsi_print(struct node *n); +char * ngsi_print(struct vnode *n); /** @see node_type::start */ -int ngsi_start(struct node *n); +int ngsi_start(struct vnode *n); /** @see node_type::stop */ -int ngsi_stop(struct node *n); +int ngsi_stop(struct vnode *n); /** @see node_type::reverse */ -int ngsi_reverse(struct node *n); +int ngsi_reverse(struct vnode *n); /** @see node_type::read */ -int ngsi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int ngsi_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int ngsi_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int ngsi_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/opal.hpp b/include/villas/nodes/opal.hpp index 2c5c716aa..5c79b6fad 100644 --- a/include/villas/nodes/opal.hpp +++ b/include/villas/nodes/opal.hpp @@ -65,24 +65,24 @@ int opal_type_start(villas::node::SuperNode *sn); int opal_type_stop(); /** @see node_type::parse */ -int opal_parse(struct node *n, json_t *cfg); +int opal_parse(struct vnode *n, json_t *cfg); /** @see node_type::print */ -char * opal_print(struct node *n); +char * opal_print(struct vnode *n); /** Print global settings of the OPAL node type. */ int opal_print_global(); /** @see node_type::start */ -int opal_start(struct node *n); +int opal_start(struct vnode *n); /** @see node_type::stop */ -int opal_stop(struct node *n); +int opal_stop(struct vnode *n); /** @see node_type::read */ -int opal_read(struct node *n, struct sample *smps[], unsigned cnt); +int opal_read(struct vnode *n, struct sample *smps[], unsigned cnt); /** @see node_type::write */ -int opal_write(struct node *n, struct sample *smps[], unsigned cnt); +int opal_write(struct vnode *n, struct sample *smps[], unsigned cnt); /** @} */ diff --git a/include/villas/nodes/rtp.hpp b/include/villas/nodes/rtp.hpp index a2d2d64e1..b432ca2bc 100644 --- a/include/villas/nodes/rtp.hpp +++ b/include/villas/nodes/rtp.hpp @@ -106,21 +106,21 @@ struct rtp { }; /** @see node_type::print */ -char * rtp_print(struct node *n); +char * rtp_print(struct vnode *n); /** @see node_type::parse */ -int rtp_parse(struct node *n, json_t *cfg); +int rtp_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int rtp_start(struct node *n); +int rtp_start(struct vnode *n); /** @see node_type::stop */ -int rtp_stop(struct node *n); +int rtp_stop(struct vnode *n); /** @see node_type::read */ -int rtp_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int rtp_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int rtp_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int rtp_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/shmem.hpp b/include/villas/nodes/shmem.hpp index 8a0426599..7332c4dc6 100644 --- a/include/villas/nodes/shmem.hpp +++ b/include/villas/nodes/shmem.hpp @@ -48,21 +48,21 @@ struct shmem { }; /** @see node_type::print */ -char * shmem_print(struct node *n); +char * shmem_print(struct vnode *n); /** @see node_type::parse */ -int shmem_parse(struct node *n, json_t *cfg); +int shmem_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int shmem_start(struct node *n); +int shmem_start(struct vnode *n); /** @see node_type::stop */ -int shmem_stop(struct node *n); +int shmem_stop(struct vnode *n); /** @see node_type::read */ -int shmem_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int shmem_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int shmem_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int shmem_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/signal_generator.hpp b/include/villas/nodes/signal_generator.hpp index 74f35a78e..4f4f100d1 100644 --- a/include/villas/nodes/signal_generator.hpp +++ b/include/villas/nodes/signal_generator.hpp @@ -33,7 +33,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; struct sample; /** Node-type for signal generation. @@ -77,18 +77,18 @@ struct signal_generator { }; /** @see node_type::print */ -char * signal_generator_print(struct node *n); +char * signal_generator_print(struct vnode *n); /** @see node_type::parse */ -int signal_generator_parse(struct node *n, json_t *cfg); +int signal_generator_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int signal_generator_start(struct node *n); +int signal_generator_start(struct vnode *n); /** @see node_type::stop */ -int signal_generator_stop(struct node *n); +int signal_generator_stop(struct vnode *n); /** @see node_type::read */ -int signal_generator_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int signal_generator_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/socket.hpp b/include/villas/nodes/socket.hpp index 7d76dd237..2ddd1d99c 100644 --- a/include/villas/nodes/socket.hpp +++ b/include/villas/nodes/socket.hpp @@ -72,21 +72,21 @@ int socket_type_start(villas::node::SuperNode *sn); int socket_type_stop(); /** @see node_type::start */ -int socket_start(struct node *n); +int socket_start(struct vnode *n); /** @see node_type::stop */ -int socket_stop(struct node *n); +int socket_stop(struct vnode *n); /** @see node_type::write */ -int socket_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int socket_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::read */ -int socket_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int socket_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::parse */ -int socket_parse(struct node *n, json_t *cfg); +int socket_parse(struct vnode *n, json_t *cfg); /** @see node_type::print */ -char * socket_print(struct node *n); +char * socket_print(struct vnode *n); /** @} */ diff --git a/include/villas/nodes/stats.hpp b/include/villas/nodes/stats.hpp index 6b46d8259..cbf7f877e 100644 --- a/include/villas/nodes/stats.hpp +++ b/include/villas/nodes/stats.hpp @@ -37,7 +37,7 @@ #include struct stats_node_signal { - struct node *node; + struct vnode *node; char *node_str; enum villas::Stats::Metric metric; @@ -56,20 +56,20 @@ struct stats_node { int stats_node_type_start(villas::node::SuperNode *sn); /** @see node_type::print */ -char *stats_node_print(struct node *n); +char *stats_node_print(struct vnode *n); /** @see node_type::parse */ -int stats_node_parse(struct node *n, json_t *cfg); +int stats_node_parse(struct vnode *n, json_t *cfg); int stats_node_parse_signal(struct stats_node_signal *s, json_t *cfg); /** @see node_type::start */ -int stats_node_start(struct node *n); +int stats_node_start(struct vnode *n); /** @see node_type::stop */ -int stats_node_stop(struct node *n); +int stats_node_stop(struct vnode *n); /** @see node_type::read */ -int stats_node_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int stats_node_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/test_rtt.hpp b/include/villas/nodes/test_rtt.hpp index 0a9c9a91d..590dd83d1 100644 --- a/include/villas/nodes/test_rtt.hpp +++ b/include/villas/nodes/test_rtt.hpp @@ -35,7 +35,7 @@ /* Forward declarations */ struct test_rtt; -struct node; +struct vnode; struct sample; struct test_rtt_case { @@ -64,21 +64,21 @@ struct test_rtt { }; /** @see node_type::print */ -char * test_rtt_print(struct node *n); +char * test_rtt_print(struct vnode *n); /** @see node_type::parse */ -int test_rtt_parse(struct node *n, json_t *cfg); +int test_rtt_parse(struct vnode *n, json_t *cfg); /** @see node_type::start */ -int test_rtt_start(struct node *n); +int test_rtt_start(struct vnode *n); /** @see node_type::stop */ -int test_rtt_stop(struct node *n); +int test_rtt_stop(struct vnode *n); /** @see node_type::read */ -int test_rtt_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int test_rtt_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int test_rtt_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int test_rtt_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/websocket.hpp b/include/villas/nodes/websocket.hpp index 95b01690f..2e988c685 100644 --- a/include/villas/nodes/websocket.hpp +++ b/include/villas/nodes/websocket.hpp @@ -69,7 +69,7 @@ struct websocket_connection { } mode; struct lws *wsi; - struct node *node; + struct vnode *node; struct io io; struct queue queue; /**< For samples which are sent to the WebSocket */ @@ -98,18 +98,18 @@ int websocket_type_start(villas::node::SuperNode *sn); int websocket_type_stop(); /** @see node_type::start */ -int websocket_start(struct node *n); +int websocket_start(struct vnode *n); /** @see node_type::stop */ -int websocket_stop(struct node *n); +int websocket_stop(struct vnode *n); /** @see node_type::stop */ -int websocket_destroy(struct node *n); +int websocket_destroy(struct vnode *n); /** @see node_type::read */ -int websocket_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int websocket_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int websocket_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int websocket_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/nodes/zeromq.hpp b/include/villas/nodes/zeromq.hpp index 11d31284e..4eba2f4da 100644 --- a/include/villas/nodes/zeromq.hpp +++ b/include/villas/nodes/zeromq.hpp @@ -41,7 +41,7 @@ /* Forward declarations */ struct format_type; -struct node; +struct vnode; struct sample; struct zeromq { @@ -75,10 +75,10 @@ struct zeromq { }; /** @see node_type::print */ -char * zeromq_print(struct node *n); +char * zeromq_print(struct vnode *n); /** @see node_type::parse */ -int zeromq_parse(struct node *n, json_t *cfg); +int zeromq_parse(struct vnode *n, json_t *cfg); /** @see node_type::type_start */ int zeromq_type_start(villas::node::SuperNode *sn); @@ -87,15 +87,15 @@ int zeromq_type_start(villas::node::SuperNode *sn); int zeromq_type_stop(); /** @see node_type::start */ -int zeromq_start(struct node *n); +int zeromq_start(struct vnode *n); /** @see node_type::stop */ -int zeromq_stop(struct node *n); +int zeromq_stop(struct vnode *n); /** @see node_type::read */ -int zeromq_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int zeromq_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @see node_type::write */ -int zeromq_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release); +int zeromq_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release); /** @} */ diff --git a/include/villas/path.h b/include/villas/path.h index b84a88785..c2125f6f7 100644 --- a/include/villas/path.h +++ b/include/villas/path.h @@ -45,7 +45,7 @@ #include /* Forward declarations */ -struct node; +struct vnode; /** The register mode determines under which condition the path is triggered. */ enum class PathMode { @@ -145,7 +145,7 @@ struct vlist * path_output_signals(struct vpath *n); int path_reverse(struct vpath *p, struct vpath *r); /** Check if node is used as source or destination of a path. */ -int path_uses_node(struct vpath *p, struct node *n); +int path_uses_node(struct vpath *p, struct vnode *n); /** Parse a single path and add it to the global configuration. * diff --git a/include/villas/path_destination.h b/include/villas/path_destination.h index 069a288ef..3d9690527 100644 --- a/include/villas/path_destination.h +++ b/include/villas/path_destination.h @@ -36,7 +36,7 @@ struct vpath; struct sample; struct vpath_destination { - struct node *node; + struct vnode *node; struct queue queue; }; diff --git a/include/villas/path_source.h b/include/villas/path_source.h index 2130f0a6e..fdadfcb68 100644 --- a/include/villas/path_source.h +++ b/include/villas/path_source.h @@ -37,7 +37,7 @@ struct vpath; struct sample; struct vpath_source { - struct node *node; + struct vnode *node; bool masked; diff --git a/include/villas/plugin.h b/include/villas/plugin.h index 4f2e62d1b..3d4d079bd 100644 --- a/include/villas/plugin.h +++ b/include/villas/plugin.h @@ -43,7 +43,7 @@ struct plugin { union { struct format_type format; - struct node_type node; + struct vnode_type node; }; }; diff --git a/include/villas/stats.hpp b/include/villas/stats.hpp index 9976c7d10..a864a17d4 100644 --- a/include/villas/stats.hpp +++ b/include/villas/stats.hpp @@ -37,7 +37,7 @@ /* Forward declarations */ struct sample; -struct node; +struct vnode; namespace villas { @@ -116,7 +116,7 @@ public: static void printHeader(enum Format fmt); - void printPeriodic(FILE *f, enum Format fmt, struct node *p) const; + void printPeriodic(FILE *f, enum Format fmt, struct vnode *p) const; void print(FILE *f, enum Format fmt, int verbose) const; diff --git a/include/villas/super_node.hpp b/include/villas/super_node.hpp index 8e83f1e76..8e3ed7ffb 100644 --- a/include/villas/super_node.hpp +++ b/include/villas/super_node.hpp @@ -43,7 +43,7 @@ extern "C" { #include /* Forward declarations */ -struct node; +struct vnode; namespace villas { namespace node { @@ -130,9 +130,9 @@ public: state = st; } - struct node * getNode(const std::string &name) + struct vnode * getNode(const std::string &name) { - return vlist_lookup_name(&nodes, name); + return vlist_lookup_name(&nodes, name); } struct vlist * getNodes() diff --git a/lib/api/requests/node_action.cpp b/lib/api/requests/node_action.cpp index b57ef2b5c..30b639a64 100644 --- a/lib/api/requests/node_action.cpp +++ b/lib/api/requests/node_action.cpp @@ -35,7 +35,7 @@ namespace villas { namespace node { namespace api { -template +template class NodeActionRequest : public NodeRequest { public: diff --git a/lib/api/requests/node_file.cpp b/lib/api/requests/node_file.cpp index 06c851635..1ce6d841e 100644 --- a/lib/api/requests/node_file.cpp +++ b/lib/api/requests/node_file.cpp @@ -45,7 +45,7 @@ public: if (body != nullptr) throw BadRequest("File endpoint does not accept any body data"); - struct node_type *vt = node_type_lookup("file"); + struct vnode_type *vt = node_type_lookup("file"); if (node->_vt != vt) throw BadRequest("This node is not a file node"); diff --git a/lib/api/requests/node_stats.cpp b/lib/api/requests/node_stats.cpp index 91b9bf2ac..04a319fed 100644 --- a/lib/api/requests/node_stats.cpp +++ b/lib/api/requests/node_stats.cpp @@ -52,7 +52,7 @@ public: const auto &nodeName = matches[1].str(); struct vlist *nodes = session->getSuperNode()->getNodes(); - struct node *node = vlist_lookup_name(nodes, nodeName.c_str()); + struct vnode *node = vlist_lookup_name(nodes, nodeName.c_str()); if (!node) throw BadRequest("Unknown node"); @@ -65,7 +65,7 @@ public: }; /* Register API requests */ -static char n[] = "stats"; +static char n[] = "node/stats"; static char r[] = "/node/(" REGEX_NODE_NAME "|" REGEX_UUID ")/stats"; static char d[] = "get internal statistics counters"; static RequestPlugin p; diff --git a/lib/api/requests/node_stats_reset.cpp b/lib/api/requests/node_stats_reset.cpp index c4dd3394d..69d56a05f 100644 --- a/lib/api/requests/node_stats_reset.cpp +++ b/lib/api/requests/node_stats_reset.cpp @@ -64,7 +64,7 @@ public: struct vlist *nodes = session->getSuperNode()->getNodes(); for (size_t i = 0; i < vlist_length(nodes); i++) { - struct node *n = (struct node *) vlist_at(nodes, i); + struct vnode *n = (struct vnode *) vlist_at(nodes, i); if (node && strcmp(node, node_name(n))) continue; diff --git a/lib/api/requests/nodes.cpp b/lib/api/requests/nodes.cpp index dded6ba1e..6d7658b7e 100644 --- a/lib/api/requests/nodes.cpp +++ b/lib/api/requests/nodes.cpp @@ -53,7 +53,7 @@ public: struct vlist *nodes = session->getSuperNode()->getNodes(); for (size_t i = 0; i < vlist_length(nodes); i++) { - struct node *n = (struct node *) vlist_at(nodes, i); + struct vnode *n = (struct vnode *) vlist_at(nodes, i); json_array_append_new(json_nodes, node_to_json(n)); } diff --git a/lib/hook.cpp b/lib/hook.cpp index b7629c6ba..0c33e42bd 100644 --- a/lib/hook.cpp +++ b/lib/hook.cpp @@ -38,7 +38,7 @@ const char *hook_reasons[] = { using namespace villas; using namespace villas::node; -Hook::Hook(struct vpath *p, struct node *n, int fl, int prio, bool en) : +Hook::Hook(struct vpath *p, struct vnode *n, int fl, int prio, bool en) : state(State::INITIALIZED), flags(fl), priority(prio), diff --git a/lib/hook_list.cpp b/lib/hook_list.cpp index 0d3acbce7..1d7aba314 100644 --- a/lib/hook_list.cpp +++ b/lib/hook_list.cpp @@ -58,7 +58,7 @@ int hook_list_destroy(vlist *hs) return 0; } -void hook_list_parse(vlist *hs, json_t *cfg, int mask, struct vpath *o, struct node *n) +void hook_list_parse(vlist *hs, json_t *cfg, int mask, struct vpath *o, struct vnode *n) { if (!json_is_array(cfg)) throw ConfigError(cfg, "node-config-hook", "Hooks must be configured as a list of hook objects"); @@ -100,7 +100,7 @@ static int hook_is_enabled(const Hook *h) return h->isEnabled() ? 0 : -1; } -void hook_list_prepare(vlist *hs, vlist *sigs, int m, struct vpath *p, struct node *n) +void hook_list_prepare(vlist *hs, vlist *sigs, int m, struct vpath *p, struct vnode *n) { assert(hs->state == State::INITIALIZED); diff --git a/lib/hooks/average.cpp b/lib/hooks/average.cpp index 8ccf9aa0d..d8e8e9a31 100644 --- a/lib/hooks/average.cpp +++ b/lib/hooks/average.cpp @@ -45,7 +45,7 @@ protected: vlist signal_names; public: - AverageHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + AverageHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en) { int ret; diff --git a/lib/hooks/cast.cpp b/lib/hooks/cast.cpp index e97e7339f..be261f51f 100644 --- a/lib/hooks/cast.cpp +++ b/lib/hooks/cast.cpp @@ -44,7 +44,7 @@ protected: char *new_unit; public: - CastHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + CastHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), signal_index(-1), signal_name(nullptr), diff --git a/lib/hooks/dp.cpp b/lib/hooks/dp.cpp index 27b19a7e4..5f9c61375 100644 --- a/lib/hooks/dp.cpp +++ b/lib/hooks/dp.cpp @@ -116,7 +116,7 @@ protected: public: - DPHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + DPHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), inverse(0) { } diff --git a/lib/hooks/gate.cpp b/lib/hooks/gate.cpp index ee6078621..14be2a146 100644 --- a/lib/hooks/gate.cpp +++ b/lib/hooks/gate.cpp @@ -58,7 +58,7 @@ protected: timespec startTime; public: - GateHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + GateHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), mode(Mode::RISING_EDGE), threshold(0.5), diff --git a/lib/hooks/jitter_calc.cpp b/lib/hooks/jitter_calc.cpp index 1627f4108..e9692ff21 100644 --- a/lib/hooks/jitter_calc.cpp +++ b/lib/hooks/jitter_calc.cpp @@ -50,7 +50,7 @@ protected: public: - JitterCalcHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + JitterCalcHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en) { size_t sz = GPS_NTP_DELAY_WIN_SIZE; diff --git a/lib/hooks/limit_value.cpp b/lib/hooks/limit_value.cpp index bd15189a0..d9fa8297d 100644 --- a/lib/hooks/limit_value.cpp +++ b/lib/hooks/limit_value.cpp @@ -47,7 +47,7 @@ protected: vlist signal_names; public: - LimitValueHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + LimitValueHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en) { int ret; diff --git a/lib/hooks/pps_ts.cpp b/lib/hooks/pps_ts.cpp index 48ab721a5..f7038a4e1 100644 --- a/lib/hooks/pps_ts.cpp +++ b/lib/hooks/pps_ts.cpp @@ -46,7 +46,7 @@ protected: timespec realTime; public: - PpsTsHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + PpsTsHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), lastValue(0), thresh(1.5), diff --git a/lib/hooks/print.cpp b/lib/hooks/print.cpp index d7e9b8e0a..6fb1d52e6 100644 --- a/lib/hooks/print.cpp +++ b/lib/hooks/print.cpp @@ -45,7 +45,7 @@ protected: char *uri; public: - PrintHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + PrintHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), prefix(nullptr), uri(nullptr) diff --git a/lib/hooks/scale.cpp b/lib/hooks/scale.cpp index 956136cd6..803024378 100644 --- a/lib/hooks/scale.cpp +++ b/lib/hooks/scale.cpp @@ -42,7 +42,7 @@ protected: double offset; public: - ScaleHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + ScaleHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), scale(1), offset(0) diff --git a/lib/hooks/shift_ts.cpp b/lib/hooks/shift_ts.cpp index 6102cde06..2172d7c3b 100644 --- a/lib/hooks/shift_ts.cpp +++ b/lib/hooks/shift_ts.cpp @@ -43,7 +43,7 @@ protected: } mode; public: - ShiftTimestampHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + ShiftTimestampHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), mode(SHIFT_ORIGIN) { } diff --git a/lib/hooks/stats.cpp b/lib/hooks/stats.cpp index 7e6b9f496..0f9e53cf6 100644 --- a/lib/hooks/stats.cpp +++ b/lib/hooks/stats.cpp @@ -45,7 +45,7 @@ protected: StatsHook *parent; public: - StatsWriteHook(StatsHook *pa, struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + StatsWriteHook(StatsHook *pa, struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), parent(pa) { @@ -63,7 +63,7 @@ protected: StatsHook *parent; public: - StatsReadHook(StatsHook *pa, struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + StatsReadHook(StatsHook *pa, struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), parent(pa) { @@ -113,7 +113,7 @@ protected: public: - StatsHook(struct vpath *p, struct node *n, int fl, int prio, bool en = true) : + StatsHook(struct vpath *p, struct vnode *n, int fl, int prio, bool en = true) : Hook(p, n, fl, prio, en), format(Stats::Format::HUMAN), verbose(0), diff --git a/lib/kernel/if.cpp b/lib/kernel/if.cpp index 43e7dfdaa..b09244020 100644 --- a/lib/kernel/if.cpp +++ b/lib/kernel/if.cpp @@ -79,7 +79,7 @@ int if_start(struct interface *i) /* Assign fwmark's to nodes which have netem options */ int ret, fwmark = 0; for (size_t j = 0; j < vlist_length(&i->nodes); j++) { - struct node *n = (struct node *) vlist_at(&i->nodes, j); + struct vnode *n = (struct vnode *) vlist_at(&i->nodes, j); if (n->tc_qdisc && n->fwmark < 0) n->fwmark = 1 + fwmark++; @@ -99,7 +99,7 @@ int if_start(struct interface *i) /* Create netem qdisks and appropriate filter per netem node */ for (size_t j = 0; j < vlist_length(&i->nodes); j++) { - struct node *n = (struct node *) vlist_at(&i->nodes, j); + struct vnode *n = (struct vnode *) vlist_at(&i->nodes, j); if (n->tc_qdisc) { ret = tc_mark(i, &n->tc_classifier, TC_HANDLE(1, n->fwmark), n->fwmark); diff --git a/lib/mapping.cpp b/lib/mapping.cpp index 2498d0c60..873617843 100644 --- a/lib/mapping.cpp +++ b/lib/mapping.cpp @@ -48,7 +48,7 @@ int mapping_parse_str(struct mapping_entry *me, const char *str, struct vlist *n goto invalid_format; } - me->node = vlist_lookup_name(nodes, node); + me->node = vlist_lookup_name(nodes, node); if (!me->node) { warning("Unknown node %s", node); goto invalid_format; diff --git a/lib/memory/ib.cpp b/lib/memory/ib.cpp index de391c39d..c8fe90cf4 100644 --- a/lib/memory/ib.cpp +++ b/lib/memory/ib.cpp @@ -82,7 +82,7 @@ static int memory_ib_free(struct memory_allocation *ma, struct memory_type *m) return 0; } -struct memory_type * memory_ib(struct node *n, struct memory_type *parent) +struct memory_type * memory_ib(struct vnode *n, struct memory_type *parent) { struct infiniband *i = (struct infiniband *) n->_vd; struct memory_type *mt = (struct memory_type *) malloc(sizeof(struct memory_type)); diff --git a/lib/node.cpp b/lib/node.cpp index aec2f1465..088caec6c 100644 --- a/lib/node.cpp +++ b/lib/node.cpp @@ -49,7 +49,7 @@ using namespace villas; using namespace villas::utils; -int node_init(struct node *n, struct node_type *vt) +int node_init(struct vnode *n, struct vnode_type *vt) { int ret; @@ -100,7 +100,7 @@ int node_init(struct node *n, struct node_type *vt) return 0; } -int node_prepare(struct node *n) +int node_prepare(struct vnode *n) { int ret; @@ -123,9 +123,9 @@ int node_prepare(struct node *n) return 0; } -int node_parse(struct node *n, json_t *json, const char *name) +int node_parse(struct vnode *n, json_t *json, const char *name) { - struct node_type *nt; + struct vnode_type *nt; int ret; json_error_t err; @@ -189,7 +189,7 @@ int node_parse(struct node *n, json_t *json, const char *name) struct { const char *str; - struct node_direction *dir; + struct vnode_direction *dir; } dirs[] = { { "in", &n->in }, { "out", &n->out } @@ -228,7 +228,7 @@ int node_parse(struct node *n, json_t *json, const char *name) return 0; } -int node_check(struct node *n) +int node_check(struct vnode *n) { int ret; assert(n->state != State::DESTROYED); @@ -250,7 +250,7 @@ int node_check(struct node *n) return 0; } -int node_start(struct node *n) +int node_start(struct vnode *n) { int ret; @@ -295,7 +295,7 @@ int node_start(struct node *n) return ret; } -int node_stop(struct node *n) +int node_stop(struct vnode *n) { int ret; @@ -320,7 +320,7 @@ int node_stop(struct node *n) return ret; } -int node_pause(struct node *n) +int node_pause(struct vnode *n) { int ret; @@ -337,7 +337,7 @@ int node_pause(struct node *n) return ret; } -int node_resume(struct node *n) +int node_resume(struct vnode *n) { int ret; @@ -354,7 +354,7 @@ int node_resume(struct node *n) return ret; } -int node_restart(struct node *n) +int node_restart(struct vnode *n) { int ret; @@ -378,7 +378,7 @@ int node_restart(struct node *n) return 0; } -int node_destroy(struct node *n) +int node_destroy(struct vnode *n) { int ret; assert(n->state != State::DESTROYED && n->state != State::STARTED); @@ -425,7 +425,7 @@ int node_destroy(struct node *n) return 0; } -int node_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int node_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int readd, nread = 0; @@ -471,7 +471,7 @@ int node_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rel #endif /* WITH_HOOKS */ } -int node_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int node_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int tosend, sent, nsent = 0; @@ -512,7 +512,7 @@ int node_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re return nsent; } -char * node_name(struct node *n) +char * node_name(struct vnode *n) { if (!n->_name) strcatf(&n->_name, CLR_RED("%s") "(" CLR_YEL("%s") ")", n->name, node_type_name(node_type(n))); @@ -520,7 +520,7 @@ char * node_name(struct node *n) return n->_name; } -char * node_name_long(struct node *n) +char * node_name_long(struct vnode *n) { if (!n->_name_long) { char uuid[37]; @@ -544,7 +544,7 @@ char * node_name_long(struct node *n) strcatf(&n->_name_long, ", output_path=%s", path_name(n->output_path)); if (node_type(n)->print) { - struct node_type *vt = node_type(n); + struct vnode_type *vt = node_type(n); /* Append node-type specific details */ char *name_long = vt->print(n); @@ -556,12 +556,12 @@ char * node_name_long(struct node *n) return n->_name_long; } -const char * node_name_short(struct node *n) +const char * node_name_short(struct vnode *n) { return n->name; } -struct vlist * node_output_signals(struct node *n) +struct vlist * node_output_signals(struct vnode *n) { if (n->output_path) return path_output_signals(n->output_path); @@ -569,29 +569,29 @@ struct vlist * node_output_signals(struct node *n) return nullptr; } -int node_reverse(struct node *n) +int node_reverse(struct vnode *n) { return node_type(n)->reverse ? node_type(n)->reverse(n) : -1; } -int node_poll_fds(struct node *n, int fds[]) +int node_poll_fds(struct vnode *n, int fds[]) { return node_type(n)->poll_fds ? node_type(n)->poll_fds(n, fds) : -1; } -int node_netem_fds(struct node *n, int fds[]) +int node_netem_fds(struct vnode *n, int fds[]) { return node_type(n)->netem_fds ? node_type(n)->netem_fds(n, fds) : -1; } -struct memory_type * node_memory_type(struct node *n) +struct memory_type * node_memory_type(struct vnode *n) { return node_type(n)->memory_type ? node_type(n)->memory_type(n, memory_default) : memory_default; } int node_list_parse(struct vlist *list, json_t *cfg, struct vlist *all) { - struct node *node; + struct vnode *node; const char *str; char *allstr = nullptr; @@ -601,7 +601,7 @@ int node_list_parse(struct vlist *list, json_t *cfg, struct vlist *all) switch (json_typeof(cfg)) { case JSON_STRING: str = json_string_value(cfg); - node = vlist_lookup_name(all, str); + node = vlist_lookup_name(all, str); if (!node) goto invalid2; @@ -613,7 +613,7 @@ int node_list_parse(struct vlist *list, json_t *cfg, struct vlist *all) if (!json_is_string(elm)) goto invalid; - node = vlist_lookup_name(all, json_string_value(elm)); + node = vlist_lookup_name(all, json_string_value(elm)); if (!node) goto invalid; @@ -634,7 +634,7 @@ invalid: invalid2: for (size_t i = 0; i < vlist_length(all); i++) { - struct node *n = (struct node *) vlist_at(all, i); + struct vnode *n = (struct vnode *) vlist_at(all, i); strcatf(&allstr, " %s", node_name_short(n)); } @@ -651,19 +651,19 @@ bool node_is_valid_name(const char *name) return std::regex_match(name, re); } -bool node_is_enabled(const struct node *n) +bool node_is_enabled(const struct vnode *n) { return n->enabled; } -struct vlist * node_get_signals(struct node *n, enum NodeDir dir) +struct vlist * node_get_signals(struct vnode *n, enum NodeDir dir) { - struct node_direction *nd = dir == NodeDir::IN ? &n->in : &n->out; + struct vnode_direction *nd = dir == NodeDir::IN ? &n->in : &n->out; return node_direction_get_signals(nd); } -json_t * node_to_json(struct node *n) +json_t * node_to_json(struct vnode *n) { struct vlist *output_signals; diff --git a/lib/node_direction.cpp b/lib/node_direction.cpp index c044af714..006993c72 100644 --- a/lib/node_direction.cpp +++ b/lib/node_direction.cpp @@ -33,7 +33,7 @@ using namespace villas; using namespace villas::node; using namespace villas::utils; -int node_direction_prepare(struct node_direction *nd, struct node *n) +int node_direction_prepare(struct vnode_direction *nd, struct vnode *n) { assert(nd->state == State::CHECKED); @@ -49,7 +49,7 @@ int node_direction_prepare(struct node_direction *nd, struct node *n) return 0; } -int node_direction_init(struct node_direction *nd, enum NodeDir dir, struct node *n) +int node_direction_init(struct vnode_direction *nd, enum NodeDir dir, struct vnode *n) { int ret; @@ -73,7 +73,7 @@ int node_direction_init(struct node_direction *nd, enum NodeDir dir, struct node return 0; } -int node_direction_destroy(struct node_direction *nd, struct node *n) +int node_direction_destroy(struct vnode_direction *nd, struct vnode *n) { int ret = 0; @@ -94,7 +94,7 @@ int node_direction_destroy(struct node_direction *nd, struct node *n) return 0; } -int node_direction_parse(struct node_direction *nd, struct node *n, json_t *cfg) +int node_direction_parse(struct vnode_direction *nd, struct vnode *n, json_t *cfg) { int ret; @@ -167,7 +167,7 @@ int node_direction_parse(struct node_direction *nd, struct node *n, json_t *cfg) return 0; } -int node_direction_check(struct node_direction *nd, struct node *n) +int node_direction_check(struct vnode_direction *nd, struct vnode *n) { assert(nd->state == State::PARSED); @@ -183,7 +183,7 @@ int node_direction_check(struct node_direction *nd, struct node *n) return 0; } -int node_direction_start(struct node_direction *nd, struct node *n) +int node_direction_start(struct vnode_direction *nd, struct vnode *n) { assert(nd->state == State::PREPARED); @@ -196,7 +196,7 @@ int node_direction_start(struct node_direction *nd, struct node *n) return 0; } -int node_direction_stop(struct node_direction *nd, struct node *n) +int node_direction_stop(struct vnode_direction *nd, struct vnode *n) { assert(nd->state == State::STARTED); @@ -209,7 +209,7 @@ int node_direction_stop(struct node_direction *nd, struct node *n) return 0; } -struct vlist * node_direction_get_signals(struct node_direction *nd) +struct vlist * node_direction_get_signals(struct vnode_direction *nd) { assert(nd->state == State::PREPARED); diff --git a/lib/node_type.cpp b/lib/node_type.cpp index c730ad31d..c61080617 100644 --- a/lib/node_type.cpp +++ b/lib/node_type.cpp @@ -29,7 +29,7 @@ #include #include -int node_type_start(struct node_type *vt, villas::node::SuperNode *sn) +int node_type_start(struct vnode_type *vt, villas::node::SuperNode *sn) { int ret; @@ -45,7 +45,7 @@ int node_type_start(struct node_type *vt, villas::node::SuperNode *sn) return ret; } -int node_type_stop(struct node_type *vt) +int node_type_stop(struct vnode_type *vt) { int ret; @@ -61,12 +61,12 @@ int node_type_stop(struct node_type *vt) return ret; } -const char * node_type_name(struct node_type *vt) +const char * node_type_name(struct vnode_type *vt) { return plugin_name(vt); } -struct node_type * node_type_lookup(const char *name) +struct vnode_type * node_type_lookup(const char *name) { struct plugin *p; diff --git a/lib/nodes/amqp.cpp b/lib/nodes/amqp.cpp index 59423f2a2..cff9cba68 100644 --- a/lib/nodes/amqp.cpp +++ b/lib/nodes/amqp.cpp @@ -113,7 +113,7 @@ static int amqp_close(amqp_connection_state_t conn) return 0; } -int amqp_parse(struct node *n, json_t *json) +int amqp_parse(struct vnode *n, json_t *json) { int ret; struct amqp *a = (struct amqp *) n->_vd; @@ -195,7 +195,7 @@ int amqp_parse(struct node *n, json_t *json) return 0; } -char * amqp_print(struct node *n) +char * amqp_print(struct vnode *n) { struct amqp *a = (struct amqp *) n->_vd; @@ -232,7 +232,7 @@ char * amqp_print(struct node *n) return buf; } -int amqp_start(struct node *n) +int amqp_start(struct vnode *n) { int ret; struct amqp *a = (struct amqp *) n->_vd; @@ -292,7 +292,7 @@ int amqp_start(struct node *n) return 0; } -int amqp_stop(struct node *n) +int amqp_stop(struct vnode *n) { int ret; struct amqp *a = (struct amqp *) n->_vd; @@ -312,7 +312,7 @@ int amqp_stop(struct node *n) return 0; } -int amqp_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int amqp_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct amqp *a = (struct amqp *) n->_vd; @@ -330,7 +330,7 @@ int amqp_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rel return ret; } -int amqp_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int amqp_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct amqp *a = (struct amqp *) n->_vd; @@ -358,7 +358,7 @@ int amqp_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re return cnt; } -int amqp_poll_fds(struct node *n, int fds[]) +int amqp_poll_fds(struct vnode *n, int fds[]) { struct amqp *a = (struct amqp *) n->_vd; @@ -369,7 +369,7 @@ int amqp_poll_fds(struct node *n, int fds[]) return 1; } -int amqp_destroy(struct node *n) +int amqp_destroy(struct vnode *n) { struct amqp *a = (struct amqp *) n->_vd; diff --git a/lib/nodes/can.cpp b/lib/nodes/can.cpp index b3c8674af..212c9aeb4 100644 --- a/lib/nodes/can.cpp +++ b/lib/nodes/can.cpp @@ -48,7 +48,7 @@ static struct plugin p; using namespace villas::node; using namespace villas::utils; -int can_init(struct node *n) +int can_init(struct vnode *n) { struct can *c = (struct can *) n->_vd; @@ -62,7 +62,7 @@ int can_init(struct node *n) return 0; } -int can_destroy(struct node *n) +int can_destroy(struct vnode *n) { struct can *c = (struct can *) n->_vd; @@ -124,7 +124,7 @@ int can_parse_signal(json_t *json, struct vlist *node_signals, struct can_signal out: return ret; } -int can_parse(struct node *n, json_t *cfg) +int can_parse(struct vnode *n, json_t *cfg) { int ret = 1; struct can *c = (struct can *) n->_vd; @@ -189,14 +189,14 @@ out: if (ret != 0) { return ret; } -char * can_print(struct node *n) +char * can_print(struct vnode *n) { struct can *c = (struct can *) n->_vd; return strf("interface_name=%s", c->interface_name); } -int can_check(struct node *n) +int can_check(struct vnode *n) { struct can *c = (struct can *) n->_vd; @@ -208,7 +208,7 @@ int can_check(struct node *n) return 0; } -int can_prepare(struct node *n) +int can_prepare(struct vnode *n) { struct can *c = (struct can *) n->_vd; @@ -217,7 +217,7 @@ int can_prepare(struct node *n) return (c->sample_buf != 0 ? 0 : 1); } -int can_start(struct node *n) +int can_start(struct vnode *n) { int ret = 1; struct sockaddr_can addr = {0}; @@ -250,7 +250,7 @@ int can_start(struct node *n) out: return ret; } -int can_stop(struct node *n) +int can_stop(struct vnode *n) { struct can *c = (struct can *) n->_vd; @@ -399,7 +399,7 @@ fail: return 1; } -int can_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int can_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret = 0; int nbytes; @@ -474,7 +474,7 @@ int can_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rele return ret; } -int can_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int can_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int nbytes; unsigned nwrite; @@ -547,7 +547,7 @@ int can_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rel return nwrite; } -int can_poll_fds(struct node *n, int fds[]) +int can_poll_fds(struct vnode *n, int fds[]) { struct can *c = (struct can *) n->_vd; diff --git a/lib/nodes/comedi.cpp b/lib/nodes/comedi.cpp index 72bc60519..d1f2c7147 100644 --- a/lib/nodes/comedi.cpp +++ b/lib/nodes/comedi.cpp @@ -100,7 +100,7 @@ static int comedi_parse_direction(struct comedi *c, struct comedi_direction *d, return 0; } -static int comedi_start_common(struct node *n) +static int comedi_start_common(struct vnode *n) { struct comedi *c = (struct comedi *) n->_vd; struct comedi_direction* directions[2] = { &c->in, &c->out }; @@ -162,7 +162,7 @@ static int comedi_start_common(struct node *n) return 0; } -static int comedi_start_in(struct node *n) +static int comedi_start_in(struct vnode *n) { int ret; struct comedi *c = (struct comedi *) n->_vd; @@ -253,7 +253,7 @@ static int comedi_start_in(struct node *n) return 0; } -static int comedi_start_out(struct node *n) +static int comedi_start_out(struct vnode *n) { int ret; struct comedi *c = (struct comedi *) n->_vd; @@ -363,7 +363,7 @@ static int comedi_start_out(struct node *n) return 0; } -static int comedi_stop_in(struct node *n) +static int comedi_stop_in(struct vnode *n) { int ret; struct comedi *c = (struct comedi *) n->_vd; @@ -378,7 +378,7 @@ static int comedi_stop_in(struct node *n) return 0; } -static int comedi_stop_out(struct node *n) +static int comedi_stop_out(struct vnode *n) { int ret; struct comedi *c = (struct comedi *) n->_vd; @@ -393,7 +393,7 @@ static int comedi_stop_out(struct node *n) return 0; } -int comedi_parse(struct node *n, json_t *cfg) +int comedi_parse(struct vnode *n, json_t *cfg) { int ret; struct comedi *c = (struct comedi *) n->_vd; @@ -437,7 +437,7 @@ int comedi_parse(struct node *n, json_t *cfg) return 0; } -char * comedi_print(struct node *n) +char * comedi_print(struct vnode *n) { struct comedi *c = (struct comedi *) n->_vd; @@ -451,7 +451,7 @@ char * comedi_print(struct node *n) return buf; } -int comedi_start(struct node *n) +int comedi_start(struct vnode *n) { struct comedi *c = (struct comedi *) n->_vd; @@ -498,7 +498,7 @@ int comedi_start(struct node *n) return 0; } -int comedi_stop(struct node *n) +int comedi_stop(struct vnode *n) { int ret; struct comedi *c = (struct comedi *) n->_vd; @@ -518,7 +518,7 @@ int comedi_stop(struct node *n) #if COMEDI_USE_READ -int comedi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int comedi_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct comedi *c = (struct comedi *) n->_vd; @@ -636,7 +636,7 @@ int comedi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *r #else -int comedi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int comedi_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct comedi *c = (struct comedi *) n->_vd; @@ -817,7 +817,7 @@ int comedi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *r #endif -int comedi_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int comedi_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct comedi *c = (struct comedi *) n->_vd; @@ -986,7 +986,7 @@ void comedi_dump_cmd(comedi_cmd *cmd, int debug_level) debug(LOG_COMEDI | debug_level, "stop: %-8s %u", src, cmd->stop_arg); } -int comedi_poll_fds(struct node *n, int fds[]) +int comedi_poll_fds(struct vnode *n, int fds[]) { struct comedi *c = (struct comedi *) n->_vd; diff --git a/lib/nodes/ethercat.cpp b/lib/nodes/ethercat.cpp index 9ff20f3e7..8a4ca6b1d 100644 --- a/lib/nodes/ethercat.cpp +++ b/lib/nodes/ethercat.cpp @@ -59,7 +59,7 @@ struct coupler { .sc = nullptr }; -static void ethercat_cyclic_task(struct node *n) +static void ethercat_cyclic_task(struct vnode *n) { struct sample *smp; struct ethercat *w = (struct ethercat *) n->_vd; @@ -149,7 +149,7 @@ int ethercat_type_stop() return 0; } -int ethercat_parse(struct node *n, json_t *cfg) +int ethercat_parse(struct vnode *n, json_t *cfg) { struct ethercat *w = (struct ethercat *) n->_vd; @@ -177,7 +177,7 @@ int ethercat_parse(struct node *n, json_t *cfg) return 0; } -char * ethercat_print(struct node *n) +char * ethercat_print(struct vnode *n) { struct ethercat *w = (struct ethercat *) n->_vd; std::stringstream ss; @@ -189,7 +189,7 @@ char * ethercat_print(struct node *n) return strdup(ss.str().c_str()); } -int ethercat_check(struct node *n) +int ethercat_check(struct vnode *n) { struct ethercat *w = (struct ethercat *) n->_vd; @@ -206,7 +206,7 @@ int ethercat_check(struct node *n) return 0; } -int ethercat_prepare(struct node *n) +int ethercat_prepare(struct vnode *n) { struct ethercat *w = (struct ethercat *) n->_vd; @@ -262,7 +262,7 @@ int ethercat_prepare(struct node *n) return 0; } -int ethercat_start(struct node *n) +int ethercat_start(struct vnode *n) { int ret; struct ethercat *w = (struct ethercat *) n->_vd; @@ -317,7 +317,7 @@ int ethercat_start(struct node *n) return 0; } -int ethercat_stop(struct node *n) +int ethercat_stop(struct vnode *n) { struct ethercat *w = (struct ethercat *) n->_vd; @@ -326,7 +326,7 @@ int ethercat_stop(struct node *n) return 0; } -int ethercat_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int ethercat_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct ethercat *w = (struct ethercat *) n->_vd; @@ -343,7 +343,7 @@ int ethercat_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned return avail; } -int ethercat_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int ethercat_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct ethercat *w = (struct ethercat *) n->_vd; @@ -361,7 +361,7 @@ int ethercat_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned return 1; } -int ethercat_init(struct node *n) +int ethercat_init(struct vnode *n) { int ret; struct ethercat *w = (struct ethercat *) n->_vd; @@ -405,7 +405,7 @@ int ethercat_init(struct node *n) return 0; } -int ethercat_destroy(struct node *n) +int ethercat_destroy(struct vnode *n) { int ret; struct ethercat *w = (struct ethercat *) n->_vd; @@ -434,7 +434,7 @@ int ethercat_destroy(struct node *n) return 0; } -int ethercat_poll_fds(struct node *n, int *fds) +int ethercat_poll_fds(struct vnode *n, int *fds) { struct ethercat *w = (struct ethercat *) n->_vd; diff --git a/lib/nodes/example.cpp b/lib/nodes/example.cpp index e702a7257..a34e2e9e1 100644 --- a/lib/nodes/example.cpp +++ b/lib/nodes/example.cpp @@ -46,7 +46,7 @@ int example_type_stop() return 0; } -int example_init(struct node *n) +int example_init(struct vnode *n) { struct example *s = (struct example *) n->_vd; @@ -58,7 +58,7 @@ int example_init(struct node *n) return 0; } -int example_destroy(struct node *n) +int example_destroy(struct vnode *n) { struct example *s = (struct example *) n->_vd; @@ -70,7 +70,7 @@ int example_destroy(struct node *n) return 0; } -int example_parse(struct node *n, json_t *cfg) +int example_parse(struct vnode *n, json_t *cfg) { int ret; struct example *s = (struct example *) n->_vd; @@ -89,7 +89,7 @@ int example_parse(struct node *n, json_t *cfg) return 0; } -char * example_print(struct node *n) +char * example_print(struct vnode *n) { struct example *s = (struct example *) n->_vd; @@ -98,7 +98,7 @@ char * example_print(struct node *n) return strf("setting1=%d, setting2=%s", s->setting1, s->setting2); } -int example_check(struct node *n) +int example_check(struct vnode *n) { struct example *s = (struct example *) n->_vd; @@ -113,7 +113,7 @@ int example_check(struct node *n) return 0; } -int example_prepare(struct node *n) +int example_prepare(struct vnode *n) { struct example *s = (struct example *) n->_vd; @@ -127,7 +127,7 @@ int example_prepare(struct node *n) return 0; } -int example_start(struct node *n) +int example_start(struct vnode *n) { struct example *s = (struct example *) n->_vd; @@ -138,7 +138,7 @@ int example_start(struct node *n) return 0; } -int example_stop(struct node *n) +int example_stop(struct vnode *n) { //struct example *s = (struct example *) n->_vd; @@ -147,7 +147,7 @@ int example_stop(struct node *n) return 0; } -int example_pause(struct node *n) +int example_pause(struct vnode *n) { //struct example *s = (struct example *) n->_vd; @@ -156,7 +156,7 @@ int example_pause(struct node *n) return 0; } -int example_resume(struct node *n) +int example_resume(struct vnode *n) { //struct example *s = (struct example *) n->_vd; @@ -165,7 +165,7 @@ int example_resume(struct node *n) return 0; } -int example_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int example_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int read; struct example *s = (struct example *) n->_vd; @@ -189,7 +189,7 @@ int example_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned * return read; } -int example_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int example_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int written; //struct example *s = (struct example *) n->_vd; @@ -201,7 +201,7 @@ int example_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned return written; } -int example_reverse(struct node *n) +int example_reverse(struct vnode *n) { //struct example *s = (struct example *) n->_vd; @@ -210,7 +210,7 @@ int example_reverse(struct node *n) return 0; } -int example_poll_fds(struct node *n, int fds[]) +int example_poll_fds(struct vnode *n, int fds[]) { //struct example *s = (struct example *) n->_vd; @@ -219,7 +219,7 @@ int example_poll_fds(struct node *n, int fds[]) return 0; /* The number of file descriptors which have been set in fds */ } -int example_netem_fds(struct node *n, int fds[]) +int example_netem_fds(struct vnode *n, int fds[]) { //struct example *s = (struct example *) n->_vd; diff --git a/lib/nodes/exec.cpp b/lib/nodes/exec.cpp index b11201c68..71028d34b 100644 --- a/lib/nodes/exec.cpp +++ b/lib/nodes/exec.cpp @@ -31,7 +31,7 @@ using namespace villas; using namespace villas::utils; -int exec_parse(struct node *n, json_t *cfg) +int exec_parse(struct vnode *n, json_t *cfg) { struct exec *e = (struct exec *) n->_vd; @@ -115,7 +115,7 @@ int exec_parse(struct node *n, json_t *cfg) return 0; } -int exec_prepare(struct node *n) +int exec_prepare(struct vnode *n) { int ret; struct exec *e = (struct exec *) n->_vd; @@ -136,7 +136,7 @@ int exec_prepare(struct node *n) return 0; } -int exec_init(struct node *n) +int exec_init(struct vnode *n) { struct exec *e = (struct exec *) n->_vd; @@ -149,7 +149,7 @@ int exec_init(struct node *n) return 0; } -int exec_destroy(struct node *n) +int exec_destroy(struct vnode *n) { int ret; struct exec *e = (struct exec *) n->_vd; @@ -174,14 +174,14 @@ int exec_destroy(struct node *n) return 0; } -int exec_start(struct node *n) +int exec_start(struct vnode *n) { // struct exec *e = (struct exec *) n->_vd; return 0; } -int exec_stop(struct node *n) +int exec_stop(struct vnode *n) { struct exec *e = (struct exec *) n->_vd; @@ -196,7 +196,7 @@ int exec_stop(struct node *n) return 0; } -int exec_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int exec_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct exec *e = (struct exec *) n->_vd; @@ -213,7 +213,7 @@ int exec_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rel return avail; } -int exec_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int exec_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct exec *e = (struct exec *) n->_vd; @@ -237,7 +237,7 @@ int exec_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re return cnt; } -char * exec_print(struct node *n) +char * exec_print(struct vnode *n) { struct exec *e = (struct exec *) n->_vd; char *buf = nullptr; @@ -255,7 +255,7 @@ char * exec_print(struct node *n) return buf; } -int exec_poll_fds(struct node *n, int fds[]) +int exec_poll_fds(struct vnode *n, int fds[]) { struct exec *e = (struct exec *) n->_vd; diff --git a/lib/nodes/file.cpp b/lib/nodes/file.cpp index 342d59d3b..7275c81e6 100644 --- a/lib/nodes/file.cpp +++ b/lib/nodes/file.cpp @@ -79,7 +79,7 @@ static struct timespec file_calc_offset(const struct timespec *first, const stru } } -int file_parse(struct node *n, json_t *cfg) +int file_parse(struct vnode *n, json_t *cfg) { struct file *f = (struct file *) n->_vd; @@ -147,7 +147,7 @@ int file_parse(struct node *n, json_t *cfg) return 0; } -char * file_print(struct node *n) +char * file_print(struct vnode *n) { struct file *f = (struct file *) n->_vd; char *buf = nullptr; @@ -232,7 +232,7 @@ char * file_print(struct node *n) return buf; } -int file_start(struct node *n) +int file_start(struct vnode *n) { struct file *f = (struct file *) n->_vd; @@ -334,7 +334,7 @@ int file_start(struct node *n) return 0; } -int file_stop(struct node *n) +int file_stop(struct vnode *n) { int ret; struct file *f = (struct file *) n->_vd; @@ -354,7 +354,7 @@ int file_stop(struct node *n) return 0; } -int file_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int file_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct file *f = (struct file *) n->_vd; int ret; @@ -434,7 +434,7 @@ retry: ret = io_scan(&f->io, smps, cnt); return cnt; } -int file_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int file_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct file *f = (struct file *) n->_vd; @@ -448,7 +448,7 @@ int file_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re return cnt; } -int file_poll_fds(struct node *n, int fds[]) +int file_poll_fds(struct vnode *n, int fds[]) { struct file *f = (struct file *) n->_vd; @@ -466,7 +466,7 @@ int file_poll_fds(struct node *n, int fds[]) return -1; /** @todo not supported yet */ } -int file_init(struct node *n) +int file_init(struct vnode *n) { struct file *f = (struct file *) n->_vd; @@ -484,7 +484,7 @@ int file_init(struct node *n) return 0; } -int file_destroy(struct node *n) +int file_destroy(struct vnode *n) { struct file *f = (struct file *) n->_vd; diff --git a/lib/nodes/fpga.cpp b/lib/nodes/fpga.cpp index 4da9dc7ee..204981af6 100644 --- a/lib/nodes/fpga.cpp +++ b/lib/nodes/fpga.cpp @@ -95,7 +95,7 @@ int fpga_type_stop() return 0; } -int fpga_init(struct node *n) +int fpga_init(struct vnode *n) { struct fpga *f = (struct fpga *) n->_vd; @@ -118,7 +118,7 @@ int fpga_init(struct node *n) return 0; } -int fpga_destroy(struct node *n) +int fpga_destroy(struct vnode *n) { struct fpga *f = (struct fpga *) n->_vd; @@ -143,7 +143,7 @@ int fpga_destroy(struct node *n) return 0; } -int fpga_parse(struct node *n, json_t *cfg) +int fpga_parse(struct vnode *n, json_t *cfg) { int ret; struct fpga *f = (struct fpga *) n->_vd; @@ -179,7 +179,7 @@ int fpga_parse(struct node *n, json_t *cfg) return 0; } -char * fpga_print(struct node *n) +char * fpga_print(struct vnode *n) { struct fpga *f = (struct fpga *) n->_vd; @@ -191,14 +191,14 @@ char * fpga_print(struct node *n) ); } -int fpga_check(struct node *n) +int fpga_check(struct vnode *n) { // struct fpga *f = (struct fpga *) n->_vd; return 0; } -int fpga_prepare(struct node *n) +int fpga_prepare(struct vnode *n) { int ret; struct fpga *f = (struct fpga *) n->_vd; @@ -258,21 +258,21 @@ int fpga_prepare(struct node *n) return 0; } -int fpga_start(struct node *n) +int fpga_start(struct vnode *n) { // struct fpga *f = (struct fpga *) n->_vd; return 0; } -int fpga_stop(struct node *n) +int fpga_stop(struct vnode *n) { //struct fpga *f = (struct fpga *) n->_vd; return 0; } -int fpga_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int fpga_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { unsigned read; struct fpga *f = (struct fpga *) n->_vd; @@ -292,7 +292,7 @@ int fpga_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rel return read; } -int fpga_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int fpga_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int written; struct fpga *f = (struct fpga *) n->_vd; @@ -312,7 +312,7 @@ int fpga_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re return written; } -int fpga_poll_fds(struct node *n, int fds[]) +int fpga_poll_fds(struct vnode *n, int fds[]) { struct fpga *f = (struct fpga *) n->_vd; diff --git a/lib/nodes/iec61850_sv.cpp b/lib/nodes/iec61850_sv.cpp index ba422d86e..ce0b22692 100644 --- a/lib/nodes/iec61850_sv.cpp +++ b/lib/nodes/iec61850_sv.cpp @@ -40,7 +40,7 @@ using namespace villas::utils; static void iec61850_sv_listener(SVSubscriber subscriber, void *ctx, SVSubscriber_ASDU asdu) { - struct node *n = (struct node *) ctx; + struct vnode *n = (struct vnode *) ctx; struct iec61850_sv *i = (struct iec61850_sv *) n->_vd; struct sample *smp; @@ -137,7 +137,7 @@ static void iec61850_sv_listener(SVSubscriber subscriber, void *ctx, SVSubscribe queue_signalled_push(&i->in.queue, smp); } -int iec61850_sv_parse(struct node *n, json_t *json) +int iec61850_sv_parse(struct vnode *n, json_t *json) { int ret; struct iec61850_sv *i = (struct iec61850_sv *) n->_vd; @@ -243,7 +243,7 @@ int iec61850_sv_parse(struct node *n, json_t *json) return 0; } -char * iec61850_sv_print(struct node *n) +char * iec61850_sv_print(struct vnode *n) { char *buf; struct iec61850_sv *i = (struct iec61850_sv *) n->_vd; @@ -268,7 +268,7 @@ char * iec61850_sv_print(struct node *n) return buf; } -int iec61850_sv_start(struct node *n) +int iec61850_sv_start(struct vnode *n) { int ret; struct iec61850_sv *i = (struct iec61850_sv *) n->_vd; @@ -350,7 +350,7 @@ int iec61850_sv_start(struct node *n) return 0; } -int iec61850_sv_stop(struct node *n) +int iec61850_sv_stop(struct vnode *n) { struct iec61850_sv *i = (struct iec61850_sv *) n->_vd; @@ -360,7 +360,7 @@ int iec61850_sv_stop(struct node *n) return 0; } -int iec61850_sv_destroy(struct node *n) +int iec61850_sv_destroy(struct vnode *n) { int ret; struct iec61850_sv *i = (struct iec61850_sv *) n->_vd; @@ -383,7 +383,7 @@ int iec61850_sv_destroy(struct node *n) return 0; } -int iec61850_sv_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int iec61850_sv_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int pulled; struct iec61850_sv *i = (struct iec61850_sv *) n->_vd; @@ -400,7 +400,7 @@ int iec61850_sv_read(struct node *n, struct sample *smps[], unsigned cnt, unsign return pulled; } -int iec61850_sv_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int iec61850_sv_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct iec61850_sv *i = (struct iec61850_sv *) n->_vd; @@ -466,7 +466,7 @@ int iec61850_sv_write(struct node *n, struct sample *smps[], unsigned cnt, unsig return cnt; } -int iec61850_sv_poll_fds(struct node *n, int fds[]) +int iec61850_sv_poll_fds(struct vnode *n, int fds[]) { struct iec61850_sv *i = (struct iec61850_sv *) n->_vd; diff --git a/lib/nodes/infiniband.cpp b/lib/nodes/infiniband.cpp index 2ed97a39c..559f86d86 100644 --- a/lib/nodes/infiniband.cpp +++ b/lib/nodes/infiniband.cpp @@ -36,7 +36,7 @@ using namespace villas::utils; -static int ib_disconnect(struct node *n) +static int ib_disconnect(struct vnode *n) { struct infiniband *ib = (struct infiniband *) n->_vd; struct ibv_wc wc[MAX(ib->recv_cq_size, ib->send_cq_size)]; @@ -68,7 +68,7 @@ static int ib_disconnect(struct node *n) return ib->stopThreads; } -static void ib_build_ibv(struct node *n) +static void ib_build_ibv(struct vnode *n) { struct infiniband *ib = (struct infiniband *) n->_vd; int ret; @@ -104,7 +104,7 @@ static void ib_build_ibv(struct node *n) info("Maximum inline size is set to %i byte", ib->qp_init.cap.max_inline_data); } -static int ib_addr_resolved(struct node *n) +static int ib_addr_resolved(struct vnode *n) { struct infiniband *ib = (struct infiniband *) n->_vd; int ret; @@ -122,7 +122,7 @@ static int ib_addr_resolved(struct node *n) return 0; } -static int ib_route_resolved(struct node *n) +static int ib_route_resolved(struct vnode *n) { struct infiniband *ib = (struct infiniband *) n->_vd; int ret; @@ -140,7 +140,7 @@ static int ib_route_resolved(struct node *n) return 0; } -static int ib_connect_request(struct node *n, struct rdma_cm_id *id) +static int ib_connect_request(struct vnode *n, struct rdma_cm_id *id) { struct infiniband *ib = (struct infiniband *) n->_vd; int ret; @@ -162,7 +162,7 @@ static int ib_connect_request(struct node *n, struct rdma_cm_id *id) return 0; } -int ib_reverse(struct node *n) +int ib_reverse(struct vnode *n) { struct infiniband *ib = (struct infiniband *) n->_vd; @@ -171,7 +171,7 @@ int ib_reverse(struct node *n) return 0; } -int ib_parse(struct node *n, json_t *cfg) +int ib_parse(struct vnode *n, json_t *cfg) { struct infiniband *ib = (struct infiniband *) n->_vd; @@ -342,7 +342,7 @@ int ib_parse(struct node *n, json_t *cfg) return 0; } -int ib_check(struct node *n) +int ib_check(struct vnode *n) { struct infiniband *ib = (struct infiniband *) n->_vd; @@ -393,17 +393,17 @@ int ib_check(struct node *n) return 0; } -char * ib_print(struct node *n) +char * ib_print(struct vnode *n) { return 0; } -int ib_destroy(struct node *n) +int ib_destroy(struct vnode *n) { return 0; } -static void ib_create_bind_id(struct node *n) +static void ib_create_bind_id(struct vnode *n) { struct infiniband *ib = (struct infiniband *) n->_vd; int ret; @@ -464,7 +464,7 @@ static void ib_create_bind_id(struct node *n) ib->ctx.listen_id = ib->ctx.id; } -static void ib_continue_as_listen(struct node *n, struct rdma_cm_event *event) +static void ib_continue_as_listen(struct vnode *n, struct rdma_cm_event *event) { struct infiniband *ib = (struct infiniband *) n->_vd; int ret; @@ -500,7 +500,7 @@ static void ib_continue_as_listen(struct node *n, struct rdma_cm_event *event) void * ib_rdma_cm_event_thread(void *n) { - struct node *node = (struct node *) n; + struct vnode *node = (struct vnode *) n; struct infiniband *ib = (struct infiniband *) node->_vd; struct rdma_cm_event *event; int ret = 0; @@ -610,7 +610,7 @@ void * ib_rdma_cm_event_thread(void *n) return nullptr; } -int ib_start(struct node *n) +int ib_start(struct vnode *n) { struct infiniband *ib = (struct infiniband *) n->_vd; int ret; @@ -676,7 +676,7 @@ int ib_start(struct node *n) return 0; } -int ib_stop(struct node *n) +int ib_stop(struct vnode *n) { struct infiniband *ib = (struct infiniband *) n->_vd; int ret; @@ -730,7 +730,7 @@ int ib_stop(struct node *n) return 0; } -int ib_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int ib_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct infiniband *ib = (struct infiniband *) n->_vd; struct ibv_wc wc[cnt]; @@ -872,7 +872,7 @@ int ib_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *relea return read_values; } -int ib_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int ib_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct infiniband *ib = (struct infiniband *) n->_vd; struct ibv_send_wr wr[cnt], *bad_wr = nullptr; diff --git a/lib/nodes/influxdb.cpp b/lib/nodes/influxdb.cpp index 93168247c..43dc0a3ae 100644 --- a/lib/nodes/influxdb.cpp +++ b/lib/nodes/influxdb.cpp @@ -35,7 +35,7 @@ using namespace villas::utils; -int influxdb_parse(struct node *n, json_t *json) +int influxdb_parse(struct vnode *n, json_t *json) { struct influxdb *i = (struct influxdb *) n->_vd; @@ -66,7 +66,7 @@ int influxdb_parse(struct node *n, json_t *json) return 0; } -int influxdb_open(struct node *n) +int influxdb_open(struct vnode *n) { int ret; struct influxdb *i = (struct influxdb *) n->_vd; @@ -103,7 +103,7 @@ int influxdb_open(struct node *n) return p ? 0 : -1; } -int influxdb_close(struct node *n) +int influxdb_close(struct vnode *n) { struct influxdb *i = (struct influxdb *) n->_vd; @@ -119,7 +119,7 @@ int influxdb_close(struct node *n) return 0; } -int influxdb_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int influxdb_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct influxdb *i = (struct influxdb *) n->_vd; @@ -202,7 +202,7 @@ int influxdb_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned return cnt; } -char * influxdb_print(struct node *n) +char * influxdb_print(struct vnode *n) { struct influxdb *i = (struct influxdb *) n->_vd; char *buf = nullptr; diff --git a/lib/nodes/loopback.cpp b/lib/nodes/loopback.cpp index 64cb50622..a8c690e4e 100644 --- a/lib/nodes/loopback.cpp +++ b/lib/nodes/loopback.cpp @@ -30,7 +30,7 @@ using namespace villas::utils; -int loopback_parse(struct node *n, json_t *cfg) +int loopback_parse(struct vnode *n, json_t *cfg) { struct loopback *l = (struct loopback *) n->_vd; const char *mode_str = nullptr; @@ -71,7 +71,7 @@ int loopback_parse(struct node *n, json_t *cfg) return 0; } -int loopback_start(struct node *n) +int loopback_start(struct vnode *n) { int ret; struct loopback *l = (struct loopback *) n->_vd; @@ -88,7 +88,7 @@ int loopback_start(struct node *n) return queue_signalled_init(&l->queue, l->queuelen, memory_default, l->mode); } -int loopback_stop(struct node *n) +int loopback_stop(struct vnode *n) { int ret; struct loopback *l= (struct loopback *) n->_vd; @@ -100,7 +100,7 @@ int loopback_stop(struct node *n) return queue_signalled_destroy(&l->queue); } -int loopback_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int loopback_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int avail; @@ -117,7 +117,7 @@ int loopback_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned return avail; } -int loopback_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int loopback_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct loopback *l = (struct loopback *) n->_vd; struct sample *copies[cnt]; @@ -133,7 +133,7 @@ int loopback_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned return queue_signalled_push_many(&l->queue, (void **) copies, copied); } -char * loopback_print(struct node *n) +char * loopback_print(struct vnode *n) { struct loopback *l = (struct loopback *) n->_vd; char *buf = nullptr; @@ -143,7 +143,7 @@ char * loopback_print(struct node *n) return buf; } -int loopback_poll_fds(struct node *n, int fds[]) +int loopback_poll_fds(struct vnode *n, int fds[]) { struct loopback *l = (struct loopback *) n->_vd; diff --git a/lib/nodes/mqtt.cpp b/lib/nodes/mqtt.cpp index 7adfc3d68..1895a7061 100644 --- a/lib/nodes/mqtt.cpp +++ b/lib/nodes/mqtt.cpp @@ -47,7 +47,7 @@ static void * mosquitto_loop_thread(void *ctx) while (true) { for (unsigned i = 0; i < vlist_length(&clients); i++) { - struct node *node = (struct node *) vlist_at(&clients, i); + struct vnode *node = (struct vnode *) vlist_at(&clients, i); struct mqtt *m = (struct mqtt *) node->_vd; // Execute mosquitto loop for this client @@ -96,7 +96,7 @@ static void mqtt_log_cb(struct mosquitto *mosq, void *userdata, int level, const static void mqtt_connect_cb(struct mosquitto *mosq, void *userdata, int result) { - struct node *n = (struct node *) userdata; + struct vnode *n = (struct vnode *) userdata; struct mqtt *m = (struct mqtt *) n->_vd; int ret; @@ -114,7 +114,7 @@ static void mqtt_connect_cb(struct mosquitto *mosq, void *userdata, int result) static void mqtt_disconnect_cb(struct mosquitto *mosq, void *userdata, int result) { - struct node *n = (struct node *) userdata; + struct vnode *n = (struct vnode *) userdata; struct mqtt *m = (struct mqtt *) n->_vd; info("MQTT: Node %s disconnected from broker %s", node_name(n), m->host); @@ -123,7 +123,7 @@ static void mqtt_disconnect_cb(struct mosquitto *mosq, void *userdata, int resul static void mqtt_message_cb(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *msg) { int ret; - struct node *n = (struct node *) userdata; + struct vnode *n = (struct vnode *) userdata; struct mqtt *m = (struct mqtt *) n->_vd; struct sample *smps[n->in.vectorize]; @@ -153,13 +153,13 @@ static void mqtt_message_cb(struct mosquitto *mosq, void *userdata, const struct static void mqtt_subscribe_cb(struct mosquitto *mosq, void *userdata, int mid, int qos_count, const int *granted_qos) { - struct node *n = (struct node *) userdata; + struct vnode *n = (struct vnode *) userdata; struct mqtt *m = (struct mqtt *) n->_vd; info("MQTT: Node %s subscribed to broker %s", node_name(n), m->host); } -int mqtt_reverse(struct node *n) +int mqtt_reverse(struct vnode *n) { struct mqtt *m = (struct mqtt *) n->_vd; @@ -168,7 +168,7 @@ int mqtt_reverse(struct node *n) return 0; } -int mqtt_parse(struct node *n, json_t *cfg) +int mqtt_parse(struct vnode *n, json_t *cfg) { int ret; struct mqtt *m = (struct mqtt *) n->_vd; @@ -251,7 +251,7 @@ int mqtt_parse(struct node *n, json_t *cfg) return 0; } -int mqtt_check(struct node *n) +int mqtt_check(struct vnode *n) { int ret; struct mqtt *m = (struct mqtt *) n->_vd; @@ -267,7 +267,7 @@ int mqtt_check(struct node *n) return 0; } -char * mqtt_print(struct node *n) +char * mqtt_print(struct vnode *n) { struct mqtt *m = (struct mqtt *) n->_vd; @@ -293,7 +293,7 @@ char * mqtt_print(struct node *n) return buf; } -int mqtt_destroy(struct node *n) +int mqtt_destroy(struct vnode *n) { int ret; struct mqtt *m = (struct mqtt *) n->_vd; @@ -322,7 +322,7 @@ int mqtt_destroy(struct node *n) return 0; } -int mqtt_start(struct node *n) +int mqtt_start(struct vnode *n) { int ret; struct mqtt *m = (struct mqtt *) n->_vd; @@ -385,7 +385,7 @@ mosquitto_error: return ret; } -int mqtt_stop(struct node *n) +int mqtt_stop(struct vnode *n) { int ret; struct mqtt *m = (struct mqtt *) n->_vd; @@ -471,7 +471,7 @@ mosquitto_error: return ret; } -int mqtt_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int mqtt_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int pulled; struct mqtt *m = (struct mqtt *) n->_vd; @@ -485,7 +485,7 @@ int mqtt_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rel return pulled; } -int mqtt_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int mqtt_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct mqtt *m = (struct mqtt *) n->_vd; @@ -511,7 +511,7 @@ int mqtt_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re return cnt; } -int mqtt_poll_fds(struct node *n, int fds[]) +int mqtt_poll_fds(struct vnode *n, int fds[]) { struct mqtt *m = (struct mqtt *) n->_vd; diff --git a/lib/nodes/nanomsg.cpp b/lib/nodes/nanomsg.cpp index d294e2bce..56cb97856 100644 --- a/lib/nodes/nanomsg.cpp +++ b/lib/nodes/nanomsg.cpp @@ -31,7 +31,7 @@ using namespace villas::utils; -int nanomsg_reverse(struct node *n) +int nanomsg_reverse(struct vnode *n) { struct nanomsg *m = (struct nanomsg *) n->_vd; @@ -79,7 +79,7 @@ static int nanomsg_parse_endpoints(struct vlist *l, json_t *cfg) return 0; } -int nanomsg_parse(struct node *n, json_t *cfg) +int nanomsg_parse(struct vnode *n, json_t *cfg) { int ret; struct nanomsg *m = (struct nanomsg *) n->_vd; @@ -123,7 +123,7 @@ int nanomsg_parse(struct node *n, json_t *cfg) return 0; } -char * nanomsg_print(struct node *n) +char * nanomsg_print(struct vnode *n) { struct nanomsg *m = (struct nanomsg *) n->_vd; @@ -150,7 +150,7 @@ char * nanomsg_print(struct node *n) return buf; } -int nanomsg_start(struct node *n) +int nanomsg_start(struct vnode *n) { int ret; struct nanomsg *m = (struct nanomsg *) n->_vd; @@ -205,7 +205,7 @@ int nanomsg_start(struct node *n) return 0; } -int nanomsg_stop(struct node *n) +int nanomsg_stop(struct vnode *n) { int ret; struct nanomsg *m = (struct nanomsg *) n->_vd; @@ -232,7 +232,7 @@ int nanomsg_type_stop() return 0; } -int nanomsg_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int nanomsg_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct nanomsg *m = (struct nanomsg *) n->_vd; int bytes; @@ -246,7 +246,7 @@ int nanomsg_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned * return io_sscan(&m->io, data, bytes, nullptr, smps, cnt); } -int nanomsg_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int nanomsg_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct nanomsg *m = (struct nanomsg *) n->_vd; @@ -266,7 +266,7 @@ int nanomsg_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned return cnt; } -int nanomsg_poll_fds(struct node *n, int fds[]) +int nanomsg_poll_fds(struct vnode *n, int fds[]) { int ret; struct nanomsg *m = (struct nanomsg *) n->_vd; @@ -283,7 +283,7 @@ int nanomsg_poll_fds(struct node *n, int fds[]) return 1; } -int nanomsg_netem_fds(struct node *n, int fds[]) +int nanomsg_netem_fds(struct vnode *n, int fds[]) { struct nanomsg *m = (struct nanomsg *) n->_vd; diff --git a/lib/nodes/ngsi.cpp b/lib/nodes/ngsi.cpp index 2a67f9da8..f72f69e7b 100644 --- a/lib/nodes/ngsi.cpp +++ b/lib/nodes/ngsi.cpp @@ -235,7 +235,7 @@ struct ngsi_response { size_t len; }; -static json_t* ngsi_build_entity(struct node *n, struct sample *smps[], unsigned cnt, int flags) +static json_t* ngsi_build_entity(struct vnode *n, struct sample *smps[], unsigned cnt, int flags) { struct ngsi *i = (struct ngsi *) n->_vd; @@ -274,7 +274,7 @@ static json_t* ngsi_build_entity(struct node *n, struct sample *smps[], unsigned return json_entity; } -static int ngsi_parse_entity(struct node *n, json_t *json_entity, struct sample *smps[], unsigned cnt) +static int ngsi_parse_entity(struct vnode *n, json_t *json_entity, struct sample *smps[], unsigned cnt) { int ret, length = 0; const char *id, *name, *type; @@ -603,7 +603,7 @@ int ngsi_type_stop() return 0; } -int ngsi_parse(struct node *n, json_t *cfg) +int ngsi_parse(struct vnode *n, json_t *cfg) { struct ngsi *i = (struct ngsi *) n->_vd; @@ -651,7 +651,7 @@ int ngsi_parse(struct node *n, json_t *cfg) return 0; } -char * ngsi_print(struct node *n) +char * ngsi_print(struct vnode *n) { struct ngsi *i = (struct ngsi *) n->_vd; @@ -659,7 +659,7 @@ char * ngsi_print(struct node *n) i->endpoint, i->timeout); } -int ngsi_start(struct node *n) +int ngsi_start(struct vnode *n) { struct ngsi *i = (struct ngsi *) n->_vd; int ret; @@ -706,7 +706,7 @@ int ngsi_start(struct node *n) return ret; } -int ngsi_stop(struct node *n) +int ngsi_stop(struct vnode *n) { struct ngsi *i = (struct ngsi *) n->_vd; int ret; @@ -727,7 +727,7 @@ int ngsi_stop(struct node *n) return ret; } -int ngsi_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int ngsi_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct ngsi *i = (struct ngsi *) n->_vd; int ret; @@ -752,7 +752,7 @@ out: json_decref(json_entity); return ret; } -int ngsi_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int ngsi_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct ngsi *i = (struct ngsi *) n->_vd; int ret; @@ -766,7 +766,7 @@ int ngsi_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re return ret ? 0 : cnt; } -int ngsi_poll_fds(struct node *n, int fds[]) +int ngsi_poll_fds(struct vnode *n, int fds[]) { struct ngsi *i = (struct ngsi *) n->_vd; @@ -775,7 +775,7 @@ int ngsi_poll_fds(struct node *n, int fds[]) return 1; } -int ngsi_init(struct node *n) +int ngsi_init(struct vnode *n) { int ret; struct ngsi *i = (struct ngsi *) n->_vd; @@ -799,7 +799,7 @@ int ngsi_init(struct node *n) return 0; } -int ngsi_destroy(struct node *n) +int ngsi_destroy(struct vnode *n) { int ret; struct ngsi *i = (struct ngsi *) n->_vd; @@ -830,7 +830,7 @@ int ngsi_destroy(struct node *n) return 0; } -int ngsi_reverse(struct node *n) +int ngsi_reverse(struct vnode *n) { struct ngsi *i = (struct ngsi *) n->_vd; diff --git a/lib/nodes/opal.cpp b/lib/nodes/opal.cpp index d6d1e9cad..12f9f261e 100644 --- a/lib/nodes/opal.cpp +++ b/lib/nodes/opal.cpp @@ -154,7 +154,7 @@ int opal_print_global() return 0; } -int opal_parse(struct node *n, json_t *cfg) +int opal_parse(struct vnode *n, json_t *cfg) { struct opal *o = (struct opal *) n->_vd; @@ -172,7 +172,7 @@ int opal_parse(struct node *n, json_t *cfg) return 0; } -char * opal_print(struct node *n) +char * opal_print(struct vnode *n) { struct opal *o = (struct opal *) n->_vd; @@ -182,7 +182,7 @@ char * opal_print(struct node *n) o->send_id, o->recv_id, o->reply); } -int opal_start(struct node *n) +int opal_start(struct vnode *n) { struct opal *o = (struct opal *) n->_vd; @@ -206,12 +206,12 @@ int opal_start(struct node *n) return 0; } -int opal_stop(struct node *n) +int opal_stop(struct vnode *n) { return 0; } -int opal_read(struct node *n, struct pool *pool, unsigned cnt) +int opal_read(struct vnode *n, struct pool *pool, unsigned cnt) { struct opal *o = (struct opal *) n->_vd; @@ -276,7 +276,7 @@ int opal_read(struct node *n, struct pool *pool, unsigned cnt) return 1; } -int opal_write(struct node *n, struct pool *pool, unsigned cnt) +int opal_write(struct vnode *n, struct pool *pool, unsigned cnt) { struct opal *o = (struct opal *) n->_vd; diff --git a/lib/nodes/rtp.cpp b/lib/nodes/rtp.cpp index 14c6cf2bc..6040f2073 100644 --- a/lib/nodes/rtp.cpp +++ b/lib/nodes/rtp.cpp @@ -59,7 +59,7 @@ using namespace villas::utils; static struct plugin p; -static int rtp_aimd(struct node *n, double loss_frac) +static int rtp_aimd(struct vnode *n, double loss_frac) { struct rtp *r = (struct rtp *) n->_vd; @@ -88,7 +88,7 @@ static int rtp_aimd(struct node *n, double loss_frac) return 0; } -int rtp_init(struct node *n) +int rtp_init(struct vnode *n) { struct rtp *r = (struct rtp *) n->_vd; @@ -113,7 +113,7 @@ int rtp_init(struct node *n) return 0; } -int rtp_reverse(struct node *n) +int rtp_reverse(struct vnode *n) { struct rtp *r = (struct rtp *) n->_vd; @@ -123,7 +123,7 @@ int rtp_reverse(struct node *n) return 0; } -int rtp_parse(struct node *n, json_t *cfg) +int rtp_parse(struct vnode *n, json_t *cfg) { int ret = 0; struct rtp *r = (struct rtp *) n->_vd; @@ -220,7 +220,7 @@ int rtp_parse(struct node *n, json_t *cfg) return ret; } -char * rtp_print(struct node *n) +char * rtp_print(struct vnode *n) { struct rtp *r = (struct rtp *) n->_vd; char *buf; @@ -266,7 +266,7 @@ char * rtp_print(struct node *n) static void rtp_handler(const struct sa *src, const struct rtp_header *hdr, struct mbuf *mb, void *arg) { int ret; - struct node *n = (struct node *) arg; + struct vnode *n = (struct vnode *) arg; struct rtp *r = (struct rtp *) n->_vd; /* source, header not used */ @@ -284,7 +284,7 @@ static void rtp_handler(const struct sa *src, const struct rtp_header *hdr, stru static void rtcp_handler(const struct sa *src, struct rtcp_msg *msg, void *arg) { - struct node *n = (struct node *) arg; + struct vnode *n = (struct vnode *) arg; struct rtp *r = (struct rtp *) n->_vd; /* source not used */ @@ -315,7 +315,7 @@ static void rtcp_handler(const struct sa *src, struct rtcp_msg *msg, void *arg) r->rtcp.num_rrs++; } -int rtp_start(struct node *n) +int rtp_start(struct vnode *n) { int ret; struct rtp *r = (struct rtp *) n->_vd; @@ -411,7 +411,7 @@ int rtp_start(struct node *n) return ret; } -int rtp_stop(struct node *n) +int rtp_stop(struct vnode *n) { int ret; struct rtp *r = (struct rtp *) n->_vd; @@ -442,7 +442,7 @@ int rtp_stop(struct node *n) return ret; } -int rtp_destroy(struct node *n) +int rtp_destroy(struct vnode *n) { struct rtp *r = (struct rtp *) n->_vd; @@ -495,7 +495,7 @@ int rtp_type_start(villas::node::SuperNode *sn) /* Gather list of used network interfaces */ for (size_t i = 0; i < vlist_length(&p.node.instances); i++) { - struct node *n = (struct node *) vlist_at(&p.node.instances, i); + struct vnode *n = (struct vnode *) vlist_at(&p.node.instances, i); struct rtp *r = (struct rtp *) n->_vd; struct interface *j = if_get_egress(&r->out.saddr_rtp.u.sa, interfaces); @@ -528,7 +528,7 @@ int rtp_type_stop() return ret; } -int rtp_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int rtp_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct rtp *r = (struct rtp *) n->_vd; @@ -549,7 +549,7 @@ int rtp_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *rele return ret; } -int rtp_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int rtp_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct rtp *r = (struct rtp *) n->_vd; @@ -587,7 +587,7 @@ retry: mbuf_set_pos(r->send_mb, RTP_HEADER_SIZE); return cnt; } -int rtp_poll_fds(struct node *n, int fds[]) +int rtp_poll_fds(struct vnode *n, int fds[]) { struct rtp *r = (struct rtp *) n->_vd; @@ -596,7 +596,7 @@ int rtp_poll_fds(struct node *n, int fds[]) return 1; } -int rtp_netem_fds(struct node *n, int fds[]) +int rtp_netem_fds(struct vnode *n, int fds[]) { struct rtp *r = (struct rtp *) n->_vd; diff --git a/lib/nodes/shmem.cpp b/lib/nodes/shmem.cpp index 4d4fd8c60..f39064cfe 100644 --- a/lib/nodes/shmem.cpp +++ b/lib/nodes/shmem.cpp @@ -40,7 +40,7 @@ using namespace villas; using namespace villas::utils; -int shmem_parse(struct node *n, json_t *cfg) +int shmem_parse(struct vnode *n, json_t *cfg) { struct shmem *shm = (struct shmem *) n->_vd; const char *val, *mode_str = nullptr; @@ -102,7 +102,7 @@ int shmem_parse(struct node *n, json_t *cfg) return 0; } -int shmem_start(struct node *n) +int shmem_start(struct vnode *n) { struct shmem *shm = (struct shmem *) n->_vd; int ret; @@ -122,14 +122,14 @@ int shmem_start(struct node *n) return 0; } -int shmem_stop(struct node *n) +int shmem_stop(struct vnode *n) { struct shmem* shm = (struct shmem *) n->_vd; return shmem_int_close(&shm->intf); } -int shmem_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int shmem_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct shmem *shm = (struct shmem *) n->_vd; int recv; @@ -160,7 +160,7 @@ int shmem_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re return recv; } -int shmem_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int shmem_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct shmem *shm = (struct shmem *) n->_vd; struct sample *shared_smps[cnt]; /* Samples need to be copied to the shared pool first */ @@ -181,7 +181,7 @@ int shmem_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *r return pushed; } -char * shmem_print(struct node *n) +char * shmem_print(struct vnode *n) { struct shmem *shm = (struct shmem *) n->_vd; char *buf = nullptr; diff --git a/lib/nodes/signal_generator.cpp b/lib/nodes/signal_generator.cpp index d17068b38..4111fccb8 100644 --- a/lib/nodes/signal_generator.cpp +++ b/lib/nodes/signal_generator.cpp @@ -92,7 +92,7 @@ static const char * signal_generator_type_str(enum signal_generator::SignalType } } -int signal_generator_init(struct node *n) +int signal_generator_init(struct vnode *n) { struct signal_generator *s = (struct signal_generator *) n->_vd; @@ -116,7 +116,7 @@ int signal_generator_init(struct node *n) return 0; } -int signal_generator_destroy(struct node *n) +int signal_generator_destroy(struct vnode *n) { struct signal_generator *s = (struct signal_generator *) n->_vd; @@ -137,7 +137,7 @@ int signal_generator_destroy(struct node *n) return 0; } -int signal_generator_prepare(struct node *n) +int signal_generator_prepare(struct vnode *n) { struct signal_generator *s = (struct signal_generator *) n->_vd; @@ -153,7 +153,7 @@ int signal_generator_prepare(struct node *n) return 0; } -int signal_generator_parse(struct node *n, json_t *cfg) +int signal_generator_parse(struct vnode *n, json_t *cfg) { struct signal_generator *s = (struct signal_generator *) n->_vd; @@ -287,7 +287,7 @@ int signal_generator_parse(struct node *n, json_t *cfg) return 0; } -int signal_generator_start(struct node *n) +int signal_generator_start(struct vnode *n) { struct signal_generator *s = (struct signal_generator *) n->_vd; @@ -308,7 +308,7 @@ int signal_generator_start(struct node *n) return 0; } -int signal_generator_stop(struct node *n) +int signal_generator_stop(struct vnode *n) { struct signal_generator *s = (struct signal_generator *) n->_vd; @@ -323,7 +323,7 @@ int signal_generator_stop(struct node *n) return 0; } -int signal_generator_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int signal_generator_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct signal_generator *s = (struct signal_generator *) n->_vd; struct sample *t = smps[0]; @@ -418,7 +418,7 @@ int signal_generator_read(struct node *n, struct sample *smps[], unsigned cnt, u return 1; } -char * signal_generator_print(struct node *n) +char * signal_generator_print(struct vnode *n) { struct signal_generator *s = (struct signal_generator *) n->_vd; char *buf = nullptr; @@ -431,7 +431,7 @@ char * signal_generator_print(struct node *n) return buf; } -int signal_generator_poll_fds(struct node *n, int fds[]) +int signal_generator_poll_fds(struct vnode *n, int fds[]) { struct signal_generator *s = (struct signal_generator *) n->_vd; diff --git a/lib/nodes/socket.cpp b/lib/nodes/socket.cpp index d0e09a1b5..4f837b358 100644 --- a/lib/nodes/socket.cpp +++ b/lib/nodes/socket.cpp @@ -58,7 +58,7 @@ int socket_type_start(villas::node::SuperNode *sn) /* Gather list of used network interfaces */ for (size_t i = 0; i < vlist_length(&p.node.instances); i++) { - struct node *n = (struct node *) vlist_at(&p.node.instances, i); + struct vnode *n = (struct vnode *) vlist_at(&p.node.instances, i); struct socket *s = (struct socket *) n->_vd; if (s->layer == SocketLayer::UNIX) @@ -74,7 +74,7 @@ int socket_type_start(villas::node::SuperNode *sn) return 0; } -char * socket_print(struct node *n) +char * socket_print(struct vnode *n) { struct socket *s = (struct socket *) n->_vd; const char *layer = nullptr; @@ -123,7 +123,7 @@ char * socket_print(struct node *n) return buf; } -int socket_check(struct node *n) +int socket_check(struct vnode *n) { struct socket *s = (struct socket *) n->_vd; @@ -159,7 +159,7 @@ int socket_check(struct node *n) return 0; } -int socket_start(struct node *n) +int socket_start(struct vnode *n) { struct socket *s = (struct socket *) n->_vd; int ret; @@ -287,7 +287,7 @@ int socket_start(struct node *n) return 0; } -int socket_reverse(struct node *n) +int socket_reverse(struct vnode *n) { struct socket *s = (struct socket *) n->_vd; union sockaddr_union tmp; @@ -299,7 +299,7 @@ int socket_reverse(struct node *n) return 0; } -int socket_stop(struct node *n) +int socket_stop(struct vnode *n) { int ret; struct socket *s = (struct socket *) n->_vd; @@ -326,7 +326,7 @@ int socket_stop(struct node *n) return 0; } -int socket_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int socket_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct socket *s = (struct socket *) n->_vd; @@ -384,7 +384,7 @@ int socket_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *r return ret; } -int socket_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int socket_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct socket *s = (struct socket *) n->_vd; @@ -456,7 +456,7 @@ retry2: bytes = sendto(s->sd, s->out.buf, wbytes, 0, (struct sockaddr *) &s->out return cnt; } -int socket_parse(struct node *n, json_t *cfg) +int socket_parse(struct vnode *n, json_t *cfg) { struct socket *s = (struct socket *) n->_vd; @@ -556,7 +556,7 @@ int socket_parse(struct node *n, json_t *cfg) return 0; } -int socket_fds(struct node *n, int fds[]) +int socket_fds(struct vnode *n, int fds[]) { struct socket *s = (struct socket *) n->_vd; diff --git a/lib/nodes/stats.cpp b/lib/nodes/stats.cpp index 060a3280d..11494a1fa 100644 --- a/lib/nodes/stats.cpp +++ b/lib/nodes/stats.cpp @@ -91,7 +91,7 @@ int stats_node_type_start(villas::node::SuperNode *sn) return 0; } -int stats_node_start(struct node *n) +int stats_node_start(struct vnode *n) { struct stats_node *s = (struct stats_node *) n->_vd; @@ -100,7 +100,7 @@ int stats_node_start(struct node *n) for (size_t i = 0; i < vlist_length(&s->signals); i++) { struct stats_node_signal *stats_sig = (struct stats_node_signal *) vlist_at(&s->signals, i); - stats_sig->node = vlist_lookup_name(nodes, stats_sig->node_str); + stats_sig->node = vlist_lookup_name(nodes, stats_sig->node_str); if (!stats_sig->node) error("Invalid reference node %s for setting 'node' of node %s", stats_sig->node_str, node_name(n)); } @@ -108,7 +108,7 @@ int stats_node_start(struct node *n) return 0; } -int stats_node_stop(struct node *n) +int stats_node_stop(struct vnode *n) { struct stats_node *s = (struct stats_node *) n->_vd; @@ -117,14 +117,14 @@ int stats_node_stop(struct node *n) return 0; } -char * stats_node_print(struct node *n) +char * stats_node_print(struct vnode *n) { struct stats_node *s = (struct stats_node *) n->_vd; return strf("rate=%f", s->rate); } -int stats_node_init(struct node *n) +int stats_node_init(struct vnode *n) { int ret; struct stats_node *s = (struct stats_node *) n->_vd; @@ -138,7 +138,7 @@ int stats_node_init(struct node *n) return 0; } -int stats_node_destroy(struct node *n) +int stats_node_destroy(struct vnode *n) { int ret; struct stats_node *s = (struct stats_node *) n->_vd; @@ -152,7 +152,7 @@ int stats_node_destroy(struct node *n) return 0; } -int stats_node_parse(struct node *n, json_t *cfg) +int stats_node_parse(struct vnode *n, json_t *cfg) { struct stats_node *s = (struct stats_node *) n->_vd; @@ -206,7 +206,7 @@ int stats_node_parse(struct node *n, json_t *cfg) return 0; } -int stats_node_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int stats_node_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct stats_node *s = (struct stats_node *) n->_vd; @@ -234,7 +234,7 @@ int stats_node_read(struct node *n, struct sample *smps[], unsigned cnt, unsigne return 1; } -int stats_node_poll_fds(struct node *n, int fds[]) +int stats_node_poll_fds(struct vnode *n, int fds[]) { struct stats_node *s = (struct stats_node *) n->_vd; diff --git a/lib/nodes/test_rtt.cpp b/lib/nodes/test_rtt.cpp index 526a5cf98..5957c535c 100644 --- a/lib/nodes/test_rtt.cpp +++ b/lib/nodes/test_rtt.cpp @@ -85,7 +85,7 @@ static int test_rtt_case_destroy(struct test_rtt_case *c) return 0; } -int test_rtt_prepare(struct node *n) +int test_rtt_prepare(struct vnode *n) { struct test_rtt *t = (struct test_rtt *) n->_vd; @@ -117,7 +117,7 @@ int test_rtt_prepare(struct node *n) return 0; } -int test_rtt_parse(struct node *n, json_t *cfg) +int test_rtt_parse(struct vnode *n, json_t *cfg) { int ret; struct test_rtt *t = (struct test_rtt *) n->_vd; @@ -249,7 +249,7 @@ int test_rtt_parse(struct node *n, json_t *cfg) return 0; } -int test_rtt_init(struct node *n) +int test_rtt_init(struct vnode *n) { struct test_rtt *t = (struct test_rtt *) n->_vd; @@ -258,7 +258,7 @@ int test_rtt_init(struct node *n) return 0; } -int test_rtt_destroy(struct node *n) +int test_rtt_destroy(struct vnode *n) { int ret; struct test_rtt *t = (struct test_rtt *) n->_vd; @@ -278,14 +278,14 @@ int test_rtt_destroy(struct node *n) return 0; } -char * test_rtt_print(struct node *n) +char * test_rtt_print(struct vnode *n) { struct test_rtt *t = (struct test_rtt *) n->_vd; return strf("output=%s, prefix=%s, cooldown=%f, #cases=%zu", t->output, t->prefix, t->cooldown, vlist_length(&t->cases)); } -int test_rtt_start(struct node *n) +int test_rtt_start(struct vnode *n) { int ret; struct stat st; @@ -318,7 +318,7 @@ int test_rtt_start(struct node *n) return 0; } -int test_rtt_stop(struct node *n) +int test_rtt_stop(struct vnode *n) { int ret; struct test_rtt *t = (struct test_rtt *) n->_vd; @@ -336,7 +336,7 @@ int test_rtt_stop(struct node *n) return 0; } -int test_rtt_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int test_rtt_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; unsigned i; @@ -408,7 +408,7 @@ int test_rtt_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned } } -int test_rtt_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int test_rtt_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct test_rtt *t = (struct test_rtt *) n->_vd; @@ -430,7 +430,7 @@ int test_rtt_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned return i; } -int test_rtt_poll_fds(struct node *n, int fds[]) +int test_rtt_poll_fds(struct vnode *n, int fds[]) { struct test_rtt *t = (struct test_rtt *) n->_vd; diff --git a/lib/nodes/uldaq.cpp b/lib/nodes/uldaq.cpp index 7668706f3..8d1c705ed 100644 --- a/lib/nodes/uldaq.cpp +++ b/lib/nodes/uldaq.cpp @@ -174,7 +174,7 @@ static DaqDeviceDescriptor * uldaq_find_device(struct uldaq *u) { return nullptr; } -static int uldaq_connect(struct node *n) +static int uldaq_connect(struct vnode *n) { struct uldaq *u = (struct uldaq *) n->_vd; UlError err; @@ -236,7 +236,7 @@ int uldaq_type_start(villas::node::SuperNode *sn) return 0; } -int uldaq_init(struct node *n) +int uldaq_init(struct vnode *n) { int ret; struct uldaq *u = (struct uldaq *) n->_vd; @@ -260,7 +260,7 @@ int uldaq_init(struct node *n) return 0; } -int uldaq_destroy(struct node *n) +int uldaq_destroy(struct vnode *n) { int ret; struct uldaq *u = (struct uldaq *) n->_vd; @@ -279,7 +279,7 @@ int uldaq_destroy(struct node *n) return 0; } -int uldaq_parse(struct node *n, json_t *cfg) +int uldaq_parse(struct vnode *n, json_t *cfg) { int ret; struct uldaq *u = (struct uldaq *) n->_vd; @@ -364,7 +364,7 @@ int uldaq_parse(struct node *n, json_t *cfg) return ret; } -char * uldaq_print(struct node *n) +char * uldaq_print(struct vnode *n) { struct uldaq *u = (struct uldaq *) n->_vd; @@ -389,7 +389,7 @@ char * uldaq_print(struct node *n) return buf; } -int uldaq_check(struct node *n) +int uldaq_check(struct vnode *n) { int ret; long long has_ai, event_types, max_channel, scan_options, num_ranges_se, num_ranges_diff; @@ -500,7 +500,7 @@ found: if (q->channel > max_channel) { void uldaq_data_available(DaqDeviceHandle device_handle, DaqEventType event_type, unsigned long long event_data, void *ctx) { - struct node *n = (struct node *) ctx; + struct vnode *n = (struct vnode *) ctx; struct uldaq *u = (struct uldaq *) n->_vd; pthread_mutex_lock(&u->in.mutex); @@ -516,7 +516,7 @@ void uldaq_data_available(DaqDeviceHandle device_handle, DaqEventType event_type pthread_cond_signal(&u->in.cv); } -int uldaq_start(struct node *n) +int uldaq_start(struct vnode *n) { struct uldaq *u = (struct uldaq *) n->_vd; @@ -567,7 +567,7 @@ int uldaq_start(struct node *n) return 0; } -int uldaq_stop(struct node *n) +int uldaq_stop(struct vnode *n) { struct uldaq *u = (struct uldaq *) n->_vd; @@ -601,7 +601,7 @@ int uldaq_stop(struct node *n) return 0; } -int uldaq_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int uldaq_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { struct uldaq *u = (struct uldaq *) n->_vd; diff --git a/lib/nodes/websocket.cpp b/lib/nodes/websocket.cpp index 7f86b1498..513afcf97 100644 --- a/lib/nodes/websocket.cpp +++ b/lib/nodes/websocket.cpp @@ -218,7 +218,7 @@ int websocket_protocol_cb(struct lws *wsi, enum lws_callback_reasons reason, voi format = (char *) "villas.web"; /* Search for node whose name matches the URI. */ - c->node = vlist_lookup_name(&p.node.instances, node); + c->node = vlist_lookup_name(&p.node.instances, node); if (!c->node) { websocket_connection_close(c, wsi, LWS_CLOSE_STATUS_POLICY_VIOLATION, "Unknown node"); warning("Failed to find node: node=%s", node); @@ -314,7 +314,7 @@ int websocket_protocol_cb(struct lws *wsi, enum lws_callback_reasons reason, voi /* We dont try to parse the frame yet, as we have to wait for the remaining fragments */ if (lws_is_final_fragment(wsi)) { struct timespec ts_recv = time_now(); - struct node *n = c->node; + struct vnode *n = c->node; int avail, enqueued; struct websocket *w = (struct websocket *) n->_vd; @@ -378,7 +378,7 @@ int websocket_type_start(villas::node::SuperNode *sn) return 0; } -int websocket_start(struct node *n) +int websocket_start(struct vnode *n) { int ret; struct websocket *w = (struct websocket *) n->_vd; @@ -423,7 +423,7 @@ int websocket_start(struct node *n) return 0; } -int websocket_stop(struct node *n) +int websocket_stop(struct vnode *n) { int ret, open_connections = 0;; struct websocket *w = (struct websocket *) n->_vd; @@ -467,7 +467,7 @@ int websocket_stop(struct node *n) return 0; } -int websocket_destroy(struct node *n) +int websocket_destroy(struct vnode *n) { struct websocket *w = (struct websocket *) n->_vd; int ret; @@ -479,7 +479,7 @@ int websocket_destroy(struct node *n) return 0; } -int websocket_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int websocket_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int avail; @@ -496,7 +496,7 @@ int websocket_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned return avail; } -int websocket_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int websocket_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int avail; @@ -522,7 +522,7 @@ int websocket_write(struct node *n, struct sample *smps[], unsigned cnt, unsigne return cnt; } -int websocket_parse(struct node *n, json_t *cfg) +int websocket_parse(struct vnode *n, json_t *cfg) { struct websocket *w = (struct websocket *) n->_vd; int ret; @@ -576,7 +576,7 @@ int websocket_parse(struct node *n, json_t *cfg) return 0; } -char * websocket_print(struct node *n) +char * websocket_print(struct vnode *n) { struct websocket *w = (struct websocket *) n->_vd; @@ -600,7 +600,7 @@ char * websocket_print(struct node *n) return buf; } -int websocket_poll_fds(struct node *n, int fds[]) +int websocket_poll_fds(struct vnode *n, int fds[]) { struct websocket *w = (struct websocket *) n->_vd; diff --git a/lib/nodes/zeromq.cpp b/lib/nodes/zeromq.cpp index d52b493e8..ca9e21413 100644 --- a/lib/nodes/zeromq.cpp +++ b/lib/nodes/zeromq.cpp @@ -77,7 +77,7 @@ static int get_monitor_event(void *monitor, int *value, char **address) return event; } -int zeromq_reverse(struct node *n) +int zeromq_reverse(struct vnode *n) { struct zeromq *z = (struct zeromq *) n->_vd; @@ -94,7 +94,7 @@ int zeromq_reverse(struct node *n) return 0; } -int zeromq_init(struct node *n) +int zeromq_init(struct vnode *n) { struct zeromq *z = (struct zeromq *) n->_vd; @@ -142,7 +142,7 @@ int zeromq_parse_endpoints(json_t *json_ep, struct vlist *epl) return 0; } -int zeromq_parse(struct node *n, json_t *cfg) +int zeromq_parse(struct vnode *n, json_t *cfg) { struct zeromq *z = (struct zeromq *) n->_vd; @@ -234,7 +234,7 @@ int zeromq_parse(struct node *n, json_t *cfg) return 0; } -char * zeromq_print(struct node *n) +char * zeromq_print(struct vnode *n) { struct zeromq *z = (struct zeromq *) n->_vd; @@ -287,7 +287,7 @@ char * zeromq_print(struct node *n) return buf; } -int zeromq_check(struct node *n) +int zeromq_check(struct vnode *n) { struct zeromq *z = (struct zeromq *) n->_vd; @@ -310,7 +310,7 @@ int zeromq_type_stop() return zmq_ctx_term(context); } -int zeromq_start(struct node *n) +int zeromq_start(struct vnode *n) { int ret; struct zeromq *z = (struct zeromq *) n->_vd; @@ -473,7 +473,7 @@ fail: return ret; } -int zeromq_stop(struct node *n) +int zeromq_stop(struct vnode *n) { int ret; struct zeromq *z = (struct zeromq *) n->_vd; @@ -497,7 +497,7 @@ int zeromq_stop(struct node *n) return 0; } -int zeromq_destroy(struct node *n) +int zeromq_destroy(struct vnode *n) { int ret; struct zeromq *z = (struct zeromq *) n->_vd; @@ -515,7 +515,7 @@ int zeromq_destroy(struct node *n) return 0; } -int zeromq_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int zeromq_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int recv, ret; struct zeromq *z = (struct zeromq *) n->_vd; @@ -551,7 +551,7 @@ int zeromq_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *r return recv; } -int zeromq_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release) +int zeromq_write(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *release) { int ret; struct zeromq *z = (struct zeromq *) n->_vd; @@ -601,7 +601,7 @@ fail: return ret; } -int zeromq_poll_fds(struct node *n, int fds[]) +int zeromq_poll_fds(struct vnode *n, int fds[]) { int ret; struct zeromq *z = (struct zeromq *) n->_vd; @@ -618,7 +618,7 @@ int zeromq_poll_fds(struct node *n, int fds[]) return 1; } -int zeromq_netem_fds(struct node *n, int fds[]) +int zeromq_netem_fds(struct vnode *n, int fds[]) { int ret; struct zeromq *z = (struct zeromq *) n->_vd; diff --git a/lib/path.cpp b/lib/path.cpp index 9847e5fa6..c66c734e0 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -424,7 +424,7 @@ int path_parse(struct vpath *p, json_t *cfg, struct vlist *nodes) } for (size_t i = 0; i < vlist_length(&destinations); i++) { - struct node *n = (struct node *) vlist_at(&destinations, i); + struct vnode *n = (struct vnode *) vlist_at(&destinations, i); if (n->output_path) throw ConfigError(cfg, "node-config-path", "Every node must only be used by a single path as destination"); @@ -455,7 +455,7 @@ int path_parse(struct vpath *p, json_t *cfg, struct vlist *nodes) json_array_foreach(json_mask, i, json_entry) { const char *name; - struct node *node; + struct vnode *node; struct vpath_source *ps = nullptr; name = json_string_value(json_entry); @@ -464,7 +464,7 @@ int path_parse(struct vpath *p, json_t *cfg, struct vlist *nodes) return -1; } - node = vlist_lookup_name(nodes, name); + node = vlist_lookup_name(nodes, name); if (!node) { p->logger->error("The 'mask' entry '{}' is not a valid node name", name); return -1; @@ -788,7 +788,7 @@ struct vlist * path_output_signals(struct vpath *p) return &p->signals; } -int path_uses_node(struct vpath *p, struct node *n) +int path_uses_node(struct vpath *p, struct vnode *n) { for (size_t i = 0; i < vlist_length(&p->destinations); i++) { struct vpath_destination *pd = (struct vpath_destination *) vlist_at(&p->destinations, i); diff --git a/lib/stats.cpp b/lib/stats.cpp index 417fbd4c5..e5b8d947a 100644 --- a/lib/stats.cpp +++ b/lib/stats.cpp @@ -155,7 +155,7 @@ void Stats::setupTable() table = std::make_shared(columns); } -void Stats::printPeriodic(FILE *f, enum Format fmt, struct node *n) const +void Stats::printPeriodic(FILE *f, enum Format fmt, struct vnode *n) const { switch (fmt) { case Format::HUMAN: diff --git a/lib/super_node.cpp b/lib/super_node.cpp index ef19a9f6b..913cd1f45 100644 --- a/lib/super_node.cpp +++ b/lib/super_node.cpp @@ -136,7 +136,7 @@ void SuperNode::parse(json_t *cfg) const char *name; json_t *json_node; json_object_foreach(json_nodes, name, json_node) { - struct node_type *nt; + struct vnode_type *nt; const char *type; ret = node_is_valid_name(name); @@ -151,7 +151,7 @@ void SuperNode::parse(json_t *cfg) if (!nt) throw ConfigError(json_node, "node-config-node-type", "Invalid node type: {}", type); - auto *n = new struct node; + auto *n = new struct vnode; if (!n) throw MemoryAllocationError(); @@ -226,7 +226,7 @@ void SuperNode::check() assert(state == State::INITIALIZED || state == State::PARSED || state == State::CHECKED); for (size_t i = 0; i < vlist_length(&nodes); i++) { - auto *n = (struct node *) vlist_at(&nodes, i); + auto *n = (struct vnode *) vlist_at(&nodes, i); ret = node_check(n); if (ret) @@ -249,7 +249,7 @@ void SuperNode::startNodeTypes() int ret; for (size_t i = 0; i < vlist_length(&nodes); i++) { - auto *n = (struct node *) vlist_at(&nodes, i); + auto *n = (struct vnode *) vlist_at(&nodes, i); ret = node_type_start(n->_vt, this); if (ret) @@ -277,7 +277,7 @@ void SuperNode::startNodes() int ret; for (size_t i = 0; i < vlist_length(&nodes); i++) { - auto *n = (struct node *) vlist_at(&nodes, i); + auto *n = (struct vnode *) vlist_at(&nodes, i); if (!node_is_enabled(n)) continue; @@ -309,7 +309,7 @@ void SuperNode::prepareNodes() int ret, refs; for (size_t i = 0; i < vlist_length(&nodes); i++) { - auto *n = (struct node *) vlist_at(&nodes, i); + auto *n = (struct vnode *) vlist_at(&nodes, i); refs = vlist_count(&paths, (cmp_cb_t) path_uses_node, n); if (refs <= 0) { @@ -402,7 +402,7 @@ void SuperNode::stopNodes() int ret; for (size_t i = 0; i < vlist_length(&nodes); i++) { - auto *n = (struct node *) vlist_at(&nodes, i); + auto *n = (struct vnode *) vlist_at(&nodes, i); ret = node_stop(n); if (ret) @@ -499,7 +499,7 @@ int SuperNode::periodic() } for (size_t i = 0; i < vlist_length(&nodes); i++) { - auto *n = (struct node *) vlist_at(&nodes, i); + auto *n = (struct vnode *) vlist_at(&nodes, i); if (n->state == State::STARTED) { #ifdef WITH_HOOKS diff --git a/src/villas-pipe.cpp b/src/villas-pipe.cpp index d01f6ac3c..d08489002 100644 --- a/src/villas-pipe.cpp +++ b/src/villas-pipe.cpp @@ -58,7 +58,7 @@ class PipeDirection { protected: struct pool pool; - struct node *node; + struct vnode *node; struct io *io; std::thread thread; @@ -67,7 +67,7 @@ protected: bool enabled; int limit; public: - PipeDirection(struct node *n, struct io *i, bool en = true, int lim = -1) : + PipeDirection(struct vnode *n, struct io *i, bool en = true, int lim = -1) : node(n), io(i), stop(false), @@ -114,7 +114,7 @@ public: class PipeSendDirection : public PipeDirection { public: - PipeSendDirection(struct node *n, struct io *i, bool en = true, int lim = -1) : + PipeSendDirection(struct vnode *n, struct io *i, bool en = true, int lim = -1) : PipeDirection(n, i, en, lim) { } @@ -184,7 +184,7 @@ leave: if (io_eof(io)) { class PipeReceiveDirection : public PipeDirection { public: - PipeReceiveDirection(struct node *n, struct io *i, bool en = true, int lim = -1) : + PipeReceiveDirection(struct vnode *n, struct io *i, bool en = true, int lim = -1) : PipeDirection(n, i, en, lim) { } @@ -396,7 +396,7 @@ check: if (optarg == endptr) { int ret; - struct node *node; + struct vnode *node; struct format_type *ft; logger->info("Logging level: {}", logging.getLevelName()); diff --git a/src/villas-signal.cpp b/src/villas-signal.cpp index d1cb5a727..d336b5f3b 100644 --- a/src/villas-signal.cpp +++ b/src/villas-signal.cpp @@ -67,7 +67,7 @@ public: protected: std::atomic stop; - struct node n; + struct vnode n; struct io io; struct pool q; @@ -213,7 +213,7 @@ check: if (optarg == endptr) { int ret; json_t *cfg; - struct node_type *nt; + struct vnode_type *nt; struct format_type *ft; struct sample *t; diff --git a/src/villas-test-rtt.cpp b/src/villas-test-rtt.cpp index 0ac08eb2c..fa7071792 100644 --- a/src/villas-test-rtt.cpp +++ b/src/villas-test-rtt.cpp @@ -177,7 +177,7 @@ check: if (optarg == endptr) if (!smp_send || !smp_recv) throw MemoryAllocationError(); - struct node *node; + struct vnode *node; if (!uri.empty()) sn.parse(uri); diff --git a/tests/unit/mapping.cpp b/tests/unit/mapping.cpp index 99d44ccab..6a565c9af 100644 --- a/tests/unit/mapping.cpp +++ b/tests/unit/mapping.cpp @@ -46,7 +46,7 @@ Test(mapping, parse_nodes) vlist_init(&nodes); for (unsigned i = 0; i < ARRAY_LEN(node_names); i++) { - struct node *n = new struct node; + struct vnode *n = new struct vnode; cr_assert_not_null(n); n->name = strdup(node_names[i]); @@ -67,41 +67,41 @@ Test(mapping, parse_nodes) ret = mapping_parse_str(&m, "apple.ts.origin", &nodes); cr_assert_eq(ret, 0); - cr_assert_eq(m.node, vlist_lookup_name(&nodes, "apple")); + cr_assert_eq(m.node, vlist_lookup_name(&nodes, "apple")); cr_assert_eq(m.type, MappingType::TIMESTAMP); cr_assert_eq(m.timestamp.type, MappingTimestampType::ORIGIN); ret = mapping_parse_str(&m, "cherry.stats.owd.mean", &nodes); cr_assert_eq(ret, 0); - cr_assert_eq(m.node, vlist_lookup_name(&nodes, "cherry")); + cr_assert_eq(m.node, vlist_lookup_name(&nodes, "cherry")); cr_assert_eq(m.type, MappingType::STATS); cr_assert_eq(m.stats.metric, Stats::Metric::OWD); cr_assert_eq(m.stats.type, Stats::Type::MEAN); ret = mapping_parse_str(&m, "carrot.data[1-2]", &nodes); cr_assert_eq(ret, 0); - cr_assert_eq(m.node, vlist_lookup_name(&nodes, "carrot")); + cr_assert_eq(m.node, vlist_lookup_name(&nodes, "carrot")); cr_assert_eq(m.type, MappingType::DATA); cr_assert_eq(m.data.offset, 1); cr_assert_eq(m.length, 2); ret = mapping_parse_str(&m, "carrot", &nodes); cr_assert_eq(ret, 0); - cr_assert_eq(m.node, vlist_lookup_name(&nodes, "carrot")); + cr_assert_eq(m.node, vlist_lookup_name(&nodes, "carrot")); cr_assert_eq(m.type, MappingType::DATA); cr_assert_eq(m.data.offset, 0); cr_assert_eq(m.length, -1); ret = mapping_parse_str(&m, "carrot.data[sole]", &nodes); cr_assert_eq(ret, 0); - cr_assert_eq(m.node, vlist_lookup_name(&nodes, "carrot")); + cr_assert_eq(m.node, vlist_lookup_name(&nodes, "carrot")); cr_assert_eq(m.type, MappingType::DATA); cr_assert_eq(m.data.offset, 1); cr_assert_eq(m.length, 1); ret = mapping_parse_str(&m, "carrot.data[sole-mio]", &nodes); cr_assert_eq(ret, 0); - cr_assert_eq(m.node, vlist_lookup_name(&nodes, "carrot")); + cr_assert_eq(m.node, vlist_lookup_name(&nodes, "carrot")); cr_assert_eq(m.type, MappingType::DATA); cr_assert_eq(m.data.offset, 1); cr_assert_eq(m.length, 2);