From bd2dc6141b59d8fe67e7765b5dfce5b819ed7e33 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 3 Mar 2016 14:09:57 +0100 Subject: tools: irm: Provide all IRM calls This commit makes all IRM calls available to the user of the 'irm' tool. The bootstrap_ipcp call does not yet take the anything except the AP name. This will be added once we stabilize what should be configurable in the IPCP. --- src/tools/irm/irm_utils.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/tools/irm/irm_utils.c') diff --git a/src/tools/irm/irm_utils.c b/src/tools/irm/irm_utils.c index 34bec18c..021227fd 100644 --- a/src/tools/irm/irm_utils.c +++ b/src/tools/irm/irm_utils.c @@ -21,6 +21,11 @@ */ #include +#include +#include +#include + +#include "irm_utils.h" int matches(const char * cmd, const char * pattern) { @@ -31,3 +36,23 @@ int matches(const char * cmd, const char * pattern) return memcmp(pattern, cmd, len); } + + +bool parse_name(char ** argv, + rina_name_t * name) +{ + bool found = true; + + if (matches(*argv, "ap") == 0) + name->ap_name = *(argv + 1); + else if (matches(*argv, "api") == 0) + name->api_id = atoi(*(argv + 1)); + else if (matches(*argv, "ae") == 0) + name->ae_name = *(argv + 1); + else if (matches(*argv, "aei") == 0) + name->aei_id = atoi(*(argv + 1)); + else + found = false; + + return found; +} -- cgit v1.2.3