diff options
author | Dimitri Staessens <dimitri.staessens@intec.ugent.be> | 2016-03-29 12:06:58 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri.staessens@intec.ugent.be> | 2016-03-29 12:06:58 +0200 |
commit | 1d4442e472d20f261986089ea468daa93631d1f4 (patch) | |
tree | 3b27a134c762190b096de421310a50910dca4a34 /src/tools/irm/irm_enroll_ipcp.c | |
parent | e5d67f7d4df123c2490201447681f2efd553dcc1 (diff) | |
parent | 37c4ccaf59a0406053573e14909be48322ffb084 (diff) | |
download | ouroboros-1d4442e472d20f261986089ea468daa93631d1f4.tar.gz ouroboros-1d4442e472d20f261986089ea468daa93631d1f4.zip |
Merged in sandervrijders/ouroboros/be-gpb (pull request #45)
Replace custom ser/des with GPB
Diffstat (limited to 'src/tools/irm/irm_enroll_ipcp.c')
-rw-r--r-- | src/tools/irm/irm_enroll_ipcp.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/tools/irm/irm_enroll_ipcp.c b/src/tools/irm/irm_enroll_ipcp.c index 1dcdc919..70798821 100644 --- a/src/tools/irm/irm_enroll_ipcp.c +++ b/src/tools/irm/irm_enroll_ipcp.c @@ -21,6 +21,7 @@ */ #include <stdio.h> +#include <stdlib.h> #include <ouroboros/irm.h> #include <ouroboros/common.h> @@ -37,31 +38,31 @@ static void usage() int do_enroll_ipcp(int argc, char ** argv) { - rina_name_t name; + char * ap_name = NULL; + int api_id = 0; char * dif_name = NULL; - name.ap_name = NULL; - name.api_id = 0; - while (argc > 0) { - if (!parse_name(argv, &name)) { - if (matches(*argv, "dif") == 0) { - dif_name = *(argv + 1); - } else { - printf("\"%s\" is unknown, try \"irm " - "enroll_ipcp\".\n", *argv); - return -1; - } + 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) { + dif_name = *(argv + 1); + } else { + printf("\"%s\" is unknown, try \"irm " + "enroll_ipcp\".\n", *argv); + return -1; } argc -= 2; argv += 2; } - if (dif_name == NULL || name.ap_name == NULL) { + if (dif_name == NULL || ap_name == NULL) { usage(); return -1; } - return irm_enroll_ipcp(name, dif_name); + return irm_enroll_ipcp(ap_name, api_id, dif_name); } |