2018-11-16 16:07:47 +01:00
|
|
|
/** Node type: rtp
|
|
|
|
*
|
|
|
|
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
|
|
|
* @copyright 2017-2018, 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/>.
|
|
|
|
*********************************************************************************/
|
|
|
|
|
2018-11-21 18:21:29 +01:00
|
|
|
#include <inttypes.h>
|
2018-12-07 06:37:48 +01:00
|
|
|
#include <pthread.h>
|
2018-11-16 16:07:47 +01:00
|
|
|
#include <string.h>
|
2018-11-28 18:12:06 +01:00
|
|
|
#include <time.h>
|
2019-01-07 15:49:34 +01:00
|
|
|
#include <signal.h>
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-11-22 07:18:27 +01:00
|
|
|
#include <re/re_types.h>
|
|
|
|
#include <re/re_main.h>
|
2018-11-28 18:12:06 +01:00
|
|
|
#include <re/re_mbuf.h>
|
2018-12-01 12:31:12 +01:00
|
|
|
#include <re/re_mem.h>
|
2018-11-22 07:18:27 +01:00
|
|
|
#include <re/re_rtp.h>
|
2018-11-28 18:12:06 +01:00
|
|
|
#include <re/re_sys.h>
|
2018-11-22 07:18:27 +01:00
|
|
|
#undef ALIGN_MASK
|
2018-11-21 18:21:29 +01:00
|
|
|
|
2018-11-16 16:07:47 +01:00
|
|
|
#include <villas/plugin.h>
|
2018-11-22 17:53:07 +01:00
|
|
|
#include <villas/nodes/socket.h>
|
2018-11-28 18:12:06 +01:00
|
|
|
#include <villas/nodes/rtp.h>
|
2018-11-16 16:07:47 +01:00
|
|
|
#include <villas/utils.h>
|
|
|
|
#include <villas/format_type.h>
|
|
|
|
|
2018-12-07 06:37:48 +01:00
|
|
|
pthread_t re_pthread;
|
|
|
|
|
2018-11-16 16:07:47 +01:00
|
|
|
int rtp_reverse(struct node *n)
|
|
|
|
{
|
2018-11-22 17:53:07 +01:00
|
|
|
struct rtp *r = (struct rtp *) n->_vd;
|
|
|
|
struct sa tmp;
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-12-20 08:25:13 +01:00
|
|
|
tmp = r->local_rtp;
|
|
|
|
r->local_rtp = r->remote_rtp;
|
|
|
|
r->remote_rtp = tmp;
|
|
|
|
|
|
|
|
tmp = r->local_rtcp;
|
|
|
|
r->local_rtcp = r->remote_rtcp;
|
|
|
|
r->remote_rtcp = tmp;
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-11-22 17:53:07 +01:00
|
|
|
return 0;
|
2018-11-16 16:07:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int rtp_parse(struct node *n, json_t *cfg)
|
|
|
|
{
|
2018-11-21 18:21:29 +01:00
|
|
|
int ret = 0;
|
2018-11-22 17:53:07 +01:00
|
|
|
struct rtp *r = (struct rtp *) n->_vd;
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-11-22 07:18:27 +01:00
|
|
|
const char *local, *remote;
|
|
|
|
const char *format = "villas.binary";
|
2018-11-22 17:53:07 +01:00
|
|
|
bool enable_rtcp = false;
|
2018-12-20 08:25:13 +01:00
|
|
|
uint16_t port;
|
2018-11-16 16:07:47 +01:00
|
|
|
|
|
|
|
json_error_t err;
|
|
|
|
|
2018-11-22 17:53:07 +01:00
|
|
|
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: b, s: { s: s }, s: { s: s } }",
|
2018-11-22 07:18:27 +01:00
|
|
|
"format", &format,
|
2018-11-22 17:53:07 +01:00
|
|
|
"enable_rtcp", &enable_rtcp,
|
2018-11-22 07:18:27 +01:00
|
|
|
"out",
|
|
|
|
"address", &remote,
|
|
|
|
"in",
|
|
|
|
"address", &local
|
|
|
|
);
|
2018-11-16 16:07:47 +01:00
|
|
|
if (ret)
|
|
|
|
jerror(&err, "Failed to parse configuration of node %s", node_name(n));
|
|
|
|
|
2018-11-22 07:18:27 +01:00
|
|
|
/* Format */
|
2018-11-22 17:53:07 +01:00
|
|
|
r->format = format_type_lookup(format);
|
|
|
|
if(!r->format)
|
2018-11-22 07:18:27 +01:00
|
|
|
error("Invalid format '%s' for node %s", format, node_name(n));
|
|
|
|
|
2018-12-07 15:15:24 +01:00
|
|
|
/* Enable RTCP */
|
2018-11-22 17:53:07 +01:00
|
|
|
r->enable_rtcp = enable_rtcp;
|
|
|
|
if(enable_rtcp)
|
2019-01-07 12:52:24 +01:00
|
|
|
warning("RTCP is not implemented yet");
|
2018-11-22 17:53:07 +01:00
|
|
|
|
|
|
|
/* Remote address */
|
2018-12-20 08:25:13 +01:00
|
|
|
ret = sa_decode(&r->remote_rtp, remote, strlen(remote));
|
2018-11-22 07:18:27 +01:00
|
|
|
if (ret) {
|
|
|
|
error("Failed to resolve remote address '%s' of node %s: %s",
|
|
|
|
remote, node_name(n), strerror(ret));
|
|
|
|
}
|
|
|
|
|
2018-12-20 08:25:13 +01:00
|
|
|
/* Assign even port number to RTP socket, next odd number to RTCP socket */
|
|
|
|
port = sa_port(&r->remote_rtp) & ~1;
|
|
|
|
sa_set_sa(&r->remote_rtcp, &r->remote_rtp.u.sa);
|
|
|
|
sa_set_port(&r->remote_rtp, port);
|
|
|
|
sa_set_port(&r->remote_rtcp, port+1);
|
|
|
|
|
2018-11-22 17:53:07 +01:00
|
|
|
/* Local address */
|
2018-12-20 08:25:13 +01:00
|
|
|
ret = sa_decode(&r->local_rtp, local, strlen(local));
|
2018-11-22 07:18:27 +01:00
|
|
|
if (ret) {
|
|
|
|
error("Failed to resolve local address '%s' of node %s: %s",
|
|
|
|
local, node_name(n), strerror(ret));
|
|
|
|
}
|
|
|
|
|
2018-12-20 08:25:13 +01:00
|
|
|
/* Assign even port number to RTP socket, next odd number to RTCP socket */
|
|
|
|
port = sa_port(&r->local_rtp) & ~1;
|
|
|
|
sa_set_sa(&r->local_rtcp, &r->local_rtp.u.sa);
|
|
|
|
sa_set_port(&r->local_rtp, port);
|
|
|
|
sa_set_port(&r->local_rtcp, port+1);
|
|
|
|
|
2018-11-22 17:53:07 +01:00
|
|
|
/** @todo parse * in addresses */
|
2018-11-22 07:18:27 +01:00
|
|
|
|
|
|
|
return ret;
|
2018-11-16 16:07:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
char * rtp_print(struct node *n)
|
|
|
|
{
|
2018-11-22 17:53:07 +01:00
|
|
|
struct rtp *r = (struct rtp *) n->_vd;
|
|
|
|
char *buf;
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-12-20 08:25:13 +01:00
|
|
|
char *local = socket_print_addr((struct sockaddr *) &r->local_rtp.u);
|
|
|
|
char *remote = socket_print_addr((struct sockaddr *) &r->remote_rtp.u);
|
2018-11-22 17:53:07 +01:00
|
|
|
|
|
|
|
buf = strf("format=%s, in.address=%s, out.address=%s", format_type_name(r->format), local, remote);
|
|
|
|
|
|
|
|
free(local);
|
|
|
|
free(remote);
|
2018-11-16 16:07:47 +01:00
|
|
|
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
2018-11-28 06:11:13 +01:00
|
|
|
static void rtp_handler(const struct sa *src, const struct rtp_header *hdr, struct mbuf *mb, void *arg)
|
|
|
|
{
|
2018-12-07 15:15:24 +01:00
|
|
|
struct rtp *r = (struct rtp *) arg;
|
|
|
|
|
2019-01-07 15:22:38 +01:00
|
|
|
if (queue_signalled_push(&r->recv_queue, (void *) mbuf_alloc_ref(mb)) != 1)
|
2019-01-07 12:52:24 +01:00
|
|
|
warning("Failed to push to queue");
|
2018-11-28 06:11:13 +01:00
|
|
|
|
2018-12-16 11:47:33 +01:00
|
|
|
/* source, header not yet used */
|
|
|
|
(void) src;
|
|
|
|
(void) hdr;
|
2018-11-28 06:11:13 +01:00
|
|
|
}
|
|
|
|
|
2018-12-20 08:25:13 +01:00
|
|
|
static void rtcp_handler(const struct sa *src, struct rtcp_msg *msg, void *arg)
|
|
|
|
{
|
|
|
|
(void)src;
|
|
|
|
(void)arg;
|
|
|
|
|
|
|
|
printf("rtcp: recv %s\n", rtcp_type_name(msg->hdr.pt));
|
|
|
|
}
|
|
|
|
|
2018-11-16 16:07:47 +01:00
|
|
|
int rtp_start(struct node *n)
|
|
|
|
{
|
|
|
|
int ret;
|
2018-11-22 17:53:07 +01:00
|
|
|
struct rtp *r = (struct rtp *) n->_vd;
|
2018-12-07 15:15:24 +01:00
|
|
|
|
2018-12-13 18:50:18 +01:00
|
|
|
/* Initialize Queue */
|
2019-01-07 15:52:34 +01:00
|
|
|
ret = queue_signalled_init(&r->recv_queue, 1024, &memory_heap, 0);
|
2018-12-07 15:15:24 +01:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
2018-11-22 17:53:07 +01:00
|
|
|
/* Initialize IO */
|
|
|
|
ret = io_init(&r->io, r->format, &n->signals, SAMPLE_HAS_ALL & ~SAMPLE_HAS_OFFSET);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
ret = io_check(&r->io);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
2018-11-28 18:12:06 +01:00
|
|
|
/* Initialize RTP socket */
|
2018-12-20 08:25:13 +01:00
|
|
|
uint16_t port = sa_port(&r->local_rtp) & ~1;
|
|
|
|
ret = rtp_listen(&r->rs, IPPROTO_UDP, &r->local_rtp, port, port+1, r->enable_rtcp, rtp_handler, rtcp_handler, n->_vd);
|
|
|
|
|
|
|
|
/* Start RTCP session */
|
|
|
|
rtcp_start(r->rs, node_name(n), &r->remote_rtcp);
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-11-22 17:53:07 +01:00
|
|
|
return ret;
|
2018-11-16 16:07:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int rtp_stop(struct node *n)
|
|
|
|
{
|
2018-12-19 18:40:53 +01:00
|
|
|
int ret;
|
2018-11-28 18:12:06 +01:00
|
|
|
struct rtp *r = (struct rtp *) n->_vd;
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-12-01 12:31:12 +01:00
|
|
|
/*mem_deref(r->rs);*/
|
|
|
|
|
2019-01-07 15:22:38 +01:00
|
|
|
ret = queue_signalled_close(&r->recv_queue);
|
2018-12-19 18:40:53 +01:00
|
|
|
if (ret)
|
2019-01-07 12:52:24 +01:00
|
|
|
warning("Problem closing queue");
|
2018-12-19 18:40:53 +01:00
|
|
|
|
2019-01-07 15:22:38 +01:00
|
|
|
ret = queue_signalled_destroy(&r->recv_queue);
|
2018-12-19 18:40:53 +01:00
|
|
|
if (ret)
|
2019-01-07 12:52:24 +01:00
|
|
|
warning("Problem destroying queue");
|
2018-12-19 18:40:53 +01:00
|
|
|
|
2018-12-07 06:37:48 +01:00
|
|
|
return io_destroy(&r->io);
|
|
|
|
}
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-12-07 06:37:48 +01:00
|
|
|
static void * th_func(void *arg)
|
|
|
|
{
|
|
|
|
re_main(NULL);
|
|
|
|
return NULL;
|
2018-11-16 16:07:47 +01:00
|
|
|
}
|
|
|
|
|
2019-01-08 22:53:04 +01:00
|
|
|
static void stop_handler(int sig, siginfo_t *si, void *ctx)
|
|
|
|
{
|
|
|
|
re_cancel();
|
|
|
|
}
|
|
|
|
|
2018-12-01 12:31:12 +01:00
|
|
|
int rtp_type_start()
|
2018-11-16 16:07:47 +01:00
|
|
|
{
|
2018-12-07 06:37:48 +01:00
|
|
|
int ret;
|
|
|
|
|
2018-12-01 12:31:12 +01:00
|
|
|
/* Initialize library */
|
2018-12-07 06:37:48 +01:00
|
|
|
ret = libre_init();
|
|
|
|
if (ret) {
|
|
|
|
error("Error initializing libre");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add worker thread */
|
|
|
|
ret = pthread_create(&re_pthread, NULL, th_func, NULL);
|
|
|
|
if (ret) {
|
|
|
|
error("Error creating rtp node type pthread");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2019-01-07 15:49:34 +01:00
|
|
|
struct sigaction sa;
|
|
|
|
sa.sa_flags = SA_SIGINFO;
|
|
|
|
sa.sa_sigaction = stop_handler;
|
|
|
|
|
|
|
|
ret = sigaction(SIGUSR1, &sa, NULL);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
2018-12-07 06:37:48 +01:00
|
|
|
return ret;
|
2018-12-01 12:31:12 +01:00
|
|
|
}
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-12-01 12:31:12 +01:00
|
|
|
int rtp_type_stop()
|
|
|
|
{
|
2018-12-07 06:37:48 +01:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* Join worker thread */
|
2019-01-07 15:49:34 +01:00
|
|
|
pthread_kill(re_pthread, SIGUSR1);
|
2018-12-07 06:37:48 +01:00
|
|
|
ret = pthread_join(re_pthread, NULL);
|
|
|
|
if (ret) {
|
|
|
|
error("Error joining rtp node type pthread");
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2018-12-01 12:31:12 +01:00
|
|
|
libre_close();
|
2019-01-08 22:53:04 +01:00
|
|
|
|
2018-12-07 06:37:48 +01:00
|
|
|
return ret;
|
2018-11-16 16:07:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int rtp_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release)
|
|
|
|
{
|
2018-12-07 15:15:24 +01:00
|
|
|
int ret;
|
2018-11-28 18:12:06 +01:00
|
|
|
struct rtp *r = (struct rtp *) n->_vd;
|
2018-12-13 18:50:18 +01:00
|
|
|
size_t bytes;
|
|
|
|
char *buf;
|
|
|
|
struct mbuf *mb;
|
2018-12-07 15:15:24 +01:00
|
|
|
|
2018-12-13 18:50:18 +01:00
|
|
|
/* Get data from queue */
|
2019-01-07 15:22:38 +01:00
|
|
|
ret = queue_signalled_pull(&r->recv_queue, (void **) &mb);
|
2018-12-13 18:50:18 +01:00
|
|
|
if (ret <= 0) {
|
2018-12-07 15:15:24 +01:00
|
|
|
if (ret < 0)
|
2019-01-07 12:52:24 +01:00
|
|
|
warning("Failed to pull from queue");
|
2018-12-13 18:50:18 +01:00
|
|
|
return ret;
|
2018-12-07 15:15:24 +01:00
|
|
|
}
|
|
|
|
|
2018-12-13 18:50:18 +01:00
|
|
|
/* Read from mbuf */
|
|
|
|
bytes = mbuf_get_left(mb);
|
|
|
|
buf = (char *) alloc(bytes);
|
|
|
|
mbuf_read_mem(mb, (uint8_t *) buf, bytes);
|
|
|
|
|
|
|
|
/* Unpack data */
|
|
|
|
ret = io_sscan(&r->io, buf, bytes, NULL, smps, cnt);
|
|
|
|
if (ret < 0)
|
2019-01-07 12:52:24 +01:00
|
|
|
warning("Received invalid packet from node %s: reason=%d", node_name(n), ret);
|
2018-12-13 18:50:18 +01:00
|
|
|
|
2018-12-16 11:47:33 +01:00
|
|
|
free(buf);
|
2018-12-07 15:15:24 +01:00
|
|
|
return ret;
|
2018-11-16 16:07:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int rtp_write(struct node *n, struct sample *smps[], unsigned cnt, unsigned *release)
|
|
|
|
{
|
2018-11-28 18:12:06 +01:00
|
|
|
int ret;
|
|
|
|
struct rtp *r = (struct rtp *) n->_vd;
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-11-28 18:12:06 +01:00
|
|
|
char *buf;
|
2018-12-01 12:31:12 +01:00
|
|
|
char pad[] = " ";
|
2018-11-28 18:12:06 +01:00
|
|
|
size_t buflen;
|
|
|
|
size_t wbytes;
|
|
|
|
|
|
|
|
buflen = RTP_INITIAL_BUFFER_LEN;
|
|
|
|
buf = alloc(buflen);
|
2018-12-01 12:31:12 +01:00
|
|
|
if (!buf) {
|
2019-01-13 00:02:34 +01:00
|
|
|
warning("Error allocating buffer space");
|
2018-11-28 18:12:06 +01:00
|
|
|
return -1;
|
2018-12-01 12:31:12 +01:00
|
|
|
}
|
2018-11-28 18:12:06 +01:00
|
|
|
|
2018-12-01 12:31:12 +01:00
|
|
|
retry: cnt = io_sprint(&r->io, buf, buflen, &wbytes, smps, cnt);
|
|
|
|
if (cnt < 0) {
|
2019-01-13 00:02:34 +01:00
|
|
|
warning("Error from io_sprint, reason: %d", cnt);
|
|
|
|
goto out1;
|
2018-12-01 12:31:12 +01:00
|
|
|
}
|
2018-11-28 18:12:06 +01:00
|
|
|
|
2018-12-01 12:31:12 +01:00
|
|
|
if (wbytes <= 0) {
|
2019-01-13 00:02:34 +01:00
|
|
|
warning("Error written bytes = %ld <= 0", wbytes);
|
|
|
|
cnt = -1;
|
|
|
|
goto out1;
|
2018-12-01 12:31:12 +01:00
|
|
|
}
|
2018-11-28 18:12:06 +01:00
|
|
|
|
|
|
|
if (wbytes > buflen) {
|
|
|
|
buflen = wbytes;
|
|
|
|
buf = realloc(buf, buflen);
|
|
|
|
goto retry;
|
|
|
|
}
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-11-28 18:12:06 +01:00
|
|
|
/* Prepare mbuf */
|
|
|
|
struct mbuf *mb = mbuf_alloc(buflen + 12);
|
2019-01-13 00:02:34 +01:00
|
|
|
if (!mb) {
|
|
|
|
warning("Failed to allocate memory");
|
|
|
|
cnt = -1;
|
|
|
|
goto out2;
|
|
|
|
}
|
|
|
|
|
2018-11-28 18:12:06 +01:00
|
|
|
ret = mbuf_write_str(mb, pad);
|
2018-12-07 06:37:48 +01:00
|
|
|
if (ret) {
|
2019-01-13 00:02:34 +01:00
|
|
|
warning("Error writing padding to mbuf");
|
2018-12-01 12:31:12 +01:00
|
|
|
cnt = ret;
|
2019-01-13 00:02:34 +01:00
|
|
|
goto out2;
|
2018-11-28 18:12:06 +01:00
|
|
|
}
|
2019-01-13 00:02:34 +01:00
|
|
|
|
2018-12-01 12:31:12 +01:00
|
|
|
ret = mbuf_write_mem(mb, (uint8_t*)buf, buflen);
|
2018-12-07 06:37:48 +01:00
|
|
|
if (ret) {
|
2019-01-13 00:02:34 +01:00
|
|
|
warning("Error writing data to mbuf");
|
2018-12-01 12:31:12 +01:00
|
|
|
cnt = ret;
|
2019-01-13 00:02:34 +01:00
|
|
|
goto out2;
|
2018-11-28 18:12:06 +01:00
|
|
|
}
|
2019-01-13 00:02:34 +01:00
|
|
|
|
2018-11-28 18:12:06 +01:00
|
|
|
mbuf_set_pos(mb, 12);
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2018-11-28 18:12:06 +01:00
|
|
|
/* Send dataset */
|
2018-12-20 08:25:13 +01:00
|
|
|
ret = rtp_send(r->rs, &r->remote_rtp, false, false, 21, (uint32_t) time(NULL), mb);
|
2018-12-07 06:37:48 +01:00
|
|
|
if (ret) {
|
2019-01-13 00:02:34 +01:00
|
|
|
warning("Error from rtp_send, reason: %d", ret);
|
2018-12-01 12:31:12 +01:00
|
|
|
cnt = ret;
|
|
|
|
}
|
2018-11-16 16:07:47 +01:00
|
|
|
|
2019-01-13 00:02:34 +01:00
|
|
|
out2: mem_deref(mb);
|
|
|
|
out1: free(buf);
|
2018-11-28 18:12:06 +01:00
|
|
|
|
2018-12-01 12:31:12 +01:00
|
|
|
return cnt;
|
2018-11-16 16:07:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct plugin p = {
|
|
|
|
.name = "rtp",
|
|
|
|
.description = "real-time transport protocol (libre)",
|
|
|
|
.type = PLUGIN_TYPE_NODE,
|
|
|
|
.node = {
|
|
|
|
.vectorize = 0,
|
|
|
|
.size = sizeof(struct rtp),
|
2019-01-13 00:02:34 +01:00
|
|
|
.type.start = rtp_type_start,
|
2018-11-16 16:07:47 +01:00
|
|
|
.type.stop = rtp_type_stop,
|
|
|
|
.reverse = rtp_reverse,
|
|
|
|
.parse = rtp_parse,
|
|
|
|
.print = rtp_print,
|
|
|
|
.start = rtp_start,
|
|
|
|
.stop = rtp_stop,
|
|
|
|
.read = rtp_read,
|
|
|
|
.write = rtp_write,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
REGISTER_PLUGIN(&p)
|
|
|
|
LIST_INIT_STATIC(&p.node.instances)
|