diff options
author | dimitri staessens <[email protected]> | 2017-08-28 18:54:22 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2017-08-28 20:49:34 +0200 |
commit | 9de8dc4948cf7ce239232aae0889c39ffa39ede2 (patch) | |
tree | 396295b2d36f69ee55e5080e556891f11210aed8 /src/ipcpd/normal/enroll.c | |
parent | 176698e8c2fd7ab8007b8074515d6144e7177d8e (diff) | |
download | ouroboros-9de8dc4948cf7ce239232aae0889c39ffa39ede2.tar.gz ouroboros-9de8dc4948cf7ce239232aae0889c39ffa39ede2.zip |
tools: Add tool to connect IPCP components
This enables user-written tools to instruct IPCPs to establish and
tear down connections (a.k.a. adjacencies) between its internal
components (Management and Data Transfer).
For more info, do "irm ipcp connect" or "irm ipcp disconnect" on the
command line.
This commit exposes a deletion bug in the RIB where FSO's fail to
unpack/parse. This will be fixed when the RIB is deprecated.
Diffstat (limited to 'src/ipcpd/normal/enroll.c')
-rw-r--r-- | src/ipcpd/normal/enroll.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c index 2f7dd9bc..7f93ed3a 100644 --- a/src/ipcpd/normal/enroll.c +++ b/src/ipcpd/normal/enroll.c @@ -259,14 +259,17 @@ static void * enroll_handle(void * o) continue; } - if (msg->code != ENROLL_CODE__ENROLL_DONE) { + if (msg->code != ENROLL_CODE__ENROLL_DONE || !msg->has_result) { log_err("Wrong message type."); enroll_msg__free_unpacked(msg, NULL); connmgr_dealloc(AEID_ENROLL, &conn); continue; } - log_dbg("Neighbor enrollment successful."); + if (msg->result == 0) + log_dbg("Neighbor enrollment successful."); + else + log_dbg("Neigbor reported failed enrollment."); connmgr_dealloc(AEID_ENROLL, &conn); } @@ -287,13 +290,16 @@ int enroll_boot(struct conn * conn, return 0; } -int enroll_done(struct conn * conn) +int enroll_done(struct conn * conn, + int result) { enroll_msg_t msg = ENROLL_MSG__INIT; uint8_t buf[ENROLL_BUF_LEN]; ssize_t len; - msg.code = ENROLL_CODE__ENROLL_DONE; + msg.code = ENROLL_CODE__ENROLL_DONE; + msg.has_result = true; + msg.result = result; len = enroll_msg__get_packed_size(&msg); if (len < 0) { |