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

remove old plugin code

This commit is contained in:
Steffen Vogel 2021-06-21 16:11:42 -04:00
parent c3cd33779a
commit 00a9e92b0a
65 changed files with 644 additions and 895 deletions

2
common

@ -1 +1 @@
Subproject commit 6fb725374693af9cc8ac831bd12b3b504c391ca8
Subproject commit 574f4467cccc72a4fc71b078b6b28f3f9eb7b28c

View file

@ -50,14 +50,17 @@ enum class NodeFlags {
/** C++ like vtable construct for node_types */
struct vnode_type {
unsigned vectorize; /**< Maximal vector length supported by this node type. Zero is unlimited. */
const char *name;
const char *description;
unsigned vectorize; /**< Maximal vector length supported by this node type. Zero is unlimited. */
int flags;
enum State state; /**< State of this node-type. */
enum State state; /**< State of this node-type. */
struct vlist instances; /**< A list of all existing nodes of this type. */
size_t size; /**< Size of private data bock. @see node::_vd */
size_t size; /**< Size of private data bock. @see node::_vd */
size_t pool_size;
struct {
@ -259,6 +262,10 @@ int node_type_stop(struct vnode_type *vt);
/** Return a printable representation of the node-type. */
const char * node_type_name(struct vnode_type *vt);
struct vnode_type * node_type_lookup(const char *name);
struct vnode_type * node_type_lookup(const std::string &name);
using NodeTypeList = std::list<struct vnode_type *>;
extern NodeTypeList *node_types;
/** @} */

View file

@ -31,10 +31,12 @@
#include <amqp.h>
#include <villas/node.h>
#include <villas/list.h>
#include <villas/format.hpp>
/* Forward declarations */
struct vnode;
struct amqp_ssl_info {
int verify_peer;
int verify_hostname;

View file

@ -31,10 +31,12 @@
#include <comedilib.h>
#include <villas/node.h>
#include <villas/list.h>
#include <villas/timing.h>
/* Forward declarations */
struct vnode;
// whether to use read() or mmap() kernel interface
#define COMEDI_USE_READ (1)
//#define COMEDI_USE_READ (0)

View file

@ -33,7 +33,6 @@
#include <thread>
#include <villas/node.h>
#include <villas/pool.h>
#include <villas/task.hpp>
#include <villas/queue_signalled.h>
@ -41,6 +40,9 @@
#include <villas/format.hpp>
#include <villas/config.h>
/* Forward declarations */
struct vnode;
/* Include hard-coded Ethercat Bus configuration */
#include <villas/nodes/ethercat_config.hpp>

View file

@ -30,10 +30,12 @@
#pragma once
#include <villas/node/config.h>
#include <villas/node.h>
#include <villas/format.hpp>
#include <villas/timing.h>
/* Forward declarations */
struct vnode;
struct example {
/* Settings */
int setting1;

View file

@ -32,9 +32,11 @@
#include <cstdio>
#include <villas/format.hpp>
#include <villas/node.h>
#include <villas/task.hpp>
/* Forward declarations */
struct vnode;
#define FILE_MAX_PATHLEN 512
struct file {

View file

@ -30,7 +30,6 @@
#pragma once
#include <villas/node/config.h>
#include <villas/node.h>
#include <villas/format.hpp>
#include <villas/timing.h>
@ -38,6 +37,9 @@
#include <villas/fpga/node.hpp>
#include <villas/fpga/ips/dma.hpp>
/* Forward declarations */
struct vnode;
using namespace villas;
#define FPGA_DMA_VLNV

View file

@ -41,10 +41,12 @@
#include <libiec61850/goose_receiver.h>
#include <libiec61850/sv_subscriber.h>
#include <villas/node.h>
#include <villas/list.h>
#include <villas/signal.h>
/* Forward declarations */
struct vnode;
enum class IEC61850Type {
/* According to IEC 61850-7-2 */
BOOLEAN,

View file

@ -36,10 +36,12 @@
#include <villas/queue_signalled.h>
#include <villas/pool.h>
#include <villas/node.h>
#include <villas/list.h>
#include <villas/nodes/iec61850.hpp>
/* Forward declarations */
struct vnode;
struct iec61850_sv {
char *interface;
int app_id;

View file

@ -29,12 +29,14 @@
#pragma once
#include <villas/node.h>
#include <villas/pool.h>
#include <villas/format.hpp>
#include <villas/queue_signalled.h>
#include <rdma/rdma_cma.h>
/* Forward declarations */
struct vnode;
/* Constants */
#define META_SIZE 24
#define GRH_SIZE 40

View file

@ -31,11 +31,12 @@
#include <librdkafka/rdkafka.h>
#include <villas/node.h>
#include <villas/pool.h>
#include <villas/format.hpp>
#include <villas/queue_signalled.h>
/* Forward declarations */
struct vnode;
struct kafka {
struct queue_signalled queue;

View file

@ -29,12 +29,12 @@
#pragma once
#include <villas/node.h>
#include <villas/pool.h>
#include <villas/format.hpp>
#include <villas/queue_signalled.h>
/* Forward declarations */
struct vnode;
struct mosquitto;
struct mqtt {

View file

@ -29,10 +29,12 @@
#pragma once
#include <villas/node.h>
#include <villas/list.h>
#include <villas/format.hpp>
/* Forward declarations */
struct vnode;
/** The maximum length of a packet which contains stuct msg. */
#define NANOMSG_MAX_PACKET_LEN 1500

View file

@ -39,7 +39,6 @@
#include <jansson.h>
#include <villas/list.h>
#include <villas/node.h>
#include <villas/task.hpp>
/* Forward declarations */

View file

@ -31,9 +31,11 @@
#include <pthread.h>
#include <villas/node.h>
#include <villas/sample.h>
/* Forward declarations */
struct vnode;
extern "C" {
#include <OpalGenAsyncParamCtrl.h>
}

View file

@ -34,7 +34,6 @@
#include <fstream>
#include <villas/node.h>
#include <villas/list.h>
#include <villas/log.hpp>
#include <villas/format.hpp>
@ -43,6 +42,9 @@
#include <villas/hooks/decimate.hpp>
#include <villas/dsp/pid.hpp>
/* Forward declarations */
struct vnode;
extern "C" {
#include <re/re_sa.h>
#include <re/re_rtp.h>

View file

@ -29,13 +29,15 @@
#pragma once
#include <villas/node.h>
#include <villas/memory.h>
#include <villas/pool.h>
#include <villas/queue.h>
#include <villas/node/config.h>
#include <villas/shmem.h>
/* Forward declarations */
struct vnode;
/** Node-type for shared memory communication.
* @see node_type
*/

View file

@ -30,10 +30,12 @@
#pragma once
#include <villas/node/config.h>
#include <villas/node.h>
#include <villas/socket_addr.h>
#include <villas/format.hpp>
/* Forward declarations */
struct vnode;
/** The maximum length of a packet which contains stuct msg. */
#define SOCKET_INITIAL_BUFFER_LEN (64*1024)

View file

@ -31,11 +31,13 @@
#include <jansson.h>
#include <villas/node.h>
#include <villas/stats.hpp>
#include <villas/task.hpp>
#include <villas/list.h>
/* Forward declarations */
struct vnode;
struct stats_node_signal {
struct vnode *node;
char *node_str;

View file

@ -30,12 +30,14 @@
#pragma once
#include <villas/node/config.h>
#include <villas/node.h>
#include <villas/format.hpp>
#include <villas/timing.h>
#include <villas/usb.hpp>
#include <villas/log.hpp>
/* Forward declarations */
struct vnode;
class TEMPerDevice : public villas::usb::Device {
protected:

View file

@ -29,7 +29,6 @@
#pragma once
#include <villas/node.h>
#include <villas/pool.h>
#include <villas/queue_signalled.h>
#include <villas/common.hpp>
@ -37,6 +36,9 @@
#include <villas/format.hpp>
#include <villas/node/config.h>
/* Forward declarations */
struct vnode;
#define DEFAULT_WEBSOCKET_QUEUE_LENGTH (DEFAULT_QUEUE_LENGTH * 64)
#define DEFAULT_WEBSOCKET_SAMPLE_LENGTH DEFAULT_SAMPLE_LENGTH

View file

@ -1,56 +0,0 @@
/** Loadable / plugin support.
*
* @file
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#pragma once
#include <villas/common.hpp>
#include <villas/utils.hpp>
#include <villas/node_type.h>
extern struct vlist plugins;
enum PluginType {
NODE
};
struct plugin {
const char *name;
const char *description;
enum PluginType type;
union {
struct vnode_type node;
};
};
/** Return a pointer to the plugin structure */
#define plugin(vt) ((struct plugin *) ((char *) (vt) - offsetof(struct plugin, node)))
#define plugin_name(vt) plugin(vt)->name
#define plugin_description(vt) plugin(vt)->description
void plugin_dump(enum PluginType type);
/** Find registered and loaded plugin with given name and type. */
struct plugin * plugin_lookup(enum PluginType type, const char *name);

View file

@ -60,7 +60,6 @@ set(LIB_SRC
path_destination.cpp
path_source.cpp
path.cpp
plugin.cpp
pool.cpp
queue_signalled.cpp
queue.cpp

View file

@ -21,7 +21,6 @@
*********************************************************************************/
#include <villas/config.h>
#include <villas/plugin.h>
#include <villas/hook.hpp>
#include <villas/format.hpp>
#include <villas/api/request.hpp>
@ -75,17 +74,8 @@ public:
json_array_append_new(json_nodes, json_name);
}
#else
for (size_t i = 0; i < vlist_length(&plugins); i++) {
struct plugin *p = (struct plugin *) vlist_at(&plugins, i);
json_t *json_name;
switch(p->type) {
case PluginType::NODE:
json_name = json_string(p->name);
json_array_append_new(json_nodes, json_name);
break;
}
}
for (auto *vt : *node_types)
json_array_append_new(json_nodes, json_string(vt->name));
#endif
auto *json_capabilities = json_pack("{ s: o, s: o, s: o, s: o }",

View file

@ -22,7 +22,6 @@
#include <jansson.h>
#include <villas/plugin.h>
#include <villas/node.h>
#include <villas/super_node.hpp>
#include <villas/utils.hpp>

View file

@ -22,7 +22,6 @@
#include <jansson.h>
#include <villas/plugin.h>
#include <villas/path.h>
#include <villas/super_node.hpp>
#include <villas/utils.hpp>

View file

@ -34,7 +34,6 @@
#include <villas/path.h>
#include <villas/sample.h>
#include <villas/format.hpp>
#include <villas/plugin.h>
namespace villas {
namespace node {

View file

@ -32,7 +32,6 @@
#include <villas/path.h>
#include <villas/sample.h>
#include <villas/format.hpp>
#include <villas/plugin.h>
namespace villas {
namespace node {

View file

@ -27,10 +27,12 @@
#include <villas/utils.hpp>
#include <villas/colors.hpp>
#include <villas/node/config.h>
#include <villas/plugin.h>
using namespace villas;
/** Global list of all known plugins */
std::list<struct vnode_type *> *node_types = nullptr;
int node_type_start(struct vnode_type *vt, villas::node::SuperNode *sn)
{
int ret;
@ -39,7 +41,7 @@ int node_type_start(struct vnode_type *vt, villas::node::SuperNode *sn)
return 0;
auto logger = logging.get(fmt::format("node:{}", node_type_name(vt)));
logger->info("Initializing node type which is used by {} nodes", vlist_length(&vt->instances));
logger->info("Initializing node type which is used by {} nodes", vt->instances.size());
ret = vt->type.start ? vt->type.start(sn) : 0;
if (ret == 0)
@ -67,16 +69,15 @@ int node_type_stop(struct vnode_type *vt)
const char * node_type_name(struct vnode_type *vt)
{
return plugin_name(vt);
return vt->name;
}
struct vnode_type * node_type_lookup(const char *name)
struct vnode_type * node_type_lookup(const std::string &name)
{
struct plugin *p;
for (auto *vt : *node_types) {
if (name == vt->name)
return vt;
}
p = plugin_lookup(PluginType::NODE, name);
if (!p)
return nullptr;
return &p->node;
return nullptr;
}

View file

@ -25,7 +25,7 @@
#include <amqp_ssl_socket.h>
#include <amqp_tcp_socket.h>
#include <villas/plugin.h>
#include <villas/node.h>
#include <villas/nodes/amqp.hpp>
#include <villas/utils.hpp>
#include <villas/exceptions.hpp>
@ -388,33 +388,28 @@ int amqp_destroy(struct vnode *n)
return 0;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "amqp";
p.description = "Advanced Message Queueing Protoocl (rabbitmq-c)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct amqp);
p.node.destroy = amqp_destroy;
p.node.parse = amqp_parse;
p.node.print = amqp_print;
p.node.start = amqp_start;
p.node.stop = amqp_stop;
p.node.read = amqp_read;
p.node.write = amqp_write;
p.node.poll_fds = amqp_poll_fds;
p.name = "amqp";
p.description = "Advanced Message Queueing Protoocl (rabbitmq-c)";
p.vectorize = 0;
p.size = sizeof(struct amqp);
p.destroy = amqp_destroy;
p.parse = amqp_parse;
p.print = amqp_print;
p.start = amqp_start;
p.stop = amqp_stop;
p.read = amqp_read;
p.write = amqp_write;
p.poll_fds = amqp_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -34,17 +34,16 @@
#include <linux/can/raw.h>
#include <linux/sockios.h>
#include <villas/node.h>
#include <villas/nodes/can.hpp>
#include <villas/utils.hpp>
#include <villas/sample.h>
#include <villas/plugin.h>
#include <villas/signal.h>
#include <villas/node.h>
#include <villas/exceptions.hpp>
/* Forward declarations */
static struct plugin p;
static struct vnode_type p;
using namespace villas;
using namespace villas::node;
@ -525,30 +524,24 @@ int can_poll_fds(struct vnode *n, int fds[])
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "can";
p.description = "Receive CAN messages using the socketCAN driver";
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct can);
p.node.init = can_init;
p.node.destroy = can_destroy;
p.node.prepare = can_prepare;
p.node.parse = can_parse;
p.node.print = can_print;
p.node.check = can_check;
p.node.start = can_start;
p.node.stop = can_stop;
p.node.read = can_read;
p.node.write = can_write;
p.node.poll_fds = can_poll_fds;
p.name = "can";
p.description = "Receive CAN messages using the socketCAN driver";
p.vectorize = 0;
p.size = sizeof(struct can);
p.init = can_init;
p.destroy = can_destroy;
p.prepare = can_prepare;
p.parse = can_parse;
p.print = can_print;
p.check = can_check;
p.start = can_start;
p.stop = can_stop;
p.read = can_read;
p.write = can_write;
p.poll_fds = can_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
if (plugins.state != State::DESTROYED)
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -27,7 +27,7 @@
#include <comedilib.h>
#include <comedi_errno.h>
#include <villas/plugin.h>
#include <villas/node.h>
#include <villas/nodes/comedi.hpp>
#include <villas/utils.hpp>
#include <villas/exceptions.hpp>
@ -974,30 +974,24 @@ int comedi_poll_fds(struct vnode *n, int fds[])
return 0;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "comedi";
p.description = "Comedi-compatible DAQ/ADC cards";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct comedi);
p.node.parse = comedi_parse;
p.node.print = comedi_print;
p.node.start = comedi_start;
p.node.stop = comedi_stop;
p.node.read = comedi_read;
p.node.write = comedi_write;
p.node.poll_fds = comedi_poll_fds;
p.name = "comedi";
p.description = "Comedi-compatible DAQ/ADC cards";
p.vectorize = 0;
p.size = sizeof(struct comedi);
p.parse = comedi_parse;
p.print = comedi_print;
p.start = comedi_start;
p.stop = comedi_stop;
p.read = comedi_read;
p.write = comedi_write;
p.poll_fds = comedi_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -26,15 +26,15 @@
#include <villas/super_node.hpp>
#include <villas/utils.hpp>
#include <villas/plugin.h>
#include <villas/exceptions.hpp>
#include <villas/node.h>
#include <villas/nodes/ethercat.hpp>
using namespace villas;
using namespace villas::node;
/* Forward declartions */
static struct plugin p;
static struct vnode_type p;
/* Constants */
#define NSEC_PER_SEC (1000000000)
@ -440,32 +440,27 @@ int ethercat_poll_fds(struct vnode *n, int *fds)
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "ethercat";
p.description = "Send and receive samples of an ethercat connection";
p.type = PluginType::NODE;
p.node.vectorize = 1; /* we only process a single sample per call */
p.node.size = sizeof(struct ethercat);
p.node.type.start = ethercat_type_start;
p.node.type.stop = ethercat_type_stop;
p.node.parse = ethercat_parse;
p.node.print = ethercat_print;
p.node.check = ethercat_check;
p.node.init = ethercat_init;
p.node.destroy = ethercat_destroy;
p.node.prepare = ethercat_prepare;
p.node.start = ethercat_start;
p.node.stop = ethercat_stop;
p.node.read = ethercat_read;
p.node.write = ethercat_write;
p.node.poll_fds = ethercat_poll_fds;
p.name = "ethercat";
p.description = "Send and receive samples of an ethercat connection";
p.vectorize = 1; /* we only process a single sample per call */
p.size = sizeof(struct ethercat);
p.type.start = ethercat_type_start;
p.type.stop = ethercat_type_stop;
p.parse = ethercat_parse;
p.print = ethercat_print;
p.check = ethercat_check;
p.init = ethercat_init;
p.destroy = ethercat_destroy;
p.prepare = ethercat_prepare;
p.start = ethercat_start;
p.stop = ethercat_stop;
p.read = ethercat_read;
p.write = ethercat_write;
p.poll_fds = ethercat_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
if (!node_types)
node_types = new NodeTypeList();
node_types->push_back(&p);
}

View file

@ -20,16 +20,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#include <villas/node.h>
#include <villas/nodes/example.hpp>
#include <villas/utils.hpp>
#include <villas/sample.h>
#include <villas/plugin.h>
#include <villas/exceptions.hpp>
#include <villas/super_node.hpp>
#include <villas/exceptions.hpp>
/* Forward declartions */
static struct plugin p;
static struct vnode_type p;
using namespace villas;
using namespace villas::node;
@ -235,34 +235,28 @@ __attribute__((constructor(110)))
static void register_plugin() {
p.name = "example";
p.description = "An example for staring new node-type implementations";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct example);
p.node.type.start = example_type_start;
p.node.type.stop = example_type_stop;
p.node.init = example_init;
p.node.destroy = example_destroy;
p.node.prepare = example_prepare;
p.node.parse = example_parse;
p.node.print = example_print;
p.node.check = example_check;
p.node.start = example_start;
p.node.stop = example_stop;
p.node.pause = example_pause;
p.node.resume = example_resume;
p.node.read = example_read;
p.node.write = example_write;
p.node.reverse = example_reverse;
p.node.poll_fds = example_poll_fds;
p.node.netem_fds = example_netem_fds;
p.vectorize = 0;
p.size = sizeof(struct example);
p.type.start = example_type_start;
p.type.stop = example_type_stop;
p.init = example_init;
p.destroy = example_destroy;
p.prepare = example_prepare;
p.parse = example_parse;
p.print = example_print;
p.check = example_check;
p.start = example_start;
p.stop = example_stop;
p.pause = example_pause;
p.resume = example_resume;
p.read = example_read;
p.write = example_write;
p.reverse = example_reverse;
p.poll_fds = example_poll_fds;
p.netem_fds = example_netem_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -22,10 +22,10 @@
#include <string>
#include <villas/node.h>
#include <villas/plugin.h>
#include <villas/node/config.h>
#include <villas/node.h>
#include <villas/nodes/exec.hpp>
#include <villas/utils.hpp>
#include <villas/node/exceptions.hpp>
using namespace villas;
@ -244,32 +244,26 @@ int exec_poll_fds(struct vnode *n, int fds[])
return 1;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "exec";
p.description = "run subprocesses with stdin/stdout communication";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct exec);
p.node.parse = exec_parse;
p.node.print = exec_print;
p.node.prepare = exec_prepare;
p.node.init = exec_init;
p.node.destroy = exec_destroy;
p.node.stop = exec_stop;
p.node.read = exec_read;
p.node.write = exec_write;
p.node.poll_fds = exec_poll_fds;
p.name = "exec";
p.description = "run subprocesses with stdin/stdout communication";
p.vectorize = 0;
p.size = sizeof(struct exec);
p.parse = exec_parse;
p.print = exec_print;
p.prepare = exec_prepare;
p.init = exec_init;
p.destroy = exec_destroy;
p.stop = exec_stop;
p.read = exec_read;
p.write = exec_write;
p.poll_fds = exec_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -27,11 +27,11 @@
#include <sys/stat.h>
#include <cerrno>
#include <villas/node.h>
#include <villas/nodes/file.hpp>
#include <villas/utils.hpp>
#include <villas/timing.h>
#include <villas/queue.h>
#include <villas/plugin.h>
#include <villas/format.hpp>
#include <villas/exceptions.hpp>
@ -475,32 +475,26 @@ int file_destroy(struct vnode *n)
return 0;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "file";
p.description = "support for file log / replay node type";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 1;
p.node.size = sizeof(struct file);
p.node.init = file_init;
p.node.destroy = file_destroy;
p.node.parse = file_parse;
p.node.print = file_print;
p.node.start = file_start;
p.node.stop = file_stop;
p.node.read = file_read;
p.node.write = file_write;
p.node.poll_fds = file_poll_fds;
p.name = "file";
p.description = "support for file log / replay node type";
p.vectorize = 1;
p.size = sizeof(struct file);
p.init = file_init;
p.destroy = file_destroy;
p.parse = file_parse;
p.print = file_print;
p.start = file_start;
p.stop = file_stop;
p.read = file_read;
p.write = file_write;
p.poll_fds = file_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -27,12 +27,12 @@
#include <algorithm>
#include <jansson.h>
#include <villas/node.h>
#include <villas/nodes/fpga.hpp>
#include <villas/log.hpp>
#include <villas/utils.hpp>
#include <villas/exceptions.hpp>
#include <villas/sample.h>
#include <villas/plugin.h>
#include <villas/super_node.hpp>
#include <villas/fpga/core.hpp>
@ -40,7 +40,7 @@
#include <villas/fpga/ips/dma.hpp>
/* Forward declartions */
static struct plugin p;
static struct vnode_type p;
using namespace villas;
using namespace villas::node;
@ -328,33 +328,27 @@ int fpga_poll_fds(struct vnode *n, int fds[])
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "fpga";
p.description = "Communicate with VILLASfpga Xilinx FPGA boards";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 1;
p.node.size = sizeof(struct fpga);
p.node.type.start = fpga_type_start;
p.node.type.stop = fpga_type_stop;
p.node.init = fpga_init;
p.node.destroy = fpga_destroy;
p.node.prepare = fpga_prepare;
p.node.parse = fpga_parse;
p.node.print = fpga_print;
p.node.check = fpga_check;
p.node.start = fpga_start;
p.node.stop = fpga_stop;
p.node.read = fpga_read;
p.node.write = fpga_write;
p.node.poll_fds = fpga_poll_fds;
p.name = "fpga";
p.description = "Communicate with VILLASfpga Xilinx FPGA boards";
p.vectorize = 1;
p.size = sizeof(struct fpga);
p.start = fpga_type_start;
p.stop = fpga_type_stop;
p.init = fpga_init;
p.destroy = fpga_destroy;
p.prepare = fpga_prepare;
p.parse = fpga_parse;
p.print = fpga_print;
p.check = fpga_check;
p.start = fpga_start;
p.stop = fpga_stop;
p.read = fpga_read;
p.write = fpga_write;
p.poll_fds = fpga_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
if (!node_types)
node_types = new NodeTypeList();
node_types->push_back(&p);
}
__attribute__((destructor(110)))
static void deregister_plugin() {
if (plugins.state != State::DESTROYED)
vlist_remove_all(&plugins, &p);
}

View file

@ -24,9 +24,10 @@
#include <pthread.h>
#include <unistd.h>
#include <villas/node.h>
#include <villas/nodes/iec61850_sv.hpp>
#include <villas/plugin.h>
#include <villas/signal.h>
#include <villas/utils.hpp>
#include <villas/exceptions.hpp>
#define CONFIG_SV_DEFAULT_APPID 0x4000

View file

@ -27,7 +27,6 @@
#include <unistd.h>
#include <villas/nodes/iec61850_sv.hpp>
#include <villas/plugin.h>
#define CONFIG_SV_DEFAULT_APPID 0x4000
#define CONFIG_SV_DEFAULT_DST_ADDRESS CONFIG_GOOSE_DEFAULT_DST_ADDRESS
@ -476,35 +475,29 @@ int iec61850_sv_poll_fds(struct vnode *n, int fds[])
return 1;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "iec61850-9-2";
p.description = "IEC 61850-9-2 (Sampled Values)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct iec61850_sv);
p.node.type.start = iec61850_type_start;
p.node.type.stop = iec61850_type_stop;
p.node.destroy = iec61850_sv_destroy;
p.node.parse = iec61850_sv_parse;
p.node.print = iec61850_sv_print;
p.node.start = iec61850_sv_start;
p.node.stop = iec61850_sv_stop;
p.node.read = iec61850_sv_read;
p.node.write = iec61850_sv_write;
p.node.poll_fds = iec61850_sv_poll_fds;
p.name = "iec61850-9-2";
p.description = "IEC 61850-9-2 (Sampled Values)";
p.vectorize = 0;
p.size = sizeof(struct iec61850_sv);
p.start = iec61850_type_start;
p.stop = iec61850_type_stop;
p.destroy = iec61850_sv_destroy;
p.parse = iec61850_sv_parse;
p.print = iec61850_sv_print;
p.start = iec61850_sv_start;
p.stop = iec61850_sv_stop;
p.read = iec61850_sv_read;
p.write = iec61850_sv_write;
p.poll_fds = iec61850_sv_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}
#endif /* CONFIG_IEC61850_SAMPLED_VALUES_SUPPORT */

View file

@ -26,8 +26,8 @@
#include <netdb.h>
#include <villas/node/config.h>
#include <villas/node.h>
#include <villas/nodes/infiniband.hpp>
#include <villas/plugin.h>
#include <villas/utils.hpp>
#include <villas/memory.h>
#include <villas/memory/ib.h>
@ -1000,34 +1000,28 @@ int ib_write(struct vnode *n, struct sample * const smps[], unsigned cnt)
return sent;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "infiniband";
p.description = "Infiniband interface (libibverbs, librdmacm)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct infiniband);
p.node.pool_size = 8192;
p.node.destroy = ib_destroy;
p.node.parse = ib_parse;
p.node.check = ib_check;
p.node.print = ib_print;
p.node.start = ib_start;
p.node.stop = ib_stop;
p.node.read = ib_read;
p.node.write = ib_write;
p.node.reverse = ib_reverse;
p.node.memory_type = memory_ib;
p.name = "infiniband";
p.description = "Infiniband interface (libibverbs, librdmacm)";
p.vectorize = 0;
p.size = sizeof(struct infiniband);
p.pool_size = 8192;
p.destroy = ib_destroy;
p.parse = ib_parse;
p.check = ib_check;
p.print = ib_print;
p.start = ib_start;
p.stop = ib_stop;
p.read = ib_read;
p.write = ib_write;
p.reverse = ib_reverse;
p.memory_type = memory_ib;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -26,12 +26,13 @@
#include <sys/socket.h>
#include <netdb.h>
#include <villas/node.h>
#include <villas/plugin.h>
#include <villas/signal.h>
#include <villas/sample.h>
#include <villas/node/config.h>
#include <villas/node.h>
#include <villas/nodes/influxdb.hpp>
#include <villas/memory.h>
#include <villas/utils.hpp>
#include <villas/exceptions.hpp>
using namespace villas;
@ -214,28 +215,22 @@ char * influxdb_print(struct vnode *n)
return buf;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "influxdb";
p.description = "Write results to InfluxDB";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct influxdb);
p.node.parse = influxdb_parse;
p.node.print = influxdb_print;
p.node.start = influxdb_open;
p.node.stop = influxdb_close;
p.node.write = influxdb_write;
p.name = "influxdb";
p.description = "Write results to InfluxDB";
p.vectorize = 0;
p.size = sizeof(struct influxdb);
p.parse = influxdb_parse;
p.print = influxdb_print;
p.start = influxdb_open;
p.stop = influxdb_close;
p.write = influxdb_write;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -24,8 +24,8 @@
#include <sys/syslog.h>
#include <librdkafka/rdkafkacpp.h>
#include <villas/node.h>
#include <villas/nodes/kafka.hpp>
#include <villas/plugin.h>
#include <villas/utils.hpp>
#include <villas/exceptions.hpp>
@ -576,38 +576,33 @@ int kafka_poll_fds(struct vnode *n, int fds[])
return 1;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "kafka";
p.description = "Kafka event message streaming (rdkafka)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct kafka);
p.node.type.start = kafka_type_start;
p.node.type.stop = kafka_type_stop;
p.node.destroy = kafka_destroy;
p.node.prepare = kafka_prepare;
p.node.parse = kafka_parse;
p.node.prepare = kafka_prepare;
p.node.print = kafka_print;
p.node.init = kafka_init;
p.node.destroy = kafka_destroy;
p.node.start = kafka_start;
p.node.stop = kafka_stop;
p.node.read = kafka_read;
p.node.write = kafka_write;
p.node.reverse = kafka_reverse;
p.node.poll_fds = kafka_poll_fds;
p.instances.state = State::DESTROYED;
p.vectorize = 0;
p.size = sizeof(struct kafka);
p.start = kafka_type_start;
p.stop = kafka_type_stop;
p.destroy = kafka_destroy;
p.prepare = kafka_prepare;
p.parse = kafka_parse;
p.prepare = kafka_prepare;
p.print = kafka_print;
p.init = kafka_init;
p.destroy = kafka_destroy;
p.start = kafka_start;
p.stop = kafka_stop;
p.read = kafka_read;
p.write = kafka_write;
p.reverse = kafka_reverse;
p.poll_fds = kafka_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -22,18 +22,18 @@
#include <cstring>
#include <villas/node.h>
#include <villas/plugin.h>
#include <villas/node/config.h>
#include <villas/node.h>
#include <villas/nodes/loopback.hpp>
#include <villas/exceptions.hpp>
#include <villas/memory.h>
#include <villas/utils.hpp>
using namespace villas;
using namespace villas::node;
using namespace villas::utils;
static struct plugin p;
static struct vnode_type p;
int loopback_init(struct vnode *n)
{
@ -143,28 +143,22 @@ int loopback_poll_fds(struct vnode *n, int fds[])
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "loopback";
p.description = "Loopback to connect multiple paths";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.flags = 0;
p.node.size = sizeof(struct loopback);
p.node.parse = loopback_parse;
p.node.print = loopback_print;
p.node.prepare = loopback_prepare;
p.node.init = loopback_init;
p.node.destroy = loopback_destroy;
p.node.read = loopback_read;
p.node.write = loopback_write;
p.node.poll_fds = loopback_poll_fds;
p.name = "loopback";
p.description = "Loopback to connect multiple paths";
p.vectorize = 0;
p.flags = 0;
p.size = sizeof(struct loopback);
p.parse = loopback_parse;
p.print = loopback_print;
p.prepare = loopback_prepare;
p.init = loopback_init;
p.destroy = loopback_destroy;
p.read = loopback_read;
p.write = loopback_write;
p.poll_fds = loopback_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -22,18 +22,16 @@
#include <cstring>
#include <villas/node.h>
#include <villas/plugin.h>
#include <villas/node/config.h>
#include <villas/node.h>
#include <villas/nodes/loopback_internal.hpp>
#include <villas/exceptions.hpp>
#include <villas/memory.h>
using namespace villas;
using namespace villas::node;
using namespace villas::utils;
static struct plugin p;
static struct vnode_type p;
int loopback_internal_init(struct vnode *n)
{
@ -108,7 +106,7 @@ struct vnode * loopback_internal_create(struct vnode *orig)
if (!n)
throw MemoryAllocationError();
ret = node_init(n, &p.node);
ret = node_init(n, &p);
if (ret)
return nullptr;
@ -123,26 +121,20 @@ struct vnode * loopback_internal_create(struct vnode *orig)
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "loopback_internal";
p.description = "internal loopback to connect multiple paths";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.flags = (int) NodeFlags::PROVIDES_SIGNALS | (int) NodeFlags::INTERNAL;
p.node.size = sizeof(struct loopback_internal);
p.node.prepare = loopback_internal_prepare;
p.node.init = loopback_internal_init;
p.node.destroy = loopback_internal_destroy;
p.node.read = loopback_internal_read;
p.node.write = loopback_internal_write;
p.node.poll_fds = loopback_internal_poll_fds;
p.name = "loopback_internal";
p.description = "internal loopback to connect multiple paths";
p.vectorize = 0;
p.flags = (int) NodeFlags::PROVIDES_SIGNALS | (int) NodeFlags::INTERNAL;
p.size = sizeof(struct loopback_internal);
p.prepare = loopback_internal_prepare;
p.init = loopback_internal_init;
p.destroy = loopback_internal_destroy;
p.read = loopback_internal_read;
p.write = loopback_internal_write;
p.poll_fds = loopback_internal_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -23,8 +23,8 @@
#include <cstring>
#include <mosquitto.h>
#include <villas/node.h>
#include <villas/nodes/mqtt.hpp>
#include <villas/plugin.h>
#include <villas/utils.hpp>
#include <villas/exceptions.hpp>
@ -559,39 +559,33 @@ int mqtt_poll_fds(struct vnode *n, int fds[])
return 1;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "mqtt";
p.description = "Message Queuing Telemetry Transport (libmosquitto)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct mqtt);
p.node.type.start = mqtt_type_start;
p.node.type.stop = mqtt_type_stop;
p.node.destroy = mqtt_destroy;
p.node.prepare = mqtt_prepare;
p.node.parse = mqtt_parse;
p.node.check = mqtt_check;
p.node.prepare = mqtt_prepare;
p.node.print = mqtt_print;
p.node.init = mqtt_init;
p.node.destroy = mqtt_destroy;
p.node.start = mqtt_start;
p.node.stop = mqtt_stop;
p.node.read = mqtt_read;
p.node.write = mqtt_write;
p.node.reverse = mqtt_reverse;
p.node.poll_fds = mqtt_poll_fds;
p.name = "mqtt";
p.description = "Message Queuing Telemetry Transport (libmosquitto)";
p.vectorize = 0;
p.size = sizeof(struct mqtt);
p.type.start = mqtt_type_start;
p.type.stop = mqtt_type_stop;
p.destroy = mqtt_destroy;
p.prepare = mqtt_prepare;
p.parse = mqtt_parse;
p.check = mqtt_check;
p.prepare = mqtt_prepare;
p.print = mqtt_print;
p.init = mqtt_init;
p.destroy = mqtt_destroy;
p.start = mqtt_start;
p.stop = mqtt_stop;
p.read = mqtt_read;
p.write = mqtt_write;
p.reverse = mqtt_reverse;
p.poll_fds = mqtt_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -24,7 +24,7 @@
#include <nanomsg/pubsub.h>
#include <cstring>
#include <villas/plugin.h>
#include <villas/node.h>
#include <villas/nodes/nanomsg.hpp>
#include <villas/utils.hpp>
#include <villas/exceptions.hpp>
@ -284,33 +284,27 @@ int nanomsg_netem_fds(struct vnode *n, int fds[])
return 1;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "nanomsg";
p.description = "scalability protocols library (libnanomsg)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct nanomsg);
p.node.type.stop = nanomsg_type_stop;
p.node.parse = nanomsg_parse;
p.node.print = nanomsg_print;
p.node.start = nanomsg_start;
p.node.stop = nanomsg_stop;
p.node.read = nanomsg_read;
p.node.write = nanomsg_write;
p.node.reverse = nanomsg_reverse;
p.node.poll_fds = nanomsg_poll_fds;
p.node.netem_fds = nanomsg_netem_fds;
p.name = "nanomsg";
p.description = "scalability protocols library (libnanomsg)";
p.vectorize = 0;
p.size = sizeof(struct nanomsg);
p.type.stop = nanomsg_type_stop;
p.parse = nanomsg_parse;
p.print = nanomsg_print;
p.start = nanomsg_start;
p.stop = nanomsg_stop;
p.read = nanomsg_read;
p.write = nanomsg_write;
p.reverse = nanomsg_reverse;
p.poll_fds = nanomsg_poll_fds;
p.netem_fds = nanomsg_netem_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -31,12 +31,12 @@
#include <openssl/opensslv.h>
#include <curl/curl.h>
#include <villas/node.h>
#include <villas/nodes/ngsi.hpp>
#include <villas/utils.hpp>
#include <villas/super_node.hpp>
#include <villas/exceptions.hpp>
#include <villas/timing.h>
#include <villas/plugin.h>
#include <villas/node/config.h>
using namespace villas;
@ -846,39 +846,33 @@ int ngsi_reverse(struct vnode *n)
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "ngsi";
p.description = "OMA Next Generation Services Interface 10 (libcurl, libjansson)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
#ifdef NGSI_VECTORS
p.node.vectorize = 0, /* unlimited */
p.vectorize = 0, /* unlimited */
#else
p.node.vectorize = 1,
p.vectorize = 1,
#endif
p.node.size = sizeof(struct ngsi);
p.node.type.start = ngsi_type_start;
p.node.type.stop = ngsi_type_stop;
p.node.init = ngsi_init;
p.node.destroy = ngsi_destroy;
p.node.parse = ngsi_parse;
p.node.print = ngsi_print;
p.node.start = ngsi_start;
p.node.stop = ngsi_stop;
p.node.read = ngsi_read;
p.node.write = ngsi_write;
p.node.poll_fds = ngsi_poll_fds;
p.node.reverse = ngsi_reverse;
p.size = sizeof(struct ngsi);
p.type.start = ngsi_type_start;
p.type.stop = ngsi_type_stop;
p.init = ngsi_init;
p.destroy = ngsi_destroy;
p.parse = ngsi_parse;
p.print = ngsi_print;
p.start = ngsi_start;
p.stop = ngsi_stop;
p.read = ngsi_read;
p.write = ngsi_write;
p.poll_fds = ngsi_poll_fds;
p.reverse = ngsi_reverse;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -30,9 +30,9 @@
#include <cmath>
#include <vector>
#include <villas/node.h>
#include <villas/nodes/opal.hpp>
#include <villas/utils.hpp>
#include <villas/plugin.h>
#include <villas/exceptions.hpp>
extern "C" {
@ -351,30 +351,24 @@ int opal_write(struct vnode *n, struct sample * const smps[], unsigned cnt)
return 1;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "opal";
p.description = "run as OPAL Asynchronous Process (libOpalAsyncApi)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 1;
p.node.size = sizeof(struct opal);
p.node.type.start = opal_type_start;
p.node.type.stop = opal_type_stop;
p.node.parse = opal_parse;
p.node.print = opal_print;
p.node.start = opal_start;
p.node.read = opal_read;
p.node.write = opal_write;
p.name = "opal";
p.description = "run as OPAL Asynchronous Process (libOpalAsyncApi)";
p.vectorize = 1;
p.size = sizeof(struct opal);
p.start = opal_type_start;
p.stop = opal_type_stop;
p.parse = opal_parse;
p.print = opal_print;
p.start = opal_start;
p.read = opal_read;
p.write = opal_write;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -39,7 +39,7 @@ extern "C" {
#undef ALIGN_MASK
}
#include <villas/plugin.h>
#include <villas/node.h>
#include <villas/nodes/socket.hpp>
#include <villas/utils.hpp>
#include <villas/stats.hpp>
@ -57,7 +57,7 @@ using namespace villas::utils;
using namespace villas::node;
using namespace villas::kernel;
static struct plugin p;
static struct vnode_type p;
static int rtp_aimd(struct vnode *n, double loss_frac)
{
@ -471,8 +471,7 @@ int rtp_type_start(villas::node::SuperNode *sn)
#ifdef WITH_NETEM
/* Gather list of used network interfaces */
for (size_t i = 0; i < vlist_length(&p.node.instances); i++) {
struct vnode *n = (struct vnode *) vlist_at(&p.node.instances, i);
for (auto *n : p.instances) {
struct rtp *r = (struct rtp *) n->_vd;
Interface *j = Interface::getEgress(&r->out.saddr_rtp.u.sa, sn);
@ -589,30 +588,24 @@ static void register_plugin() {
#else
p.description = "real-time transport protocol (libre)";
#endif
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct rtp);
p.node.type.start = rtp_type_start;
p.node.type.stop = rtp_type_stop;
p.node.init = rtp_init;
p.node.destroy = rtp_destroy;
p.node.parse = rtp_parse;
p.node.print = rtp_print;
p.node.start = rtp_start;
p.node.stop = rtp_stop;
p.node.read = rtp_read;
p.node.write = rtp_write;
p.node.reverse = rtp_reverse;
p.node.poll_fds = rtp_poll_fds;
p.node.netem_fds = rtp_netem_fds;
p.vectorize = 0;
p.size = sizeof(struct rtp);
p.type.start = rtp_type_start;
p.type.stop = rtp_type_stop;
p.init = rtp_init;
p.destroy = rtp_destroy;
p.parse = rtp_parse;
p.print = rtp_print;
p.start = rtp_start;
p.stop = rtp_stop;
p.read = rtp_read;
p.write = rtp_write;
p.reverse = rtp_reverse;
p.poll_fds = rtp_poll_fds;
p.netem_fds = rtp_netem_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -32,8 +32,8 @@
#include <villas/log.hpp>
#include <villas/exceptions.hpp>
#include <villas/shmem.h>
#include <villas/node.h>
#include <villas/nodes/shmem.hpp>
#include <villas/plugin.h>
#include <villas/timing.h>
#include <villas/utils.hpp>
@ -202,29 +202,23 @@ char * shmem_print(struct vnode *n)
return buf;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "shmem";
p.description = "POSIX shared memory interface with external processes";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct shmem);
p.node.parse = shmem_parse;
p.node.print = shmem_print;
p.node.start = shmem_start;
p.node.stop = shmem_stop;
p.node.read = shmem_read;
p.node.write = shmem_write;
p.name = "shmem";
p.description = "POSIX shared memory interface with external processes";
p.vectorize = 0;
p.size = sizeof(struct shmem);
p.parse = shmem_parse;
p.print = shmem_print;
p.start = shmem_start;
p.stop = shmem_stop;
p.read = shmem_read;
p.write = shmem_write;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -25,10 +25,10 @@
#include <cmath>
#include <cstring>
#include <villas/node.h>
#include <villas/plugin.h>
#include <villas/exceptions.hpp>
#include <villas/node.h>
#include <villas/nodes/signal_generator.hpp>
#include <villas/utils.hpp>
using namespace villas;
using namespace villas::node;
@ -444,33 +444,27 @@ int signal_generator_poll_fds(struct vnode *n, int fds[])
return 0;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "signal";
p.description = "Signal generator";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 1;
p.node.flags = (int) NodeFlags::PROVIDES_SIGNALS;
p.node.size = sizeof(struct signal_generator);
p.node.init = signal_generator_init;
p.node.destroy = signal_generator_destroy;
p.node.parse = signal_generator_parse;
p.node.prepare = signal_generator_prepare;
p.node.print = signal_generator_print;
p.node.start = signal_generator_start;
p.node.stop = signal_generator_stop;
p.node.read = signal_generator_read;
p.node.poll_fds = signal_generator_poll_fds;
p.name = "signal";
p.description = "Signal generator";
p.vectorize = 1;
p.flags = (int) NodeFlags::PROVIDES_SIGNALS;
p.size = sizeof(struct signal_generator);
p.init = signal_generator_init;
p.destroy = signal_generator_destroy;
p.parse = signal_generator_parse;
p.prepare = signal_generator_prepare;
p.print = signal_generator_print;
p.start = signal_generator_start;
p.stop = signal_generator_stop;
p.read = signal_generator_read;
p.poll_fds = signal_generator_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -26,11 +26,11 @@
#include <arpa/inet.h>
#include <netinet/ip.h>
#include <villas/node.h>
#include <villas/nodes/socket.hpp>
#include <villas/utils.hpp>
#include <villas/sample.h>
#include <villas/queue.h>
#include <villas/plugin.h>
#include <villas/compat.hpp>
#include <villas/super_node.hpp>
@ -44,7 +44,7 @@
#endif /* WITH_NETEM */
/* Forward declartions */
static struct plugin p;
static struct vnode_type p;
using namespace villas;
using namespace villas::utils;
@ -55,8 +55,7 @@ int socket_type_start(villas::node::SuperNode *sn)
{
#ifdef WITH_NETEM
/* Gather list of used network interfaces */
for (size_t i = 0; i < vlist_length(&p.node.instances); i++) {
struct vnode *n = (struct vnode *) vlist_at(&p.node.instances, i);
for (auto *n : p.instances) {
struct socket *s = (struct socket *) n->_vd;
if (s->layer == SocketLayer::UNIX)
@ -555,28 +554,22 @@ static void register_plugin() {
#else
p.description = "BSD network sockets for Ethernet / IP / UDP";
#endif
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct socket);
p.node.type.start = socket_type_start;
p.node.reverse = socket_reverse;
p.node.parse = socket_parse;
p.node.print = socket_print;
p.node.check = socket_check;
p.node.start = socket_start;
p.node.stop = socket_stop;
p.node.read = socket_read;
p.node.write = socket_write;
p.node.poll_fds = socket_fds;
p.node.netem_fds = socket_fds;
p.vectorize = 0;
p.size = sizeof(struct socket);
p.type.start = socket_type_start;
p.reverse = socket_reverse;
p.parse = socket_parse;
p.print = socket_print;
p.check = socket_check;
p.start = socket_start;
p.stop = socket_stop;
p.read = socket_read;
p.write = socket_write;
p.poll_fds = socket_fds;
p.netem_fds = socket_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -22,19 +22,19 @@
#include <cstring>
#include <villas/node.h>
#include <villas/nodes/stats.hpp>
#include <villas/hook.hpp>
#include <villas/plugin.h>
#include <villas/stats.hpp>
#include <villas/super_node.hpp>
#include <villas/sample.h>
#include <villas/node.h>
#include <villas/utils.hpp>
using namespace villas;
using namespace villas::node;
using namespace villas::utils;
static struct vlist *nodes; /** The global list of nodes */
static NodeList nodes; /** The global list of nodes */
int stats_node_signal_destroy(struct stats_node_signal *s)
{
@ -126,7 +126,7 @@ int stats_node_start(struct vnode *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 vnode>(nodes, stats_sig->node_str);
stats_sig->node = nodes.lookup(stats_sig->node_str);
if (!stats_sig->node)
throw ConfigError(n->config, "node-config-node-stats-node", "Invalid reference node {}", stats_sig->node_str);
}
@ -253,34 +253,28 @@ int stats_node_poll_fds(struct vnode *n, int fds[])
return 0;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "stats";
p.description = "Send statistics to another node";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 1;
p.node.flags = (int) NodeFlags::PROVIDES_SIGNALS;
p.node.size = sizeof(struct stats_node);
p.node.type.start = stats_node_type_start;
p.node.parse = stats_node_parse;
p.node.init = stats_node_init;
p.node.destroy = stats_node_destroy;
p.node.print = stats_node_print;
p.node.prepare = stats_node_prepare;
p.node.start = stats_node_start;
p.node.stop = stats_node_stop;
p.node.read = stats_node_read;
p.node.poll_fds = stats_node_poll_fds;
p.name = "stats";
p.description = "Send statistics to another node";
p.vectorize = 1;
p.flags = (int) NodeFlags::PROVIDES_SIGNALS;
p.size = sizeof(struct stats_node);
p.type.start = stats_node_type_start;
p.parse = stats_node_parse;
p.init = stats_node_init;
p.destroy = stats_node_destroy;
p.print = stats_node_print;
p.prepare = stats_node_prepare;
p.start = stats_node_start;
p.stop = stats_node_stop;
p.read = stats_node_read;
p.poll_fds = stats_node_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -30,9 +30,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <villas/node.h>
#include <villas/nodes/temper.hpp>
#include <villas/exceptions.hpp>
#include <villas/plugin.h>
#include <villas/utils.hpp>
using namespace villas;
@ -46,7 +46,7 @@ static std::list<TEMPerDevice *> devices;
static struct libusb_context *context;
/* Forward declartions */
static struct plugin p;
static struct vnode_type p;
TEMPerDevice::TEMPerDevice(struct libusb_device *dev) :
@ -414,30 +414,24 @@ int temper_read(struct vnode *n, struct sample * const smps[], unsigned cnt)
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "temper";
p.description = "An temper for staring new node-type implementations";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 1;
p.node.flags = (int) NodeFlags::PROVIDES_SIGNALS;
p.node.size = sizeof(struct temper);
p.node.type.start = temper_type_start;
p.node.type.stop = temper_type_stop;
p.node.init = temper_init;
p.node.destroy = temper_destroy;
p.node.prepare = temper_prepare;
p.node.parse = temper_parse;
p.node.print = temper_print;
p.node.start = temper_start;
p.node.stop = temper_stop;
p.node.read = temper_read;
p.name = "temper";
p.description = "An temper for staring new node-type implementations";
p.vectorize = 1;
p.flags = (int) NodeFlags::PROVIDES_SIGNALS;
p.size = sizeof(struct temper);
p.type.start = temper_type_start;
p.type.stop = temper_type_stop;
p.init = temper_init;
p.destroy = temper_destroy;
p.prepare = temper_prepare;
p.parse = temper_parse;
p.print = temper_print;
p.start = temper_start;
p.stop = temper_stop;
p.read = temper_read;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -27,18 +27,19 @@
#include <linux/limits.h>
#include <villas/format.hpp>
#include <villas/node.h>
#include <villas/sample.h>
#include <villas/node.h>
#include <villas/utils.hpp>
#include <villas/timing.h>
#include <villas/plugin.h>
#include <villas/exceptions.hpp>
#include <villas/node.h>
#include <villas/nodes/test_rtt.hpp>
using namespace villas;
using namespace villas::node;
using namespace villas::utils;
static struct plugin p;
static struct vnode_type p;
static int test_rtt_case_start(struct vnode *n, int id)
{
@ -428,29 +429,23 @@ int test_rtt_poll_fds(struct vnode *n, int fds[])
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "test_rtt";
p.description = "Test round-trip time with loopback";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.flags = (int) NodeFlags::PROVIDES_SIGNALS;
p.node.size = sizeof(struct test_rtt);
p.node.parse = test_rtt_parse;
p.node.prepare = test_rtt_prepare;
p.node.init = test_rtt_init;
p.node.destroy = test_rtt_destroy;
p.node.print = test_rtt_print;
p.node.start = test_rtt_start;
p.node.stop = test_rtt_stop;
p.node.read = test_rtt_read;
p.node.write = test_rtt_write;
p.name = "test_rtt";
p.description = "Test round-trip time with loopback";
p.vectorize = 0;
p.flags = (int) NodeFlags::PROVIDES_SIGNALS;
p.size = sizeof(struct test_rtt);
p.parse = test_rtt_parse;
p.prepare = test_rtt_prepare;
p.init = test_rtt_init;
p.destroy = test_rtt_destroy;
p.print = test_rtt_print;
p.start = test_rtt_start;
p.stop = test_rtt_stop;
p.read = test_rtt_read;
p.write = test_rtt_write;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -24,12 +24,12 @@
#include <cstring>
#include <villas/node.h>
#include <villas/plugin.h>
#include <villas/config.h>
#include <villas/node.h>
#include <villas/nodes/uldaq.hpp>
#include <villas/exceptions.hpp>
#include <villas/memory.h>
#include <villas/utils.hpp>
using namespace villas;
using namespace villas::node;
@ -625,32 +625,26 @@ int uldaq_read(struct vnode *n, struct sample * const smps[], unsigned cnt)
return cnt;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "uldaq";
p.description = "Measurement Computing DAQ devices like UL201 (libuldaq)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.flags = 0;
p.node.size = sizeof(struct uldaq);
p.node.type.start = uldaq_type_start;
p.node.init = uldaq_init;
p.node.destroy = uldaq_destroy;
p.node.parse = uldaq_parse;
p.node.print = uldaq_print;
p.node.start = uldaq_start;
p.node.stop = uldaq_stop;
p.node.read = uldaq_read;
p.name = "uldaq";
p.description = "Measurement Computing DAQ devices like UL201 (libuldaq)";
p.vectorize = 0;
p.flags = 0;
p.size = sizeof(struct uldaq);
p.type.start = uldaq_type_start;
p.init = uldaq_init;
p.destroy = uldaq_destroy;
p.parse = uldaq_parse;
p.print = uldaq_print;
p.start = uldaq_start;
p.stop = uldaq_stop;
p.read = uldaq_read;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -30,7 +30,7 @@
#include <villas/timing.h>
#include <villas/utils.hpp>
#include <villas/plugin.h>
#include <villas/node.h>
#include <villas/nodes/websocket.hpp>
#include <villas/super_node.hpp>
@ -47,7 +47,7 @@ static villas::node::Web *web;
static villas::Logger logger = logging.get("websocket");
/* Forward declarations */
static struct plugin p;
static struct vnode_type p;
static char * websocket_connection_name(struct websocket_connection *c)
{
@ -211,7 +211,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 vnode>(&p.node.instances, node);
c->node = p.instances.lookup(node);
if (!c->node) {
websocket_connection_close(c, wsi, LWS_CLOSE_STATUS_POLICY_VIOLATION, "Unknown node");
logger->warn("Failed to find node: {}", node);
@ -601,27 +601,22 @@ int websocket_poll_fds(struct vnode *n, int fds[])
}
__attribute__((constructor(110))) static void UNIQUE(__ctor)() {
p.name = "websocket";
p.description = "Send and receive samples of a WebSocket connection (libwebsockets)";
p.type = PluginType::NODE;
p.node.vectorize = 0; /* unlimited */
p.node.size = sizeof(struct websocket);
p.node.instances.state = State::DESTROYED;
p.node.type.start = websocket_type_start;
p.node.destroy = websocket_destroy;
p.node.parse = websocket_parse;
p.node.print = websocket_print;
p.node.start = websocket_start;
p.node.stop = websocket_stop;
p.node.read = websocket_read;
p.node.write = websocket_write;
p.node.poll_fds = websocket_poll_fds;
p.name = "websocket";
p.description = "Send and receive samples of a WebSocket connection (libwebsockets)";
p.vectorize = 0;
p.size = sizeof(struct websocket);
p.type.start = websocket_type_start;
p.destroy = websocket_destroy;
p.parse = websocket_parse;
p.print = websocket_print;
p.start = websocket_start;
p.stop = websocket_stop;
p.read = websocket_read;
p.write = websocket_write;
p.poll_fds = websocket_poll_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110))) static void UNIQUE(__dtor)() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -27,12 +27,11 @@
#include <zmq_utils.h>
#endif
#include <villas/nodes/zeromq.hpp>
#include <villas/node.h>
#include <villas/nodes/zeromq.hpp>
#include <villas/super_node.hpp>
#include <villas/utils.hpp>
#include <villas/queue.h>
#include <villas/plugin.h>
#include <villas/exceptions.hpp>
using namespace villas;
@ -636,37 +635,31 @@ int zeromq_netem_fds(struct vnode *n, int fds[])
return 1;
}
static struct plugin p;
static struct vnode_type p;
__attribute__((constructor(110)))
static void register_plugin() {
p.name = "zeromq";
p.description = "ZeroMQ Distributed Messaging (libzmq)";
p.type = PluginType::NODE;
p.node.instances.state = State::DESTROYED;
p.node.vectorize = 0;
p.node.size = sizeof(struct zeromq);
p.node.type.start = zeromq_type_start;
p.node.type.stop = zeromq_type_stop;
p.node.init = zeromq_init;
p.node.destroy = zeromq_destroy;
p.node.check = zeromq_check;
p.node.parse = zeromq_parse;
p.node.print = zeromq_print;
p.node.start = zeromq_start;
p.node.stop = zeromq_stop;
p.node.read = zeromq_read;
p.node.write = zeromq_write;
p.node.reverse = zeromq_reverse;
p.node.poll_fds = zeromq_poll_fds;
p.node.netem_fds = zeromq_netem_fds;
p.name = "zeromq";
p.description = "ZeroMQ Distributed Messaging (libzmq)";
p.vectorize = 0;
p.size = sizeof(struct zeromq);
p.type.start = zeromq_type_start;
p.type.stop = zeromq_type_stop;
p.init = zeromq_init;
p.destroy = zeromq_destroy;
p.check = zeromq_check;
p.parse = zeromq_parse;
p.print = zeromq_print;
p.start = zeromq_start;
p.stop = zeromq_stop;
p.read = zeromq_read;
p.write = zeromq_write;
p.reverse = zeromq_reverse;
p.poll_fds = zeromq_poll_fds;
p.netem_fds = zeromq_netem_fds;
int ret = vlist_init(&p.node.instances);
if (!ret)
vlist_init_and_push(&plugins, &p);
}
if (!node_types)
node_types = new NodeTypeList();
__attribute__((destructor(110)))
static void deregister_plugin() {
vlist_remove_all(&plugins, &p);
node_types->push_back(&p);
}

View file

@ -1,53 +0,0 @@
/** Loadable / plugin support.
*
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#include <dlfcn.h>
#include <cstring>
#include <villas/plugin.h>
/** Global list of all known plugins */
struct vlist plugins;
LIST_INIT_STATIC(&plugins)
struct plugin * plugin_lookup(enum PluginType type, const char *name)
{
for (size_t i = 0; i < vlist_length(&plugins); i++) {
struct plugin *p = (struct plugin *) vlist_at(&plugins, i);
if (p->type == type && strcmp(p->name, name) == 0)
return p;
}
return nullptr;
}
void plugin_dump(enum PluginType type)
{
for (size_t i = 0; i < vlist_length(&plugins); i++) {
struct plugin *p = (struct plugin *) vlist_at(&plugins, i);
if (p->type == type)
printf(" - %-13s: %s\n", p->name, p->description);
}
}

View file

@ -32,8 +32,9 @@
#include <villas/log.hpp>
#include <villas/format.hpp>
#include <villas/sample.h>
#include <villas/plugin.h>
#include <villas/exceptions.hpp>
#include <villas/node/config.h>
#include <villas/memory.h>
using namespace villas;

View file

@ -41,7 +41,6 @@
#include <villas/colors.hpp>
#include <villas/exceptions.hpp>
#include <villas/plugin.hpp>
#include <villas/plugin.h>
#include <villas/config_helper.hpp>
#include <villas/kernel/rt.hpp>
#include <villas/node/config.h>

View file

@ -23,6 +23,7 @@
#include <cstdlib>
#include <unistd.h>
#include <iomanip>
#include <iostream>
#include <exception>
#include <atomic>
@ -44,7 +45,6 @@
#include <villas/web.hpp>
#include <villas/log.hpp>
#include <villas/exceptions.hpp>
#include <villas/plugin.h>
#include <villas/kernel/kernel.hpp>
#include <villas/kernel/rt.hpp>
@ -102,26 +102,27 @@ protected:
<< " See in the RT-LAB User Guide for more information." << std::endl << std::endl
#endif /* WITH_NODE_OPAL */
<< "Supported node-types:" << std::endl;
plugin_dump(PluginType::NODE);
<< "Supported node-types:" << std::endl;
for (auto *vt : *node_types)
std::cout << " - " << std::left << std::setw(18) << node_type_name(vt) << vt->description << std::endl;
std::cout << std::endl;
std::cout << "Supported IO formats:" << std::endl;
for (Plugin *p : Registry::lookup<FormatFactory>())
std::cout << " - " << p->getName() << ": " << p->getDescription() << std::endl;
std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl;
std::cout << std::endl;
#ifdef WITH_HOOKS
std::cout << "Supported hooks:" << std::endl;
for (Plugin *p : Registry::lookup<HookFactory>())
std::cout << " - " << p->getName() << ": " << p->getDescription() << std::endl;
std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl;
std::cout << std::endl;
#endif /* WITH_HOOKS */
#ifdef WITH_API
std::cout << "Supported API commands:" << std::endl;
for (Plugin *p : Registry::lookup<api::RequestFactory>())
std::cout << " - " << p->getName() << ": " << p->getDescription() << std::endl;
std::cout << " - " << std::left << std::setw(18) << p->getName() << p->getDescription() << std::endl;
std::cout << std::endl;
#endif /* WITH_API */

View file

@ -40,7 +40,6 @@
#include <villas/timing.h>
#include <villas/node.h>
#include <villas/pool.h>
#include <villas/plugin.h>
#include <villas/nodes/signal_generator.hpp>
using namespace villas;

View file

@ -31,7 +31,6 @@
#include <villas/timing.h>
#include <villas/sample.h>
#include <villas/signal.h>
#include <villas/plugin.h>
#include <villas/pool.h>
#include <villas/format.hpp>
#include <villas/log.hpp>