summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_create_ipcp.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-03-30 11:23:52 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-03-30 11:23:52 +0200
commitdd993fcf19f02dc1c694e16cd6fafadceb19dd4e (patch)
tree7231ffd5d341904ae75a6d141c6b36754d1ec4b6 /src/tools/irm/irm_create_ipcp.c
parent8cef483119da184d631634bc98b5236ac54c30ae (diff)
parent1d4442e472d20f261986089ea468daa93631d1f4 (diff)
downloadouroboros-dd993fcf19f02dc1c694e16cd6fafadceb19dd4e.tar.gz
ouroboros-dd993fcf19f02dc1c694e16cd6fafadceb19dd4e.zip
Merge branch 'be' of bitbucket.org:ouroboros-rina/ouroboros into HEAD
Diffstat (limited to 'src/tools/irm/irm_create_ipcp.c')
-rw-r--r--src/tools/irm/irm_create_ipcp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/tools/irm/irm_create_ipcp.c b/src/tools/irm/irm_create_ipcp.c
index 854a15f9..3262bd5c 100644
--- a/src/tools/irm/irm_create_ipcp.c
+++ b/src/tools/irm/irm_create_ipcp.c
@@ -40,31 +40,31 @@ static void usage()
int do_create_ipcp(int argc, char ** argv)
{
- rina_name_t name;
char * ipcp_type = NULL;
-
- name.ap_name = NULL;
- name.api_id = 0;
+ char * ap_name = NULL;
+ int api_id = 0;
while (argc > 0) {
- if (!parse_name(argv, &name)) {
- if (matches(*argv, "type") == 0) {
- ipcp_type = *(argv + 1);
- } else {
- printf("\"%s\" is unknown, try \"irm "
- "create_ipcp\".\n", *argv);
- return -1;
- }
+ if (matches(*argv, "type") == 0) {
+ ipcp_type = *(argv + 1);
+ } else if (matches(*argv, "ap") == 0) {
+ ap_name = *(argv + 1);
+ } else if (matches(*argv, "api") == 0) {
+ api_id = atoi(*(argv + 1));
+ } else {
+ printf("\"%s\" is unknown, try \"irm "
+ "create_ipcp\".\n", *argv);
+ return -1;
}
argc -= 2;
argv += 2;
}
- if (ipcp_type == NULL || name.ap_name == NULL) {
+ if (ipcp_type == NULL || ap_name == NULL) {
usage();
return -1;
}
- return irm_create_ipcp(name, ipcp_type);
+ return irm_create_ipcp(ap_name, api_id, ipcp_type);
}