From 45c6615484ffe347654c34decb72ff1ef9bde0f3 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Sat, 9 Sep 2017 13:50:47 +0200 Subject: 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. --- src/ipcpd/normal/connmgr.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'src/ipcpd/normal/connmgr.c') diff --git a/src/ipcpd/normal/connmgr.c b/src/ipcpd/normal/connmgr.c index 9feac0f6..8d3da709 100644 --- a/src/ipcpd/normal/connmgr.c +++ b/src/ipcpd/normal/connmgr.c @@ -26,16 +26,15 @@ #include #include -#include #include #include #include +#include #include "ae.h" #include "connmgr.h" #include "enroll.h" #include "ipcp.h" -#include "ribmgr.h" #include #include @@ -198,8 +197,7 @@ void connmgr_stop(void) } int connmgr_ae_init(enum ae_id id, - const struct conn_info * info, - struct nbs * nbs) + const struct conn_info * info) { struct ae * ae; @@ -220,8 +218,6 @@ int connmgr_ae_init(enum ae_id id, memcpy(&connmgr.aes[id].info, info, sizeof(connmgr.aes[id].info)); - connmgr.aes[id].nbs = nbs; - return 0; } @@ -258,8 +254,6 @@ void connmgr_ae_fini(enum ae_id id) pthread_mutex_destroy(&ae->lock); memset(&connmgr.aes[id].info, 0, sizeof(connmgr.aes[id].info)); - - connmgr.aes[id].nbs = NULL; } int connmgr_ipcp_connect(const char * dst, @@ -394,8 +388,16 @@ int connmgr_alloc(enum ae_id id, return -1; } - if (connmgr.aes[id].nbs != NULL) - nbs_add(connmgr.aes[id].nbs, *conn); + switch (id) { + case AEID_DT: + notifier_event(NOTIFY_DT_CONN_ADD, conn); + break; + case AEID_MGMT: + notifier_event(NOTIFY_MGMT_CONN_ADD, conn); + break; + default: + break; + } return 0; } @@ -403,8 +405,16 @@ int connmgr_alloc(enum ae_id id, int connmgr_dealloc(enum ae_id id, struct conn * conn) { - if (connmgr.aes[id].nbs != NULL) - nbs_del(connmgr.aes[id].nbs, conn->flow_info.fd); + switch (id) { + case AEID_DT: + notifier_event(NOTIFY_DT_CONN_DEL, conn); + break; + case AEID_MGMT: + notifier_event(NOTIFY_MGMT_CONN_DEL, conn); + break; + default: + break; + } return flow_dealloc(conn->flow_info.fd); } -- cgit v1.2.3