- SUBGRP_FOREACH_ADJ_SAFE
- AF_FOREACH
- FOREACH_AFI_SAFI
+ # ospfd
+ - LSDB_LOOP
struct router_lsa *rlsa;
struct in_addr *best = NULL;
- LSDB_LOOP(ROUTER_LSDB(area), rn, lsa)
- {
+ LSDB_LOOP (ROUTER_LSDB(area), rn, lsa) {
/* sanity checks */
if (!lsa || (lsa->data->type != OSPF_ROUTER_LSA)
|| IS_LSA_SELF(lsa))
inet_ntoa(area->area_id));
LSDB_LOOP(NSSA_LSDB(area), rn, lsa)
- ospf_abr_translate_nssa(area, lsa);
+ ospf_abr_translate_nssa(area, lsa);
}
if (IS_DEBUG_OSPF_NSSA)
and we would want to flush any residuals anyway */
LSDB_LOOP(EXTERNAL_LSDB(ospf), rn, lsa)
- if (CHECK_FLAG(lsa->flags, OSPF_LSA_LOCAL_XLT)) {
- UNSET_FLAG(lsa->flags, OSPF_LSA_APPROVED);
- if (IS_DEBUG_OSPF_NSSA)
- zlog_debug(
- "ospf_abr_unapprove_translates(): "
- "approved unset on link id %s",
- inet_ntoa(lsa->data->id));
- }
+ if (CHECK_FLAG(lsa->flags, OSPF_LSA_LOCAL_XLT)) {
+ UNSET_FLAG(lsa->flags, OSPF_LSA_APPROVED);
+ if (IS_DEBUG_OSPF_NSSA)
+ zlog_debug(
+ "ospf_abr_unapprove_translates(): "
+ "approved unset on link id %s",
+ inet_ntoa(lsa->data->id));
+ }
if (IS_DEBUG_OSPF_NSSA)
zlog_debug("ospf_abr_unapprove_translates(): Stop");
"considering area %s",
inet_ntoa(area->area_id));
LSDB_LOOP(SUMMARY_LSDB(area), rn, lsa)
- if (ospf_lsa_is_self_originated(ospf, lsa)) {
- if (IS_DEBUG_OSPF_EVENT)
- zlog_debug(
- "ospf_abr_unapprove_summaries(): "
- "approved unset on summary link id %s",
- inet_ntoa(lsa->data->id));
- UNSET_FLAG(lsa->flags, OSPF_LSA_APPROVED);
- }
+ if (ospf_lsa_is_self_originated(ospf, lsa)) {
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug(
+ "ospf_abr_unapprove_summaries(): "
+ "approved unset on summary link id %s",
+ inet_ntoa(lsa->data->id));
+ UNSET_FLAG(lsa->flags, OSPF_LSA_APPROVED);
+ }
LSDB_LOOP(ASBR_SUMMARY_LSDB(area), rn, lsa)
- if (ospf_lsa_is_self_originated(ospf, lsa)) {
- if (IS_DEBUG_OSPF_EVENT)
- zlog_debug(
- "ospf_abr_unapprove_summaries(): "
- "approved unset on asbr-summary link id %s",
- inet_ntoa(lsa->data->id));
- UNSET_FLAG(lsa->flags, OSPF_LSA_APPROVED);
- }
+ if (ospf_lsa_is_self_originated(ospf, lsa)) {
+ if (IS_DEBUG_OSPF_EVENT)
+ zlog_debug(
+ "ospf_abr_unapprove_summaries(): "
+ "approved unset on asbr-summary link id %s",
+ inet_ntoa(lsa->data->id));
+ UNSET_FLAG(lsa->flags, OSPF_LSA_APPROVED);
+ }
}
if (IS_DEBUG_OSPF_EVENT)
zlog_debug("ospf_abr_remove_unapproved_translates(): Start");
LSDB_LOOP(EXTERNAL_LSDB(ospf), rn, lsa)
- ospf_abr_remove_unapproved_translates_apply(ospf, lsa);
+ ospf_abr_remove_unapproved_translates_apply(ospf, lsa);
if (IS_DEBUG_OSPF_NSSA)
zlog_debug("ospf_abr_remove_unapproved_translates(): Stop");
inet_ntoa(area->area_id));
LSDB_LOOP(SUMMARY_LSDB(area), rn, lsa)
- if (ospf_lsa_is_self_originated(ospf, lsa))
- if (!CHECK_FLAG(lsa->flags, OSPF_LSA_APPROVED))
- ospf_lsa_flush_area(lsa, area);
+ if (ospf_lsa_is_self_originated(ospf, lsa))
+ if (!CHECK_FLAG(lsa->flags, OSPF_LSA_APPROVED))
+ ospf_lsa_flush_area(lsa, area);
LSDB_LOOP(ASBR_SUMMARY_LSDB(area), rn, lsa)
- if (ospf_lsa_is_self_originated(ospf, lsa))
- if (!CHECK_FLAG(lsa->flags, OSPF_LSA_APPROVED))
- ospf_lsa_flush_area(lsa, area);
+ if (ospf_lsa_is_self_originated(ospf, lsa))
+ if (!CHECK_FLAG(lsa->flags, OSPF_LSA_APPROVED))
+ ospf_lsa_flush_area(lsa, area);
}
if (IS_DEBUG_OSPF_EVENT)
/* Check msg type. */
if (mask & Power2[OSPF_ROUTER_LSA])
LSDB_LOOP(ROUTER_LSDB(area), rn, lsa)
- apiserver_sync_callback(lsa, (void *)¶m, seqnum);
+ apiserver_sync_callback(
+ lsa, (void *)¶m, seqnum);
if (mask & Power2[OSPF_NETWORK_LSA])
LSDB_LOOP(NETWORK_LSDB(area), rn, lsa)
- apiserver_sync_callback(lsa, (void *)¶m, seqnum);
+ apiserver_sync_callback(
+ lsa, (void *)¶m, seqnum);
if (mask & Power2[OSPF_SUMMARY_LSA])
LSDB_LOOP(SUMMARY_LSDB(area), rn, lsa)
- apiserver_sync_callback(lsa, (void *)¶m, seqnum);
+ apiserver_sync_callback(
+ lsa, (void *)¶m, seqnum);
if (mask & Power2[OSPF_ASBR_SUMMARY_LSA])
LSDB_LOOP(ASBR_SUMMARY_LSDB(area), rn, lsa)
- apiserver_sync_callback(lsa, (void *)¶m, seqnum);
+ apiserver_sync_callback(
+ lsa, (void *)¶m, seqnum);
if (mask & Power2[OSPF_OPAQUE_LINK_LSA])
LSDB_LOOP(OPAQUE_LINK_LSDB(area), rn, lsa)
- apiserver_sync_callback(lsa, (void *)¶m, seqnum);
+ apiserver_sync_callback(
+ lsa, (void *)¶m, seqnum);
if (mask & Power2[OSPF_OPAQUE_AREA_LSA])
LSDB_LOOP(OPAQUE_AREA_LSDB(area), rn, lsa)
- apiserver_sync_callback(lsa, (void *)¶m, seqnum);
+ apiserver_sync_callback(
+ lsa, (void *)¶m, seqnum);
}
}
if (ospf->lsdb) {
if (mask & Power2[OSPF_AS_EXTERNAL_LSA])
LSDB_LOOP(EXTERNAL_LSDB(ospf), rn, lsa)
- apiserver_sync_callback(lsa, (void *)¶m, seqnum);
+ apiserver_sync_callback(lsa, (void *)¶m,
+ seqnum);
}
/* For AS-external opaque LSAs */
if (ospf->lsdb) {
if (mask & Power2[OSPF_OPAQUE_AS_LSA])
LSDB_LOOP(OPAQUE_AS_LSDB(ospf), rn, lsa)
- apiserver_sync_callback(lsa, (void *)¶m, seqnum);
+ apiserver_sync_callback(lsa, (void *)¶m,
+ seqnum);
}
/* Send a reply back to client with return code */
case OSPF_OPAQUE_LINK_LSA:
for (ALL_LIST_ELEMENTS(ospf->areas, node, nnode, area))
LSDB_LOOP(OPAQUE_LINK_LSDB(area), rn, lsa)
- apiserver_flush_opaque_type_callback(lsa, (void *)¶m, 0);
+ apiserver_flush_opaque_type_callback(
+ lsa, (void *)¶m, 0);
break;
case OSPF_OPAQUE_AREA_LSA:
for (ALL_LIST_ELEMENTS(ospf->areas, node, nnode, area))
LSDB_LOOP(OPAQUE_AREA_LSDB(area), rn, lsa)
- apiserver_flush_opaque_type_callback(lsa, (void *)¶m, 0);
+ apiserver_flush_opaque_type_callback(
+ lsa, (void *)¶m, 0);
break;
case OSPF_OPAQUE_AS_LSA:
LSDB_LOOP(OPAQUE_LINK_LSDB(ospf), rn, lsa)
- apiserver_flush_opaque_type_callback(lsa, (void *)¶m, 0);
+ apiserver_flush_opaque_type_callback(lsa,
+ (void *)¶m, 0);
break;
default:
break;
/* Calculate external route for each AS-external-LSA */
LSDB_LOOP(EXTERNAL_LSDB(ospf), rn, lsa)
- ospf_ase_calculate_route(ospf, lsa);
+ ospf_ase_calculate_route(ospf, lsa);
/* This version simple adds to the table all NSSA areas */
if (ospf->anyNSSA)
if (area->external_routing == OSPF_AREA_NSSA)
LSDB_LOOP(NSSA_LSDB(area), rn, lsa)
- ospf_ase_calculate_route(ospf, lsa);
+ ospf_ase_calculate_route(ospf,
+ lsa);
}
/* kevinm: And add the NSSA routes in ospf_top */
LSDB_LOOP(NSSA_LSDB(ospf), rn, lsa)
- ospf_ase_calculate_route(ospf, lsa);
+ ospf_ase_calculate_route(ospf, lsa);
/* Compare old and new external routing table and install the
difference info zebra/kernel */
struct route_node *rn;
LSDB_LOOP(lsdb_rt, rn, lsa)
- process_summary_lsa(area, rt, rtrs, lsa);
+ process_summary_lsa(area, rt, rtrs, lsa);
}
int ospf_area_is_transit(struct ospf_area *area)
struct route_node *rn;
LSDB_LOOP(lsdb_rt, rn, lsa)
- process_transit_summary_lsa(area, rt, rtrs, lsa);
+ process_transit_summary_lsa(area, rt, rtrs, lsa);
}
void ospf_ia_routing(struct ospf *ospf, struct route_table *rt,
if (area->external_routing != OSPF_AREA_NSSA && !type7)
continue;
- LSDB_LOOP(NSSA_LSDB(area), rn, lsa)
- {
+ LSDB_LOOP (NSSA_LSDB(area), rn, lsa) {
if (lsa->data->id.s_addr
== type5->data->id.s_addr) {
type7 = lsa;
for (ALL_LIST_ELEMENTS(ospf->areas, node, nnode, area)) {
LSDB_LOOP(ROUTER_LSDB(area), rn, lsa)
- ospf_lsa_maxage_walker_remover(ospf, lsa);
+ ospf_lsa_maxage_walker_remover(ospf, lsa);
LSDB_LOOP(NETWORK_LSDB(area), rn, lsa)
- ospf_lsa_maxage_walker_remover(ospf, lsa);
+ ospf_lsa_maxage_walker_remover(ospf, lsa);
LSDB_LOOP(SUMMARY_LSDB(area), rn, lsa)
- ospf_lsa_maxage_walker_remover(ospf, lsa);
+ ospf_lsa_maxage_walker_remover(ospf, lsa);
LSDB_LOOP(ASBR_SUMMARY_LSDB(area), rn, lsa)
- ospf_lsa_maxage_walker_remover(ospf, lsa);
+ ospf_lsa_maxage_walker_remover(ospf, lsa);
LSDB_LOOP(OPAQUE_AREA_LSDB(area), rn, lsa)
- ospf_lsa_maxage_walker_remover(ospf, lsa);
+ ospf_lsa_maxage_walker_remover(ospf, lsa);
LSDB_LOOP(OPAQUE_LINK_LSDB(area), rn, lsa)
- ospf_lsa_maxage_walker_remover(ospf, lsa);
+ ospf_lsa_maxage_walker_remover(ospf, lsa);
LSDB_LOOP(NSSA_LSDB(area), rn, lsa)
- ospf_lsa_maxage_walker_remover(ospf, lsa);
+ ospf_lsa_maxage_walker_remover(ospf, lsa);
}
/* for AS-external-LSAs. */
if (ospf->lsdb) {
LSDB_LOOP(EXTERNAL_LSDB(ospf), rn, lsa)
- ospf_lsa_maxage_walker_remover(ospf, lsa);
+ ospf_lsa_maxage_walker_remover(ospf, lsa);
LSDB_LOOP(OPAQUE_AS_LSDB(ospf), rn, lsa)
- ospf_lsa_maxage_walker_remover(ospf, lsa);
+ ospf_lsa_maxage_walker_remover(ospf, lsa);
}
OSPF_TIMER_ON(ospf->t_maxage_walker, ospf_lsa_maxage_walker,
}
LSDB_LOOP(SUMMARY_LSDB(area), rn, lsa)
- ospf_lsa_flush_schedule(ospf, lsa);
+ ospf_lsa_flush_schedule(ospf, lsa);
LSDB_LOOP(ASBR_SUMMARY_LSDB(area), rn, lsa)
- ospf_lsa_flush_schedule(ospf, lsa);
+ ospf_lsa_flush_schedule(ospf, lsa);
LSDB_LOOP(OPAQUE_LINK_LSDB(area), rn, lsa)
- ospf_lsa_flush_schedule(ospf, lsa);
+ ospf_lsa_flush_schedule(ospf, lsa);
LSDB_LOOP(OPAQUE_AREA_LSDB(area), rn, lsa)
- ospf_lsa_flush_schedule(ospf, lsa);
+ ospf_lsa_flush_schedule(ospf, lsa);
}
if (need_to_flush_ase) {
LSDB_LOOP(EXTERNAL_LSDB(ospf), rn, lsa)
- ospf_lsa_flush_schedule(ospf, lsa);
+ ospf_lsa_flush_schedule(ospf, lsa);
LSDB_LOOP(OPAQUE_AS_LSDB(ospf), rn, lsa)
- ospf_lsa_flush_schedule(ospf, lsa);
+ ospf_lsa_flush_schedule(ospf, lsa);
}
/*
ospf_proactively_arp(nbr);
LSDB_LOOP(ROUTER_LSDB(area), rn, lsa)
- ospf_db_summary_add(nbr, lsa);
+ ospf_db_summary_add(nbr, lsa);
LSDB_LOOP(NETWORK_LSDB(area), rn, lsa)
- ospf_db_summary_add(nbr, lsa);
+ ospf_db_summary_add(nbr, lsa);
LSDB_LOOP(SUMMARY_LSDB(area), rn, lsa)
- ospf_db_summary_add(nbr, lsa);
+ ospf_db_summary_add(nbr, lsa);
LSDB_LOOP(ASBR_SUMMARY_LSDB(area), rn, lsa)
- ospf_db_summary_add(nbr, lsa);
+ ospf_db_summary_add(nbr, lsa);
/* Process only if the neighbor is opaque capable. */
if (CHECK_FLAG(nbr->options, OSPF_OPTION_O)) {
LSDB_LOOP(OPAQUE_LINK_LSDB(area), rn, lsa)
- ospf_db_summary_add(nbr, lsa);
+ ospf_db_summary_add(nbr, lsa);
LSDB_LOOP(OPAQUE_AREA_LSDB(area), rn, lsa)
- ospf_db_summary_add(nbr, lsa);
+ ospf_db_summary_add(nbr, lsa);
}
if (CHECK_FLAG(nbr->options, OSPF_OPTION_NP)) {
LSDB_LOOP(NSSA_LSDB(area), rn, lsa)
- ospf_db_summary_add(nbr, lsa);
+ ospf_db_summary_add(nbr, lsa);
}
if (nbr->oi->type != OSPF_IFTYPE_VIRTUALLINK
&& area->external_routing == OSPF_AREA_DEFAULT)
LSDB_LOOP(EXTERNAL_LSDB(nbr->oi->ospf), rn, lsa)
- ospf_db_summary_add(nbr, lsa);
+ ospf_db_summary_add(nbr, lsa);
if (CHECK_FLAG(nbr->options, OSPF_OPTION_O)
&& (nbr->oi->type != OSPF_IFTYPE_VIRTUALLINK
&& area->external_routing == OSPF_AREA_DEFAULT))
LSDB_LOOP(OPAQUE_AS_LSDB(nbr->oi->ospf), rn, lsa)
- ospf_db_summary_add(nbr, lsa);
+ ospf_db_summary_add(nbr, lsa);
return 0;
}
show_database_header[type]);
LSDB_LOOP(AREA_LSDB(area, type), rn, lsa)
- show_lsa_summary(vty, lsa, self);
+ show_lsa_summary(vty, lsa, self);
vty_out(vty, "\n");
}
vty_out(vty, "%s\n", show_database_header[type]);
LSDB_LOOP(AS_LSDB(ospf, type), rn, lsa)
- show_lsa_summary(vty, lsa, self);
+ show_lsa_summary(vty, lsa, self);
vty_out(vty, "\n");
}
struct ospf_lsa *lsa;
LSDB_LOOP(EXTERNAL_LSDB(ospf), rn, lsa)
- if (IS_LSA_SELF(lsa))
- ospf_lsa_flush_schedule(ospf, lsa);
+ if (IS_LSA_SELF(lsa))
+ ospf_lsa_flush_schedule(ospf, lsa);
}
ospf->router_id = router_id;
struct route_node *rn;
struct ospf_lsa *lsa;
- LSDB_LOOP(EXTERNAL_LSDB(ospf), rn, lsa)
- {
+ LSDB_LOOP (EXTERNAL_LSDB(ospf), rn, lsa) {
/* AdvRouter and Router ID is the same. */
if (IPV4_ADDR_SAME(&lsa->data->adv_router,
&ospf->router_id)) {
stream_free(ospf->ibuf);
LSDB_LOOP(OPAQUE_AS_LSDB(ospf), rn, lsa)
- ospf_discard_from_db(ospf, ospf->lsdb, lsa);
+ ospf_discard_from_db(ospf, ospf->lsdb, lsa);
LSDB_LOOP(EXTERNAL_LSDB(ospf), rn, lsa)
- ospf_discard_from_db(ospf, ospf->lsdb, lsa);
+ ospf_discard_from_db(ospf, ospf->lsdb, lsa);
ospf_lsdb_delete_all(ospf->lsdb);
ospf_lsdb_free(ospf->lsdb);
/* Free LSDBs. */
LSDB_LOOP(ROUTER_LSDB(area), rn, lsa)
- ospf_discard_from_db(area->ospf, area->lsdb, lsa);
+ ospf_discard_from_db(area->ospf, area->lsdb, lsa);
LSDB_LOOP(NETWORK_LSDB(area), rn, lsa)
- ospf_discard_from_db(area->ospf, area->lsdb, lsa);
+ ospf_discard_from_db(area->ospf, area->lsdb, lsa);
LSDB_LOOP(SUMMARY_LSDB(area), rn, lsa)
- ospf_discard_from_db(area->ospf, area->lsdb, lsa);
+ ospf_discard_from_db(area->ospf, area->lsdb, lsa);
LSDB_LOOP(ASBR_SUMMARY_LSDB(area), rn, lsa)
- ospf_discard_from_db(area->ospf, area->lsdb, lsa);
+ ospf_discard_from_db(area->ospf, area->lsdb, lsa);
LSDB_LOOP(NSSA_LSDB(area), rn, lsa)
- ospf_discard_from_db(area->ospf, area->lsdb, lsa);
+ ospf_discard_from_db(area->ospf, area->lsdb, lsa);
LSDB_LOOP(OPAQUE_AREA_LSDB(area), rn, lsa)
- ospf_discard_from_db(area->ospf, area->lsdb, lsa);
+ ospf_discard_from_db(area->ospf, area->lsdb, lsa);
LSDB_LOOP(OPAQUE_LINK_LSDB(area), rn, lsa)
- ospf_discard_from_db(area->ospf, area->lsdb, lsa);
+ ospf_discard_from_db(area->ospf, area->lsdb, lsa);
ospf_opaque_type10_lsa_term(area);
ospf_lsdb_delete_all(area->lsdb);