version 1.1.1.2, 2012/10/09 09:22:29
|
version 1.1.1.3, 2013/07/21 23:54:40
|
Line 88 ospf_area_range_add (struct ospf_area *area, struct os
|
Line 88 ospf_area_range_add (struct ospf_area *area, struct os
|
} |
} |
|
|
static void |
static void |
ospf_area_range_delete (struct ospf_area *area, struct ospf_area_range *range) | ospf_area_range_delete (struct ospf_area *area, struct route_node *rn) |
{ |
{ |
struct route_node *rn; | struct ospf_area_range *range = rn->info; |
struct prefix_ipv4 p; | |
|
|
p.family = AF_INET; | if (range->specifics != 0) |
p.prefixlen = range->masklen; | ospf_delete_discard_route (area->ospf->new_table, |
p.prefix = range->addr; | (struct prefix_ipv4 *) &rn->p); |
|
|
rn = route_node_lookup (area->ranges, (struct prefix *)&p); | ospf_area_range_free (range); |
if (rn) | rn->info = NULL; |
{ | route_unlock_node (rn); |
ospf_area_range_free (rn->info); | route_unlock_node (rn); |
rn->info = NULL; | |
route_unlock_node (rn); | |
route_unlock_node (rn); | |
} | |
} |
} |
|
|
struct ospf_area_range * |
struct ospf_area_range * |
Line 263 ospf_area_range_unset (struct ospf *ospf, struct in_ad
|
Line 258 ospf_area_range_unset (struct ospf *ospf, struct in_ad
|
struct prefix_ipv4 *p) |
struct prefix_ipv4 *p) |
{ |
{ |
struct ospf_area *area; |
struct ospf_area *area; |
struct ospf_area_range *range; | struct route_node *rn; |
|
|
area = ospf_area_lookup_by_area_id (ospf, area_id); |
area = ospf_area_lookup_by_area_id (ospf, area_id); |
if (area == NULL) |
if (area == NULL) |
return 0; |
return 0; |
|
|
range = ospf_area_range_lookup (area, p); | rn = route_node_lookup (area->ranges, (struct prefix*)p); |
if (range == NULL) | if (rn == NULL) |
return 0; |
return 0; |
|
|
if (ospf_area_range_active (range)) | if (ospf_area_range_active (rn->info)) |
ospf_schedule_abr_task (ospf); |
ospf_schedule_abr_task (ospf); |
|
|
ospf_area_range_delete (area, range); | ospf_area_range_delete (area, rn); |
|
|
return 1; |
return 1; |
} |
} |
Line 571 ospf_check_abr_status (struct ospf *ospf)
|
Line 566 ospf_check_abr_status (struct ospf *ospf)
|
|
|
static void |
static void |
ospf_abr_update_aggregate (struct ospf_area_range *range, |
ospf_abr_update_aggregate (struct ospf_area_range *range, |
struct ospf_route *or) | struct ospf_route *or, struct ospf_area *area) |
{ |
{ |
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("ospf_abr_update_aggregate(): Start"); |
zlog_debug ("ospf_abr_update_aggregate(): Start"); |
|
|
if (range->cost_config != OSPF_AREA_RANGE_COST_UNSPEC) | if (CHECK_FLAG (area->stub_router_state, OSPF_AREA_IS_STUB_ROUTED) && |
| (range->cost != OSPF_STUB_MAX_METRIC_SUMMARY_COST)) |
{ |
{ |
|
range->cost = OSPF_STUB_MAX_METRIC_SUMMARY_COST; |
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
|
zlog_debug ("ospf_abr_update_aggregate(): use summary max-metric 0x%08x", |
|
range->cost); |
|
} |
|
else if (range->cost_config != OSPF_AREA_RANGE_COST_UNSPEC) |
|
{ |
|
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("ospf_abr_update_aggregate(): use configured cost %d", |
zlog_debug ("ospf_abr_update_aggregate(): use configured cost %d", |
range->cost_config); |
range->cost_config); |
|
|
Line 587 ospf_abr_update_aggregate (struct ospf_area_range *ran
|
Line 590 ospf_abr_update_aggregate (struct ospf_area_range *ran
|
else |
else |
{ |
{ |
if (range->specifics == 0) |
if (range->specifics == 0) |
range->cost = or->cost; /* 1st time get 1st cost */ | { |
| if (IS_DEBUG_OSPF_EVENT) |
| zlog_debug ("ospf_abr_update_aggregate(): use or->cost %d", |
| or->cost); |
|
|
|
range->cost = or->cost; /* 1st time get 1st cost */ |
|
} |
|
|
if (or->cost > range->cost) |
if (or->cost > range->cost) |
{ |
{ |
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("ospf_abr_update_aggregate(): largest cost, update"); | zlog_debug ("ospf_abr_update_aggregate(): update to %d", or->cost); |
|
|
range->cost = or->cost; |
range->cost = or->cost; |
} |
} |
Line 716 ospf_abr_announce_network_to_area (struct prefix_ipv4
|
Line 725 ospf_abr_announce_network_to_area (struct prefix_ipv4
|
{ |
{ |
struct ospf_lsa *lsa, *old = NULL; |
struct ospf_lsa *lsa, *old = NULL; |
struct summary_lsa *sl = NULL; |
struct summary_lsa *sl = NULL; |
|
u_int32_t full_cost; |
|
|
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("ospf_abr_announce_network_to_area(): Start"); |
zlog_debug ("ospf_abr_announce_network_to_area(): Start"); |
|
|
|
if (CHECK_FLAG (area->stub_router_state, OSPF_AREA_IS_STUB_ROUTED)) |
|
full_cost = OSPF_STUB_MAX_METRIC_SUMMARY_COST; |
|
else |
|
full_cost = cost; |
|
|
old = ospf_lsa_lookup_by_prefix (area->lsdb, OSPF_SUMMARY_LSA, |
old = ospf_lsa_lookup_by_prefix (area->lsdb, OSPF_SUMMARY_LSA, |
(struct prefix_ipv4 *) p, |
(struct prefix_ipv4 *) p, |
area->ospf->router_id); |
area->ospf->router_id); |
Line 734 ospf_abr_announce_network_to_area (struct prefix_ipv4
|
Line 749 ospf_abr_announce_network_to_area (struct prefix_ipv4
|
zlog_debug ("ospf_abr_announce_network_to_area(): " |
zlog_debug ("ospf_abr_announce_network_to_area(): " |
"old metric: %d, new metric: %d", |
"old metric: %d, new metric: %d", |
GET_METRIC (sl->metric), cost); |
GET_METRIC (sl->metric), cost); |
| |
if (GET_METRIC (sl->metric) == cost) | if ((GET_METRIC (sl->metric) == full_cost) && |
| ((old->flags & OSPF_LSA_IN_MAXAGE) == 0)) |
{ |
{ |
/* unchanged. simply reapprove it */ |
/* unchanged. simply reapprove it */ |
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
Line 749 ospf_abr_announce_network_to_area (struct prefix_ipv4
|
Line 765 ospf_abr_announce_network_to_area (struct prefix_ipv4
|
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("ospf_abr_announce_network_to_area(): " |
zlog_debug ("ospf_abr_announce_network_to_area(): " |
"refreshing summary"); |
"refreshing summary"); |
set_metric (old, cost); | set_metric (old, full_cost); |
lsa = ospf_lsa_refresh (area->ospf, old); |
lsa = ospf_lsa_refresh (area->ospf, old); |
|
|
if (!lsa) |
if (!lsa) |
Line 773 ospf_abr_announce_network_to_area (struct prefix_ipv4
|
Line 789 ospf_abr_announce_network_to_area (struct prefix_ipv4
|
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("ospf_abr_announce_network_to_area(): " |
zlog_debug ("ospf_abr_announce_network_to_area(): " |
"creating new summary"); |
"creating new summary"); |
lsa = ospf_summary_lsa_originate ( (struct prefix_ipv4 *)p, cost, area); | lsa = ospf_summary_lsa_originate ( (struct prefix_ipv4 *)p, full_cost, area); |
/* This will flood through area. */ |
/* This will flood through area. */ |
|
|
if (!lsa) |
if (!lsa) |
Line 934 ospf_abr_announce_network (struct ospf *ospf,
|
Line 950 ospf_abr_announce_network (struct ospf *ospf,
|
inet_ntoa (p->prefix), p->prefixlen); |
inet_ntoa (p->prefix), p->prefixlen); |
if ((range = ospf_area_range_match (or_area, p)) |
if ((range = ospf_area_range_match (or_area, p)) |
&& !ospf_area_is_transit (area)) |
&& !ospf_area_is_transit (area)) |
ospf_abr_update_aggregate (range, or); | ospf_abr_update_aggregate (range, or, area); |
else |
else |
ospf_abr_announce_network_to_area (p, or->cost, area); |
ospf_abr_announce_network_to_area (p, or->cost, area); |
} |
} |
Line 1124 ospf_abr_announce_rtr_to_area (struct prefix_ipv4 *p,
|
Line 1140 ospf_abr_announce_rtr_to_area (struct prefix_ipv4 *p,
|
GET_METRIC (slsa->metric), cost); |
GET_METRIC (slsa->metric), cost); |
} |
} |
|
|
if (old && (GET_METRIC (slsa->metric) == cost)) | if (old && (GET_METRIC (slsa->metric) == cost) && |
| ((old->flags & OSPF_LSA_IN_MAXAGE) == 0)) |
{ |
{ |
if (IS_DEBUG_OSPF_EVENT) |
if (IS_DEBUG_OSPF_EVENT) |
zlog_debug ("ospf_abr_announce_rtr_to_area(): old summary approved"); |
zlog_debug ("ospf_abr_announce_rtr_to_area(): old summary approved"); |
Line 1695 ospf_abr_manage_discard_routes (struct ospf *ospf)
|
Line 1712 ospf_abr_manage_discard_routes (struct ospf *ospf)
|
ospf_add_discard_route (ospf->new_table, area, |
ospf_add_discard_route (ospf->new_table, area, |
(struct prefix_ipv4 *) &rn->p); |
(struct prefix_ipv4 *) &rn->p); |
else |
else |
ospf_delete_discard_route ((struct prefix_ipv4 *) &rn->p); | ospf_delete_discard_route (ospf->new_table, |
| (struct prefix_ipv4 *) &rn->p); |
} |
} |
} |
} |
|
|