summaryrefslogtreecommitdiff
path: root/src/irmd/main.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/irmd/main.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/irmd/main.c')
-rw-r--r--src/irmd/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index a900b0ed..1f1c4839 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -31,6 +31,7 @@
#include <ouroboros/list.h>
#include <ouroboros/instance_name.h>
#include <ouroboros/utils.h>
+#include <ouroboros/dif_config.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -84,7 +85,7 @@ static struct ipcp_entry * find_ipcp_by_name(instance_name_t * api)
}
static int create_ipcp(instance_name_t * api,
- char * ipcp_type)
+ enum ipcp_type ipcp_type)
{
pid_t pid;
struct ipcp_entry * tmp = NULL;
@@ -144,8 +145,8 @@ static int destroy_ipcp(instance_name_t * api)
return 0;
}
-static int bootstrap_ipcp(instance_name_t * api,
- struct dif_config * conf)
+static int bootstrap_ipcp(instance_name_t * api,
+ dif_config_msg_t * conf)
{
struct ipcp_entry * entry = NULL;
@@ -155,7 +156,7 @@ static int bootstrap_ipcp(instance_name_t * api,
return -1;
}
- entry->dif_name = strdup( conf->dif_name);
+ entry->dif_name = strdup(conf->dif_name);
if (entry->dif_name == NULL) {
LOG_ERR("Failed to strdup");
return -1;
@@ -389,7 +390,7 @@ int main()
break;
case IRM_MSG_CODE__IRM_BOOTSTRAP_IPCP:
ret_msg.has_result = true;
- ret_msg.result = bootstrap_ipcp(&api, NULL);
+ ret_msg.result = bootstrap_ipcp(&api, msg->conf);
break;
case IRM_MSG_CODE__IRM_ENROLL_IPCP:
ret_msg.has_result = true;