summaryrefslogtreecommitdiff
path: root/src/ipcpd/ipcp.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2017-01-08 11:14:43 +0100
committerSander Vrijders <sander.vrijders@intec.ugent.be>2017-01-09 11:23:48 +0100
commit0a071a42d4e80f54e92f34911cafda3d666d35d5 (patch)
tree456cb6250d0396705bef29b0d80c889bee205fe7 /src/ipcpd/ipcp.c
parente56d24010287127fc6b9c9da8d1f7cf160c50253 (diff)
downloadouroboros-0a071a42d4e80f54e92f34911cafda3d666d35d5.tar.gz
ouroboros-0a071a42d4e80f54e92f34911cafda3d666d35d5.zip
ipcpd: Let IPCPs bind a name
This allows IPCPs to bind a name, so that they can announce their name to neighbors which can then allocate a flow to them. Registering of the name happens by an administrator. It also moves the irmd_api to common ground, since it is used by all IPCPs.
Diffstat (limited to 'src/ipcpd/ipcp.c')
-rw-r--r--src/ipcpd/ipcp.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c
index 2e4c3fca..96f00dc0 100644
--- a/src/ipcpd/ipcp.c
+++ b/src/ipcpd/ipcp.c
@@ -440,22 +440,26 @@ int ipcp_parse_arg(int argc, char * argv[])
if (atoi(argv[1]) == 0)
return -1;
- if (argv[2] == NULL)
+ ipcpi.irmd_api = atoi(argv[1]);
+
+ /* argument 2: IPCP name */
+ ipcpi.name = argv[2];
+
+ /* argument 3: logfile name (if any) */
+ if (argv[3] == NULL)
return 0;
len += strlen(INSTALL_PREFIX);
len += strlen(LOG_DIR);
- len += strlen(argv[2]);
+ len += strlen(argv[3]);
log_file = malloc(len + 1);
- if (log_file == NULL) {
- LOG_ERR("Failed to malloc");
+ if (log_file == NULL)
return -1;
- }
strcpy(log_file, INSTALL_PREFIX);
strcat(log_file, LOG_DIR);
- strcat(log_file, argv[2]);
+ strcat(log_file, argv[3]);
log_file[len] = '\0';
if (set_logfile(log_file))