summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_register_ipcp.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2016-04-01 15:01:51 +0200
committerdimitri staessens <[email protected]>2016-04-01 15:01:51 +0200
commit65591e5211fb3c44450c52d7534918902e0760d5 (patch)
treeb3f21e0bdb9cf0e773962db73be041bb86d0ee44 /src/tools/irm/irm_register_ipcp.c
parent3d859bb9a75932a6cffdd37466d510b479c9aa71 (diff)
parent0e1aeba4f2d2de3ce827bfaeb1d9f2480e628529 (diff)
downloadouroboros-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_register_ipcp.c')
-rw-r--r--src/tools/irm/irm_register_ipcp.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/tools/irm/irm_register_ipcp.c b/src/tools/irm/irm_register_ipcp.c
index 468ef28f..f0c1ccff 100644
--- a/src/tools/irm/irm_register_ipcp.c
+++ b/src/tools/irm/irm_register_ipcp.c
@@ -45,36 +45,35 @@ 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;
+ instance_name_t api = {NULL, 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) {
+ api.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 || api.name == NULL) {
usage();
return -1;
}
- return irm_reg_ipcp(name, difs, difs_size);
+ return irm_reg_ipcp(&api, difs, difs_size);
}