summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-10 12:55:23 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-10 12:55:23 +0200
commite5cb8042c9f0c6374c4f14bf7ff3f4fe3cdcd155 (patch)
tree31c27f46ba0a5f4981aa7522b11d133e1288c26d /src/lib
parent0ec8f7b6d977a9cc469445d4990d432253f979d9 (diff)
parent155fbfb32b9a69705a06a5771bd146c1bed22821 (diff)
downloadouroboros-e5cb8042c9f0c6374c4f14bf7ff3f4fe3cdcd155.tar.gz
ouroboros-e5cb8042c9f0c6374c4f14bf7ff3f4fe3cdcd155.zip
Merged in sandervrijders/ouroboros/be-create-ipcp (pull request #200)
ipcp, irmd, lib: Notify IRMd upon IPCP initialization
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ipcp.c25
-rw-r--r--src/lib/irmd_messages.proto35
2 files changed, 43 insertions, 17 deletions
diff --git a/src/lib/ipcp.c b/src/lib/ipcp.c
index 141db43d..9ff05e7b 100644
--- a/src/lib/ipcp.c
+++ b/src/lib/ipcp.c
@@ -168,6 +168,31 @@ pid_t ipcp_create(enum ipcp_type ipcp_type)
exit(EXIT_FAILURE);
}
+int ipcp_create_r(pid_t api)
+{
+ irm_msg_t msg = IRM_MSG__INIT;
+ irm_msg_t * recv_msg = NULL;
+ int ret = -1;
+
+ msg.code = IRM_MSG_CODE__IPCP_CREATE_R;
+ msg.has_api = true;
+ msg.api = api;
+
+ recv_msg = send_recv_irm_msg(&msg);
+ if (recv_msg == NULL)
+ return -1;
+
+ if (recv_msg->has_result == false) {
+ irm_msg__free_unpacked(recv_msg, NULL);
+ return -1;
+ }
+
+ ret = recv_msg->result;
+ irm_msg__free_unpacked(recv_msg, NULL);
+
+ return ret;
+}
+
int ipcp_destroy(pid_t api)
{
int status;
diff --git a/src/lib/irmd_messages.proto b/src/lib/irmd_messages.proto
index 315d6092..730f842c 100644
--- a/src/lib/irmd_messages.proto
+++ b/src/lib/irmd_messages.proto
@@ -24,23 +24,24 @@ import "dif_config.proto";
enum irm_msg_code {
IRM_CREATE_IPCP = 1;
- IRM_DESTROY_IPCP = 2;
- IRM_LIST_IPCPS = 3;
- IRM_BOOTSTRAP_IPCP = 4;
- IRM_ENROLL_IPCP = 5;
- IRM_BIND = 6;
- IRM_UNBIND = 7;
- IRM_REG = 8;
- IRM_UNREG = 9;
- IRM_FLOW_ACCEPT = 10;
- IRM_FLOW_ALLOC_RESP = 11;
- IRM_FLOW_ALLOC = 12;
- IRM_FLOW_ALLOC_RES = 13;
- IRM_FLOW_DEALLOC = 14;
- IPCP_FLOW_REQ_ARR = 15;
- IPCP_FLOW_ALLOC_REPLY = 16;
- IPCP_FLOW_DEALLOC = 17;
- IRM_REPLY = 18;
+ IPCP_CREATE_R = 2;
+ IRM_DESTROY_IPCP = 3;
+ IRM_LIST_IPCPS = 4;
+ IRM_BOOTSTRAP_IPCP = 5;
+ IRM_ENROLL_IPCP = 6;
+ IRM_BIND = 7;
+ IRM_UNBIND = 8;
+ IRM_REG = 9;
+ IRM_UNREG = 10;
+ IRM_FLOW_ACCEPT = 11;
+ IRM_FLOW_ALLOC_RESP = 12;
+ IRM_FLOW_ALLOC = 13;
+ IRM_FLOW_ALLOC_RES = 14;
+ IRM_FLOW_DEALLOC = 15;
+ IPCP_FLOW_REQ_ARR = 16;
+ IPCP_FLOW_ALLOC_REPLY = 17;
+ IPCP_FLOW_DEALLOC = 18;
+ IRM_REPLY = 19;
};
message irm_msg {