From 15ad172a847fa667c57a4594ef4158405db9a984 Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Tue, 31 Mar 2020 17:50:43 +0200 Subject: [HICN-554] hicn-light refactoring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I36f2d393741d4502ce14d3791158e43e3e9cd4cf Signed-off-by: Jordan AugĂ© --- hicn-plugin/src/mapme_ctrl_node.c | 12 +++++++----- hicn-plugin/src/mapme_eventmgr.c | 3 ++- hicn-plugin/src/mapme_eventmgr.h | 2 ++ 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'hicn-plugin') diff --git a/hicn-plugin/src/mapme_ctrl_node.c b/hicn-plugin/src/mapme_ctrl_node.c index ed25a31b0..182fbabd3 100644 --- a/hicn-plugin/src/mapme_ctrl_node.c +++ b/hicn-plugin/src/mapme_ctrl_node.c @@ -130,7 +130,7 @@ hicn_mapme_process_ctrl (vlib_main_t * vm, vlib_buffer_t * b, #endif /* Process the hICN DPO */ - hicn_mapme_tfib_t *tfib = + hicn_mapme_tfib_t * tfib = TFIB (hicn_strategy_dpo_ctx_get (dpo->dpoi_index)); if (tfib == NULL) @@ -158,6 +158,7 @@ hicn_mapme_process_ctrl (vlib_main_t * vm, vlib_buffer_t * b, /* Move next hops to TFIB... but in_face... */ for (u8 pos = 0; pos < tfib->entry_count; pos++) { + // XXX BUG if (dpo_cmp (&tfib->next_hops[pos], in_face) == 0) { tfib->entry_count = 0; @@ -180,10 +181,10 @@ hicn_mapme_process_ctrl (vlib_main_t * vm, vlib_buffer_t * b, HICN_MAPME_EVENT_FACE_NH_SET, 1, sizeof (retx_t)); - *retx = (retx_t) - { - .prefix = prefix,.dpo = *dpo}; - + *retx = (retx_t) { + .prefix = prefix, + .dpo = *dpo + }; } else if (params.seq == fib_seq) { @@ -213,6 +214,7 @@ hicn_mapme_process_ctrl (vlib_main_t * vm, vlib_buffer_t * b, * face is propagating outdated information, we can just consider it as a * prevHops */ + // XXX BUG hicn_mapme_tfib_add (tfib, in_face); retx_t *retx = vlib_process_signal_event_data (vm, diff --git a/hicn-plugin/src/mapme_eventmgr.c b/hicn-plugin/src/mapme_eventmgr.c index 5a9e7967e..f35a9909a 100644 --- a/hicn-plugin/src/mapme_eventmgr.c +++ b/hicn-plugin/src/mapme_eventmgr.c @@ -307,6 +307,7 @@ hicn_mapme_send_updates (vlib_main_t * vm, hicn_prefix_t * prefix, } else { + // XXX BUG are we sure it is always the last ?? hicn_mapme_send_message (vm, prefix, ¶ms, &tfib->next_hops[tfib_last_idx]); } @@ -510,7 +511,7 @@ hicn_mapme_eventmgr_process (vlib_main_t * vm, hicn_mapme_send_updates (vm, &retx->prefix, retx->dpo, true); retx->rtx_count++; - // If we exceed the numver of retransmittion it means that all tfib entries have seens at least HICN_PARAM_RTX_MAX of retransmission + // If we exceed the numver of retransmission it means that all tfib entries have seens at least HICN_PARAM_RTX_MAX of retransmission if (retx->rtx_count < HICN_PARAM_RTX_MAX) { /* diff --git a/hicn-plugin/src/mapme_eventmgr.h b/hicn-plugin/src/mapme_eventmgr.h index 338915d63..b715ae847 100644 --- a/hicn-plugin/src/mapme_eventmgr.h +++ b/hicn-plugin/src/mapme_eventmgr.h @@ -26,7 +26,9 @@ typedef struct u8 rtx_count; // Number of retransmissions since last tfib addition } retx_t; +#if 0 #define HASH32(x) ((u16)x ^ (x << 16)) +#endif /** * @brief This is a process node reacting to face events. -- cgit 1.2.3-korg