From 6ad0fcf2f32f412091d0dfd58da1d8f5dc474809 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Fri, 8 Apr 2016 16:32:35 +0200 Subject: 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. --- src/irmd/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/irmd/main.c') 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 #include #include +#include #include #include @@ -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; -- cgit v1.2.3