summaryrefslogtreecommitdiff
path: root/src/tools/irm/irm_create_ipcp.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-04-16 11:41:48 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-04-16 11:41:48 +0200
commit9687ace9a1faf752672774ae49a6428b378fa409 (patch)
tree046635cd3ca941f0debad37fa0865357b5b62a41 /src/tools/irm/irm_create_ipcp.c
parent1d5c9ae5c7c77f200e9670bbee714adad983136e (diff)
parent9906ac98c45530e530d7aa439937aedf526c3508 (diff)
downloadouroboros-9687ace9a1faf752672774ae49a6428b378fa409.tar.gz
ouroboros-9687ace9a1faf752672774ae49a6428b378fa409.zip
Merge branch 'be' of bitbucket.org:sandervrijders/ouroboros into be
Diffstat (limited to 'src/tools/irm/irm_create_ipcp.c')
-rw-r--r--src/tools/irm/irm_create_ipcp.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/tools/irm/irm_create_ipcp.c b/src/tools/irm/irm_create_ipcp.c
index 73d20dce..08b55259 100644
--- a/src/tools/irm/irm_create_ipcp.c
+++ b/src/tools/irm/irm_create_ipcp.c
@@ -20,10 +20,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <stdio.h>
#include <ouroboros/irm.h>
#include <ouroboros/common.h>
#include <ouroboros/instance_name.h>
+
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -31,18 +32,23 @@
#include "irm_ops.h"
#include "irm_utils.h"
+#define NORMAL "normal"
+#define SHIM_UDP "shim-udp"
+
static void usage()
{
printf("Usage: irm create_ipcp\n"
" ap <application process name>\n"
" [api <application process instance>]\n"
- " type <ipc process type>\n");
+ " type [TYPE]\n\n"
+ "where TYPE = {" NORMAL " " SHIM_UDP "}\n");
}
int do_create_ipcp(int argc, char ** argv)
{
char * ipcp_type = NULL;
instance_name_t api = {NULL, 0};
+ enum ipcp_type type = 0;
while (argc > 0) {
if (matches(*argv, "type") == 0) {
@@ -66,5 +72,14 @@ int do_create_ipcp(int argc, char ** argv)
return -1;
}
- return irm_create_ipcp(&api, ipcp_type);
+ if (strcmp(ipcp_type, NORMAL) == 0)
+ type = IPCP_NORMAL;
+ else if (strcmp(ipcp_type, SHIM_UDP) == 0)
+ type = IPCP_SHIM_UDP;
+ else {
+ usage();
+ return -1;
+ }
+
+ return irm_create_ipcp(&api, type);
}