From 0ed6ef2567a8355013e2cd61a1a31df6be67ae01 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Fri, 24 Mar 2017 14:05:40 +0100 Subject: ipcpd: normal: Fill in forwarding table The routing now takes the results of the routing table to fill in the forwarding table, by going through the neighbors and filling in the right fd. --- src/ipcpd/normal/pff.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/ipcpd/normal/pff.c') diff --git a/src/ipcpd/normal/pff.c b/src/ipcpd/normal/pff.c index 8cab7936..77c2c551 100644 --- a/src/ipcpd/normal/pff.c +++ b/src/ipcpd/normal/pff.c @@ -68,6 +68,16 @@ void pff_destroy(struct pff * instance) free(instance); } +void pff_lock(struct pff * instance) +{ + pthread_mutex_lock(&instance->lock); +} + +void pff_unlock(struct pff * instance) +{ + pthread_mutex_unlock(&instance->lock); +} + int pff_add(struct pff * instance, uint64_t addr, int fd) { int * val; @@ -132,6 +142,15 @@ int pff_remove(struct pff * instance, uint64_t addr) return 0; } +void pff_flush(struct pff * instance) +{ + assert(instance); + + pthread_mutex_lock(&instance->lock); + htable_flush(instance->table); + pthread_mutex_unlock(&instance->lock); +} + int pff_nhop(struct pff * instance, uint64_t addr) { int * j; -- cgit v1.2.3