diff options
Diffstat (limited to 'proto/ospf/rt.c')
-rw-r--r-- | proto/ospf/rt.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c index 79b21e6..123d4fb 100644 --- a/proto/ospf/rt.c +++ b/proto/ospf/rt.c @@ -155,7 +155,7 @@ ospf_rt_spfa(struct ospf_area *oa) return; OSPF_TRACE(D_EVENTS, "Starting routing table calculation for area %I", - oa->areaid); + ipa_from_u32(oa->areaid)); if (oa->rt->dist != LSINFINITY) bug("Aging was not processed."); @@ -168,8 +168,8 @@ ospf_rt_spfa(struct ospf_area *oa) oa->rt->dist = 0; oa->rt->color = CANDIDATE; add_head(&oa->cand, &oa->rt->cn); - DBG("RT LSA: rt: %I, id: %I, type: %u\n", oa->rt->lsa.rt, - oa->rt->lsa.id, oa->rt->lsa.type); + DBG("RT LSA: rt: %I, id: %I, type: %u\n", ipa_from_u32(oa->rt->lsa.rt), + ipa_from_u32(oa->rt->lsa.id), oa->rt->lsa.type); while (!EMPTY_LIST(oa->cand)) { @@ -177,8 +177,8 @@ ospf_rt_spfa(struct ospf_area *oa) act = SKIP_BACK(struct top_hash_entry, cn, n); rem_node(n); - DBG("Working on LSA: rt: %I, id: %I, type: %u\n", act->lsa.rt, - act->lsa.id, act->lsa.type); + DBG("Working on LSA: rt: %I, id: %I, type: %u\n", ipa_from_u32(act->lsa.rt), + ipa_from_u32(act->lsa.id), act->lsa.type); act->color = INSPF; switch (act->lsa.type) @@ -208,7 +208,7 @@ ospf_rt_spfa(struct ospf_area *oa) { tmp = NULL; rtl = (rr + i); - DBG(" Working on link: %I (type: %u) ", rtl->id, rtl->type); + DBG(" Working on link: %I (type: %u) ", ipa_from_u32(rtl->id), rtl->type); switch (rtl->type) { case LSART_STUB: @@ -265,7 +265,7 @@ ospf_rt_spfa(struct ospf_area *oa) DBG("PTP found.\n"); break; default: - log("Unknown link type in router lsa. (rid = %I)", act->lsa.id); + log("Unknown link type in router lsa. (rid = %I)", ipa_from_u32(act->lsa.id)); break; } if (tmp) @@ -292,8 +292,8 @@ ospf_rt_spfa(struct ospf_area *oa) for (i = 0; i < (act->lsa.length - sizeof(struct ospf_lsa_header) - sizeof(struct ospf_lsa_net)) / sizeof(u32); i++) { - DBG(" Working on router %I ", *(rts + i)); - tmp = ospf_hash_find(po->gr, oa->areaid, *(rts + i), *(rts + i), LSA_T_RT); + DBG(" Working on router %I ", ipa_from_u32(rts[i])); + tmp = ospf_hash_find(po->gr, oa->areaid, rts[i], rts[i], LSA_T_RT); if (tmp != NULL) DBG("Found :-)\n"); else @@ -314,7 +314,7 @@ ospf_rt_spfa(struct ospf_area *oa) { if ((iface->state != OSPF_IS_PTP) || (iface->iface != tmp->nhi->iface) || (!ipa_equal(iface->vip, tmp->lb))) { - OSPF_TRACE(D_EVENTS, "Vlink peer %I found", tmp->lsa.id); + OSPF_TRACE(D_EVENTS, "Vlink peer %I found", ipa_from_u32(tmp->lsa.id)); ospf_iface_sm(iface, ISM_DOWN); iface->iface = tmp->nhi->iface; iface->vip = tmp->lb; @@ -325,7 +325,7 @@ ospf_rt_spfa(struct ospf_area *oa) { if (iface->state > OSPF_IS_DOWN) { - OSPF_TRACE(D_EVENTS, "Vlink peer %I lost", iface->vid); + OSPF_TRACE(D_EVENTS, "Vlink peer %I lost", ipa_from_u32(iface->vid)); ospf_iface_sm(iface, ISM_DOWN); } } @@ -372,7 +372,7 @@ link_back(struct ospf_area *oa, struct top_hash_entry *fol, struct top_hash_entr } break; default: - log("Unknown link type in router lsa. (rid = %I)", fol->lsa.id); + log("Unknown link type in router lsa. (rid = %I)", ipa_from_u32(fol->lsa.id)); break; } } @@ -390,7 +390,7 @@ link_back(struct ospf_area *oa, struct top_hash_entry *fol, struct top_hash_entr } break; default: - bug("Unknown lsa type. (id = %I)", fol->lsa.id); + bug("Unknown lsa type. (id = %I)", ipa_from_u32(fol->lsa.id)); } return 0; } @@ -480,7 +480,7 @@ ospf_rt_sum(struct ospf_area *oa) int mlen = -1, type = -1; union ospf_lsa_sum_tm *tm; - OSPF_TRACE(D_EVENTS, "Starting routing table calculation for inter-area (area %I)", oa->areaid); + OSPF_TRACE(D_EVENTS, "Starting routing table calculation for inter-area (area %I)", ipa_from_u32(oa->areaid)); WALK_SLIST(en, po->lsal) { @@ -664,7 +664,8 @@ ospf_ext_spf(struct proto_ospf *po) lt = (struct ospf_lsa_ext_tos *) (le + 1); DBG("%s: Working on LSA. ID: %I, RT: %I, Type: %u, Mask %I\n", - p->name, en->lsa.id, en->lsa.rt, en->lsa.type, le->netmask); + p->name, ipa_from_u32(en->lsa.id), ipa_from_u32(en->lsa.rt), + en->lsa.type, le->netmask); if ((lt->etm.metric & METRIC_MASK) == LSINFINITY) continue; @@ -673,7 +674,8 @@ ospf_ext_spf(struct proto_ospf *po) if ((mlen < 0) || (mlen > 32)) { log("%s: Invalid mask in LSA. ID: %I, RT: %I, Type: %u, Mask %I", - p->name, en->lsa.id, en->lsa.rt, en->lsa.type, le->netmask); + p->name, ipa_from_u32(en->lsa.id), ipa_from_u32(en->lsa.rt), + en->lsa.type, le->netmask); continue; } nhi = NULL; @@ -796,8 +798,8 @@ add_cand(list * l, struct top_hash_entry *en, struct top_hash_entry *par, if (!link_back(oa, en, par)) return; - DBG(" Adding candidate: rt: %I, id: %I, type: %u\n", en->lsa.rt, - en->lsa.id, en->lsa.type); + DBG(" Adding candidate: rt: %I, id: %I, type: %u\n", + ipa_from_u32(en->lsa.rt), ipa_from_u32(en->lsa.id), en->lsa.type); en->nhi = NULL; en->nh = IPA_NONE; @@ -860,7 +862,7 @@ calc_next_hop(struct top_hash_entry *en, struct top_hash_entry *par, { neighbor *nn; DBG(" Next hop calculating for id: %I rt: %I type: %u\n", - en->lsa.id, en->lsa.rt, en->lsa.type); + ipa_from_u32(en->lsa.id), ipa_from_u32(en->lsa.rt), en->lsa.type); if (par == oa->rt) { @@ -915,7 +917,7 @@ calc_next_hop(struct top_hash_entry *en, struct top_hash_entry *par, else { /* Parent is some RT neighbor */ log(L_ERR "Router's parent has no next hop. (EN=%I, PAR=%I)", - en->lsa.id, par->lsa.id); + ipa_from_u32(en->lsa.id), ipa_from_u32(par->lsa.id)); /* I hope this would never happen */ return; } |