summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/pff.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-03-24 13:36:48 +0000
committerdimitri staessens <dimitri.staessens@ugent.be>2017-03-24 13:36:48 +0000
commit25d262cb383039b1d97a5b41ec477d6a40957398 (patch)
tree1967a00bfe73a11cafbee7a5e97173abd7699add /src/ipcpd/normal/pff.c
parente7f439e31aa8cd972b567da8c0421faa1ca09e59 (diff)
parent0ed6ef2567a8355013e2cd61a1a31df6be67ae01 (diff)
downloadouroboros-25d262cb383039b1d97a5b41ec477d6a40957398.tar.gz
ouroboros-25d262cb383039b1d97a5b41ec477d6a40957398.zip
Merged in sandervrijders/ouroboros/be-full-pff (pull request #421)
ipcpd: normal: Fill in forwarding table
Diffstat (limited to 'src/ipcpd/normal/pff.c')
-rw-r--r--src/ipcpd/normal/pff.c19
1 files changed, 19 insertions, 0 deletions
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;