From 301212fc967b51fd01e02c0dca8c9183db923b11 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 3 Jul 2018 15:51:16 +0200 Subject: ipcpd: React to flow events actively This adds the infrastructure to actively react to flow up, down and deallocated events. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- src/ipcpd/normal/sdu_sched.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/ipcpd/normal/sdu_sched.c') diff --git a/src/ipcpd/normal/sdu_sched.c b/src/ipcpd/normal/sdu_sched.c index 0ae22895..6ce18ed5 100644 --- a/src/ipcpd/normal/sdu_sched.c +++ b/src/ipcpd/normal/sdu_sched.c @@ -25,9 +25,11 @@ #include "config.h" #include +#include #include "ipcp.h" #include "sdu_sched.h" +#include "connmgr.h" #include #include @@ -86,10 +88,25 @@ static void * sdu_reader(void * o) continue; while ((fd = fqueue_next(fq)) >= 0) { - if (ipcp_flow_read(fd, &sdb)) - continue; - - sched->callback(fd, qc, sdb); + switch (fqueue_type(fq)) { + case FLOW_DEALLOC: + notifier_event(NOTIFY_DT_FLOW_DEALLOC, &fd); + break; + case FLOW_DOWN: + notifier_event(NOTIFY_DT_FLOW_DOWN, &fd); + break; + case FLOW_UP: + notifier_event(NOTIFY_DT_FLOW_UP, &fd); + break; + case FLOW_PKT: + if (ipcp_flow_read(fd, &sdb)) + continue; + + sched->callback(fd, qc, sdb); + break; + default: + break; + } } } -- cgit v1.2.3