summaryrefslogtreecommitdiff
path: root/src/lib/irm.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-06-22 16:16:58 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-06-22 16:16:58 +0200
commite24581b93fb3329a1c89b294da15e3375513cf89 (patch)
tree4af7b471aeeff9d5f6224c48fcaf067104ac0a07 /src/lib/irm.c
parentaa6255a605cac034089c78562c0d000aacd0af1e (diff)
parentfa0a0dbc88adcf9cff8bf35a253f020a49ff4084 (diff)
downloadouroboros-e24581b93fb3329a1c89b294da15e3375513cf89.tar.gz
ouroboros-e24581b93fb3329a1c89b294da15e3375513cf89.zip
Merged in sandervrijders/ouroboros/be (pull request #136)
lib: Add errnos specific for Ouroboros
Diffstat (limited to 'src/lib/irm.c')
-rw-r--r--src/lib/irm.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/lib/irm.c b/src/lib/irm.c
index ff5c3237..01ee498c 100644
--- a/src/lib/irm.c
+++ b/src/lib/irm.c
@@ -22,6 +22,7 @@
#define OUROBOROS_PREFIX "libouroboros-irm"
+#include <ouroboros/errno.h>
#include <ouroboros/irm.h>
#include <ouroboros/common.h>
#include <ouroboros/logs.h>
@@ -47,7 +48,7 @@ pid_t irm_create_ipcp(char * ipcp_name,
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRM;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -76,7 +77,7 @@ int irm_destroy_ipcp(instance_name_t * api)
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRM;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -143,12 +144,12 @@ int irm_bootstrap_ipcp(instance_name_t * api,
config.if_name = conf->if_name;
break;
default:
- return -1;
+ return -EIPCPTYPE;
}
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL) {
- return -1;
+ return -EIRM;
}
if (recv_msg->has_result == false) {
@@ -180,14 +181,14 @@ int irm_enroll_ipcp(instance_name_t * api,
msg.dif_name = malloc(sizeof(*(msg.dif_name)));
if (msg.dif_name == NULL) {
LOG_ERR("Failed to malloc");
- return -1;
+ return -ENOMEM;
}
msg.dif_name[0] = dif_name;
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL) {
free(msg.dif_name);
- return -1;
+ return -EIRM;
}
if (recv_msg->has_result == false) {
@@ -238,7 +239,7 @@ int irm_reg(char * name,
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRM;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -284,7 +285,7 @@ int irm_unreg(char * name,
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRM;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);