/* * dump mapping */ void dump_mapping_entry( lispd_mapping_elt *mapping, int log_level) { lispd_locators_list *locator_iterator_array[2] = {NULL,NULL}; lispd_locators_list *locator_iterator = NULL; lispd_locator_elt *locator = NULL; int ctr = 0; if (is_loggable(log_level) == FALSE){ return; } lispd_log_msg(log_level,"IDENTIFIER (EID): %s/%d (IID = %d)\n ", get_char_from_lisp_addr_t(mapping->eid_prefix), mapping->eid_prefix_length, mapping->iid); lispd_log_msg(log_level, "| Locator (RLOC) | Status | Priority/Weight |"); if (mapping->locator_count > 0){ locator_iterator_array[0] = mapping->head_v4_locators_list; locator_iterator_array[1] = mapping->head_v6_locators_list; // Loop through the locators and print each for (ctr = 0 ; ctr < 2 ; ctr++){ locator_iterator = locator_iterator_array[ctr]; while (locator_iterator != NULL) { locator = locator_iterator->locator; dump_locator (locator,log_level); locator_iterator = locator_iterator->next; } } lispd_log_msg(log_level,"\n"); } }
void dump_proxy_etrs(int log_level) { lispd_locators_list *locator_lst_elt[2] = {NULL,NULL}; int ctr = 0; if (proxy_etrs == NULL || is_loggable(log_level) == FALSE){ return; } locator_lst_elt[0] = proxy_etrs->mapping->head_v4_locators_list; locator_lst_elt[1] = proxy_etrs->mapping->head_v6_locators_list; lispd_log_msg(log_level, "************************* Proxy ETRs List ****************************"); lispd_log_msg(log_level, "| Locator (RLOC) | Status | Priority/Weight |"); for (ctr = 0 ; ctr<2 ; ctr++){ while (locator_lst_elt[ctr]){ dump_locator (locator_lst_elt[ctr]->locator,log_level); locator_lst_elt[ctr] = locator_lst_elt[ctr]->next; } } }
void dump_referral_cache_entry( lispd_referral_cache_entry *entry, int log_level) { int ctr = 0; char str[400]; lispd_locators_list *locator_iterator_array[2] = {NULL,NULL}; lispd_locators_list *locator_iterator = NULL; lispd_locator_elt *locator = NULL; if (is_loggable(log_level) == FALSE){ return; } sprintf(str,"IDENTIFIER (EID): %s/%d (IID = %d), TTL: %d", get_char_from_lisp_addr_t(entry->mapping->eid_prefix), entry->mapping->eid_prefix_length, entry->mapping->iid, entry->ttl); switch (entry->act_entry_type){ case NODE_REFERRAL: sprintf(str + strlen(str)," Type: Node Referral "); break; case MS_REFERRAL: sprintf(str + strlen(str)," Type: MS Referral "); break; case MS_ACK: sprintf(str + strlen(str)," Type: MS ACK "); break; case MS_NOT_REGISTERED: sprintf(str + strlen(str)," Type: Not Registered "); break; case DELEGATION_HOLE: sprintf(str + strlen(str)," Type: Delegation hole "); break; case NOT_AUTHORITATIVE: sprintf(str + strlen(str)," Type: Not authoritative "); break; default: sprintf(str + strlen(str)," Type: %d ", entry->act_entry_type); break; } if (entry->parent_node != NULL){ sprintf(str + strlen(str)," Parent (EID): %s/%d ", get_char_from_lisp_addr_t(entry->parent_node->mapping->eid_prefix), entry->parent_node->mapping->eid_prefix_length); } lispd_log_msg(log_level,"%s",str); if (entry->mapping->locator_count > 0){ locator_iterator_array[0] = entry->mapping->head_v4_locators_list; locator_iterator_array[1] = entry->mapping->head_v6_locators_list; lispd_log_msg(log_level, "| Locator (RLOC) | Status | Priority/Weight |"); // Loop through the locators and print each for (ctr = 0 ; ctr < 2 ; ctr++){ locator_iterator = locator_iterator_array[ctr]; while (locator_iterator != NULL) { locator = locator_iterator->locator; dump_locator(locator, log_level); locator_iterator = locator_iterator->next; } } lispd_log_msg(log_level,"\n"); } }