diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-04-26 20:31:39 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-04-27 17:59:01 +0200 |
commit | b398dbe5cfd12b928e00f9a22cd6826bbdfb18d7 (patch) | |
tree | 137c34f79897b5f371a65dd14208b77201d1e907 /src/ipcpd/ipcp.c | |
parent | 6d6a4a488d7b631f519b1cf462ffbb44d399e1ce (diff) | |
download | ouroboros-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/ipcp.c')
-rw-r--r-- | src/ipcpd/ipcp.c | 12 |
1 files changed, 10 insertions, 2 deletions
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; |