This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
2017-08-28 00:03:35 +02:00
|
|
|
#ifndef __REMOTE_MSG_H__
|
|
|
|
#define __REMOTE_MSG_H__
|
|
|
|
|
|
|
|
#define REMOTE_MSG_TYPE_CONNECT 1
|
|
|
|
#define REMOTE_MSG_TYPE_LISTEN 2
|
|
|
|
#define REMOTE_MSG_TYPE_PUB 3
|
|
|
|
|
|
|
|
struct remoted_msg {
|
|
|
|
unsigned char type; // message types = commands (connect, listen, ...)
|
|
|
|
char *data;
|
|
|
|
size_t datalen;
|
|
|
|
};
|
|
|
|
|
2018-10-03 21:52:11 +02:00
|
|
|
void remote_message_serialize (const struct remoted_msg *msg, char **data, size_t *len);
|
|
|
|
void remote_message_unserialize (struct remoted_msg *msg, const char *data, size_t len);
|
2017-08-28 00:03:35 +02:00
|
|
|
|
2018-10-03 21:52:11 +02:00
|
|
|
void remote_message_free (struct remoted_msg *msg);
|
|
|
|
void remote_message_print (const struct remoted_msg *msg);
|
2017-08-28 00:03:35 +02:00
|
|
|
|
|
|
|
#endif
|