From 229385955109b866a23c4ac2aa03d4d11044c39d Mon Sep 17 00:00:00 2001 From: "Enrico Loparco (eloparco)" Date: Thu, 24 Jun 2021 09:15:41 +0200 Subject: [HICN-708] Rebase with master Signed-off-by: Enrico Loparco (eloparco) Change-Id: I2122e1d61dd3b2e039972624ffbdbcb3c5610159 --- hicn-plugin/src/strategies/dpo_mw.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'hicn-plugin/src/strategies/dpo_mw.c') diff --git a/hicn-plugin/src/strategies/dpo_mw.c b/hicn-plugin/src/strategies/dpo_mw.c index eebb572c4..12c77bce8 100644 --- a/hicn-plugin/src/strategies/dpo_mw.c +++ b/hicn-plugin/src/strategies/dpo_mw.c @@ -76,8 +76,6 @@ format_hicn_strategy_mw_ctx (u8 * s, va_list * ap) index_t index = va_arg (*ap, index_t); hicn_dpo_ctx_t *dpo_ctx = NULL; hicn_strategy_mw_ctx_t *mw_dpo_ctx = NULL; - dpo_id_t *next_hop = NULL; - hicn_face_vft_t *face_vft = NULL; u32 indent = va_arg (*ap, u32);; dpo_ctx = hicn_strategy_dpo_ctx_get (index); @@ -97,24 +95,20 @@ format_hicn_strategy_mw_ctx (u8 * s, va_list * ap) buf = format (NULL, "TFIB"); else continue; - next_hop = &dpo_ctx->next_hops[i]; - face_vft = hicn_face_get_vft (next_hop->dpoi_type); - if (face_vft != NULL) - { - s = format (s, "\n"); - s = - format (s, "%U ", face_vft->format_face, next_hop->dpoi_index, - indent); - s = format (s, "weight %u", mw_dpo_ctx->weight[i]); - s = format (s, " %s", buf); - } + + s = format (s, "\n"); + s = + format (s, "%U ", format_hicn_face, dpo_ctx->next_hops[i], + indent); + s = format (s, "weight %u", mw_dpo_ctx->weight[i]); + s = format (s, " %s", buf); } return (s); } void -hicn_strategy_mw_ctx_create (dpo_proto_t proto, const dpo_id_t * next_hop, +hicn_strategy_mw_ctx_create (fib_protocol_t proto, const hicn_face_id_t * next_hop, int nh_len, index_t * dpo_idx) { hicn_strategy_mw_ctx_t *hicn_strategy_mw_ctx; @@ -126,13 +120,13 @@ hicn_strategy_mw_ctx_create (dpo_proto_t proto, const dpo_id_t * next_hop, *dpo_idx = hicn_strategy_dpo_ctx_get_index (hicn_strategy_ctx); - init_dpo_ctx (hicn_strategy_ctx, next_hop, nh_len, hicn_dpo_type_mw); + init_dpo_ctx (hicn_strategy_ctx, next_hop, nh_len, hicn_dpo_type_mw, proto); memset (hicn_strategy_mw_ctx->weight, 0, HICN_PARAM_FIB_ENTRY_NHOPS_MAX); } int -hicn_strategy_mw_ctx_add_nh (const dpo_id_t * nh, index_t dpo_idx) +hicn_strategy_mw_ctx_add_nh (hicn_face_id_t nh, index_t dpo_idx) { hicn_dpo_ctx_t *hicn_strategy_dpo_ctx = hicn_strategy_dpo_ctx_get (dpo_idx); u8 pos = 0; -- cgit 1.2.3-korg