summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_enroll_ipcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/irm/irm_enroll_ipcp.c')
-rw-r--r--src/tools/irm/irm_enroll_ipcp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/tools/irm/irm_enroll_ipcp.c b/src/tools/irm/irm_enroll_ipcp.c
index 1dcdc919..5c9572bf 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,30 @@ static void usage()
int do_enroll_ipcp(int argc, char ** argv)
{
- rina_name_t name;
+ instance_name_t api = {NULL, 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) {
+ api.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 || api.name == NULL) {
usage();
return -1;
}
- return irm_enroll_ipcp(name, dif_name);
+ return irm_enroll_ipcp(&api, dif_name);
}