diff options
author | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-03-30 11:23:52 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@intec.ugent.be> | 2016-03-30 11:23:52 +0200 |
commit | dd993fcf19f02dc1c694e16cd6fafadceb19dd4e (patch) | |
tree | 7231ffd5d341904ae75a6d141c6b36754d1ec4b6 /src/tools/irm/irm_register_ipcp.c | |
parent | 8cef483119da184d631634bc98b5236ac54c30ae (diff) | |
parent | 1d4442e472d20f261986089ea468daa93631d1f4 (diff) | |
download | ouroboros-dd993fcf19f02dc1c694e16cd6fafadceb19dd4e.tar.gz ouroboros-dd993fcf19f02dc1c694e16cd6fafadceb19dd4e.zip |
Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into HEAD
Diffstat (limited to 'src/tools/irm/irm_register_ipcp.c')
-rw-r--r-- | src/tools/irm/irm_register_ipcp.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/tools/irm/irm_register_ipcp.c b/src/tools/irm/irm_register_ipcp.c index 468ef28f..b8808ecd 100644 --- a/src/tools/irm/irm_register_ipcp.c +++ b/src/tools/irm/irm_register_ipcp.c @@ -45,36 +45,36 @@ static void usage() int do_register_ipcp(int argc, char ** argv) { - rina_name_t name; char * difs[MAX_DIFS]; size_t difs_size = 0; - - name.ap_name = NULL; - name.api_id = 0; + char * ap_name = NULL; + int api_id = 0; while (argc > 0) { - if (!parse_name(argv, &name)) { - if (matches(*argv, "dif") == 0) { - difs[difs_size++] = *(argv + 1); - if (difs_size > MAX_DIFS) { - printf("Too many difs specified\n"); - return -1; - } - } else { - printf("\"%s\" is unknown, try \"irm " - "register_ipcp\".\n", *argv); + if (matches(*argv, "ap") == 0) { + ap_name = *(argv + 1); + } else if (matches(*argv, "api") == 0) { + api_id = atoi(*(argv + 1)); + } else if (matches(*argv, "dif") == 0) { + difs[difs_size++] = *(argv + 1); + if (difs_size > MAX_DIFS) { + printf("Too many difs specified\n"); return -1; } + } else { + printf("\"%s\" is unknown, try \"irm " + "register_ipcp\".\n", *argv); + return -1; } argc -= 2; argv += 2; } - if (difs_size == 0 || name.ap_name == NULL) { + if (difs_size == 0 || ap_name == NULL) { usage(); return -1; } - return irm_reg_ipcp(name, difs, difs_size); + return irm_reg_ipcp(ap_name, api_id, difs, difs_size); } |