summaryrefslogtreecommitdiff
path: root/src/lib/ipcp.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-04-08 16:32:35 +0200
committerSander Vrijders <[email protected]>2016-04-08 16:36:39 +0200
commit6ad0fcf2f32f412091d0dfd58da1d8f5dc474809 (patch)
treeeb10657a977c7c4c410ae15216d4068535a9f058 /src/lib/ipcp.c
parentaffea724d1810410186b10c93c64b7a8ddbe7aca (diff)
downloadouroboros-6ad0fcf2f32f412091d0dfd58da1d8f5dc474809.tar.gz
ouroboros-6ad0fcf2f32f412091d0dfd58da1d8f5dc474809.zip
lib, irmd, irm: Add dif_config
This adds dif_config to the prototype, in which one is able to specify the parameters a DIF should have. The bootstrap operation of an IPCP takes this as parameter and is oblivious to whether it is a shim or a normal IPCP. The dif_config struct is also correctly serialized and deserialized and passed opaquely to the correct IPCP. This IPCP is in charge of deserializing it correctly.
Diffstat (limited to 'src/lib/ipcp.c')
-rw-r--r--src/lib/ipcp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/ipcp.c b/src/lib/ipcp.c
index d61fcb50..a0febe4e 100644
--- a/src/lib/ipcp.c
+++ b/src/lib/ipcp.c
@@ -100,7 +100,7 @@ static ipcp_msg_t * send_recv_ipcp_msg(pid_t pid,
}
pid_t ipcp_create(instance_name_t * api,
- char * ipcp_type)
+ enum ipcp_type ipcp_type)
{
pid_t pid = 0;
char * api_id = NULL;
@@ -108,11 +108,6 @@ pid_t ipcp_create(instance_name_t * api,
char * ipcp_dir = "bin/ipcpd";
char * full_name = NULL;
- if (ipcp_type == NULL)
- return -1;
-
- LOG_DBG("%lu", _POSIX_C_SOURCE);
-
pid = fork();
if (pid == -1) {
LOG_ERR("Failed to fork");
@@ -146,7 +141,7 @@ pid_t ipcp_create(instance_name_t * api,
char * argv[] = {full_name,
api->name, api_id,
- ipcp_type, 0};
+ 0};
char * envp[] = {0};
@@ -241,14 +236,19 @@ int ipcp_unreg(pid_t pid,
return ret;
}
+
int ipcp_bootstrap(pid_t pid,
- struct dif_config * conf)
+ dif_config_msg_t * conf)
{
ipcp_msg_t msg = IPCP_MSG__INIT;
ipcp_msg_t * recv_msg = NULL;
int ret = -1;
+ if (conf == NULL)
+ return -EINVAL;
+
msg.code = IPCP_MSG_CODE__IPCP_BOOTSTRAP;
+ msg.conf = conf;
recv_msg = send_recv_ipcp_msg(pid, &msg);
if (recv_msg == NULL)