Rework controler

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2018-02-20 21:28:17 +00:00
parent dd3ba523a4
commit 99b51efbb3
6 changed files with 82 additions and 120 deletions

View File

@@ -3,23 +3,19 @@
#include <sys/socket.h>
enum ctl_type {
CTL_UNKNOWN,
CTL_NONE = 0,
CTL_PATH_ADD,
CTL_PATH_DEL,
CTL_STATUS,
CTL_STATUS_REPLY,
CTL_MTU,
CTL_TIMEOUT,
CTL_TIMETOLERANCE,
CTL_REPLY,
};
struct ctl_msg {
enum ctl_type type;
int reply, ret;
union {
struct {
enum ctl_type type;
} unknown;
struct sockaddr_storage path_addr;
struct {
size_t mtu;
@@ -31,10 +27,10 @@ struct ctl_msg {
int mtu;
unsigned long timeout;
unsigned long timetolerance;
int reply;
};
};
int ctl_create (const char *, const char *);
int ctl_connect (int, const char *, const char *);
int ctl_reply (int, struct ctl_msg *, struct ctl_msg *);
void ctl_delete (int);