summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2016-03-17 15:38:05 +0100
committerDimitri Staessens <[email protected]>2016-03-17 15:38:05 +0100
commitd2bffe6cc47af18099d33b82920df0bb027da207 (patch)
tree54bc0a9cfb51c1759bb2056961c555fcc9979da7 /include
parent80679807f5ed13fd0a214bc6cd4e1c182d87bfae (diff)
parent02681c391cbc1cc08f2dea5d8499f301d9321147 (diff)
downloadouroboros-d2bffe6cc47af18099d33b82920df0bb027da207.tar.gz
ouroboros-d2bffe6cc47af18099d33b82920df0bb027da207.zip
Merged in sandervrijders/ouroboros/be (pull request #35)
lib: Add communication with IPCP daemon
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/sockets.h50
1 files changed, 38 insertions, 12 deletions
diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h
index 871e3c36..426e1006 100644
--- a/include/ouroboros/sockets.h
+++ b/include/ouroboros/sockets.h
@@ -23,12 +23,17 @@
#ifndef OUROBOROS_SOCKETS_H
#define OUROBOROS_SOCKETS_H
-#include "common.h"
-#include "rina_name.h"
+#include <ouroboros/common.h>
+#include <ouroboros/rina_name.h>
+
+#include <sys/types.h>
#define IRM_SOCK_PATH "/tmp/irm_sock"
#define IRM_MSG_BUF_SIZE 256
+#define IPCP_SOCK_PATH_PREFIX "/tmp/ipcp_sock"
+#define IPCP_MSG_BUFS_SIZE IRM_MSG_BUF_SIZE
+
enum irm_msg_code {
IRM_CREATE_IPCP,
IRM_DESTROY_IPCP,
@@ -39,21 +44,42 @@ enum irm_msg_code {
};
struct irm_msg {
- enum irm_msg_code code;
- rina_name_t * name;
- char * ipcp_type;
+ enum irm_msg_code code;
+ rina_name_t * name;
+ char * ipcp_type;
+ struct dif_config * conf;
+ char * dif_name;
+ char ** difs;
+ size_t difs_size;
+};
+
+enum ipcp_msg_code {
+ IPCP_BOOTSTRAP,
+ IPCP_ENROLL,
+ IPCP_REG,
+ IPCP_UNREG
+};
+
+struct ipcp_msg {
+ enum ipcp_msg_code code;
struct dif_config * conf;
- char * dif_name;
- char ** difs;
- size_t difs_size;
+ char * dif_name;
+ rina_name_t * member;
+ char ** difs;
+ size_t difs_size;
};
-int client_socket_open(char * file_name);
-int server_socket_open(char * file_name);
+/* Returns the full socket path of an IPCP */
+char * ipcp_sock_path(pid_t pid);
+
+int client_socket_open(char * file_name);
+int server_socket_open(char * file_name);
/* Caller has to free the buffer */
-buffer_t * serialize_irm_msg(struct irm_msg * msg);
+buffer_t * serialize_irm_msg(struct irm_msg * msg);
+buffer_t * serialize_ipcp_msg(struct ipcp_msg * msg);
/* Caller has to free all the allocated fields in the message */
-struct irm_msg * deserialize_irm_msg(buffer_t * data);
+struct irm_msg * deserialize_irm_msg(buffer_t * data);
+struct ipcp_msg * deserialize_ipcp_msg(buffer_t * data);
#endif