diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-04-01 15:01:51 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-04-01 15:01:51 +0200 |
commit | 65591e5211fb3c44450c52d7534918902e0760d5 (patch) | |
tree | b3f21e0bdb9cf0e773962db73be041bb86d0ee44 /src/tools/irm/irm_create_ipcp.c | |
parent | 3d859bb9a75932a6cffdd37466d510b479c9aa71 (diff) | |
parent | 0e1aeba4f2d2de3ce827bfaeb1d9f2480e628529 (diff) | |
download | ouroboros-65591e5211fb3c44450c52d7534918902e0760d5.tar.gz ouroboros-65591e5211fb3c44450c52d7534918902e0760d5.zip |
Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into be-build
Diffstat (limited to 'src/tools/irm/irm_create_ipcp.c')
-rw-r--r-- | src/tools/irm/irm_create_ipcp.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/tools/irm/irm_create_ipcp.c b/src/tools/irm/irm_create_ipcp.c index 854a15f9..73d20dce 100644 --- a/src/tools/irm/irm_create_ipcp.c +++ b/src/tools/irm/irm_create_ipcp.c @@ -23,6 +23,7 @@ #include <stdio.h> #include <ouroboros/irm.h> #include <ouroboros/common.h> +#include <ouroboros/instance_name.h> #include <stdlib.h> #include <string.h> #include <errno.h> @@ -40,31 +41,30 @@ static void usage() int do_create_ipcp(int argc, char ** argv) { - rina_name_t name; char * ipcp_type = NULL; - - name.ap_name = NULL; - name.api_id = 0; + instance_name_t api = {NULL, 0}; while (argc > 0) { - if (!parse_name(argv, &name)) { - if (matches(*argv, "type") == 0) { - ipcp_type = *(argv + 1); - } else { - printf("\"%s\" is unknown, try \"irm " - "create_ipcp\".\n", *argv); - return -1; - } + if (matches(*argv, "type") == 0) { + ipcp_type = *(argv + 1); + } else if (matches(*argv, "ap") == 0) { + api.name = *(argv + 1); + } else if (matches(*argv, "api") == 0) { + api.id = atoi(*(argv + 1)); + } else { + printf("\"%s\" is unknown, try \"irm " + "create_ipcp\".\n", *argv); + return -1; } argc -= 2; argv += 2; } - if (ipcp_type == NULL || name.ap_name == NULL) { + if (ipcp_type == NULL || api.name == NULL) { usage(); return -1; } - return irm_create_ipcp(name, ipcp_type); + return irm_create_ipcp(&api, ipcp_type); } |