diff options
author | Dimitri Staessens <dimitri.staessens@ugent.be> | 2018-03-22 11:02:15 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2018-03-22 12:36:58 +0100 |
commit | 751fb58bcf5fdb31c0627a5153684e96126cffb6 (patch) | |
tree | 5c4e8d8b2b2b323738703644c422a7e6c7095d5e /src/tools/irm/irm_ipcp_create.c | |
parent | fd5508b8daec47e9f646c086d4cc310583154b97 (diff) | |
download | ouroboros-751fb58bcf5fdb31c0627a5153684e96126cffb6.tar.gz ouroboros-751fb58bcf5fdb31c0627a5153684e96126cffb6.zip |
lib: Simplify reg/unreg API
The reg/unreg API is simplified to registering and unregistering a
single name with a single IPCP. The functionality associated with
registering names was moved from the IRMd to the irm tool. The
function to list IPCPs was simplified to return all IPCPs in the
system with their basic properties needed for management.
The above changes led to some needed changes in the irm tool and the
management functions that were depending on the previous behaviour of
list_ipcps.
Command line functionality to list IPCPs in the system is also added
to the irm tool.
Some older code was refactored.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src/tools/irm/irm_ipcp_create.c')
-rw-r--r-- | src/tools/irm/irm_ipcp_create.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/irm/irm_ipcp_create.c b/src/tools/irm/irm_ipcp_create.c index 6da853ba..c8866962 100644 --- a/src/tools/irm/irm_ipcp_create.c +++ b/src/tools/irm/irm_ipcp_create.c @@ -47,6 +47,7 @@ #define NORMAL "normal" #define UDP "udp" #define ETH_LLC "eth-llc" +#define ETH_DIX "eth-dix" #define LOCAL "local" #define RAPTOR "raptor" @@ -59,7 +60,8 @@ static void usage(void) UDP " " ETH_LLC " " RAPTOR "}\n"); } -int do_create_ipcp(int argc, char ** argv) +int do_create_ipcp(int argc, + char ** argv) { char * ipcp_type = NULL; char * ipcp_name = NULL; @@ -94,6 +96,8 @@ int do_create_ipcp(int argc, char ** argv) type = IPCP_LOCAL; else if (strcmp(ipcp_type, ETH_LLC) == 0) 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 { @@ -102,7 +106,7 @@ int do_create_ipcp(int argc, char ** argv) } pid = irm_create_ipcp(ipcp_name, type); - if (pid == 0) + if (pid <= 0) return -1; return 0; |