1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-16 00:00:02 +01:00
VILLASnode/include/villas/nodes/nanomsg.hpp

58 lines
1.2 KiB
C++
Raw Normal View History

2017-05-23 14:54:25 +02:00
/** Node type: nanomsg
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
2022-03-15 09:28:57 -04:00
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
2022-07-04 18:20:03 +02:00
* @license Apache 2.0
2017-05-23 14:54:25 +02:00
*********************************************************************************/
#pragma once
#include <villas/list.hpp>
2021-05-10 00:12:30 +02:00
#include <villas/format.hpp>
2017-05-23 14:54:25 +02:00
namespace villas {
namespace node {
2021-06-21 16:11:42 -04:00
/* Forward declarations */
class NodeCompat;
2021-06-21 16:11:42 -04:00
/** The maximum length of a packet which contains stuct msg. */
#define NANOMSG_MAX_PACKET_LEN 1500
2017-05-23 14:54:25 +02:00
struct nanomsg {
struct {
int socket;
struct List endpoints;
} in, out;
Format *formatter;
2017-05-23 14:54:25 +02:00
};
char * nanomsg_print(NodeCompat *n);
int nanomsg_init(NodeCompat *n);
int nanomsg_destroy(NodeCompat *n);
int nanomsg_parse(NodeCompat *n, json_t *json);
int nanomsg_start(NodeCompat *n);
int nanomsg_stop(NodeCompat *n);
int nanomsg_type_stop();
2017-05-23 14:54:25 +02:00
int nanomsg_reverse(NodeCompat *n);
2017-05-23 14:54:25 +02:00
int nanomsg_poll_fds(NodeCompat *n, int fds[]);
2017-05-23 14:54:25 +02:00
int nanomsg_netem_fds(NodeCompat *n, int fds[]);
2017-05-23 14:54:25 +02:00
int nanomsg_read(NodeCompat *n, struct Sample * const smps[], unsigned cnt);
2017-05-23 14:54:25 +02:00
int nanomsg_write(NodeCompat *n, struct Sample * const smps[], unsigned cnt);
2017-05-23 14:54:25 +02:00
} // namespace node
} // namespace villas