diff options
author | Dimitri Staessens <[email protected]> | 2023-11-27 14:43:11 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2023-11-29 09:57:29 +0100 |
commit | 346b054ee32a9f7b8491f842709f72cc8d1f3f2e (patch) | |
tree | 5a406924ca94a03460e9b1e14d50cd1fca7c5c61 /src/irmd/ipcp.c | |
parent | 3f24301fff9c544dfe2b89c5737bc3cdf94ef9a9 (diff) | |
download | ouroboros-346b054ee32a9f7b8491f842709f72cc8d1f3f2e.tar.gz ouroboros-346b054ee32a9f7b8491f842709f72cc8d1f3f2e.zip |
include: Store IPCP name and type in info struct
The information for an IPCP is now stored in an ipcp_info struct,
containing name and type. The IRM public API is not changed.
Signed-off-by: Dimitri Staessens <[email protected]>
Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/irmd/ipcp.c')
-rw-r--r-- | src/irmd/ipcp.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/irmd/ipcp.c b/src/irmd/ipcp.c index b0d95b44..281c7176 100644 --- a/src/irmd/ipcp.c +++ b/src/irmd/ipcp.c @@ -122,16 +122,15 @@ ipcp_msg_t * send_recv_ipcp_msg(pid_t pid, return recv_msg; } -pid_t ipcp_create(const char * name, - enum ipcp_type ipcp_type) +pid_t ipcp_create(const struct ipcp_info * info) { pid_t pid; - char * exec_name; + char * exec_name = NULL; char irmd_pid[10]; char full_name[256]; char * argv[5]; - switch(ipcp_type) { + switch(info->type) { case IPCP_UNICAST: exec_name = IPCP_UNICAST_EXEC; break; @@ -154,7 +153,7 @@ pid_t ipcp_create(const char * name, return -1; } - if (strlen(exec_name) == 0) { + if (exec_name == NULL) { log_err("IPCP type not installed."); return -1; } @@ -167,7 +166,7 @@ pid_t ipcp_create(const char * name, /* log_file to be placed at the end */ argv[0] = full_name; argv[1] = irmd_pid; - argv[2] = (char *) name; + argv[2] = (char *) info->name; if (log_syslog) argv[3] = "1"; else |