summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast/routing.c
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2020-02-12 22:31:18 +0100
committerSander Vrijders <[email protected]>2020-02-16 18:21:41 +0100
commit0ae1f0dd600f6c21c34565cf4dc0c5ef0ae42709 (patch)
tree023e611cb59e4e14f03adaffa15190c835f80814 /src/ipcpd/unicast/routing.c
parent71eeedd1a05d5dd200c77527ea15086bf43e1a26 (diff)
downloadouroboros-0ae1f0dd600f6c21c34565cf4dc0c5ef0ae42709.tar.gz
ouroboros-0ae1f0dd600f6c21c34565cf4dc0c5ef0ae42709.zip
ipcpd: Configure PFF from routing policy
The Packet Forwarding Function (PFF) was user-configurable using the irm tool. However, this isn't really wanted since the PFF is dictated by the routing algorithm. This moves the responsability for selecting the correct PFF from the network admin to the unicast IPCP implementation. Each routing policy now has to specify which PFF it will use. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/ipcpd/unicast/routing.c')
-rw-r--r--src/ipcpd/unicast/routing.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ipcpd/unicast/routing.c b/src/ipcpd/unicast/routing.c
index 1d660cde..0794555e 100644
--- a/src/ipcpd/unicast/routing.c
+++ b/src/ipcpd/unicast/routing.c
@@ -24,6 +24,7 @@
#include <ouroboros/errno.h>
+#include "pff.h"
#include "routing.h"
#include "pol/link_state.h"
@@ -31,16 +32,25 @@ struct pol_routing_ops * r_ops;
int routing_init(enum pol_routing pr)
{
+ enum pol_pff pff_type;
+
switch (pr) {
case ROUTING_LINK_STATE:
+ pff_type = PFF_SIMPLE;
+ r_ops = &link_state_ops;
+ break;
case ROUTING_LINK_STATE_LFA:
+ pff_type = PFF_ALTERNATE;
r_ops = &link_state_ops;
break;
default:
return -ENOTSUP;
}
- return r_ops->init(pr);
+ if (r_ops->init(pr))
+ return -1;
+
+ return pff_type;
}
struct routing_i * routing_i_create(struct pff * pff)