diff options
Diffstat (limited to 'ospfd/ospf_abr.c')
-rw-r--r-- | ospfd/ospf_abr.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c index 784496bac..72d231a31 100644 --- a/ospfd/ospf_abr.c +++ b/ospfd/ospf_abr.c @@ -169,16 +169,11 @@ static int ospf_area_actively_attached(struct ospf_area *area) return area->act_ints; } -int ospf_area_range_set(struct ospf *ospf, struct in_addr area_id, +int ospf_area_range_set(struct ospf *ospf, struct ospf_area *area, struct prefix_ipv4 *p, int advertise) { - struct ospf_area *area; struct ospf_area_range *range; - area = ospf_area_get(ospf, area_id); - if (area == NULL) - return 0; - range = ospf_area_range_lookup(area, p); if (range != NULL) { if (!CHECK_FLAG(advertise, OSPF_AREA_RANGE_ADVERTISE)) @@ -204,16 +199,11 @@ int ospf_area_range_set(struct ospf *ospf, struct in_addr area_id, return 1; } -int ospf_area_range_cost_set(struct ospf *ospf, struct in_addr area_id, +int ospf_area_range_cost_set(struct ospf *ospf, struct ospf_area *area, struct prefix_ipv4 *p, uint32_t cost) { - struct ospf_area *area; struct ospf_area_range *range; - area = ospf_area_get(ospf, area_id); - if (area == NULL) - return 0; - range = ospf_area_range_lookup(area, p); if (range == NULL) return 0; @@ -227,16 +217,11 @@ int ospf_area_range_cost_set(struct ospf *ospf, struct in_addr area_id, return 1; } -int ospf_area_range_unset(struct ospf *ospf, struct in_addr area_id, +int ospf_area_range_unset(struct ospf *ospf, struct ospf_area *area, struct prefix_ipv4 *p) { - struct ospf_area *area; struct route_node *rn; - area = ospf_area_lookup_by_area_id(ospf, area_id); - if (area == NULL) - return 0; - rn = route_node_lookup(area->ranges, (struct prefix *)p); if (rn == NULL) return 0; @@ -249,13 +234,11 @@ int ospf_area_range_unset(struct ospf *ospf, struct in_addr area_id, return 1; } -int ospf_area_range_substitute_set(struct ospf *ospf, struct in_addr area_id, +int ospf_area_range_substitute_set(struct ospf *ospf, struct ospf_area *area, struct prefix_ipv4 *p, struct prefix_ipv4 *s) { - struct ospf_area *area; struct ospf_area_range *range; - area = ospf_area_get(ospf, area_id); range = ospf_area_range_lookup(area, p); if (range != NULL) { @@ -276,16 +259,11 @@ int ospf_area_range_substitute_set(struct ospf *ospf, struct in_addr area_id, return 1; } -int ospf_area_range_substitute_unset(struct ospf *ospf, struct in_addr area_id, +int ospf_area_range_substitute_unset(struct ospf *ospf, struct ospf_area *area, struct prefix_ipv4 *p) { - struct ospf_area *area; struct ospf_area_range *range; - area = ospf_area_lookup_by_area_id(ospf, area_id); - if (area == NULL) - return 0; - range = ospf_area_range_lookup(area, p); if (range == NULL) return 0; |