summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/pff.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-09-21 14:26:51 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-09-21 16:55:31 +0200
commitf6071ecf0cd3768eaed9a847f676433c120ea89e (patch)
tree21f2738c9f0130653ae4253b374f34061d119399 /src/ipcpd/normal/pff.c
parent6b6f82c8a58b2edbd029909be2ba1057c00cd6ed (diff)
downloadouroboros-f6071ecf0cd3768eaed9a847f676433c120ea89e.tar.gz
ouroboros-f6071ecf0cd3768eaed9a847f676433c120ea89e.zip
ipcpd: normal: Add alternate hop PFF
This adds a PFF that returns an alternate hop as next hop in case the hop that would have been returned is down.
Diffstat (limited to 'src/ipcpd/normal/pff.c')
-rw-r--r--src/ipcpd/normal/pff.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ipcpd/normal/pff.c b/src/ipcpd/normal/pff.c
index 27ff17f7..3d114aa1 100644
--- a/src/ipcpd/normal/pff.c
+++ b/src/ipcpd/normal/pff.c
@@ -24,6 +24,7 @@
#include "pff.h"
#include "pol-pff-ops.h"
+#include "pol/alternate_pff.h"
#include "pol/simple_pff.h"
struct pff {
@@ -40,16 +41,20 @@ struct pff * pff_create(enum pol_pff pol)
return NULL;
switch (pol) {
- case SIMPLE_PFF:
+ case PFF_ALTERNATE:
+ pff->ops = &alternate_pff_ops;
+ break;
+ case PFF_SIMPLE:
pff->ops = &simple_pff_ops;
- pff->pff_i = pff->ops->create();
- if (pff->pff_i == NULL)
- goto err;
break;
default:
goto err;
}
+ pff->pff_i = pff->ops->create();
+ if (pff->pff_i == NULL)
+ goto err;
+
return pff;
err:
free(pff);