1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

refactor: struct node -> struct vnode

This commit is contained in:
Steffen Vogel 2020-08-25 21:00:52 +02:00
parent ac572d9d97
commit 3c13f67930
96 changed files with 620 additions and 620 deletions

View file

@ -26,7 +26,7 @@
#include <villas/api/request.hpp>
/* 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<struct node>(nodes, matches[1].str());
node = vlist_lookup_name<struct vnode>(nodes, matches[1].str());
if (!node)
throw BadRequest("Unknown node");
}
else {
node = vlist_lookup_uuid<struct node>(nodes, uuid);
node = vlist_lookup_uuid<struct vnode>(nodes, uuid);
if (!node)
throw BadRequest("No node found with with matching UUID");
}

View file

@ -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());
}

View file

@ -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);

View file

@ -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)
{

View file

@ -29,7 +29,7 @@
#include <villas/common.hpp>
/* 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. */

View file

@ -30,7 +30,7 @@
#include <villas/memory_type.h>
/* Forward declarations */
struct node;
struct vnode;
/** Descriptor of a memory block. Associated block always starts at
* &m + sizeof(struct memory_block). */

View file

@ -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);

View file

@ -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<villas::Stats> 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 *);
/** @} */

View file

@ -34,14 +34,14 @@
#include <villas/list.h>
/* 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);
/** @} */

View file

@ -33,7 +33,7 @@
#include <villas/memory.h>
/* 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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -34,7 +34,7 @@
#include <villas/timing.h>
/* 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[]);
/** @} */

View file

@ -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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -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[]);
/** @} */

View file

@ -33,7 +33,7 @@
#include <villas/io.h>
/* 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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -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[]);
/** @} */

View file

@ -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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -32,7 +32,7 @@
#include <villas/list.h>
/* 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);
/** @} */

View file

@ -33,7 +33,7 @@
#include <villas/pool.h>
/* 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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -43,7 +43,7 @@
#include <villas/task.hpp>
/* 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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -33,7 +33,7 @@
#include <villas/task.hpp>
/* 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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -37,7 +37,7 @@
#include <villas/list.h>
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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -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);
/** @} */

View file

@ -45,7 +45,7 @@
#include <villas/log.hpp>
/* 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.
*

View file

@ -36,7 +36,7 @@ struct vpath;
struct sample;
struct vpath_destination {
struct node *node;
struct vnode *node;
struct queue queue;
};

View file

@ -37,7 +37,7 @@ struct vpath;
struct sample;
struct vpath_source {
struct node *node;
struct vnode *node;
bool masked;

View file

@ -43,7 +43,7 @@ struct plugin {
union {
struct format_type format;
struct node_type node;
struct vnode_type node;
};
};

View file

@ -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;

View file

@ -43,7 +43,7 @@ extern "C" {
#include <villas/common.hpp>
/* 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<struct node>(&nodes, name);
return vlist_lookup_name<struct vnode>(&nodes, name);
}
struct vlist * getNodes()

View file

@ -35,7 +35,7 @@ namespace villas {
namespace node {
namespace api {
template<int (*A)(struct node *)>
template<int (*A)(struct vnode *)>
class NodeActionRequest : public NodeRequest {
public:

View file

@ -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");

View file

@ -52,7 +52,7 @@ public:
const auto &nodeName = matches[1].str();
struct vlist *nodes = session->getSuperNode()->getNodes();
struct node *node = vlist_lookup_name<struct node>(nodes, nodeName.c_str());
struct vnode *node = vlist_lookup_name<struct vnode>(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<StatsRequest, n, r, d> p;

View file

@ -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;

View file

@ -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));
}

View file

@ -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),

View file

@ -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);

View file

@ -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;

View file

@ -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),

View file

@ -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)
{ }

View file

@ -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),

View file

@ -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;

View file

@ -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;

View file

@ -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),

View file

@ -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)

View file

@ -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)

View file

@ -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)
{ }

View file

@ -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),

View file

@ -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);

View file

@ -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<struct node>(nodes, node);
me->node = vlist_lookup_name<struct vnode>(nodes, node);
if (!me->node) {
warning("Unknown node %s", node);
goto invalid_format;

View file

@ -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));

View file

@ -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<struct node>(all, str);
node = vlist_lookup_name<struct vnode>(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<struct node>(all, json_string_value(elm));
node = vlist_lookup_name<struct vnode>(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;

View file

@ -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);

View file

@ -29,7 +29,7 @@
#include <villas/node/config.h>
#include <villas/plugin.h>
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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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<struct node>(nodes, stats_sig->node_str);
stats_sig->node = vlist_lookup_name<struct vnode>(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;

View file

@ -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;

View file

@ -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;

View file

@ -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<struct node>(&p.node.instances, node);
c->node = vlist_lookup_name<struct vnode>(&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;

View file

@ -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;

View file

@ -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<struct node>(nodes, name);
node = vlist_lookup_name<struct vnode>(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);

View file

@ -155,7 +155,7 @@ void Stats::setupTable()
table = std::make_shared<Table>(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:

View file

@ -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

View file

@ -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());

View file

@ -67,7 +67,7 @@ public:
protected:
std::atomic<bool> 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;

View file

@ -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);

View file

@ -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<struct node>(&nodes, "apple"));
cr_assert_eq(m.node, vlist_lookup_name<struct vnode>(&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<struct node>(&nodes, "cherry"));
cr_assert_eq(m.node, vlist_lookup_name<struct vnode>(&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<struct node>(&nodes, "carrot"));
cr_assert_eq(m.node, vlist_lookup_name<struct vnode>(&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<struct node>(&nodes, "carrot"));
cr_assert_eq(m.node, vlist_lookup_name<struct vnode>(&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<struct node>(&nodes, "carrot"));
cr_assert_eq(m.node, vlist_lookup_name<struct vnode>(&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<struct node>(&nodes, "carrot"));
cr_assert_eq(m.node, vlist_lookup_name<struct vnode>(&nodes, "carrot"));
cr_assert_eq(m.type, MappingType::DATA);
cr_assert_eq(m.data.offset, 1);
cr_assert_eq(m.length, 2);