diff options
author | Dimitri Staessens <dimitri.staessens@intec.ugent.be> | 2016-03-29 12:06:58 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri.staessens@intec.ugent.be> | 2016-03-29 12:06:58 +0200 |
commit | 1d4442e472d20f261986089ea468daa93631d1f4 (patch) | |
tree | 3b27a134c762190b096de421310a50910dca4a34 /include | |
parent | e5d67f7d4df123c2490201447681f2efd553dcc1 (diff) | |
parent | 37c4ccaf59a0406053573e14909be48322ffb084 (diff) | |
download | ouroboros-1d4442e472d20f261986089ea468daa93631d1f4.tar.gz ouroboros-1d4442e472d20f261986089ea468daa93631d1f4.zip |
Merged in sandervrijders/ouroboros/be-gpb (pull request #45)
Replace custom ser/des with GPB
Diffstat (limited to 'include')
-rw-r--r-- | include/ouroboros/CMakeLists.txt | 2 | ||||
-rw-r--r-- | include/ouroboros/ipcp.h | 20 | ||||
-rw-r--r-- | include/ouroboros/irm.h | 32 | ||||
-rw-r--r-- | include/ouroboros/sockets.h | 80 |
4 files changed, 41 insertions, 93 deletions
diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt index a196140b..cc6b9103 100644 --- a/include/ouroboros/CMakeLists.txt +++ b/include/ouroboros/CMakeLists.txt @@ -20,4 +20,4 @@ set(HEADER_FILES ) install(FILES ${HEADER_FILES} "${CMAKE_CURRENT_BINARY_DIR}/config.h" - DESTINATION include/ouroboros) + DESTINATION include/ouroboros) diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h index b8775fc0..cd4a3f51 100644 --- a/include/ouroboros/ipcp.h +++ b/include/ouroboros/ipcp.h @@ -32,21 +32,21 @@ struct ipcp; /* Returns the process id */ pid_t ipcp_create(rina_name_t name, - char * ipcp_type); + char * ipcp_type); int ipcp_destroy(pid_t pid); -int ipcp_reg(pid_t pid, +int ipcp_reg(pid_t pid, char ** difs, - size_t difs_size); -int ipcp_unreg(pid_t pid, + size_t difs_size); +int ipcp_unreg(pid_t pid, char ** difs, - size_t difs_size); + size_t difs_size); -int ipcp_bootstrap(pid_t pid, - struct dif_config conf); -int ipcp_enroll(pid_t pid, - char * dif_name, - char * member_name, +int ipcp_bootstrap(pid_t pid, + struct dif_config * conf); +int ipcp_enroll(pid_t pid, + char * dif_name, + char * member_name, char ** n_1_difs, ssize_t n_1_difs_size); diff --git a/include/ouroboros/irm.h b/include/ouroboros/irm.h index a6f0d9f3..fe72aefe 100644 --- a/include/ouroboros/irm.h +++ b/include/ouroboros/irm.h @@ -26,20 +26,26 @@ #include "common.h" #include "rina_name.h" -int irm_create_ipcp(rina_name_t name, - char * ipcp_type); -int irm_destroy_ipcp(rina_name_t name); +int irm_create_ipcp(char * ap_name, + int api_id, + char * ipcp_type); +int irm_destroy_ipcp(char * ap_name, + int api_id); -int irm_bootstrap_ipcp(rina_name_t name, - struct dif_config conf); -int irm_enroll_ipcp(rina_name_t name, - char * dif_name); +int irm_bootstrap_ipcp(char * ap_name, + int api_id, + struct dif_config * conf); +int irm_enroll_ipcp(char * ap_name, + int api_id, + char * dif_name); -int irm_reg_ipcp(rina_name_t name, - char ** difs, - size_t difs_size); -int irm_unreg_ipcp(rina_name_t name, - char ** difs, - size_t difs_size); +int irm_reg_ipcp(char * ap_name, + int api_id, + char ** difs, + size_t difs_size); +int irm_unreg_ipcp(char * ap_name, + int api_id, + char ** difs, + size_t difs_size); #endif diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h index 45d7a27d..bb8e6d84 100644 --- a/include/ouroboros/sockets.h +++ b/include/ouroboros/sockets.h @@ -28,83 +28,25 @@ #include <sys/types.h> +#include "irmd_messages.pb-c.h" +typedef IrmMsg irm_msg_t; + +#include "ipcpd_messages.pb-c.h" +typedef IpcpMsg ipcp_msg_t; + #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, - IRM_BOOTSTRAP_IPCP, - IRM_ENROLL_IPCP, - IRM_REG_IPCP, - IRM_UNREG_IPCP, - IRM_AP_REG, - IRM_AP_REG_R, - IRM_AP_UNREG, - IRM_FLOW_ACCEPT, - IRM_FLOW_ACCEPT_R, - IRM_FLOW_ALLOC_RESP, - IRM_FLOW_ALLOC, - IRM_FLOW_ALLOC_R, - IRM_FLOW_ALLOC_RES, - IRM_FLOW_ALLOC_RES_R, - IRM_FLOW_DEALLOC, - IRM_FLOW_CONTROL, - IRM_FLOW_WRITE, - IRM_FLOW_READ -}; - -struct irm_msg { - 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; - char * ap_name; - char * ae_name; - int fd; - int result; - struct qos_spec * qos; - int oflags; - char * dst_ap_name; - ssize_t count; -}; - -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 * ap_name; - char ** difs; - size_t difs_size; -}; - /* Returns the full socket path of an IPCP */ -char * ipcp_sock_path(pid_t pid); - -int server_socket_open(char * file_name); -int client_socket_open(char * file_name); +char * ipcp_sock_path(pid_t pid); -int send_irmd_msg(struct irm_msg * msg); -struct irm_msg * send_recv_irmd_msg(struct irm_msg * msg); +int server_socket_open(char * file_name); +int client_socket_open(char * file_name); -/* Caller has to free the buffer */ -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 ipcp_msg * deserialize_ipcp_msg(buffer_t * data); +int send_irm_msg(irm_msg_t * msg); +irm_msg_t * send_recv_irm_msg(irm_msg_t * msg); #endif |