summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/ribmgr.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-10-12 14:54:18 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-10-12 14:54:18 +0200
commit43e2f332770007a3fcea011ffb35e8fbb24a6205 (patch)
treec792e7674d1247fa95e096f746a3559e2f4f8b7e /src/ipcpd/normal/ribmgr.c
parent2ba45f5efe0486b88f91ecced451f74cc782e8a4 (diff)
downloadouroboros-43e2f332770007a3fcea011ffb35e8fbb24a6205.tar.gz
ouroboros-43e2f332770007a3fcea011ffb35e8fbb24a6205.zip
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.
Diffstat (limited to 'src/ipcpd/normal/ribmgr.c')
-rw-r--r--src/ipcpd/normal/ribmgr.c26
1 files changed, 7 insertions, 19 deletions
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;
+}