diff options
Diffstat (limited to 'src/ipcpd/unicast')
-rw-r--r-- | src/ipcpd/unicast/dt.c | 5 | ||||
-rw-r--r-- | src/ipcpd/unicast/dt.h | 1 | ||||
-rw-r--r-- | src/ipcpd/unicast/enroll.c | 3 | ||||
-rw-r--r-- | src/ipcpd/unicast/main.c | 1 | ||||
-rw-r--r-- | src/ipcpd/unicast/pff.h | 5 | ||||
-rw-r--r-- | src/ipcpd/unicast/routing.c | 12 |
6 files changed, 19 insertions, 8 deletions
diff --git a/src/ipcpd/unicast/dt.c b/src/ipcpd/unicast/dt.c index cabc159d..ee14d28e 100644 --- a/src/ipcpd/unicast/dt.c +++ b/src/ipcpd/unicast/dt.c @@ -621,7 +621,6 @@ static void * dt_conn_handle(void * o) } int dt_init(enum pol_routing pr, - enum pol_pff pp, uint8_t addr_size, uint8_t eid_size, uint8_t max_ttl) @@ -629,6 +628,7 @@ int dt_init(enum pol_routing pr, int i; int j; char dtstr[256]; + enum pol_pff pp; struct conn_info info; memset(&info, 0, sizeof(info)); @@ -659,7 +659,8 @@ int dt_init(enum pol_routing pr, goto fail_connmgr_comp_init; } - if (routing_init(pr)) { + pp = routing_init(pr); + if (pp < 0) { log_err("Failed to init routing."); goto fail_routing; } diff --git a/src/ipcpd/unicast/dt.h b/src/ipcpd/unicast/dt.h index 15a7b660..73b71a92 100644 --- a/src/ipcpd/unicast/dt.h +++ b/src/ipcpd/unicast/dt.h @@ -32,7 +32,6 @@ #define INVALID_ADDR 0 int dt_init(enum pol_routing pr, - enum pol_pff pp, uint8_t addr_size, uint8_t eid_size, uint8_t max_ttl diff --git a/src/ipcpd/unicast/enroll.c b/src/ipcpd/unicast/enroll.c index 582e808f..6a612ff3 100644 --- a/src/ipcpd/unicast/enroll.c +++ b/src/ipcpd/unicast/enroll.c @@ -136,7 +136,6 @@ static int send_rcv_enroll_msg(int fd) enroll.conf.max_ttl = reply->conf->max_ttl; enroll.conf.addr_auth_type = reply->conf->addr_auth_type; enroll.conf.routing_type = reply->conf->routing_type; - enroll.conf.pff_type = reply->conf->pff_type; enroll.conf.layer_info.dir_hash_algo = reply->conf->layer_info->dir_hash_algo; @@ -173,8 +172,6 @@ static ssize_t enroll_pack(uint8_t ** buf) config.addr_auth_type = enroll.conf.addr_auth_type; config.has_routing_type = true; config.routing_type = enroll.conf.routing_type; - config.has_pff_type = true; - config.pff_type = enroll.conf.pff_type; config.layer_info = &layer_info; layer_info.layer_name = (char *) enroll.conf.layer_info.layer_name; diff --git a/src/ipcpd/unicast/main.c b/src/ipcpd/unicast/main.c index 33295e29..43052209 100644 --- a/src/ipcpd/unicast/main.c +++ b/src/ipcpd/unicast/main.c @@ -82,7 +82,6 @@ static int initialize_components(const struct ipcp_config * conf) log_dbg("IPCP got address %" PRIu64 ".", ipcpi.dt_addr); if (dt_init(conf->routing_type, - conf->pff_type, conf->addr_size, conf->eid_size, conf->max_ttl)) { diff --git a/src/ipcpd/unicast/pff.h b/src/ipcpd/unicast/pff.h index d88ffa7f..a7b618dc 100644 --- a/src/ipcpd/unicast/pff.h +++ b/src/ipcpd/unicast/pff.h @@ -29,6 +29,11 @@ #include <stdlib.h> #include <stdbool.h> +enum pol_pff { + PFF_SIMPLE = 0, + PFF_ALTERNATE +}; + struct pff * pff_create(enum pol_pff pol); void pff_destroy(struct pff * pff); 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) |