summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/main.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2017-04-26 20:31:39 +0200
committerdimitri staessens <[email protected]>2017-04-27 17:59:01 +0200
commitb398dbe5cfd12b928e00f9a22cd6826bbdfb18d7 (patch)
tree137c34f79897b5f371a65dd14208b77201d1e907 /src/ipcpd/normal/main.c
parent6d6a4a488d7b631f519b1cf462ffbb44d399e1ce (diff)
downloadouroboros-b398dbe5cfd12b928e00f9a22cd6826bbdfb18d7.tar.gz
ouroboros-b398dbe5cfd12b928e00f9a22cd6826bbdfb18d7.zip
ipcpd: Add capability reporting
The IPCP will now report the DIF name and the hash value to the IRMd as a dif_info struct. This can later be extended to add further capability reporting. Some bugfixes in normal. Fixes #24
Diffstat (limited to 'src/ipcpd/normal/main.c')
-rw-r--r--src/ipcpd/normal/main.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index ab8cf387..9228f36b 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -116,21 +116,21 @@ static int boot_components(void)
log_dbg("Starting ribmgr.");
- if (ribmgr_init()) {
- log_err("Failed to initialize RIB manager.");
+ if (dir_init()) {
+ log_err("Failed to initialize directory.");
goto fail_addr_auth;
}
- if (dir_init()) {
- log_err("Failed to initialize directory.");
- goto fail_ribmgr;
+ if (ribmgr_init()) {
+ log_err("Failed to initialize RIB manager.");
+ goto fail_dir;
}
log_dbg("Ribmgr started.");
if (frct_init()) {
log_err("Failed to initialize FRCT.");
- goto fail_dir;
+ goto fail_ribmgr;
}
if (fa_init()) {
@@ -180,10 +180,10 @@ static int boot_components(void)
fa_fini();
fail_frct:
frct_fini();
- fail_dir:
- dir_fini();
fail_ribmgr:
ribmgr_fini();
+ fail_dir:
+ dir_fini();
fail_addr_auth:
addr_auth_fini();
fail_name:
@@ -208,16 +208,17 @@ void shutdown_components(void)
frct_fini();
- dir_fini();
-
ribmgr_fini();
+ dir_fini();
+
addr_auth_fini();
free(ipcpi.dif_name);
}
-static int normal_ipcp_enroll(const char * dst)
+static int normal_ipcp_enroll(const char * dst,
+ struct dif_info * info)
{
if (rib_add(RIB_ROOT, MEMBERS_NAME)) {
log_err("Failed to create members.");
@@ -237,7 +238,11 @@ static int normal_ipcp_enroll(const char * dst)
log_dbg("Enrolled with " HASH_FMT, HASH_VAL(dst));
- return ipcpi.dir_hash_algo;
+ info->algo = ipcpi.dir_hash_algo;
+
+ strcpy(info->dif_name, ipcpi.dif_name);
+
+ return 0;
}
const struct ros {