summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-28 16:11:19 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-06-28 16:22:01 +0200
commit0d789ed8d938cc342c8f2138280795a1d5a61e3d (patch)
treeb0a3b305473a68ee18262e7f103185b9ce9cb98c /src/tools/irm/irm.c
parentacd29da104d0d8ddace2b2693314542bb5a56fcc (diff)
downloadouroboros-0d789ed8d938cc342c8f2138280795a1d5a61e3d.tar.gz
ouroboros-0d789ed8d938cc342c8f2138280795a1d5a61e3d.zip
lib, irmd, ipcpd: Change of IRM API
This changes the IRM API after discussions with Dimitri. The register operation is now split into a bind and register operation. The same for unregister; unbind and unregister. PIDs are now used as the application instance name. A name for a PID is only provided for scriptability in bash. It is therefore also no longer passed down to the IPCP. Every operation on an IPCP through the IRM API has to use the PID. Quering of the PIDs by name is possible. The IRM tool has been updated to use this new API as well. A subcommand 'ipcp' has been added for operations that take effect on IPCPs only. Fixes #12
Diffstat (limited to 'src/tools/irm/irm.c')
-rw-r--r--src/tools/irm/irm.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/tools/irm/irm.c b/src/tools/irm/irm.c
index a1dc5ade..14420207 100644
--- a/src/tools/irm/irm.c
+++ b/src/tools/irm/irm.c
@@ -21,7 +21,6 @@
*/
#include <ouroboros/common.h>
-#include <ouroboros/instance_name.h>
#include <ouroboros/irm.h>
#include <stdio.h>
#include <string.h>
@@ -32,10 +31,8 @@
static void usage()
{
printf("Usage: irm [OPERATION]\n\n"
- "where OPERATION = {create_ipcp destroy_ipcp \n"
- " bootstrap_ipcp enroll_ipcp\n"
- " register unregister\n"
- " register_ipcp unregister_ipcp\n");
+ "where OPERATION = {ipcp bind unbind\n"
+ " register unregister\n");
}
static int do_help(int argc, char **argv)
@@ -48,10 +45,9 @@ static const struct cmd {
const char * cmd;
int (* func)(int argc, char ** argv);
} cmds[] = {
- { "create_ipcp", do_create_ipcp },
- { "destroy_ipcp", do_destroy_ipcp },
- { "bootstrap_ipcp", do_bootstrap_ipcp },
- { "enroll_ipcp", do_enroll_ipcp },
+ { "ipcp", ipcp_cmd },
+ { "bind", do_bind },
+ { "unbind", do_unbind },
{ "register", do_register },
{ "unregister", do_unregister },
{ "help", do_help },
@@ -78,7 +74,7 @@ int main(int argc, char ** argv) {
if (argc < 2) {
usage();
- return 0;
+ return -1;
}
return do_cmd(argv[1], argc - 1, argv + 1);