From b398dbe5cfd12b928e00f9a22cd6826bbdfb18d7 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Wed, 26 Apr 2017 20:31:39 +0200 Subject: 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 --- src/ipcpd/ipcp.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/ipcpd/ipcp.c') diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index d682309d..7f3ebc73 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -143,9 +143,10 @@ static void * ipcp_main_loop(void * o) ipcp_config_msg_t * conf_msg; struct ipcp_config conf; + struct dif_info info; struct timeval ltv = {(SOCKET_TIMEOUT / 1000), - (SOCKET_TIMEOUT % 1000) * 1000}; + (SOCKET_TIMEOUT % 1000) * 1000}; ssize_t id = (ssize_t) o; @@ -259,7 +260,14 @@ static void * ipcp_main_loop(void * o) break; } - ret_msg.result = ipcpi.ops->ipcp_enroll(msg->dst_name); + ret_msg.result = ipcpi.ops->ipcp_enroll(msg->dst_name, + &info); + + if (ret_msg.result == 0) { + ret_msg.has_dir_hash_algo = true; + ret_msg.dir_hash_algo = info.algo; + ret_msg.dif_name = info.dif_name; + } break; case IPCP_MSG_CODE__IPCP_REG: ret_msg.has_result = true; -- cgit v1.2.3