diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ouroboros/sockets.h | 50 |
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 |