diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-03-28 14:43:16 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-03-28 14:43:16 +0200 |
commit | a14d696bdbc72754e8019fa9579d5a338cc85a05 (patch) | |
tree | 2533a574e03a9954b9eeaf7750219d3175ce8b99 /src/tools/irm/irm_unregister_ipcp.c | |
parent | d37add0f20c93432c0b4c12866810c124a7a18ec (diff) | |
download | ouroboros-a14d696bdbc72754e8019fa9579d5a338cc85a05.tar.gz ouroboros-a14d696bdbc72754e8019fa9579d5a338cc85a05.zip |
lib: Update irm.h API
Removes rina_name_t from that API. Passing ap_name and api_id as
params instead. The IRM tool has been updated accordingly. Some errors
in the build related to protobuf-c have also been resolved.
Diffstat (limited to 'src/tools/irm/irm_unregister_ipcp.c')
-rw-r--r-- | src/tools/irm/irm_unregister_ipcp.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/tools/irm/irm_unregister_ipcp.c b/src/tools/irm/irm_unregister_ipcp.c index 0b669503..1321c263 100644 --- a/src/tools/irm/irm_unregister_ipcp.c +++ b/src/tools/irm/irm_unregister_ipcp.c @@ -45,36 +45,37 @@ static void usage() int do_unregister_ipcp(int argc, char ** argv) { - rina_name_t name; + char * ap_name = NULL; + int api_id = 0; char * difs[MAX_DIFS]; size_t difs_size = 0; - name.ap_name = NULL; - name.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 " - "unregister_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 " + "unregister_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_unreg_ipcp(name, difs, difs_size); + return irm_unreg_ipcp(ap_name, api_id, difs, difs_size); } |