diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-03-24 15:46:05 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-03-24 15:46:05 +0100 |
commit | 72abee4fc44e5e5092e215d5afee556e6e59347c (patch) | |
tree | f0e6beea035fde78b7e02a8cb449cd550cd8c3de /include | |
parent | eb46e3ddc161c543ea268c54f0c6db40019d25c1 (diff) | |
download | ouroboros-72abee4fc44e5e5092e215d5afee556e6e59347c.tar.gz ouroboros-72abee4fc44e5e5092e215d5afee556e6e59347c.zip |
lib: Adds IRMd messages for the dev.h API calls
This adds several messages for the dev.h API calls to communicate with
the IRM daemon. The deserializing of these messages is still missing
and the irmd hasn't been updated with them either.
Diffstat (limited to 'include')
-rw-r--r-- | include/ouroboros/da.h | 6 | ||||
-rw-r--r-- | include/ouroboros/dev.h | 12 | ||||
-rw-r--r-- | include/ouroboros/ipcp.h | 2 | ||||
-rw-r--r-- | include/ouroboros/rina_name.h | 14 | ||||
-rw-r--r-- | include/ouroboros/sockets.h | 31 |
5 files changed, 40 insertions, 25 deletions
diff --git a/include/ouroboros/da.h b/include/ouroboros/da.h index 2a046f6b..f678007d 100644 --- a/include/ouroboros/da.h +++ b/include/ouroboros/da.h @@ -26,12 +26,12 @@ #include "common.h" #include "rina_name.h" -rina_name_t * da_resolve_daf(char * daf_name); +char * da_resolve_daf(char * daf_name); /* * n_1_difs is an out parameter * The amount of n_1_difs is returned */ -ssize_t da_resolve_dap(rina_name_t * name, - char ** n_1_difs); +ssize_t da_resolve_dap(char * name, + char ** n_1_difs); #endif diff --git a/include/ouroboros/dev.h b/include/ouroboros/dev.h index 39194abd..b2507fbf 100644 --- a/include/ouroboros/dev.h +++ b/include/ouroboros/dev.h @@ -26,19 +26,17 @@ #include <ouroboros/common.h> /* Returns file descriptor */ -int ap_reg(char * ap_name, char * ae_name, - char ** difs, size_t difs_size); -int ap_unreg(char * ap_name, char * ae_name, - char ** difs, size_t difs_size); +int ap_reg(char * ap_name, char ** difs, size_t difs_size); +int ap_unreg(char * ap_name, char ** difs, size_t difs_size); /* Returns file descriptor (> 0) and client name(s) */ int flow_accept(int fd, char * ap_name, char * ae_name); int flow_alloc_resp(int fd, int result); /* Returns file descriptor */ -int flow_alloc(char * dst_ap_name, char * dst_ae_name, - char * src_ap_name, char * src_ae_name, - struct qos_spec * qos, int oflags); +int flow_alloc(char * dst_ap_name, char * src_ap_name, + char * src_ae_name, struct qos_spec * qos, + int oflags); /* If flow is accepted returns a value > 0 */ int flow_alloc_res(int fd); diff --git a/include/ouroboros/ipcp.h b/include/ouroboros/ipcp.h index 5e3e7f8c..b8775fc0 100644 --- a/include/ouroboros/ipcp.h +++ b/include/ouroboros/ipcp.h @@ -46,7 +46,7 @@ int ipcp_bootstrap(pid_t pid, struct dif_config conf); int ipcp_enroll(pid_t pid, char * dif_name, - rina_name_t member, + char * member_name, char ** n_1_difs, ssize_t n_1_difs_size); diff --git a/include/ouroboros/rina_name.h b/include/ouroboros/rina_name.h index d802ae14..f8af00c2 100644 --- a/include/ouroboros/rina_name.h +++ b/include/ouroboros/rina_name.h @@ -27,8 +27,6 @@ typedef struct { char * ap_name; unsigned int api_id; - char * ae_name; - unsigned int aei_id; } rina_name_t; /* @@ -50,16 +48,12 @@ rina_name_t * name_create(); */ rina_name_t * name_init_from(rina_name_t * dst, const char * ap_name, - unsigned int api_id, - const char * ae_name, - unsigned int aei_id); + unsigned int api_id); /* Takes ownership of the passed parameters */ rina_name_t * name_init_with(rina_name_t * dst, char * ap_name, - unsigned int api_id, - char * ae_name, - unsigned int aei_id); + unsigned int api_id); /* * Finalize a name object, releasing all the embedded resources (without @@ -85,9 +79,7 @@ bool name_is_ok(const rina_name_t * n); #define NAME_CMP_APN 0x01 #define NAME_CMP_API 0x02 -#define NAME_CMP_AEN 0x04 -#define NAME_CMP_AEI 0x08 -#define NAME_CMP_ALL (NAME_CMP_APN | NAME_CMP_API | NAME_CMP_AEN | NAME_CMP_AEI) +#define NAME_CMP_ALL (NAME_CMP_APN | NAME_CMP_API) bool name_cmp(uint8_t flags, const rina_name_t * a, diff --git a/include/ouroboros/sockets.h b/include/ouroboros/sockets.h index 426e1006..45d7a27d 100644 --- a/include/ouroboros/sockets.h +++ b/include/ouroboros/sockets.h @@ -40,7 +40,21 @@ enum irm_msg_code { IRM_BOOTSTRAP_IPCP, IRM_ENROLL_IPCP, IRM_REG_IPCP, - IRM_UNREG_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 { @@ -51,6 +65,14 @@ struct irm_msg { 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 { @@ -64,7 +86,7 @@ struct ipcp_msg { enum ipcp_msg_code code; struct dif_config * conf; char * dif_name; - rina_name_t * member; + char * ap_name; char ** difs; size_t difs_size; }; @@ -72,8 +94,11 @@ struct ipcp_msg { /* 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); +int client_socket_open(char * file_name); + +int send_irmd_msg(struct irm_msg * msg); +struct irm_msg * send_recv_irmd_msg(struct irm_msg * msg); /* Caller has to free the buffer */ buffer_t * serialize_irm_msg(struct irm_msg * msg); |