summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/main.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-09-18 08:03:31 +0200
committerdimitri staessens <dimitri.staessens@ugent.be>2017-09-18 09:27:53 +0200
commitf86502516b2a069954d0529d8b43593ece7360eb (patch)
tree73bc28244ef03c23e2ba5e79ae843de3df3fe727 /src/ipcpd/normal/main.c
parent60ffacc12ab73752cb6ef736f2b41022c984785c (diff)
downloadouroboros-f86502516b2a069954d0529d8b43593ece7360eb.tar.gz
ouroboros-f86502516b2a069954d0529d8b43593ece7360eb.zip
lib: Provide RIB API to export internals via fuse
This adds a virtual RIB that is accessible as a filesystem that is accessed through a fuse mountpoint (configurable , default is /tmp/ouroboros). Currently, each IPCP will export its link state database.
Diffstat (limited to 'src/ipcpd/normal/main.c')
-rw-r--r--src/ipcpd/normal/main.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c
index 2b35a04a..e6dd6717 100644
--- a/src/ipcpd/normal/main.c
+++ b/src/ipcpd/normal/main.c
@@ -26,21 +26,21 @@
#define OUROBOROS_PREFIX "normal-ipcp"
-#include <ouroboros/endian.h>
-#include <ouroboros/logs.h>
+#include <ouroboros/errno.h>
+#include <ouroboros/hash.h>
#include <ouroboros/ipcp-dev.h>
-#include <ouroboros/time_utils.h>
#include <ouroboros/irm.h>
-#include <ouroboros/hash.h>
-#include <ouroboros/errno.h>
+#include <ouroboros/logs.h>
#include <ouroboros/notifier.h>
+#include <ouroboros/rib.h>
+#include <ouroboros/time_utils.h>
#include "addr_auth.h"
#include "connmgr.h"
#include "dir.h"
+#include "dt.h"
#include "enroll.h"
#include "fa.h"
-#include "dt.h"
#include "ipcp.h"
#include <stdbool.h>
@@ -338,6 +338,11 @@ int main(int argc,
}
/* These components must be init at creation. */
+ if (rib_init("ipcpd-normal")) {
+ log_err("Failed to initialize RIB.");
+ goto fail_rib_init;
+ }
+
if (connmgr_init()) {
log_err("Failed to initialize connection manager.");
goto fail_connmgr_init;
@@ -378,6 +383,8 @@ int main(int argc,
connmgr_fini();
+ rib_fini();
+
irm_unbind_api(getpid(), ipcpi.name);
ipcp_fini();
@@ -393,6 +400,8 @@ int main(int argc,
fail_enroll_init:
connmgr_fini();
fail_connmgr_init:
+ rib_fini();
+ fail_rib_init:
irm_unbind_api(getpid(), ipcpi.name);
fail_bind_api:
ipcp_fini();