diff options
Diffstat (limited to 'hicn-plugin/src/mapme_eventmgr.c')
-rw-r--r-- | hicn-plugin/src/mapme_eventmgr.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/hicn-plugin/src/mapme_eventmgr.c b/hicn-plugin/src/mapme_eventmgr.c index 5c000a9d8..bb654edf8 100644 --- a/hicn-plugin/src/mapme_eventmgr.c +++ b/hicn-plugin/src/mapme_eventmgr.c @@ -40,6 +40,14 @@ void hicn_mapme_init (vlib_main_t *vm) { mapme_main.vm = vm; + clib_memset_u8 (&mapme_main.default_route, 0, + sizeof (mapme_main.default_route)); +} + +hicn_mapme_main_t * +hicn_mapme_get_main () +{ + return &mapme_main; } /* borrowed from vnet/fib/ip4_fib.c */ @@ -262,8 +270,8 @@ hicn_mapme_send_message (vlib_main_t *vm, const hicn_prefix_t *prefix, mapme_params_t *params, hicn_face_id_t face) { /* This should be retrieved from face information */ - HICN_DEBUG ("Retransmission for prefix %U seq=%d", format_ip46_address, - &prefix->name, IP46_TYPE_ANY, params->seq); + HICN_DEBUG ("Retransmission for prefix %U/%d seq=%d", format_ip46_address, + &prefix->name, IP46_TYPE_ANY, prefix->len, params->seq); char *node_name = hicn_mapme_get_dpo_face_node (face); if (!node_name) @@ -285,7 +293,7 @@ hicn_mapme_send_updates (vlib_main_t *vm, hicn_prefix_t *prefix, dpo_id_t dpo, hicn_mapme_tfib_t *tfib = TFIB (hicn_strategy_dpo_ctx_get (dpo.dpoi_index)); if (!tfib) { - HICN_ERROR ("NULL TFIB entry id=%d", dpo.dpoi_index); + HICN_DEBUG ("NULL TFIB entry id=%d", dpo.dpoi_index); return; } @@ -300,7 +308,8 @@ hicn_mapme_send_updates (vlib_main_t *vm, hicn_prefix_t *prefix, dpo_id_t dpo, if (send_all) { - for (u8 pos = tfib_last_idx; pos < HICN_PARAM_FIB_ENTRY_NHOPS_MAX; pos++) + u8 pos; + for (pos = tfib_last_idx; pos < HICN_PARAM_FIB_ENTRY_NHOPS_MAX; pos++) { hicn_mapme_send_message (vm, prefix, ¶ms, tfib->next_hops[pos]); } @@ -369,6 +378,7 @@ hicn_mapme_eventmgr_process (vlib_main_t *vm, vlib_node_runtime_t *rt, * - For another local face type, we need to advertise local * prefixes and schedule retransmissions */ + HICN_DEBUG ("Mapme Event: HICN_MAPME_EVENT_FACE_ADD"); retx_t *retx_events = event_data; for (u8 i = 0; i < vec_len (retx_events); i++) { @@ -384,6 +394,7 @@ hicn_mapme_eventmgr_process (vlib_main_t *vm, vlib_node_runtime_t *rt, case HICN_MAPME_EVENT_FACE_NH_SET: { + HICN_DEBUG ("Mapme Event: HICN_MAPME_EVENT_FACE_NH_SET"); /* * An hICN FIB entry has been modified. All operations so far * have been procedded in the nodes. Here we need to track @@ -420,6 +431,7 @@ hicn_mapme_eventmgr_process (vlib_main_t *vm, vlib_node_runtime_t *rt, * Transmit IU for all TFIB entries with latest seqno (we have * at least one for sure!) */ + HICN_DEBUG ("Sending mapme message upon NH_SET event"); hicn_mapme_send_updates (vm, &retx->prefix, retx->dpo, true); /* Delete entry_id from retransmissions in the current slot (if @@ -443,6 +455,7 @@ hicn_mapme_eventmgr_process (vlib_main_t *vm, vlib_node_runtime_t *rt, break; case HICN_MAPME_EVENT_FACE_NH_ADD: + HICN_DEBUG ("Mapme Event: HICN_MAPME_EVENT_FACE_NH_ADD"); /* * As per the description of states, this event should add the face * to the list of next hops, and eventually remove it from TFIB. @@ -462,6 +475,7 @@ hicn_mapme_eventmgr_process (vlib_main_t *vm, vlib_node_runtime_t *rt, break; case HICN_MAPME_EVENT_FACE_PH_ADD: + HICN_DEBUG ("Mapme Event: HICN_MAPME_EVENT_FACE_PH_ADD"); /* Back-propagation, interesting even for IN (desync) */ { retx_t *retx_events = event_data; @@ -475,6 +489,7 @@ hicn_mapme_eventmgr_process (vlib_main_t *vm, vlib_node_runtime_t *rt, break; case HICN_MAPME_EVENT_FACE_PH_DEL: + HICN_DEBUG ("Mapme Event: HICN_MAPME_EVENT_FACE_PH_DEL"); /* Ack : remove an element from TFIB */ break; |