paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3 | * |
| 4 | * This file is part of GNU Zebra. |
| 5 | * |
| 6 | * GNU Zebra is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the |
| 8 | * Free Software Foundation; either version 2, or (at your option) any |
| 9 | * later version. |
| 10 | * |
| 11 | * GNU Zebra is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with GNU Zebra; see the file COPYING. If not, write to the |
| 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | * Boston, MA 02111-1307, USA. |
| 20 | */ |
| 21 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 22 | #include <zebra.h> |
| 23 | |
| 24 | #include "log.h" |
| 25 | #include "memory.h" |
| 26 | #include "linklist.h" |
| 27 | #include "thread.h" |
| 28 | #include "vty.h" |
| 29 | #include "command.h" |
| 30 | #include "if.h" |
| 31 | #include "prefix.h" |
| 32 | #include "table.h" |
hasso | 34956b3 | 2005-06-24 08:44:02 +0000 | [diff] [blame] | 33 | #include "plist.h" |
| 34 | #include "filter.h" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 35 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 36 | #include "ospf6_proto.h" |
| 37 | #include "ospf6_lsa.h" |
| 38 | #include "ospf6_lsdb.h" |
| 39 | #include "ospf6_route.h" |
| 40 | #include "ospf6_spf.h" |
| 41 | #include "ospf6_top.h" |
| 42 | #include "ospf6_area.h" |
| 43 | #include "ospf6_interface.h" |
| 44 | #include "ospf6_intra.h" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 45 | #include "ospf6_abr.h" |
| 46 | #include "ospf6d.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 47 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 48 | int |
| 49 | ospf6_area_cmp (void *va, void *vb) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 50 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 51 | struct ospf6_area *oa = (struct ospf6_area *) va; |
| 52 | struct ospf6_area *ob = (struct ospf6_area *) vb; |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 53 | return (ntohl (oa->area_id) < ntohl (ob->area_id) ? -1 : 1); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 54 | } |
| 55 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 56 | /* schedule routing table recalculation */ |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame^] | 57 | static void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 58 | ospf6_area_lsdb_hook_add (struct ospf6_lsa *lsa) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 59 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 60 | switch (ntohs (lsa->header->type)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 61 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 62 | case OSPF6_LSTYPE_ROUTER: |
| 63 | case OSPF6_LSTYPE_NETWORK: |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 64 | if (IS_OSPF6_DEBUG_EXAMIN_TYPE (lsa->header->type)) |
| 65 | { |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 66 | zlog_debug ("Examin %s", lsa->name); |
| 67 | zlog_debug ("Schedule SPF Calculation for %s", |
| 68 | OSPF6_AREA (lsa->lsdb->data)->name); |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 69 | } |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 70 | ospf6_spf_schedule (OSPF6_AREA (lsa->lsdb->data)); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 71 | break; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 72 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 73 | case OSPF6_LSTYPE_INTRA_PREFIX: |
| 74 | ospf6_intra_prefix_lsa_add (lsa); |
| 75 | break; |
| 76 | |
| 77 | case OSPF6_LSTYPE_INTER_PREFIX: |
| 78 | case OSPF6_LSTYPE_INTER_ROUTER: |
hasso | ccb59b1 | 2004-08-25 09:10:37 +0000 | [diff] [blame] | 79 | ospf6_abr_examin_summary (lsa, (struct ospf6_area *) lsa->lsdb->data); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 80 | break; |
| 81 | |
| 82 | default: |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 83 | break; |
| 84 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 85 | } |
| 86 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame^] | 87 | static void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 88 | ospf6_area_lsdb_hook_remove (struct ospf6_lsa *lsa) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 89 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 90 | switch (ntohs (lsa->header->type)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 91 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 92 | case OSPF6_LSTYPE_ROUTER: |
| 93 | case OSPF6_LSTYPE_NETWORK: |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 94 | if (IS_OSPF6_DEBUG_EXAMIN_TYPE (lsa->header->type)) |
| 95 | { |
hasso | c6487d6 | 2004-12-24 06:00:11 +0000 | [diff] [blame] | 96 | zlog_debug ("LSA disappearing: %s", lsa->name); |
| 97 | zlog_debug ("Schedule SPF Calculation for %s", |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 98 | OSPF6_AREA (lsa->lsdb->data)->name); |
| 99 | } |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 100 | ospf6_spf_schedule (OSPF6_AREA (lsa->lsdb->data)); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 101 | break; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 102 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 103 | case OSPF6_LSTYPE_INTRA_PREFIX: |
| 104 | ospf6_intra_prefix_lsa_remove (lsa); |
| 105 | break; |
| 106 | |
| 107 | case OSPF6_LSTYPE_INTER_PREFIX: |
| 108 | case OSPF6_LSTYPE_INTER_ROUTER: |
hasso | ccb59b1 | 2004-08-25 09:10:37 +0000 | [diff] [blame] | 109 | ospf6_abr_examin_summary (lsa, (struct ospf6_area *) lsa->lsdb->data); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 110 | break; |
| 111 | |
| 112 | default: |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 113 | break; |
| 114 | } |
| 115 | } |
| 116 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame^] | 117 | static void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 118 | ospf6_area_route_hook_add (struct ospf6_route *route) |
| 119 | { |
| 120 | struct ospf6_route *copy = ospf6_route_copy (route); |
| 121 | ospf6_route_add (copy, ospf6->route_table); |
| 122 | } |
| 123 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame^] | 124 | static void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 125 | ospf6_area_route_hook_remove (struct ospf6_route *route) |
| 126 | { |
| 127 | struct ospf6_route *copy; |
| 128 | |
| 129 | copy = ospf6_route_lookup_identical (route, ospf6->route_table); |
| 130 | if (copy) |
| 131 | ospf6_route_remove (copy, ospf6->route_table); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | /* Make new area structure */ |
| 135 | struct ospf6_area * |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 136 | ospf6_area_create (u_int32_t area_id, struct ospf6 *o) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 137 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 138 | struct ospf6_area *oa; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 139 | struct ospf6_route *route; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 140 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 141 | oa = XCALLOC (MTYPE_OSPF6_AREA, sizeof (struct ospf6_area)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 142 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 143 | inet_ntop (AF_INET, &area_id, oa->name, sizeof (oa->name)); |
| 144 | oa->area_id = area_id; |
| 145 | oa->if_list = list_new (); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 146 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 147 | oa->lsdb = ospf6_lsdb_create (oa); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 148 | oa->lsdb->hook_add = ospf6_area_lsdb_hook_add; |
| 149 | oa->lsdb->hook_remove = ospf6_area_lsdb_hook_remove; |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 150 | oa->lsdb_self = ospf6_lsdb_create (oa); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 151 | |
Paul Jakma | cf1ce25 | 2006-05-15 10:46:07 +0000 | [diff] [blame] | 152 | oa->spf_table = OSPF6_ROUTE_TABLE_CREATE (AREA, SPF_RESULTS); |
| 153 | oa->spf_table->scope = oa; |
| 154 | oa->route_table = OSPF6_ROUTE_TABLE_CREATE (AREA, ROUTES); |
| 155 | oa->route_table->scope = oa; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 156 | oa->route_table->hook_add = ospf6_area_route_hook_add; |
| 157 | oa->route_table->hook_remove = ospf6_area_route_hook_remove; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 158 | |
Paul Jakma | cf1ce25 | 2006-05-15 10:46:07 +0000 | [diff] [blame] | 159 | oa->range_table = OSPF6_ROUTE_TABLE_CREATE (AREA, PREFIX_RANGES); |
| 160 | oa->range_table->scope = oa; |
| 161 | oa->summary_prefix = OSPF6_ROUTE_TABLE_CREATE (AREA, SUMMARY_PREFIXES); |
| 162 | oa->summary_prefix->scope = oa; |
| 163 | oa->summary_router = OSPF6_ROUTE_TABLE_CREATE (AREA, SUMMARY_ROUTERS); |
| 164 | oa->summary_router->scope = oa; |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 165 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 166 | /* set default options */ |
| 167 | OSPF6_OPT_SET (oa->options, OSPF6_OPT_V6); |
| 168 | OSPF6_OPT_SET (oa->options, OSPF6_OPT_E); |
| 169 | OSPF6_OPT_SET (oa->options, OSPF6_OPT_R); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 170 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 171 | oa->ospf6 = o; |
| 172 | listnode_add_sort (o->area_list, oa); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 173 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 174 | /* import athoer area's routes as inter-area routes */ |
| 175 | for (route = ospf6_route_head (o->route_table); route; |
| 176 | route = ospf6_route_next (route)) |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 177 | ospf6_abr_originate_summary_to_area (route, oa); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 178 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 179 | return oa; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 183 | ospf6_area_delete (struct ospf6_area *oa) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 184 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 185 | struct listnode *n, *nnode; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 186 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 187 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 188 | ospf6_route_table_delete (oa->range_table); |
| 189 | ospf6_route_table_delete (oa->summary_prefix); |
| 190 | ospf6_route_table_delete (oa->summary_router); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 191 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 192 | /* ospf6 interface list */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 193 | for (ALL_LIST_ELEMENTS (oa->if_list, n, nnode, oi)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 194 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 195 | ospf6_interface_delete (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 196 | } |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 197 | list_delete (oa->if_list); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 198 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 199 | ospf6_lsdb_delete (oa->lsdb); |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 200 | ospf6_lsdb_delete (oa->lsdb_self); |
| 201 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 202 | ospf6_route_table_delete (oa->spf_table); |
| 203 | ospf6_route_table_delete (oa->route_table); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 204 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 205 | #if 0 |
| 206 | ospf6_spftree_delete (oa->spf_tree); |
| 207 | ospf6_route_table_delete (oa->topology_table); |
| 208 | #endif /*0*/ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 209 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 210 | THREAD_OFF (oa->thread_spf_calculation); |
| 211 | THREAD_OFF (oa->thread_route_calculation); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 212 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 213 | listnode_delete (oa->ospf6->area_list, oa); |
| 214 | oa->ospf6 = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 215 | |
| 216 | /* free area */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 217 | XFREE (MTYPE_OSPF6_AREA, oa); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | struct ospf6_area * |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 221 | ospf6_area_lookup (u_int32_t area_id, struct ospf6 *ospf6) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 222 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 223 | struct ospf6_area *oa; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 224 | struct listnode *n; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 225 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 226 | for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, n, oa)) |
| 227 | if (oa->area_id == area_id) |
| 228 | return oa; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 229 | |
| 230 | return (struct ospf6_area *) NULL; |
| 231 | } |
| 232 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame^] | 233 | static struct ospf6_area * |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 234 | ospf6_area_get (u_int32_t area_id, struct ospf6 *o) |
| 235 | { |
| 236 | struct ospf6_area *oa; |
| 237 | oa = ospf6_area_lookup (area_id, o); |
| 238 | if (oa == NULL) |
| 239 | oa = ospf6_area_create (area_id, o); |
| 240 | return oa; |
| 241 | } |
| 242 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 243 | void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 244 | ospf6_area_enable (struct ospf6_area *oa) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 245 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 246 | struct listnode *node, *nnode; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 247 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 248 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 249 | SET_FLAG (oa->flag, OSPF6_AREA_ENABLE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 250 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 251 | for (ALL_LIST_ELEMENTS (oa->if_list, node, nnode, oi)) |
| 252 | ospf6_interface_enable (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | void |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 256 | ospf6_area_disable (struct ospf6_area *oa) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 257 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 258 | struct listnode *node, *nnode; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 259 | struct ospf6_interface *oi; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 260 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 261 | UNSET_FLAG (oa->flag, OSPF6_AREA_ENABLE); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 262 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 263 | for (ALL_LIST_ELEMENTS (oa->if_list, node, nnode, oi)) |
| 264 | ospf6_interface_disable (oi); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 265 | } |
| 266 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 267 | |
| 268 | void |
| 269 | ospf6_area_show (struct vty *vty, struct ospf6_area *oa) |
| 270 | { |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 271 | struct listnode *i; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 272 | struct ospf6_interface *oi; |
| 273 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 274 | vty_out (vty, " Area %s%s", oa->name, VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 275 | vty_out (vty, " Number of Area scoped LSAs is %u%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 276 | oa->lsdb->count, VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 277 | |
| 278 | vty_out (vty, " Interface attached to this area:"); |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 279 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, i, oi)) |
| 280 | vty_out (vty, " %s", oi->interface->name); |
| 281 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 282 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 286 | #define OSPF6_CMD_AREA_LOOKUP(str, oa) \ |
| 287 | { \ |
| 288 | u_int32_t area_id = 0; \ |
| 289 | if (inet_pton (AF_INET, str, &area_id) != 1) \ |
| 290 | { \ |
| 291 | vty_out (vty, "Malformed Area-ID: %s%s", str, VNL); \ |
| 292 | return CMD_SUCCESS; \ |
| 293 | } \ |
| 294 | oa = ospf6_area_lookup (area_id, ospf6); \ |
| 295 | if (oa == NULL) \ |
| 296 | { \ |
| 297 | vty_out (vty, "No such Area: %s%s", str, VNL); \ |
| 298 | return CMD_SUCCESS; \ |
| 299 | } \ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 300 | } |
| 301 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 302 | #define OSPF6_CMD_AREA_GET(str, oa) \ |
| 303 | { \ |
| 304 | u_int32_t area_id = 0; \ |
| 305 | if (inet_pton (AF_INET, str, &area_id) != 1) \ |
| 306 | { \ |
| 307 | vty_out (vty, "Malformed Area-ID: %s%s", str, VNL); \ |
| 308 | return CMD_SUCCESS; \ |
| 309 | } \ |
| 310 | oa = ospf6_area_get (area_id, ospf6); \ |
| 311 | } |
| 312 | |
| 313 | DEFUN (area_range, |
| 314 | area_range_cmd, |
| 315 | "area A.B.C.D range X:X::X:X/M", |
| 316 | "OSPF area parameters\n" |
| 317 | OSPF6_AREA_ID_STR |
| 318 | "Configured address range\n" |
| 319 | "Specify IPv6 prefix\n" |
| 320 | ) |
| 321 | { |
| 322 | int ret; |
| 323 | struct ospf6_area *oa; |
| 324 | struct prefix prefix; |
| 325 | struct ospf6_route *range; |
| 326 | |
| 327 | OSPF6_CMD_AREA_GET (argv[0], oa); |
| 328 | argc--; |
| 329 | argv++; |
| 330 | |
| 331 | ret = str2prefix (argv[0], &prefix); |
| 332 | if (ret != 1 || prefix.family != AF_INET6) |
| 333 | { |
| 334 | vty_out (vty, "Malformed argument: %s%s", argv[0], VNL); |
| 335 | return CMD_SUCCESS; |
| 336 | } |
| 337 | argc--; |
| 338 | argv++; |
| 339 | |
| 340 | range = ospf6_route_lookup (&prefix, oa->range_table); |
| 341 | if (range == NULL) |
| 342 | { |
| 343 | range = ospf6_route_create (); |
| 344 | range->type = OSPF6_DEST_TYPE_RANGE; |
| 345 | range->prefix = prefix; |
| 346 | } |
| 347 | |
| 348 | if (argc) |
| 349 | { |
| 350 | if (! strcmp (argv[0], "not-advertise")) |
| 351 | SET_FLAG (range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE); |
| 352 | else if (! strcmp (argv[0], "advertise")) |
| 353 | UNSET_FLAG (range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE); |
| 354 | } |
| 355 | |
| 356 | ospf6_route_add (range, oa->range_table); |
| 357 | return CMD_SUCCESS; |
| 358 | } |
| 359 | |
| 360 | ALIAS (area_range, |
| 361 | area_range_advertise_cmd, |
| 362 | "area A.B.C.D range X:X::X:X/M (advertise|not-advertise)", |
| 363 | "OSPF area parameters\n" |
| 364 | OSPF6_AREA_ID_STR |
| 365 | "Configured address range\n" |
| 366 | "Specify IPv6 prefix\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame^] | 367 | ) |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 368 | |
| 369 | DEFUN (no_area_range, |
| 370 | no_area_range_cmd, |
| 371 | "no area A.B.C.D range X:X::X:X/M", |
| 372 | "OSPF area parameters\n" |
| 373 | OSPF6_AREA_ID_STR |
| 374 | "Configured address range\n" |
| 375 | "Specify IPv6 prefix\n" |
| 376 | ) |
| 377 | { |
| 378 | int ret; |
| 379 | struct ospf6_area *oa; |
| 380 | struct prefix prefix; |
| 381 | struct ospf6_route *range; |
| 382 | |
| 383 | OSPF6_CMD_AREA_GET (argv[0], oa); |
| 384 | argc--; |
| 385 | argv++; |
| 386 | |
| 387 | ret = str2prefix (argv[0], &prefix); |
| 388 | if (ret != 1 || prefix.family != AF_INET6) |
| 389 | { |
| 390 | vty_out (vty, "Malformed argument: %s%s", argv[0], VNL); |
| 391 | return CMD_SUCCESS; |
| 392 | } |
| 393 | |
| 394 | range = ospf6_route_lookup (&prefix, oa->range_table); |
| 395 | if (range == NULL) |
| 396 | { |
| 397 | vty_out (vty, "Range %s does not exists.%s", argv[0], VNL); |
| 398 | return CMD_SUCCESS; |
| 399 | } |
| 400 | |
| 401 | ospf6_route_remove (range, oa->range_table); |
| 402 | return CMD_SUCCESS; |
| 403 | } |
| 404 | |
| 405 | void |
| 406 | ospf6_area_config_write (struct vty *vty) |
| 407 | { |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 408 | struct listnode *node; |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 409 | struct ospf6_area *oa; |
| 410 | struct ospf6_route *range; |
| 411 | char buf[128]; |
| 412 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 413 | for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 414 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 415 | for (range = ospf6_route_head (oa->range_table); range; |
| 416 | range = ospf6_route_next (range)) |
| 417 | { |
| 418 | prefix2str (&range->prefix, buf, sizeof (buf)); |
| 419 | vty_out (vty, " area %s range %s%s", oa->name, buf, VNL); |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | |
hasso | 34956b3 | 2005-06-24 08:44:02 +0000 | [diff] [blame] | 424 | DEFUN (area_filter_list, |
| 425 | area_filter_list_cmd, |
| 426 | "area A.B.C.D filter-list prefix WORD (in|out)", |
| 427 | "OSPFv6 area parameters\n" |
| 428 | "OSPFv6 area ID in IP address format\n" |
| 429 | "Filter networks between OSPFv6 areas\n" |
| 430 | "Filter prefixes between OSPFv6 areas\n" |
| 431 | "Name of an IPv6 prefix-list\n" |
| 432 | "Filter networks sent to this area\n" |
| 433 | "Filter networks sent from this area\n") |
| 434 | { |
| 435 | struct ospf6_area *area; |
| 436 | struct prefix_list *plist; |
| 437 | |
| 438 | OSPF6_CMD_AREA_GET (argv[0], area); |
| 439 | argc--; |
| 440 | argv++; |
| 441 | |
| 442 | plist = prefix_list_lookup (AFI_IP6, argv[1]); |
| 443 | if (strncmp (argv[2], "in", 2) == 0) |
| 444 | { |
| 445 | PREFIX_LIST_IN (area) = plist; |
| 446 | if (PREFIX_NAME_IN (area)) |
| 447 | free (PREFIX_NAME_IN (area)); |
| 448 | |
| 449 | PREFIX_NAME_IN (area) = strdup (argv[1]); |
| 450 | ospf6_abr_reimport (area); |
| 451 | } |
| 452 | else |
| 453 | { |
| 454 | PREFIX_LIST_OUT (area) = plist; |
| 455 | if (PREFIX_NAME_OUT (area)) |
| 456 | free (PREFIX_NAME_OUT (area)); |
| 457 | |
| 458 | PREFIX_NAME_OUT (area) = strdup (argv[1]); |
| 459 | ospf6_abr_enable_area (area); |
| 460 | } |
| 461 | |
| 462 | return CMD_SUCCESS; |
| 463 | } |
| 464 | |
| 465 | DEFUN (no_area_filter_list, |
| 466 | no_area_filter_list_cmd, |
| 467 | "no area A.B.C.D filter-list prefix WORD (in|out)", |
| 468 | NO_STR |
| 469 | "OSPFv6 area parameters\n" |
| 470 | "OSPFv6 area ID in IP address format\n" |
| 471 | "Filter networks between OSPFv6 areas\n" |
| 472 | "Filter prefixes between OSPFv6 areas\n" |
| 473 | "Name of an IPv6 prefix-list\n" |
| 474 | "Filter networks sent to this area\n" |
| 475 | "Filter networks sent from this area\n") |
| 476 | { |
| 477 | struct ospf6_area *area; |
| 478 | struct prefix_list *plist; |
| 479 | |
| 480 | OSPF6_CMD_AREA_GET (argv[0], area); |
| 481 | argc--; |
| 482 | argv++; |
| 483 | |
| 484 | plist = prefix_list_lookup (AFI_IP6, argv[1]); |
| 485 | if (strncmp (argv[2], "in", 2) == 0) |
| 486 | { |
| 487 | if (PREFIX_NAME_IN (area)) |
| 488 | if (strcmp (PREFIX_NAME_IN (area), argv[1]) != 0) |
| 489 | return CMD_SUCCESS; |
| 490 | |
| 491 | PREFIX_LIST_IN (area) = NULL; |
| 492 | if (PREFIX_NAME_IN (area)) |
| 493 | free (PREFIX_NAME_IN (area)); |
| 494 | |
| 495 | PREFIX_NAME_IN (area) = NULL; |
| 496 | ospf6_abr_reimport (area); |
| 497 | } |
| 498 | else |
| 499 | { |
| 500 | if (PREFIX_NAME_OUT (area)) |
| 501 | if (strcmp (PREFIX_NAME_OUT (area), argv[1]) != 0) |
| 502 | return CMD_SUCCESS; |
| 503 | |
| 504 | PREFIX_LIST_OUT (area) = NULL; |
| 505 | if (PREFIX_NAME_OUT (area)) |
| 506 | free (PREFIX_NAME_OUT (area)); |
| 507 | |
| 508 | PREFIX_NAME_OUT (area) = NULL; |
| 509 | ospf6_abr_enable_area (area); |
| 510 | } |
| 511 | |
| 512 | return CMD_SUCCESS; |
| 513 | } |
| 514 | |
| 515 | DEFUN (area_import_list, |
| 516 | area_import_list_cmd, |
| 517 | "area A.B.C.D import-list NAME", |
| 518 | "OSPFv6 area parameters\n" |
| 519 | "OSPFv6 area ID in IP address format\n" |
| 520 | "Set the filter for networks from other areas announced to the specified one\n" |
| 521 | "Name of the acess-list\n") |
| 522 | { |
| 523 | struct ospf6_area *area; |
| 524 | struct access_list *list; |
| 525 | |
| 526 | OSPF6_CMD_AREA_GET(argv[0], area); |
| 527 | |
| 528 | list = access_list_lookup (AFI_IP6, argv[1]); |
| 529 | |
| 530 | IMPORT_LIST (area) = list; |
| 531 | |
| 532 | if (IMPORT_NAME (area)) |
| 533 | free (IMPORT_NAME (area)); |
| 534 | |
| 535 | IMPORT_NAME (area) = strdup (argv[1]); |
| 536 | ospf6_abr_reimport (area); |
| 537 | |
| 538 | return CMD_SUCCESS; |
| 539 | } |
| 540 | |
| 541 | DEFUN (no_area_import_list, |
| 542 | no_area_import_list_cmd, |
| 543 | "no area A.B.C.D import-list NAME", |
| 544 | "OSPFv6 area parameters\n" |
| 545 | "OSPFv6 area ID in IP address format\n" |
| 546 | "Unset the filter for networks announced to other areas\n" |
| 547 | "NAme of the access-list\n") |
| 548 | { |
| 549 | struct ospf6_area *area; |
| 550 | |
| 551 | OSPF6_CMD_AREA_GET(argv[0], area); |
| 552 | |
| 553 | IMPORT_LIST (area) = 0; |
| 554 | |
| 555 | if (IMPORT_NAME (area)) |
| 556 | free (IMPORT_NAME (area)); |
| 557 | |
| 558 | IMPORT_NAME (area) = NULL; |
| 559 | ospf6_abr_reimport (area); |
| 560 | |
| 561 | return CMD_SUCCESS; |
| 562 | } |
| 563 | |
| 564 | DEFUN (area_export_list, |
| 565 | area_export_list_cmd, |
| 566 | "area A.B.C.D export-list NAME", |
| 567 | "OSPFv6 area parameters\n" |
| 568 | "OSPFv6 area ID in IP address format\n" |
| 569 | "Set the filter for networks announced to other areas\n" |
| 570 | "Name of the acess-list\n") |
| 571 | { |
| 572 | struct ospf6_area *area; |
| 573 | struct access_list *list; |
| 574 | |
| 575 | OSPF6_CMD_AREA_GET(argv[0], area); |
| 576 | |
| 577 | list = access_list_lookup (AFI_IP6, argv[1]); |
| 578 | |
| 579 | EXPORT_LIST (area) = list; |
| 580 | |
| 581 | if (EXPORT_NAME (area)) |
| 582 | free (EXPORT_NAME (area)); |
| 583 | |
| 584 | EXPORT_NAME (area) = strdup (argv[1]); |
| 585 | ospf6_abr_enable_area (area); |
| 586 | |
| 587 | return CMD_SUCCESS; |
| 588 | } |
| 589 | |
| 590 | DEFUN (no_area_export_list, |
| 591 | no_area_export_list_cmd, |
| 592 | "no area A.B.C.D export-list NAME", |
| 593 | "OSPFv6 area parameters\n" |
| 594 | "OSPFv6 area ID in IP address format\n" |
| 595 | "Unset the filter for networks announced to other areas\n" |
| 596 | "Name of the access-list\n") |
| 597 | { |
| 598 | struct ospf6_area *area; |
| 599 | |
| 600 | OSPF6_CMD_AREA_GET(argv[0], area); |
| 601 | |
| 602 | EXPORT_LIST (area) = 0; |
| 603 | |
| 604 | if (EXPORT_NAME (area)) |
| 605 | free (EXPORT_NAME (area)); |
| 606 | |
| 607 | EXPORT_NAME (area) = NULL; |
| 608 | ospf6_abr_enable_area (area); |
| 609 | |
| 610 | return CMD_SUCCESS; |
| 611 | } |
| 612 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 613 | DEFUN (show_ipv6_ospf6_spf_tree, |
| 614 | show_ipv6_ospf6_spf_tree_cmd, |
| 615 | "show ipv6 ospf6 spf tree", |
| 616 | SHOW_STR |
| 617 | IP6_STR |
| 618 | OSPF6_STR |
| 619 | "Shortest Path First caculation\n" |
| 620 | "Show SPF tree\n") |
| 621 | { |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 622 | struct listnode *node; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 623 | struct ospf6_area *oa; |
| 624 | struct ospf6_vertex *root; |
| 625 | struct ospf6_route *route; |
| 626 | struct prefix prefix; |
| 627 | |
| 628 | ospf6_linkstate_prefix (ospf6->router_id, htonl (0), &prefix); |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 629 | |
| 630 | for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 631 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 632 | route = ospf6_route_lookup (&prefix, oa->spf_table); |
| 633 | if (route == NULL) |
| 634 | { |
| 635 | vty_out (vty, "LS entry for root not found in area %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 636 | oa->name, VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 637 | continue; |
| 638 | } |
| 639 | root = (struct ospf6_vertex *) route->route_option; |
| 640 | ospf6_spf_display_subtree (vty, "", 0, root); |
| 641 | } |
| 642 | |
| 643 | return CMD_SUCCESS; |
| 644 | } |
| 645 | |
| 646 | DEFUN (show_ipv6_ospf6_area_spf_tree, |
| 647 | show_ipv6_ospf6_area_spf_tree_cmd, |
| 648 | "show ipv6 ospf6 area A.B.C.D spf tree", |
| 649 | SHOW_STR |
| 650 | IP6_STR |
| 651 | OSPF6_STR |
| 652 | OSPF6_AREA_STR |
| 653 | OSPF6_AREA_ID_STR |
| 654 | "Shortest Path First caculation\n" |
| 655 | "Show SPF tree\n") |
| 656 | { |
| 657 | u_int32_t area_id; |
| 658 | struct ospf6_area *oa; |
| 659 | struct ospf6_vertex *root; |
| 660 | struct ospf6_route *route; |
| 661 | struct prefix prefix; |
| 662 | |
| 663 | ospf6_linkstate_prefix (ospf6->router_id, htonl (0), &prefix); |
| 664 | |
| 665 | if (inet_pton (AF_INET, argv[0], &area_id) != 1) |
| 666 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 667 | vty_out (vty, "Malformed Area-ID: %s%s", argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 668 | return CMD_SUCCESS; |
| 669 | } |
| 670 | oa = ospf6_area_lookup (area_id, ospf6); |
| 671 | if (oa == NULL) |
| 672 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 673 | vty_out (vty, "No such Area: %s%s", argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 674 | return CMD_SUCCESS; |
| 675 | } |
| 676 | |
| 677 | route = ospf6_route_lookup (&prefix, oa->spf_table); |
| 678 | if (route == NULL) |
| 679 | { |
| 680 | vty_out (vty, "LS entry for root not found in area %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 681 | oa->name, VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 682 | return CMD_SUCCESS; |
| 683 | } |
| 684 | root = (struct ospf6_vertex *) route->route_option; |
| 685 | ospf6_spf_display_subtree (vty, "", 0, root); |
| 686 | |
| 687 | return CMD_SUCCESS; |
| 688 | } |
| 689 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 690 | DEFUN (show_ipv6_ospf6_simulate_spf_tree_root, |
| 691 | show_ipv6_ospf6_simulate_spf_tree_root_cmd, |
| 692 | "show ipv6 ospf6 simulate spf-tree A.B.C.D area A.B.C.D", |
| 693 | SHOW_STR |
| 694 | IP6_STR |
| 695 | OSPF6_STR |
| 696 | "Shortest Path First caculation\n" |
| 697 | "Show SPF tree\n" |
| 698 | "Specify root's router-id to calculate another router's SPF tree\n") |
| 699 | { |
| 700 | u_int32_t area_id; |
| 701 | struct ospf6_area *oa; |
| 702 | struct ospf6_vertex *root; |
| 703 | struct ospf6_route *route; |
| 704 | struct prefix prefix; |
| 705 | u_int32_t router_id; |
| 706 | struct ospf6_route_table *spf_table; |
| 707 | unsigned char tmp_debug_ospf6_spf = 0; |
| 708 | |
| 709 | inet_pton (AF_INET, argv[0], &router_id); |
| 710 | ospf6_linkstate_prefix (router_id, htonl (0), &prefix); |
| 711 | |
| 712 | if (inet_pton (AF_INET, argv[1], &area_id) != 1) |
| 713 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 714 | vty_out (vty, "Malformed Area-ID: %s%s", argv[1], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 715 | return CMD_SUCCESS; |
| 716 | } |
| 717 | oa = ospf6_area_lookup (area_id, ospf6); |
| 718 | if (oa == NULL) |
| 719 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 720 | vty_out (vty, "No such Area: %s%s", argv[1], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 721 | return CMD_SUCCESS; |
| 722 | } |
| 723 | |
| 724 | tmp_debug_ospf6_spf = conf_debug_ospf6_spf; |
| 725 | conf_debug_ospf6_spf = 0; |
| 726 | |
Paul Jakma | cf1ce25 | 2006-05-15 10:46:07 +0000 | [diff] [blame] | 727 | spf_table = OSPF6_ROUTE_TABLE_CREATE (NONE, SPF_RESULTS); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 728 | ospf6_spf_calculation (router_id, spf_table, oa); |
| 729 | |
| 730 | conf_debug_ospf6_spf = tmp_debug_ospf6_spf; |
| 731 | |
| 732 | route = ospf6_route_lookup (&prefix, spf_table); |
| 733 | if (route == NULL) |
| 734 | { |
| 735 | ospf6_spf_table_finish (spf_table); |
| 736 | ospf6_route_table_delete (spf_table); |
| 737 | return CMD_SUCCESS; |
| 738 | } |
| 739 | root = (struct ospf6_vertex *) route->route_option; |
| 740 | ospf6_spf_display_subtree (vty, "", 0, root); |
| 741 | |
| 742 | ospf6_spf_table_finish (spf_table); |
| 743 | ospf6_route_table_delete (spf_table); |
| 744 | |
| 745 | return CMD_SUCCESS; |
| 746 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 747 | |
| 748 | void |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame^] | 749 | ospf6_area_init (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 750 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 751 | install_element (VIEW_NODE, &show_ipv6_ospf6_spf_tree_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 752 | install_element (VIEW_NODE, &show_ipv6_ospf6_area_spf_tree_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 753 | install_element (VIEW_NODE, &show_ipv6_ospf6_simulate_spf_tree_root_cmd); |
| 754 | |
| 755 | install_element (ENABLE_NODE, &show_ipv6_ospf6_spf_tree_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 756 | install_element (ENABLE_NODE, &show_ipv6_ospf6_area_spf_tree_cmd); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 757 | install_element (ENABLE_NODE, &show_ipv6_ospf6_simulate_spf_tree_root_cmd); |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 758 | |
| 759 | install_element (OSPF6_NODE, &area_range_cmd); |
| 760 | install_element (OSPF6_NODE, &area_range_advertise_cmd); |
| 761 | install_element (OSPF6_NODE, &no_area_range_cmd); |
hasso | 34956b3 | 2005-06-24 08:44:02 +0000 | [diff] [blame] | 762 | |
| 763 | install_element (OSPF6_NODE, &area_import_list_cmd); |
| 764 | install_element (OSPF6_NODE, &no_area_import_list_cmd); |
| 765 | install_element (OSPF6_NODE, &area_export_list_cmd); |
| 766 | install_element (OSPF6_NODE, &no_area_export_list_cmd); |
| 767 | |
| 768 | install_element (OSPF6_NODE, &area_filter_list_cmd); |
| 769 | install_element (OSPF6_NODE, &no_area_filter_list_cmd); |
| 770 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 771 | } |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 772 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 773 | |