From 0d789ed8d938cc342c8f2138280795a1d5a61e3d Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 28 Jun 2016 16:11:19 +0200 Subject: 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 --- src/tools/irm/irm.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/tools/irm/irm.c') 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 -#include #include #include #include @@ -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); -- cgit v1.2.3