diff options
Diffstat (limited to 'src/tools/irm/irm_ipcp_create.c')
-rw-r--r-- | src/tools/irm/irm_ipcp_create.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/tools/irm/irm_ipcp_create.c b/src/tools/irm/irm_ipcp_create.c index ae2c2289..35d33782 100644 --- a/src/tools/irm/irm_ipcp_create.c +++ b/src/tools/irm/irm_ipcp_create.c @@ -1,10 +1,10 @@ /* - * Ouroboros - Copyright (C) 2016 - 2020 + * Ouroboros - Copyright (C) 2016 - 2024 * * Create IPC Processes * - * Dimitri Staessens <dimitri.staessens@ugent.be> - * Sander Vrijders <sander.vrijders@ugent.be> + * Dimitri Staessens <dimitri@ouroboros.rocks> + * Sander Vrijders <sander@ouroboros.rocks> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,30 +44,29 @@ #include "irm_ops.h" #include "irm_utils.h" -#define UNICAST "unicast" +#define UNICAST "unicast" #define BROADCAST "broadcast" #define UDP "udp" #define ETH_LLC "eth-llc" #define ETH_DIX "eth-dix" #define LOCAL "local" -#define RAPTOR "raptor" static void usage(void) { printf("Usage: irm ipcp create\n" " name <ipcp name>\n" " type [TYPE]\n\n" - "where TYPE = {" UNICAST " " BROADCAST " " LOCAL " " - UDP " " ETH_LLC " " RAPTOR "}\n"); + "where TYPE in {" UNICAST " " BROADCAST " " LOCAL " " + UDP " " ETH_LLC " " ETH_DIX "}\n"); } int do_create_ipcp(int argc, char ** argv) { - char * ipcp_type = NULL; - char * ipcp_name = NULL; - enum ipcp_type type = 0; - pid_t pid; + char * ipcp_type = NULL; + char * ipcp_name = NULL; + enum ipcp_type type = 0; + pid_t pid; while (argc > 0) { if (matches(*argv, "type") == 0) { @@ -101,15 +100,14 @@ int do_create_ipcp(int argc, type = IPCP_ETH_LLC; else if (strcmp(ipcp_type, ETH_DIX) == 0) type = IPCP_ETH_DIX; - else if (strcmp(ipcp_type, RAPTOR) == 0) - type = IPCP_RAPTOR; else { + printf("IPCP type \"%s\" is unknown.\n", ipcp_type); usage(); return -1; } pid = irm_create_ipcp(ipcp_name, type); - if (pid <= 0) + if (pid < 0) return -1; return 0; |