From 43e2f332770007a3fcea011ffb35e8fbb24a6205 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 12 Oct 2016 14:54:18 +0200 Subject: ipcpd: normal: Improve upon the internal design This commit will remove the RMT component from the normal IPCP, as some of its functionality would else be duplicated in the FMGR. Now all reading from flows, either N-1 or N+1 is done in the FMGR, then either passed to the FRCT or a lookup is performed in the PFF (not there yet) and the PDU is forwarded. --- src/ipcpd/normal/ribmgr.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'src/ipcpd/normal/ribmgr.c') diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index dd17f9bd..c69a59ce 100644 --- a/src/ipcpd/normal/ribmgr.c +++ b/src/ipcpd/normal/ribmgr.c @@ -39,7 +39,6 @@ #include "frct.h" #include "ipcp.h" #include "cdap_request.h" -#include "rmt.h" #include "static_info.pb-c.h" typedef StaticInfoMsg static_info_msg_t; @@ -242,7 +241,7 @@ int ribmgr_cdap_write(struct cdap * instance, rib.address = msg->address; - if (frct_init(rib.address)) { + if (frct_init()) { ipcp_set_state(IPCP_INIT); pthread_rwlock_unlock(&ipcpi.state_lock); cdap_send_reply(instance, invoke_id, -1, NULL, 0); @@ -251,16 +250,6 @@ int ribmgr_cdap_write(struct cdap * instance, return -1; } - if (rmt_init(rib.address)) { - ipcp_set_state(IPCP_INIT); - pthread_rwlock_unlock(&ipcpi.state_lock); - frct_fini(); - cdap_send_reply(instance, invoke_id, -1, NULL, 0); - static_info_msg__free_unpacked(msg, NULL); - LOG_ERR("Failed to init RMT"); - return -1; - } - static_info_msg__free_unpacked(msg, NULL); } else { ret = -1; @@ -540,17 +529,11 @@ int ribmgr_bootstrap(struct dif_config * conf) /* FIXME: Set correct address. */ rib.address = 0; - if (frct_init(rib.address)) { + if (frct_init()) { LOG_ERR("Failed to initialize FRCT."); return -1; } - if (rmt_init(rib.address)) { - LOG_ERR("Failed to initialize RMT."); - frct_fini(); - return -1; - } - LOG_DBG("Bootstrapped RIB Manager."); return 0; @@ -560,3 +543,8 @@ struct dt_const * ribmgr_dt_const() { return &(rib.dtc); } + +uint32_t ribmgr_address() +{ + return rib.address; +} -- cgit v1.2.3