diff options
author | dimitri staessens <[email protected]> | 2017-09-09 13:50:47 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2017-09-12 08:33:26 -0600 |
commit | 45c6615484ffe347654c34decb72ff1ef9bde0f3 (patch) | |
tree | f912e0eef256371f61b87a5a78e7604d9b623194 /src/ipcpd/normal/main.c | |
parent | 7c69c0f6b25a199bb3632eea66ccb7de1db06ccc (diff) | |
download | ouroboros-45c6615484ffe347654c34decb72ff1ef9bde0f3.tar.gz ouroboros-45c6615484ffe347654c34decb72ff1ef9bde0f3.zip |
ipcpd: Revise internals of normal IPCP
This removes the RIB as a datastructure and CDAP as the protocol
between IPCPs. CDAP, the rib and related sources are deprecated. The
link-state protocol policy is udpated to use its own protocol based on
a simple broadcast strategy along a tree. The neighbors struct is
deprecated and moved to the library as a generic notifier component.
Diffstat (limited to 'src/ipcpd/normal/main.c')
-rw-r--r-- | src/ipcpd/normal/main.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 22b6e718..2b35a04a 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -31,9 +31,9 @@ #include <ouroboros/ipcp-dev.h> #include <ouroboros/time_utils.h> #include <ouroboros/irm.h> -#include <ouroboros/rib.h> #include <ouroboros/hash.h> #include <ouroboros/errno.h> +#include <ouroboros/notifier.h> #include "addr_auth.h" #include "connmgr.h" @@ -42,8 +42,6 @@ #include "fa.h" #include "dt.h" #include "ipcp.h" -#include "ribconfig.h" -#include "ribmgr.h" #include <stdbool.h> #include <signal.h> @@ -56,11 +54,6 @@ static int initialize_components(const struct ipcp_config * conf) { - if (rib_init()) { - log_err("Failed to initialize RIB."); - goto fail_rib_init; - } - ipcpi.dif_name = strdup(conf->dif_info.dif_name); if (ipcpi.dif_name == NULL) { log_err("Failed to set DIF name."); @@ -85,11 +78,6 @@ static int initialize_components(const struct ipcp_config * conf) log_dbg("IPCP got address %" PRIu64 ".", ipcpi.dt_addr); - if (ribmgr_init()) { - log_err("Failed to initialize RIB manager."); - goto fail_ribmgr; - } - if (dt_init(conf->routing_type, conf->addr_size, conf->fd_size, @@ -117,14 +105,10 @@ static int initialize_components(const struct ipcp_config * conf) fail_fa: dt_fini(); fail_dt: - ribmgr_fini(); - fail_ribmgr: addr_auth_fini(); fail_addr_auth: free(ipcpi.dif_name); fail_dif_name: - rib_fini(); - fail_rib_init: return -1; } @@ -136,13 +120,9 @@ static void finalize_components(void) dt_fini(); - ribmgr_fini(); - addr_auth_fini(); free(ipcpi.dif_name); - - rib_fini(); } static int start_components(void) @@ -151,11 +131,6 @@ static int start_components(void) ipcp_set_state(IPCP_OPERATIONAL); - if (ribmgr_start()) { - log_err("Failed to start RIB manager."); - goto fail_ribmgr_start; - } - if (fa_start()) { log_err("Failed to start flow allocator."); goto fail_fa_start; @@ -178,8 +153,6 @@ static int start_components(void) fail_enroll_start: fa_stop(); fail_fa_start: - ribmgr_stop(); - fail_ribmgr_start: ipcp_set_state(IPCP_INIT); return -1; } @@ -195,8 +168,6 @@ static void stop_components(void) fa_stop(); - ribmgr_stop(); - ipcp_set_state(IPCP_INIT); } @@ -377,6 +348,11 @@ int main(int argc, goto fail_enroll_init; } + if (notifier_init()) { + log_err("Failed to initialize notifier component."); + goto fail_notifier_init; + } + if (ipcp_boot() < 0) { log_err("Failed to boot IPCP."); goto fail_boot; @@ -396,6 +372,8 @@ int main(int argc, finalize_components(); } + notifier_fini(); + enroll_fini(); connmgr_fini(); @@ -409,6 +387,8 @@ int main(int argc, fail_create_r: ipcp_shutdown(); fail_boot: + notifier_fini(); + fail_notifier_init: enroll_fini(); fail_enroll_init: connmgr_fini(); |