summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_unregister_ipcp.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2016-03-29 12:06:58 +0200
committerDimitri Staessens <[email protected]>2016-03-29 12:06:58 +0200
commit1d4442e472d20f261986089ea468daa93631d1f4 (patch)
tree3b27a134c762190b096de421310a50910dca4a34 /src/tools/irm/irm_unregister_ipcp.c
parente5d67f7d4df123c2490201447681f2efd553dcc1 (diff)
parent37c4ccaf59a0406053573e14909be48322ffb084 (diff)
downloadouroboros-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_unregister_ipcp.c')
-rw-r--r--src/tools/irm/irm_unregister_ipcp.c31
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);
}