diff options
Diffstat (limited to 'ospf6d/ospf6_area.c')
| -rw-r--r-- | ospf6d/ospf6_area.c | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index 999266b8d1..7e8e34a221 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -306,7 +306,8 @@ struct ospf6_area *ospf6_area_create(uint32_t area_id, struct ospf6 *o, int df) oa->range_table = OSPF6_ROUTE_TABLE_CREATE(AREA, PREFIX_RANGES); oa->range_table->scope = oa; - bf_init(oa->range_table->idspace, 32); + oa->nssa_range_table = OSPF6_ROUTE_TABLE_CREATE(AREA, PREFIX_RANGES); + oa->nssa_range_table->scope = oa; oa->summary_prefix = OSPF6_ROUTE_TABLE_CREATE(AREA, SUMMARY_PREFIXES); oa->summary_prefix->scope = oa; oa->summary_router = OSPF6_ROUTE_TABLE_CREATE(AREA, SUMMARY_ROUTERS); @@ -361,6 +362,7 @@ void ospf6_area_delete(struct ospf6_area *oa) ospf6_route_table_delete(oa->route_table); ospf6_route_table_delete(oa->range_table); + ospf6_route_table_delete(oa->nssa_range_table); ospf6_route_table_delete(oa->summary_prefix); ospf6_route_table_delete(oa->summary_router); @@ -576,8 +578,6 @@ DEFUN (area_range, range->path.u.cost_config = cost; - zlog_debug("%s: for prefix %s, flag = %x", __func__, - argv[idx_ipv6_prefixlen]->arg, range->flag); if (range->rnode == NULL) { ospf6_route_add(range, oa->range_table); } @@ -694,6 +694,22 @@ void ospf6_area_config_write(struct vty *vty, struct ospf6 *ospf6) vty_out(vty, " no-summary"); vty_out(vty, "\n"); } + for (range = ospf6_route_head(oa->nssa_range_table); range; + range = ospf6_route_next(range)) { + vty_out(vty, " area %s nssa range %pFX", oa->name, + &range->prefix); + + if (CHECK_FLAG(range->flag, + OSPF6_ROUTE_DO_NOT_ADVERTISE)) { + vty_out(vty, " not-advertise"); + } else { + if (range->path.u.cost_config + != OSPF_AREA_RANGE_COST_UNSPEC) + vty_out(vty, " cost %u", + range->path.u.cost_config); + } + vty_out(vty, "\n"); + } if (PREFIX_NAME_IN(oa)) vty_out(vty, " area %s filter-list prefix %s in\n", oa->name, PREFIX_NAME_IN(oa)); @@ -711,7 +727,7 @@ void ospf6_area_config_write(struct vty *vty, struct ospf6 *ospf6) DEFUN (area_filter_list, area_filter_list_cmd, - "area <A.B.C.D|(0-4294967295)> filter-list prefix WORD <in|out>", + "area <A.B.C.D|(0-4294967295)> filter-list prefix PREFIXLIST_NAME <in|out>", "OSPF6 area parameters\n" "OSPF6 area ID in IP address format\n" "OSPF6 area ID as a decimal value\n" @@ -754,7 +770,7 @@ DEFUN (area_filter_list, DEFUN (no_area_filter_list, no_area_filter_list_cmd, - "no area <A.B.C.D|(0-4294967295)> filter-list prefix WORD <in|out>", + "no area <A.B.C.D|(0-4294967295)> filter-list prefix PREFIXLIST_NAME <in|out>", NO_STR "OSPF6 area parameters\n" "OSPF6 area ID in IP address format\n" @@ -863,12 +879,12 @@ void ospf6_plist_update(struct prefix_list *plist) DEFUN (area_import_list, area_import_list_cmd, - "area <A.B.C.D|(0-4294967295)> import-list NAME", + "area <A.B.C.D|(0-4294967295)> import-list ACCESSLIST6_NAME", "OSPF6 area parameters\n" "OSPF6 area ID in IP address format\n" "OSPF6 area ID as a decimal value\n" "Set the filter for networks from other areas announced to the specified one\n" - "Name of the acess-list\n") + "Name of the access-list\n") { int idx_ipv4 = 1; int idx_name = 3; @@ -895,7 +911,7 @@ DEFUN (area_import_list, DEFUN (no_area_import_list, no_area_import_list_cmd, - "no area <A.B.C.D|(0-4294967295)> import-list NAME", + "no area <A.B.C.D|(0-4294967295)> import-list ACCESSLIST6_NAME", NO_STR "OSPF6 area parameters\n" "OSPF6 area ID in IP address format\n" @@ -924,12 +940,12 @@ DEFUN (no_area_import_list, DEFUN (area_export_list, area_export_list_cmd, - "area <A.B.C.D|(0-4294967295)> export-list NAME", + "area <A.B.C.D|(0-4294967295)> export-list ACCESSLIST6_NAME", "OSPF6 area parameters\n" "OSPF6 area ID in IP address format\n" "OSPF6 area ID as a decimal value\n" "Set the filter for networks announced to other areas\n" - "Name of the acess-list\n") + "Name of the access-list\n") { int idx_ipv4 = 1; int idx_name = 3; @@ -958,7 +974,7 @@ DEFUN (area_export_list, DEFUN (no_area_export_list, no_area_export_list_cmd, - "no area <A.B.C.D|(0-4294967295)> export-list NAME", + "no area <A.B.C.D|(0-4294967295)> export-list ACCESSLIST6_NAME", NO_STR "OSPF6 area parameters\n" "OSPF6 area ID in IP address format\n" @@ -1029,12 +1045,8 @@ static int ipv6_ospf6_spf_tree_common(struct vty *vty, struct ospf6 *ospf6, } } - if (uj) { - vty_out(vty, "%s\n", - json_object_to_json_string_ext( - json, JSON_C_TO_STRING_PRETTY)); - json_object_free(json); - } + if (uj) + vty_json(vty, json); return CMD_SUCCESS; } |
