summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/connmgr.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@ugent.be>2017-09-13 09:41:41 +0000
committerSander Vrijders <sander.vrijders@ugent.be>2017-09-13 09:41:41 +0000
commit888d3dbe7c3844d2efe9d6bc9823630db5d47a3b (patch)
treeed79946a5ff22267857cd6d5a864d15339c942a1 /src/ipcpd/normal/connmgr.c
parent2e4cdc1f680d5ee9086adac76acebdec3bd1da3f (diff)
parent45c6615484ffe347654c34decb72ff1ef9bde0f3 (diff)
downloadouroboros-888d3dbe7c3844d2efe9d6bc9823630db5d47a3b.tar.gz
ouroboros-888d3dbe7c3844d2efe9d6bc9823630db5d47a3b.zip
Merged in dstaesse/ouroboros/be-rib-removal (pull request #589)
ipcpd: Revise internals of normal IPCP
Diffstat (limited to 'src/ipcpd/normal/connmgr.c')
-rw-r--r--src/ipcpd/normal/connmgr.c34
1 files changed, 22 insertions, 12 deletions
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 <ouroboros/dev.h>
#include <ouroboros/cacep.h>
-#include <ouroboros/cdap.h>
#include <ouroboros/errno.h>
#include <ouroboros/list.h>
#include <ouroboros/logs.h>
+#include <ouroboros/notifier.h>
#include "ae.h"
#include "connmgr.h"
#include "enroll.h"
#include "ipcp.h"
-#include "ribmgr.h"
#include <pthread.h>
#include <string.h>
@@ -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);
}