blob: 8f01e7dd16263bbc95afaccd619b2cb985b59013 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
hasso508e53e2004-05-18 18:57:06 +00002 * Copyright (C) 2003 Yasuhiro Ohara
paul718e3742002-12-13 20:15:29 +00003 *
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
hasso508e53e2004-05-18 18:57:06 +000022#include <zebra.h>
paul718e3742002-12-13 20:15:29 +000023
hasso508e53e2004-05-18 18:57:06 +000024#include "memory.h"
paul718e3742002-12-13 20:15:29 +000025#include "if.h"
26#include "log.h"
27#include "command.h"
hasso508e53e2004-05-18 18:57:06 +000028#include "thread.h"
29#include "prefix.h"
30#include "plist.h"
paul718e3742002-12-13 20:15:29 +000031
hasso508e53e2004-05-18 18:57:06 +000032#include "ospf6d.h"
33#include "ospf6_lsa.h"
paul718e3742002-12-13 20:15:29 +000034#include "ospf6_lsdb.h"
hasso508e53e2004-05-18 18:57:06 +000035#include "ospf6_network.h"
36#include "ospf6_message.h"
37#include "ospf6_route.h"
paul718e3742002-12-13 20:15:29 +000038#include "ospf6_top.h"
39#include "ospf6_area.h"
40#include "ospf6_interface.h"
hasso508e53e2004-05-18 18:57:06 +000041#include "ospf6_neighbor.h"
42#include "ospf6_intra.h"
43#include "ospf6_spf.h"
paul718e3742002-12-13 20:15:29 +000044
hasso508e53e2004-05-18 18:57:06 +000045unsigned char conf_debug_ospf6_interface = 0;
46
47char *ospf6_interface_state_str[] =
paul718e3742002-12-13 20:15:29 +000048{
hasso508e53e2004-05-18 18:57:06 +000049 "None",
50 "Down",
51 "Loopback",
52 "Waiting",
53 "PointToPoint",
54 "DROther",
55 "BDR",
56 "DR",
57 NULL
paul718e3742002-12-13 20:15:29 +000058};
59
hasso508e53e2004-05-18 18:57:06 +000060struct ospf6_interface *
61ospf6_interface_lookup_by_ifindex (int ifindex)
paul718e3742002-12-13 20:15:29 +000062{
hasso508e53e2004-05-18 18:57:06 +000063 struct ospf6_interface *oi;
64 struct interface *ifp;
paul718e3742002-12-13 20:15:29 +000065
hasso508e53e2004-05-18 18:57:06 +000066 ifp = if_lookup_by_index (ifindex);
67 if (ifp == NULL)
68 return (struct ospf6_interface *) NULL;
69
70 oi = (struct ospf6_interface *) ifp->info;
71 return oi;
paul718e3742002-12-13 20:15:29 +000072}
73
hasso508e53e2004-05-18 18:57:06 +000074struct ospf6_interface *
75ospf6_interface_lookup_by_name (char *ifname)
paul718e3742002-12-13 20:15:29 +000076{
hasso508e53e2004-05-18 18:57:06 +000077 struct ospf6_interface *oi;
78 struct interface *ifp;
paul718e3742002-12-13 20:15:29 +000079
hasso508e53e2004-05-18 18:57:06 +000080 ifp = if_lookup_by_name (ifname);
81 if (ifp == NULL)
82 return (struct ospf6_interface *) NULL;
paul718e3742002-12-13 20:15:29 +000083
hasso508e53e2004-05-18 18:57:06 +000084 oi = (struct ospf6_interface *) ifp->info;
85 return oi;
paul718e3742002-12-13 20:15:29 +000086}
87
hasso508e53e2004-05-18 18:57:06 +000088/* schedule routing table recalculation */
paul718e3742002-12-13 20:15:29 +000089void
hasso508e53e2004-05-18 18:57:06 +000090ospf6_interface_lsdb_hook (struct ospf6_lsa *lsa)
paul718e3742002-12-13 20:15:29 +000091{
hasso508e53e2004-05-18 18:57:06 +000092 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +000093
hasso508e53e2004-05-18 18:57:06 +000094 oi = (struct ospf6_interface *) lsa->scope;
95 switch (ntohs (lsa->header->type))
96 {
97 case OSPF6_LSTYPE_LINK:
98 if (oi->state == OSPF6_INTERFACE_DR)
99 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi);
100 ospf6_spf_schedule (oi->area);
101 break;
paul718e3742002-12-13 20:15:29 +0000102
hasso508e53e2004-05-18 18:57:06 +0000103 default:
104 if (IS_OSPF6_DEBUG_LSA (RECV))
105 zlog_info ("Unknown LSA in Interface %s's lsdb",
106 oi->interface->name);
107 break;
108 }
paul718e3742002-12-13 20:15:29 +0000109}
110
111/* Create new ospf6 interface structure */
112struct ospf6_interface *
113ospf6_interface_create (struct interface *ifp)
114{
hasso508e53e2004-05-18 18:57:06 +0000115 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +0000116
hasso508e53e2004-05-18 18:57:06 +0000117 oi = (struct ospf6_interface *)
paul718e3742002-12-13 20:15:29 +0000118 XMALLOC (MTYPE_OSPF6_IF, sizeof (struct ospf6_interface));
119
hasso508e53e2004-05-18 18:57:06 +0000120 if (oi)
121 memset (oi, 0, sizeof (struct ospf6_interface));
paul718e3742002-12-13 20:15:29 +0000122 else
123 {
124 zlog_err ("Can't malloc ospf6_interface for ifindex %d", ifp->ifindex);
125 return (struct ospf6_interface *) NULL;
126 }
127
hasso508e53e2004-05-18 18:57:06 +0000128 oi->area = (struct ospf6_area *) NULL;
129 oi->neighbor_list = list_new ();
130 oi->neighbor_list->cmp = ospf6_neighbor_cmp;
131 oi->linklocal_addr = (struct in6_addr *) NULL;
132 oi->instance_id = 0;
133 oi->transdelay = 1;
134 oi->priority = 1;
paul718e3742002-12-13 20:15:29 +0000135
hasso508e53e2004-05-18 18:57:06 +0000136 oi->hello_interval = 10;
137 oi->dead_interval = 40;
138 oi->rxmt_interval = 5;
139 oi->cost = 1;
140 oi->ifmtu = ifp->mtu;
141 oi->state = OSPF6_INTERFACE_DOWN;
142 oi->flag = 0;
paul718e3742002-12-13 20:15:29 +0000143
hasso508e53e2004-05-18 18:57:06 +0000144 oi->lsupdate_list = ospf6_lsdb_create ();
145 oi->lsack_list = ospf6_lsdb_create ();
146 oi->lsdb = ospf6_lsdb_create ();
147 oi->lsdb->hook_add = ospf6_interface_lsdb_hook;
148 oi->lsdb->hook_remove = ospf6_interface_lsdb_hook;
paul718e3742002-12-13 20:15:29 +0000149
hasso508e53e2004-05-18 18:57:06 +0000150 oi->route_connected = ospf6_route_table_create ();
paul718e3742002-12-13 20:15:29 +0000151
152 /* link both */
hasso508e53e2004-05-18 18:57:06 +0000153 oi->interface = ifp;
154 ifp->info = oi;
paul718e3742002-12-13 20:15:29 +0000155
hasso508e53e2004-05-18 18:57:06 +0000156 return oi;
paul718e3742002-12-13 20:15:29 +0000157}
158
159void
hasso508e53e2004-05-18 18:57:06 +0000160ospf6_interface_delete (struct ospf6_interface *oi)
paul718e3742002-12-13 20:15:29 +0000161{
162 listnode n;
hasso508e53e2004-05-18 18:57:06 +0000163 struct ospf6_neighbor *on;
paul718e3742002-12-13 20:15:29 +0000164
hasso508e53e2004-05-18 18:57:06 +0000165 for (n = listhead (oi->neighbor_list); n; nextnode (n))
paul718e3742002-12-13 20:15:29 +0000166 {
hasso508e53e2004-05-18 18:57:06 +0000167 on = (struct ospf6_neighbor *) getdata (n);
168 ospf6_neighbor_delete (on);
paul718e3742002-12-13 20:15:29 +0000169 }
hasso508e53e2004-05-18 18:57:06 +0000170 list_delete (oi->neighbor_list);
paul718e3742002-12-13 20:15:29 +0000171
hasso508e53e2004-05-18 18:57:06 +0000172 THREAD_OFF (oi->thread_send_hello);
173 THREAD_OFF (oi->thread_send_lsupdate);
174 THREAD_OFF (oi->thread_send_lsack);
paul718e3742002-12-13 20:15:29 +0000175
hasso508e53e2004-05-18 18:57:06 +0000176 ospf6_lsdb_remove_all (oi->lsdb);
177 ospf6_lsdb_remove_all (oi->lsupdate_list);
178 ospf6_lsdb_remove_all (oi->lsack_list);
179
180 ospf6_lsdb_delete (oi->lsdb);
181 ospf6_lsdb_delete (oi->lsupdate_list);
182 ospf6_lsdb_delete (oi->lsack_list);
183
184 ospf6_route_table_delete (oi->route_connected);
paul718e3742002-12-13 20:15:29 +0000185
186 /* cut link */
hasso508e53e2004-05-18 18:57:06 +0000187 oi->interface->info = NULL;
paul718e3742002-12-13 20:15:29 +0000188
189 /* plist_name */
hasso508e53e2004-05-18 18:57:06 +0000190 if (oi->plist_name)
191 XFREE (MTYPE_PREFIX_LIST_STR, oi->plist_name);
paul718e3742002-12-13 20:15:29 +0000192
hasso508e53e2004-05-18 18:57:06 +0000193 XFREE (MTYPE_OSPF6_IF, oi);
194}
195
196void
197ospf6_interface_enable (struct ospf6_interface *oi)
198{
199 UNSET_FLAG (oi->flag, OSPF6_INTERFACE_DISABLE);
200
201 oi->thread_send_hello =
202 thread_add_event (master, ospf6_hello_send, oi, 0);
203}
204
205void
206ospf6_interface_disable (struct ospf6_interface *oi)
207{
208 listnode i;
209 struct ospf6_neighbor *on;
210
211 SET_FLAG (oi->flag, OSPF6_INTERFACE_DISABLE);
212
213 for (i = listhead (oi->neighbor_list); i; nextnode (i))
214 {
215 on = (struct ospf6_neighbor *) getdata (i);
216 ospf6_neighbor_delete (on);
217 }
218 list_delete_all_node (oi->neighbor_list);
219
220 ospf6_lsdb_remove_all (oi->lsdb);
221 ospf6_lsdb_remove_all (oi->lsupdate_list);
222 ospf6_lsdb_remove_all (oi->lsack_list);
223
224 THREAD_OFF (oi->thread_send_hello);
225 THREAD_OFF (oi->thread_send_lsupdate);
226 THREAD_OFF (oi->thread_send_lsack);
paul718e3742002-12-13 20:15:29 +0000227}
228
229static struct in6_addr *
hasso508e53e2004-05-18 18:57:06 +0000230ospf6_interface_get_linklocal_address (struct interface *ifp)
paul718e3742002-12-13 20:15:29 +0000231{
232 listnode n;
233 struct connected *c;
234 struct in6_addr *l = (struct in6_addr *) NULL;
235
236 /* for each connected address */
237 for (n = listhead (ifp->connected); n; nextnode (n))
238 {
239 c = (struct connected *) getdata (n);
240
241 /* if family not AF_INET6, ignore */
242 if (c->address->family != AF_INET6)
243 continue;
244
245 /* linklocal scope check */
246 if (IN6_IS_ADDR_LINKLOCAL (&c->address->u.prefix6))
247 l = &c->address->u.prefix6;
248 }
249 return l;
250}
251
252void
253ospf6_interface_if_add (struct interface *ifp)
254{
hasso508e53e2004-05-18 18:57:06 +0000255 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +0000256
hasso508e53e2004-05-18 18:57:06 +0000257 oi = (struct ospf6_interface *) ifp->info;
258 if (oi == NULL)
paul718e3742002-12-13 20:15:29 +0000259 return;
260
hasso508e53e2004-05-18 18:57:06 +0000261 oi->ifmtu = ifp->mtu;
paul718e3742002-12-13 20:15:29 +0000262
263 /* interface start */
hasso508e53e2004-05-18 18:57:06 +0000264 if (oi->area)
265 thread_add_event (master, interface_up, oi, 0);
paul718e3742002-12-13 20:15:29 +0000266}
267
268void
269ospf6_interface_if_del (struct interface *ifp)
270{
hasso508e53e2004-05-18 18:57:06 +0000271 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +0000272
hasso508e53e2004-05-18 18:57:06 +0000273 oi = (struct ospf6_interface *) ifp->info;
274 if (oi == NULL)
paul718e3742002-12-13 20:15:29 +0000275 return;
276
277 /* interface stop */
hasso508e53e2004-05-18 18:57:06 +0000278 if (oi->area)
279 thread_execute (master, interface_down, oi, 0);
paul718e3742002-12-13 20:15:29 +0000280
hasso508e53e2004-05-18 18:57:06 +0000281 listnode_delete (oi->area->if_list, oi);
282 oi->area = (struct ospf6_area *) NULL;
paul718e3742002-12-13 20:15:29 +0000283
284 /* cut link */
hasso508e53e2004-05-18 18:57:06 +0000285 oi->interface = NULL;
paul718e3742002-12-13 20:15:29 +0000286 ifp->info = NULL;
287
hasso508e53e2004-05-18 18:57:06 +0000288 ospf6_interface_delete (oi);
paul718e3742002-12-13 20:15:29 +0000289}
290
291void
292ospf6_interface_state_update (struct interface *ifp)
293{
hasso508e53e2004-05-18 18:57:06 +0000294 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +0000295
hasso508e53e2004-05-18 18:57:06 +0000296 oi = (struct ospf6_interface *) ifp->info;
297 if (oi == NULL)
paul718e3742002-12-13 20:15:29 +0000298 return;
hasso508e53e2004-05-18 18:57:06 +0000299 if (oi->area == NULL)
paul718e3742002-12-13 20:15:29 +0000300 return;
301
302 if (if_is_up (ifp))
hasso508e53e2004-05-18 18:57:06 +0000303 thread_add_event (master, interface_up, oi, 0);
paul718e3742002-12-13 20:15:29 +0000304 else
hasso508e53e2004-05-18 18:57:06 +0000305 thread_add_event (master, interface_down, oi, 0);
paul718e3742002-12-13 20:15:29 +0000306
307 return;
308}
309
310void
hasso508e53e2004-05-18 18:57:06 +0000311ospf6_interface_connected_route_update (struct interface *ifp)
paul718e3742002-12-13 20:15:29 +0000312{
hasso508e53e2004-05-18 18:57:06 +0000313 struct ospf6_interface *oi;
314 struct ospf6_route *route;
315 struct connected *c;
316 listnode i;
paul718e3742002-12-13 20:15:29 +0000317
hasso508e53e2004-05-18 18:57:06 +0000318 oi = (struct ospf6_interface *) ifp->info;
319 if (oi == NULL)
paul718e3742002-12-13 20:15:29 +0000320 return;
321
322 /* reset linklocal pointer */
hasso508e53e2004-05-18 18:57:06 +0000323 oi->linklocal_addr = ospf6_interface_get_linklocal_address (ifp);
paul718e3742002-12-13 20:15:29 +0000324
hasso508e53e2004-05-18 18:57:06 +0000325 /* if area is null, do not make connected-route list */
326 if (oi->area == NULL)
paul718e3742002-12-13 20:15:29 +0000327 return;
328
hasso508e53e2004-05-18 18:57:06 +0000329 /* update "route to advertise" interface route table */
330 ospf6_route_remove_all (oi->route_connected);
331 for (i = listhead (oi->interface->connected); i; nextnode (i))
332 {
333 c = (struct connected *) getdata (i);
334
335 if (c->address->family != AF_INET6)
336 continue;
337
338 CONTINUE_IF_ADDRESS_LINKLOCAL (c->address);
339 CONTINUE_IF_ADDRESS_UNSPECIFIED (c->address);
340 CONTINUE_IF_ADDRESS_LOOPBACK (c->address);
341 CONTINUE_IF_ADDRESS_V4COMPAT (c->address);
342 CONTINUE_IF_ADDRESS_V4MAPPED (c->address);
343
344 /* apply filter */
345 if (oi->plist_name)
346 {
347 struct prefix_list *plist;
348 enum prefix_list_type ret;
349 char buf[128];
350
351 prefix2str (c->address, buf, sizeof (buf));
352 plist = prefix_list_lookup (AFI_IP6, oi->plist_name);
353 ret = prefix_list_apply (plist, (void *) c->address);
354 if (ret == PREFIX_DENY)
355 {
356 zlog_info ("%s on %s filtered by prefix-list %s ",
357 buf, oi->interface->name, oi->plist_name);
358 continue;
359 }
360 }
361
362 route = ospf6_route_create ();
363 memcpy (&route->prefix, c->address, sizeof (struct prefix));
364 apply_mask (&route->prefix);
365 route->type = OSPF6_DEST_TYPE_NETWORK;
366 route->path.area_id = oi->area->area_id;
367 route->path.type = OSPF6_PATH_TYPE_INTRA;
368 route->path.cost = oi->cost;
369 route->nexthop[0].ifindex = oi->interface->ifindex;
370 inet_pton (AF_INET6, "::1", &route->nexthop[0].address);
371 ospf6_route_add (route, oi->route_connected);
372 }
373
paul718e3742002-12-13 20:15:29 +0000374 /* create new Link-LSA */
hasso508e53e2004-05-18 18:57:06 +0000375 OSPF6_LINK_LSA_SCHEDULE (oi);
376 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi);
377 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area);
paul718e3742002-12-13 20:15:29 +0000378}
379
hasso508e53e2004-05-18 18:57:06 +0000380static void
381ospf6_interface_state_change (u_char next_state, struct ospf6_interface *oi)
paul718e3742002-12-13 20:15:29 +0000382{
hasso508e53e2004-05-18 18:57:06 +0000383 u_char prev_state;
paul718e3742002-12-13 20:15:29 +0000384
hasso508e53e2004-05-18 18:57:06 +0000385 prev_state = oi->state;
386 oi->state = next_state;
paul718e3742002-12-13 20:15:29 +0000387
hasso508e53e2004-05-18 18:57:06 +0000388 if (prev_state == next_state)
389 return;
paul718e3742002-12-13 20:15:29 +0000390
hasso508e53e2004-05-18 18:57:06 +0000391 /* log */
392 if (IS_OSPF6_DEBUG_INTERFACE)
paul718e3742002-12-13 20:15:29 +0000393 {
hasso508e53e2004-05-18 18:57:06 +0000394 zlog_info ("Interface state change %s: %s -> %s", oi->interface->name,
395 ospf6_interface_state_str[prev_state],
396 ospf6_interface_state_str[next_state]);
paul718e3742002-12-13 20:15:29 +0000397 }
paul718e3742002-12-13 20:15:29 +0000398
hasso508e53e2004-05-18 18:57:06 +0000399 if ((prev_state == OSPF6_INTERFACE_DR ||
400 prev_state == OSPF6_INTERFACE_BDR) &&
401 (next_state != OSPF6_INTERFACE_DR &&
402 next_state != OSPF6_INTERFACE_BDR))
403 ospf6_leave_alldrouters (oi->interface->ifindex);
404 if ((prev_state != OSPF6_INTERFACE_DR &&
405 prev_state != OSPF6_INTERFACE_BDR) &&
406 (next_state == OSPF6_INTERFACE_DR ||
407 next_state == OSPF6_INTERFACE_BDR))
408 ospf6_join_alldrouters (oi->interface->ifindex);
paul718e3742002-12-13 20:15:29 +0000409
hasso508e53e2004-05-18 18:57:06 +0000410 OSPF6_ROUTER_LSA_SCHEDULE (oi->area);
411 if (prev_state == OSPF6_INTERFACE_DR || next_state == OSPF6_INTERFACE_DR)
paul718e3742002-12-13 20:15:29 +0000412 {
hasso508e53e2004-05-18 18:57:06 +0000413 OSPF6_NETWORK_LSA_SCHEDULE (oi);
414 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi);
415 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area);
paul718e3742002-12-13 20:15:29 +0000416 }
hasso508e53e2004-05-18 18:57:06 +0000417}
418
419
420/* DR Election, RFC2328 section 9.4 */
421
422#define IS_ELIGIBLE(n) \
423 ((n)->state >= OSPF6_NEIGHBOR_TWOWAY && (n)->priority != 0)
424
425static struct ospf6_neighbor *
426better_bdrouter (struct ospf6_neighbor *a, struct ospf6_neighbor *b)
427{
428 if ((a == NULL || ! IS_ELIGIBLE (a) || a->drouter == a->router_id) &&
429 (b == NULL || ! IS_ELIGIBLE (b) || b->drouter == b->router_id))
430 return NULL;
431 else if (a == NULL || ! IS_ELIGIBLE (a) || a->drouter == a->router_id)
432 return b;
433 else if (b == NULL || ! IS_ELIGIBLE (b) || b->drouter == b->router_id)
434 return a;
435
436 if (a->bdrouter == a->router_id && b->bdrouter != b->router_id)
437 return a;
438 if (a->bdrouter != a->router_id && b->bdrouter == b->router_id)
439 return b;
440
441 if (a->priority > b->priority)
442 return a;
443 if (a->priority < b->priority)
444 return b;
445
446 if (ntohl (a->router_id) > ntohl (b->router_id))
447 return a;
448 if (ntohl (a->router_id) < ntohl (b->router_id))
449 return b;
450
451 zlog_warn ("Router-ID duplicate ?");
452 return a;
453}
454
455static struct ospf6_neighbor *
456better_drouter (struct ospf6_neighbor *a, struct ospf6_neighbor *b)
457{
458 if ((a == NULL || ! IS_ELIGIBLE (a) || a->drouter != a->router_id) &&
459 (b == NULL || ! IS_ELIGIBLE (b) || b->drouter != b->router_id))
460 return NULL;
461 else if (a == NULL || ! IS_ELIGIBLE (a) || a->drouter != a->router_id)
462 return b;
463 else if (b == NULL || ! IS_ELIGIBLE (b) || b->drouter != b->router_id)
464 return a;
465
466 if (a->drouter == a->router_id && b->drouter != b->router_id)
467 return a;
468 if (a->drouter != a->router_id && b->drouter == b->router_id)
469 return b;
470
471 if (a->priority > b->priority)
472 return a;
473 if (a->priority < b->priority)
474 return b;
475
476 if (ntohl (a->router_id) > ntohl (b->router_id))
477 return a;
478 if (ntohl (a->router_id) < ntohl (b->router_id))
479 return b;
480
481 zlog_warn ("Router-ID duplicate ?");
482 return a;
483}
484
485static u_char
486dr_election (struct ospf6_interface *oi)
487{
488 listnode i;
489 struct ospf6_neighbor *on, *drouter, *bdrouter, myself;
490 struct ospf6_neighbor *best_drouter, *best_bdrouter;
491 u_char next_state = 0;
492
493 drouter = bdrouter = NULL;
494 best_drouter = best_bdrouter = NULL;
495
496 /* pseudo neighbor myself, including noting current DR/BDR (1) */
497 memset (&myself, 0, sizeof (myself));
498 inet_ntop (AF_INET, &oi->area->ospf6->router_id, myself.name,
499 sizeof (myself.name));
500 myself.state = OSPF6_NEIGHBOR_TWOWAY;
501 myself.drouter = oi->drouter;
502 myself.bdrouter = oi->bdrouter;
503 myself.priority = oi->priority;
504 myself.router_id = oi->area->ospf6->router_id;
505
506 /* Electing BDR (2) */
507 for (i = listhead (oi->neighbor_list); i; nextnode (i))
508 {
509 on = (struct ospf6_neighbor *) getdata (i);
510 bdrouter = better_bdrouter (bdrouter, on);
511 }
512 best_bdrouter = bdrouter;
513 bdrouter = better_bdrouter (best_bdrouter, &myself);
514
515 /* Electing DR (3) */
516 for (i = listhead (oi->neighbor_list); i; nextnode (i))
517 {
518 on = (struct ospf6_neighbor *) getdata (i);
519 drouter = better_drouter (drouter, on);
520 }
521 best_drouter = drouter;
522 drouter = better_drouter (best_drouter, &myself);
523 if (drouter == NULL)
524 drouter = bdrouter;
525
526 /* the router itself is newly/no longer DR/BDR (4) */
527 if ((drouter == &myself && myself.drouter != myself.router_id) ||
528 (drouter != &myself && myself.drouter == myself.router_id) ||
529 (bdrouter == &myself && myself.bdrouter != myself.router_id) ||
530 (bdrouter != &myself && myself.bdrouter == myself.router_id))
531 {
532 myself.drouter = (drouter ? drouter->router_id : htonl (0));
533 myself.bdrouter = (bdrouter ? bdrouter->router_id : htonl (0));
534
535 /* compatible to Electing BDR (2) */
536 bdrouter = better_bdrouter (best_bdrouter, &myself);
537
538 /* compatible to Electing DR (3) */
539 drouter = better_drouter (best_drouter, &myself);
540 if (drouter == NULL)
541 drouter = bdrouter;
542 }
543
544 /* Set interface state accordingly (5) */
545 if (drouter && drouter == &myself)
546 next_state = OSPF6_INTERFACE_DR;
547 else if (bdrouter && bdrouter == &myself)
548 next_state = OSPF6_INTERFACE_BDR;
549 else
550 next_state = OSPF6_INTERFACE_DROTHER;
551
552 /* If NBMA, schedule Start for each neighbor having priority of 0 (6) */
553 /* XXX */
554
555 /* If DR or BDR change, invoke AdjOK? for each neighbor (7) */
556 /* RFC 2328 section 12.4. Originating LSAs (3) will be handled
557 accordingly after AdjOK */
558 if (oi->drouter != (drouter ? drouter->router_id : htonl (0)) ||
559 oi->bdrouter != (bdrouter ? bdrouter->router_id : htonl (0)))
560 {
561 if (IS_OSPF6_DEBUG_INTERFACE)
562 zlog_info ("DR Election on %s: DR: %s BDR: %s", oi->interface->name,
563 (drouter ? drouter->name : "0.0.0.0"),
564 (bdrouter ? bdrouter->name : "0.0.0.0"));
565
566 for (i = listhead (oi->neighbor_list); i; nextnode (i))
567 {
568 on = (struct ospf6_neighbor *) getdata (i);
569 if (on->state < OSPF6_NEIGHBOR_TWOWAY)
570 continue;
571 /* Schedule AdjOK. */
572 thread_add_event (master, adj_ok, on, 0);
573 }
574 }
575
576 oi->drouter = (drouter ? drouter->router_id : htonl (0));
577 oi->bdrouter = (bdrouter ? bdrouter->router_id : htonl (0));
578 return next_state;
579}
580
581
582/* Interface State Machine */
583int
584interface_up (struct thread *thread)
585{
586 struct ospf6_interface *oi;
587
588 oi = (struct ospf6_interface *) THREAD_ARG (thread);
589 assert (oi && oi->interface);
590
591 if (IS_OSPF6_DEBUG_INTERFACE)
592 zlog_info ("Interface Event %s: [InterfaceUp]",
593 oi->interface->name);
594
595 /* check physical interface is up */
596 if (! if_is_up (oi->interface))
597 {
598 if (IS_OSPF6_DEBUG_INTERFACE)
599 zlog_info ("Interface %s is down, can't execute [InterfaceUp]",
600 oi->interface->name);
601 return 0;
602 }
603
604 /* if already enabled, do nothing */
605 if (oi->state > OSPF6_INTERFACE_DOWN)
606 {
607 if (IS_OSPF6_DEBUG_INTERFACE)
608 zlog_info ("Interface %s already enabled",
609 oi->interface->name);
610 return 0;
611 }
612
613 /* Join AllSPFRouters */
614 ospf6_join_allspfrouters (oi->interface->ifindex);
615
616 /* Update interface route */
617 ospf6_interface_connected_route_update (oi->interface);
618
619 /* Schedule Hello */
620 if (! CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE))
621 thread_add_event (master, ospf6_hello_send, oi, 0);
622
623 /* decide next interface state */
624 if (if_is_pointopoint (oi->interface))
625 ospf6_interface_state_change (OSPF6_INTERFACE_POINTTOPOINT, oi);
626 else if (oi->priority == 0)
627 ospf6_interface_state_change (OSPF6_INTERFACE_DROTHER, oi);
628 else
629 {
630 ospf6_interface_state_change (OSPF6_INTERFACE_WAITING, oi);
631 thread_add_timer (master, wait_timer, oi, oi->dead_interval);
632 }
633
634 return 0;
paul718e3742002-12-13 20:15:29 +0000635}
636
637int
hasso508e53e2004-05-18 18:57:06 +0000638wait_timer (struct thread *thread)
paul718e3742002-12-13 20:15:29 +0000639{
hasso508e53e2004-05-18 18:57:06 +0000640 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +0000641
hasso508e53e2004-05-18 18:57:06 +0000642 oi = (struct ospf6_interface *) THREAD_ARG (thread);
643 assert (oi && oi->interface);
paul718e3742002-12-13 20:15:29 +0000644
hasso508e53e2004-05-18 18:57:06 +0000645 if (IS_OSPF6_DEBUG_INTERFACE)
646 zlog_info ("Interface Event %s: [WaitTimer]",
647 oi->interface->name);
paul718e3742002-12-13 20:15:29 +0000648
hasso508e53e2004-05-18 18:57:06 +0000649 if (oi->state == OSPF6_INTERFACE_WAITING)
650 ospf6_interface_state_change (dr_election (oi), oi);
paul718e3742002-12-13 20:15:29 +0000651
hasso508e53e2004-05-18 18:57:06 +0000652 return 0;
paul718e3742002-12-13 20:15:29 +0000653}
654
hasso508e53e2004-05-18 18:57:06 +0000655int
656backup_seen (struct thread *thread)
paul718e3742002-12-13 20:15:29 +0000657{
hasso508e53e2004-05-18 18:57:06 +0000658 struct ospf6_interface *oi;
659
660 oi = (struct ospf6_interface *) THREAD_ARG (thread);
661 assert (oi && oi->interface);
662
663 if (IS_OSPF6_DEBUG_INTERFACE)
664 zlog_info ("Interface Event %s: [BackupSeen]",
665 oi->interface->name);
666
667 if (oi->state == OSPF6_INTERFACE_WAITING)
668 ospf6_interface_state_change (dr_election (oi), oi);
669
670 return 0;
paul718e3742002-12-13 20:15:29 +0000671}
672
hasso508e53e2004-05-18 18:57:06 +0000673int
674neighbor_change (struct thread *thread)
paul718e3742002-12-13 20:15:29 +0000675{
hasso508e53e2004-05-18 18:57:06 +0000676 struct ospf6_interface *oi;
677
678 oi = (struct ospf6_interface *) THREAD_ARG (thread);
679 assert (oi && oi->interface);
680
681 if (IS_OSPF6_DEBUG_INTERFACE)
682 zlog_info ("Interface Event %s: [NeighborChange]",
683 oi->interface->name);
684
685 if (oi->state == OSPF6_INTERFACE_DROTHER ||
686 oi->state == OSPF6_INTERFACE_BDR ||
687 oi->state == OSPF6_INTERFACE_DR)
688 ospf6_interface_state_change (dr_election (oi), oi);
689
690 return 0;
paul718e3742002-12-13 20:15:29 +0000691}
692
hasso508e53e2004-05-18 18:57:06 +0000693int
694loopind (struct thread *thread)
695{
696 struct ospf6_interface *oi;
697
698 oi = (struct ospf6_interface *) THREAD_ARG (thread);
699 assert (oi && oi->interface);
700
701 if (IS_OSPF6_DEBUG_INTERFACE)
702 zlog_info ("Interface Event %s: [LoopInd]",
703 oi->interface->name);
704
705 /* XXX not yet */
706
707 return 0;
708}
709
710int
711interface_down (struct thread *thread)
712{
713 struct ospf6_interface *oi;
714 listnode n;
715 struct ospf6_neighbor *on;
716
717 oi = (struct ospf6_interface *) THREAD_ARG (thread);
718 assert (oi && oi->interface);
719
720 if (IS_OSPF6_DEBUG_INTERFACE)
721 zlog_info ("Interface Event %s: [InterfaceDown]",
722 oi->interface->name);
723
724 /* Leave AllSPFRouters */
725 if (oi->state > OSPF6_INTERFACE_DOWN)
726 ospf6_leave_allspfrouters (oi->interface->ifindex);
727
728 ospf6_interface_state_change (OSPF6_INTERFACE_DOWN, oi);
729
730 for (n = listhead (oi->neighbor_list); n; nextnode (n))
731 {
732 on = (struct ospf6_neighbor *) getdata (n);
733 ospf6_neighbor_delete (on);
734 }
735 list_delete_all_node (oi->neighbor_list);
736
737 return 0;
738}
739
740
paul718e3742002-12-13 20:15:29 +0000741/* show specified interface structure */
742int
hasso508e53e2004-05-18 18:57:06 +0000743ospf6_interface_show (struct vty *vty, struct interface *ifp)
paul718e3742002-12-13 20:15:29 +0000744{
hasso508e53e2004-05-18 18:57:06 +0000745 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +0000746 struct connected *c;
747 struct prefix *p;
748 listnode i;
hasso508e53e2004-05-18 18:57:06 +0000749 char strbuf[64], drouter[32], bdrouter[32];
paul718e3742002-12-13 20:15:29 +0000750 char *updown[3] = {"down", "up", NULL};
751 char *type;
hasso508e53e2004-05-18 18:57:06 +0000752 struct timeval res, now;
753 char duration[32];
754 struct ospf6_lsa *lsa;
paul718e3742002-12-13 20:15:29 +0000755
756 /* check physical interface type */
hasso508e53e2004-05-18 18:57:06 +0000757 if (if_is_loopback (ifp))
paul718e3742002-12-13 20:15:29 +0000758 type = "LOOPBACK";
hasso508e53e2004-05-18 18:57:06 +0000759 else if (if_is_broadcast (ifp))
paul718e3742002-12-13 20:15:29 +0000760 type = "BROADCAST";
hasso508e53e2004-05-18 18:57:06 +0000761 else if (if_is_pointopoint (ifp))
paul718e3742002-12-13 20:15:29 +0000762 type = "POINTOPOINT";
763 else
764 type = "UNKNOWN";
765
766 vty_out (vty, "%s is %s, type %s%s",
hasso508e53e2004-05-18 18:57:06 +0000767 ifp->name, updown[if_is_up (ifp)], type,
paul718e3742002-12-13 20:15:29 +0000768 VTY_NEWLINE);
hasso508e53e2004-05-18 18:57:06 +0000769 vty_out (vty, " Interface ID: %d%s", ifp->ifindex, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +0000770
hasso508e53e2004-05-18 18:57:06 +0000771 if (ifp->info == NULL)
paul718e3742002-12-13 20:15:29 +0000772 {
773 vty_out (vty, " OSPF not enabled on this interface%s", VTY_NEWLINE);
774 return 0;
775 }
776 else
hasso508e53e2004-05-18 18:57:06 +0000777 oi = (struct ospf6_interface *) ifp->info;
paul718e3742002-12-13 20:15:29 +0000778
779 vty_out (vty, " Internet Address:%s", VTY_NEWLINE);
hasso508e53e2004-05-18 18:57:06 +0000780 for (i = listhead (ifp->connected); i; nextnode (i))
paul718e3742002-12-13 20:15:29 +0000781 {
782 c = (struct connected *)getdata (i);
783 p = c->address;
784 prefix2str (p, strbuf, sizeof (strbuf));
785 switch (p->family)
786 {
787 case AF_INET:
hasso508e53e2004-05-18 18:57:06 +0000788 vty_out (vty, " inet : %s%s", strbuf,
paul718e3742002-12-13 20:15:29 +0000789 VTY_NEWLINE);
790 break;
791 case AF_INET6:
hasso508e53e2004-05-18 18:57:06 +0000792 vty_out (vty, " inet6: %s%s", strbuf,
paul718e3742002-12-13 20:15:29 +0000793 VTY_NEWLINE);
794 break;
795 default:
hasso508e53e2004-05-18 18:57:06 +0000796 vty_out (vty, " ??? : %s%s", strbuf,
paul718e3742002-12-13 20:15:29 +0000797 VTY_NEWLINE);
798 break;
799 }
800 }
801
hasso508e53e2004-05-18 18:57:06 +0000802 if (oi->area)
paul718e3742002-12-13 20:15:29 +0000803 {
hasso508e53e2004-05-18 18:57:06 +0000804 vty_out (vty, " Instance ID %d, Interface MTU %d (autodetect: %d)%s",
805 oi->instance_id, oi->ifmtu, ifp->mtu, VTY_NEWLINE);
806 inet_ntop (AF_INET, &oi->area->area_id,
paul718e3742002-12-13 20:15:29 +0000807 strbuf, sizeof (strbuf));
hasso508e53e2004-05-18 18:57:06 +0000808 vty_out (vty, " Area ID %s, Cost %hu%s", strbuf, oi->cost,
paul718e3742002-12-13 20:15:29 +0000809 VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +0000810 }
811 else
812 vty_out (vty, " Not Attached to Area%s", VTY_NEWLINE);
813
814 vty_out (vty, " State %s, Transmit Delay %d sec, Priority %d%s",
hasso508e53e2004-05-18 18:57:06 +0000815 ospf6_interface_state_str[oi->state],
816 oi->transdelay, oi->priority,
paul718e3742002-12-13 20:15:29 +0000817 VTY_NEWLINE);
818 vty_out (vty, " Timer intervals configured:%s", VTY_NEWLINE);
819 vty_out (vty, " Hello %d, Dead %d, Retransmit %d%s",
hasso508e53e2004-05-18 18:57:06 +0000820 oi->hello_interval, oi->dead_interval, oi->rxmt_interval,
paul718e3742002-12-13 20:15:29 +0000821 VTY_NEWLINE);
822
hasso508e53e2004-05-18 18:57:06 +0000823 inet_ntop (AF_INET, &oi->drouter, drouter, sizeof (drouter));
824 inet_ntop (AF_INET, &oi->bdrouter, bdrouter, sizeof (bdrouter));
825 vty_out (vty, " DR: %s BDR: %s%s", drouter, bdrouter, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +0000826
827 vty_out (vty, " Number of I/F scoped LSAs is %u%s",
hasso508e53e2004-05-18 18:57:06 +0000828 oi->lsdb->count, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +0000829
830 gettimeofday (&now, (struct timezone *) NULL);
paul718e3742002-12-13 20:15:29 +0000831
hasso508e53e2004-05-18 18:57:06 +0000832 timerclear (&res);
833 if (oi->thread_send_lsupdate)
834 timersub (&oi->thread_send_lsupdate->u.sands, &now, &res);
835 timerstring (&res, duration, sizeof (duration));
836 vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s",
837 oi->lsupdate_list->count, duration,
838 (oi->thread_send_lsupdate ? "on" : "off"),
839 VTY_NEWLINE);
840 for (lsa = ospf6_lsdb_head (oi->lsupdate_list); lsa;
841 lsa = ospf6_lsdb_next (lsa))
842 vty_out (vty, " %s%s", lsa->name, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +0000843
hasso508e53e2004-05-18 18:57:06 +0000844 timerclear (&res);
845 if (oi->thread_send_lsack)
846 timersub (&oi->thread_send_lsack->u.sands, &now, &res);
847 timerstring (&res, duration, sizeof (duration));
848 vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]%s",
849 oi->lsack_list->count, duration,
850 (oi->thread_send_lsack ? "on" : "off"),
851 VTY_NEWLINE);
852 for (lsa = ospf6_lsdb_head (oi->lsack_list); lsa;
853 lsa = ospf6_lsdb_next (lsa))
854 vty_out (vty, " %s%s", lsa->name, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +0000855
hasso508e53e2004-05-18 18:57:06 +0000856 return 0;
paul718e3742002-12-13 20:15:29 +0000857}
858
859/* show interface */
860DEFUN (show_ipv6_ospf6_interface,
861 show_ipv6_ospf6_interface_ifname_cmd,
862 "show ipv6 ospf6 interface IFNAME",
863 SHOW_STR
864 IP6_STR
865 OSPF6_STR
866 INTERFACE_STR
867 IFNAME_STR
868 )
869{
870 struct interface *ifp;
871 listnode i;
872
873 if (argc)
874 {
875 ifp = if_lookup_by_name (argv[0]);
hasso508e53e2004-05-18 18:57:06 +0000876 if (ifp == NULL)
paul718e3742002-12-13 20:15:29 +0000877 {
878 vty_out (vty, "No such Interface: %s%s", argv[0],
hasso508e53e2004-05-18 18:57:06 +0000879 VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +0000880 return CMD_WARNING;
881 }
882 ospf6_interface_show (vty, ifp);
883 }
884 else
885 {
886 for (i = listhead (iflist); i; nextnode (i))
887 {
hasso508e53e2004-05-18 18:57:06 +0000888 ifp = (struct interface *) getdata (i);
paul718e3742002-12-13 20:15:29 +0000889 ospf6_interface_show (vty, ifp);
890 }
891 }
hasso508e53e2004-05-18 18:57:06 +0000892
paul718e3742002-12-13 20:15:29 +0000893 return CMD_SUCCESS;
894}
895
896ALIAS (show_ipv6_ospf6_interface,
897 show_ipv6_ospf6_interface_cmd,
898 "show ipv6 ospf6 interface",
899 SHOW_STR
900 IP6_STR
901 OSPF6_STR
902 INTERFACE_STR
hasso508e53e2004-05-18 18:57:06 +0000903 );
paul718e3742002-12-13 20:15:29 +0000904
hasso508e53e2004-05-18 18:57:06 +0000905DEFUN (show_ipv6_ospf6_interface_ifname_prefix,
906 show_ipv6_ospf6_interface_ifname_prefix_cmd,
907 "show ipv6 ospf6 interface IFNAME prefix",
908 SHOW_STR
paul718e3742002-12-13 20:15:29 +0000909 IP6_STR
910 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +0000911 INTERFACE_STR
912 IFNAME_STR
913 "Display connected prefixes to advertise\n"
paul718e3742002-12-13 20:15:29 +0000914 )
915{
paul718e3742002-12-13 20:15:29 +0000916 struct interface *ifp;
hasso508e53e2004-05-18 18:57:06 +0000917 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +0000918
hasso508e53e2004-05-18 18:57:06 +0000919 ifp = if_lookup_by_name (argv[0]);
920 if (ifp == NULL)
921 {
922 vty_out (vty, "No such Interface: %s%s", argv[0], VTY_NEWLINE);
923 return CMD_WARNING;
924 }
paul718e3742002-12-13 20:15:29 +0000925
hasso508e53e2004-05-18 18:57:06 +0000926 oi = ifp->info;
927 if (oi == NULL)
928 {
929 vty_out (vty, "OSPFv3 is not enabled on %s%s", argv[0], VTY_NEWLINE);
930 return CMD_WARNING;
931 }
paul718e3742002-12-13 20:15:29 +0000932
hasso508e53e2004-05-18 18:57:06 +0000933 argc--;
934 argv++;
935 ospf6_route_table_show (vty, argc, argv, oi->route_connected);
paul718e3742002-12-13 20:15:29 +0000936
937 return CMD_SUCCESS;
938}
939
hasso508e53e2004-05-18 18:57:06 +0000940ALIAS (show_ipv6_ospf6_interface_ifname_prefix,
941 show_ipv6_ospf6_interface_ifname_prefix_detail_cmd,
942 "show ipv6 ospf6 interface IFNAME prefix (X:X::X:X|X:X::X:X/M|detail)",
943 SHOW_STR
paul718e3742002-12-13 20:15:29 +0000944 IP6_STR
945 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +0000946 INTERFACE_STR
947 IFNAME_STR
948 "Display connected prefixes to advertise\n"
949 OSPF6_ROUTE_ADDRESS_STR
950 OSPF6_ROUTE_PREFIX_STR
951 "Dispaly details of the prefixes\n"
952 );
953
954ALIAS (show_ipv6_ospf6_interface_ifname_prefix,
955 show_ipv6_ospf6_interface_ifname_prefix_match_cmd,
956 "show ipv6 ospf6 interface IFNAME prefix X:X::X:X/M (match|detail)",
957 SHOW_STR
958 IP6_STR
959 OSPF6_STR
960 INTERFACE_STR
961 IFNAME_STR
962 "Display connected prefixes to advertise\n"
963 OSPF6_ROUTE_PREFIX_STR
964 OSPF6_ROUTE_MATCH_STR
965 "Dispaly details of the prefixes\n"
966 );
967
968DEFUN (show_ipv6_ospf6_interface_prefix,
969 show_ipv6_ospf6_interface_prefix_cmd,
970 "show ipv6 ospf6 interface prefix",
971 SHOW_STR
972 IP6_STR
973 OSPF6_STR
974 INTERFACE_STR
975 "Display connected prefixes to advertise\n"
paul718e3742002-12-13 20:15:29 +0000976 )
977{
hasso508e53e2004-05-18 18:57:06 +0000978 listnode i;
979 struct ospf6_interface *oi;
980 struct interface *ifp;
981
982 for (i = listhead (iflist); i; nextnode (i))
983 {
984 ifp = (struct interface *) getdata (i);
985 oi = (struct ospf6_interface *) ifp->info;
986 if (oi == NULL)
987 continue;
988
989 ospf6_route_table_show (vty, argc, argv, oi->route_connected);
990 }
991
992 return CMD_SUCCESS;
993}
994
995ALIAS (show_ipv6_ospf6_interface_prefix,
996 show_ipv6_ospf6_interface_prefix_detail_cmd,
997 "show ipv6 ospf6 interface prefix (X:X::X:X|X:X::X:X/M|detail)",
998 SHOW_STR
999 IP6_STR
1000 OSPF6_STR
1001 INTERFACE_STR
1002 "Display connected prefixes to advertise\n"
1003 OSPF6_ROUTE_ADDRESS_STR
1004 OSPF6_ROUTE_PREFIX_STR
1005 "Dispaly details of the prefixes\n"
1006 );
1007
1008ALIAS (show_ipv6_ospf6_interface_prefix,
1009 show_ipv6_ospf6_interface_prefix_match_cmd,
1010 "show ipv6 ospf6 interface prefix X:X::X:X/M (match|detail)",
1011 SHOW_STR
1012 IP6_STR
1013 OSPF6_STR
1014 INTERFACE_STR
1015 "Display connected prefixes to advertise\n"
1016 OSPF6_ROUTE_PREFIX_STR
1017 OSPF6_ROUTE_MATCH_STR
1018 "Dispaly details of the prefixes\n"
1019 );
1020
1021
1022/* interface variable set command */
1023DEFUN (ipv6_ospf6_cost,
1024 ipv6_ospf6_cost_cmd,
1025 "ipv6 ospf6 cost <1-65535>",
1026 IP6_STR
1027 OSPF6_STR
1028 "Interface cost\n"
1029 "Outgoing metric of this interface\n"
1030 )
1031{
1032 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001033 struct interface *ifp;
1034
1035 ifp = (struct interface *) vty->index;
1036 assert (ifp);
paul718e3742002-12-13 20:15:29 +00001037
hasso508e53e2004-05-18 18:57:06 +00001038 oi = (struct ospf6_interface *) ifp->info;
1039 if (oi == NULL)
1040 oi = ospf6_interface_create (ifp);
1041 assert (oi);
1042
1043 if (oi->cost == strtol (argv[0], NULL, 10))
1044 return CMD_SUCCESS;
1045
1046 oi->cost = strtol (argv[0], NULL, 10);
1047
1048 /* update cost held in route_connected list in ospf6_interface */
1049 ospf6_interface_connected_route_update (oi->interface);
1050
1051 /* execute LSA hooks */
1052 if (oi->area)
1053 {
1054 OSPF6_LINK_LSA_SCHEDULE (oi);
1055 OSPF6_ROUTER_LSA_SCHEDULE (oi->area);
1056 OSPF6_NETWORK_LSA_SCHEDULE (oi);
1057 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi);
1058 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area);
1059 }
1060
1061 return CMD_SUCCESS;
1062}
1063
1064DEFUN (ipv6_ospf6_hellointerval,
1065 ipv6_ospf6_hellointerval_cmd,
1066 "ipv6 ospf6 hello-interval <1-65535>",
1067 IP6_STR
1068 OSPF6_STR
1069 "Interval time of Hello packets\n"
1070 SECONDS_STR
1071 )
1072{
1073 struct ospf6_interface *oi;
1074 struct interface *ifp;
1075
1076 ifp = (struct interface *) vty->index;
1077 assert (ifp);
1078
1079 oi = (struct ospf6_interface *) ifp->info;
1080 if (oi == NULL)
1081 oi = ospf6_interface_create (ifp);
1082 assert (oi);
1083
1084 oi->hello_interval = strtol (argv[0], NULL, 10);
paul718e3742002-12-13 20:15:29 +00001085 return CMD_SUCCESS;
1086}
1087
1088/* interface variable set command */
1089DEFUN (ipv6_ospf6_deadinterval,
1090 ipv6_ospf6_deadinterval_cmd,
hasso508e53e2004-05-18 18:57:06 +00001091 "ipv6 ospf6 dead-interval <1-65535>",
paul718e3742002-12-13 20:15:29 +00001092 IP6_STR
1093 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001094 "Interval time after which a neighbor is declared down\n"
paul718e3742002-12-13 20:15:29 +00001095 SECONDS_STR
1096 )
1097{
hasso508e53e2004-05-18 18:57:06 +00001098 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001099 struct interface *ifp;
1100
1101 ifp = (struct interface *) vty->index;
1102 assert (ifp);
paul718e3742002-12-13 20:15:29 +00001103
hasso508e53e2004-05-18 18:57:06 +00001104 oi = (struct ospf6_interface *) ifp->info;
1105 if (oi == NULL)
1106 oi = ospf6_interface_create (ifp);
1107 assert (oi);
1108
1109 oi->dead_interval = strtol (argv[0], NULL, 10);
paul718e3742002-12-13 20:15:29 +00001110 return CMD_SUCCESS;
1111}
1112
1113/* interface variable set command */
1114DEFUN (ipv6_ospf6_transmitdelay,
1115 ipv6_ospf6_transmitdelay_cmd,
hasso508e53e2004-05-18 18:57:06 +00001116 "ipv6 ospf6 transmit-delay <1-3600>",
paul718e3742002-12-13 20:15:29 +00001117 IP6_STR
1118 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001119 "Transmit delay of this interface\n"
paul718e3742002-12-13 20:15:29 +00001120 SECONDS_STR
1121 )
1122{
hasso508e53e2004-05-18 18:57:06 +00001123 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001124 struct interface *ifp;
1125
1126 ifp = (struct interface *) vty->index;
1127 assert (ifp);
paul718e3742002-12-13 20:15:29 +00001128
hasso508e53e2004-05-18 18:57:06 +00001129 oi = (struct ospf6_interface *) ifp->info;
1130 if (oi == NULL)
1131 oi = ospf6_interface_create (ifp);
1132 assert (oi);
1133
1134 oi->transdelay = strtol (argv[0], NULL, 10);
paul718e3742002-12-13 20:15:29 +00001135 return CMD_SUCCESS;
1136}
1137
1138/* interface variable set command */
1139DEFUN (ipv6_ospf6_retransmitinterval,
1140 ipv6_ospf6_retransmitinterval_cmd,
hasso508e53e2004-05-18 18:57:06 +00001141 "ipv6 ospf6 retransmit-interval <1-65535>",
paul718e3742002-12-13 20:15:29 +00001142 IP6_STR
1143 OSPF6_STR
1144 "Time between retransmitting lost link state advertisements\n"
1145 SECONDS_STR
1146 )
1147{
hasso508e53e2004-05-18 18:57:06 +00001148 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001149 struct interface *ifp;
1150
1151 ifp = (struct interface *) vty->index;
1152 assert (ifp);
paul718e3742002-12-13 20:15:29 +00001153
hasso508e53e2004-05-18 18:57:06 +00001154 oi = (struct ospf6_interface *) ifp->info;
1155 if (oi == NULL)
1156 oi = ospf6_interface_create (ifp);
1157 assert (oi);
1158
1159 oi->rxmt_interval = strtol (argv[0], NULL, 10);
paul718e3742002-12-13 20:15:29 +00001160 return CMD_SUCCESS;
1161}
1162
1163/* interface variable set command */
1164DEFUN (ipv6_ospf6_priority,
1165 ipv6_ospf6_priority_cmd,
hasso508e53e2004-05-18 18:57:06 +00001166 "ipv6 ospf6 priority <0-255>",
paul718e3742002-12-13 20:15:29 +00001167 IP6_STR
1168 OSPF6_STR
1169 "Router priority\n"
hasso508e53e2004-05-18 18:57:06 +00001170 "Priority value\n"
paul718e3742002-12-13 20:15:29 +00001171 )
1172{
hasso508e53e2004-05-18 18:57:06 +00001173 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001174 struct interface *ifp;
1175
1176 ifp = (struct interface *) vty->index;
1177 assert (ifp);
paul718e3742002-12-13 20:15:29 +00001178
hasso508e53e2004-05-18 18:57:06 +00001179 oi = (struct ospf6_interface *) ifp->info;
1180 if (oi == NULL)
1181 oi = ospf6_interface_create (ifp);
1182 assert (oi);
paul718e3742002-12-13 20:15:29 +00001183
hasso508e53e2004-05-18 18:57:06 +00001184 oi->priority = strtol (argv[0], NULL, 10);
1185
1186 if (oi->area)
1187 ospf6_interface_state_change (dr_election (oi), oi);
paul718e3742002-12-13 20:15:29 +00001188
1189 return CMD_SUCCESS;
1190}
1191
1192DEFUN (ipv6_ospf6_instance,
1193 ipv6_ospf6_instance_cmd,
hasso508e53e2004-05-18 18:57:06 +00001194 "ipv6 ospf6 instance-id <0-255>",
paul718e3742002-12-13 20:15:29 +00001195 IP6_STR
1196 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001197 "Instance ID for this interface\n"
1198 "Instance ID value\n"
paul718e3742002-12-13 20:15:29 +00001199 )
1200{
hasso508e53e2004-05-18 18:57:06 +00001201 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001202 struct interface *ifp;
1203
1204 ifp = (struct interface *)vty->index;
1205 assert (ifp);
1206
hasso508e53e2004-05-18 18:57:06 +00001207 oi = (struct ospf6_interface *)ifp->info;
1208 if (oi == NULL)
1209 oi = ospf6_interface_create (ifp);
1210 assert (oi);
paul718e3742002-12-13 20:15:29 +00001211
hasso508e53e2004-05-18 18:57:06 +00001212 oi->instance_id = strtol (argv[0], NULL, 10);
paul718e3742002-12-13 20:15:29 +00001213 return CMD_SUCCESS;
1214}
1215
1216DEFUN (ipv6_ospf6_passive,
1217 ipv6_ospf6_passive_cmd,
1218 "ipv6 ospf6 passive",
1219 IP6_STR
1220 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001221 "passive interface, No adjacency will be formed on this interface\n"
paul718e3742002-12-13 20:15:29 +00001222 )
1223{
hasso508e53e2004-05-18 18:57:06 +00001224 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001225 struct interface *ifp;
1226 listnode node;
hasso508e53e2004-05-18 18:57:06 +00001227 struct ospf6_neighbor *on;
paul718e3742002-12-13 20:15:29 +00001228
1229 ifp = (struct interface *) vty->index;
1230 assert (ifp);
paul718e3742002-12-13 20:15:29 +00001231
hasso508e53e2004-05-18 18:57:06 +00001232 oi = (struct ospf6_interface *) ifp->info;
1233 if (oi == NULL)
1234 oi = ospf6_interface_create (ifp);
1235 assert (oi);
paul718e3742002-12-13 20:15:29 +00001236
hasso508e53e2004-05-18 18:57:06 +00001237 SET_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE);
1238 THREAD_OFF (oi->thread_send_hello);
1239
1240 for (node = listhead (oi->neighbor_list); node; nextnode (node))
paul718e3742002-12-13 20:15:29 +00001241 {
hasso508e53e2004-05-18 18:57:06 +00001242 on = (struct ospf6_neighbor *) getdata (node);
1243 THREAD_OFF (on->inactivity_timer);
1244 thread_execute (master, inactivity_timer, on, 0);
paul718e3742002-12-13 20:15:29 +00001245 }
1246
1247 return CMD_SUCCESS;
1248}
1249
1250DEFUN (no_ipv6_ospf6_passive,
1251 no_ipv6_ospf6_passive_cmd,
1252 "no ipv6 ospf6 passive",
1253 NO_STR
1254 IP6_STR
1255 OSPF6_STR
1256 "passive interface: No Adjacency will be formed on this I/F\n"
1257 )
1258{
hasso508e53e2004-05-18 18:57:06 +00001259 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001260 struct interface *ifp;
1261
1262 ifp = (struct interface *) vty->index;
1263 assert (ifp);
paul718e3742002-12-13 20:15:29 +00001264
hasso508e53e2004-05-18 18:57:06 +00001265 oi = (struct ospf6_interface *) ifp->info;
1266 if (oi == NULL)
1267 oi = ospf6_interface_create (ifp);
1268 assert (oi);
paul718e3742002-12-13 20:15:29 +00001269
hasso508e53e2004-05-18 18:57:06 +00001270 UNSET_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE);
1271 THREAD_OFF (oi->thread_send_hello);
1272 oi->thread_send_hello =
1273 thread_add_event (master, ospf6_hello_send, oi, 0);
paul718e3742002-12-13 20:15:29 +00001274
1275 return CMD_SUCCESS;
1276}
1277
1278DEFUN (ipv6_ospf6_advertise_prefix_list,
1279 ipv6_ospf6_advertise_prefix_list_cmd,
1280 "ipv6 ospf6 advertise prefix-list WORD",
1281 IP6_STR
1282 OSPF6_STR
1283 "Advertising options\n"
1284 "Filter prefix using prefix-list\n"
1285 "Prefix list name\n"
1286 )
1287{
hasso508e53e2004-05-18 18:57:06 +00001288 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001289 struct interface *ifp;
1290
1291 ifp = (struct interface *) vty->index;
1292 assert (ifp);
paul718e3742002-12-13 20:15:29 +00001293
hasso508e53e2004-05-18 18:57:06 +00001294 oi = (struct ospf6_interface *) ifp->info;
1295 if (oi == NULL)
1296 oi = ospf6_interface_create (ifp);
1297 assert (oi);
paul718e3742002-12-13 20:15:29 +00001298
hasso508e53e2004-05-18 18:57:06 +00001299 if (oi->plist_name)
1300 XFREE (MTYPE_PREFIX_LIST_STR, oi->plist_name);
1301 oi->plist_name = XSTRDUP (MTYPE_PREFIX_LIST_STR, argv[0]);
paul718e3742002-12-13 20:15:29 +00001302
hasso508e53e2004-05-18 18:57:06 +00001303 ospf6_interface_connected_route_update (oi->interface);
1304 OSPF6_LINK_LSA_SCHEDULE (oi);
1305 if (oi->state == OSPF6_INTERFACE_DR)
1306 {
1307 OSPF6_NETWORK_LSA_SCHEDULE (oi);
1308 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi);
1309 }
1310 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area);
paul718e3742002-12-13 20:15:29 +00001311
1312 return CMD_SUCCESS;
1313}
1314
1315DEFUN (no_ipv6_ospf6_advertise_prefix_list,
1316 no_ipv6_ospf6_advertise_prefix_list_cmd,
1317 "no ipv6 ospf6 advertise prefix-list",
1318 NO_STR
1319 IP6_STR
1320 OSPF6_STR
1321 "Advertising options\n"
1322 "Filter prefix using prefix-list\n"
1323 )
1324{
hasso508e53e2004-05-18 18:57:06 +00001325 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001326 struct interface *ifp;
1327
1328 ifp = (struct interface *) vty->index;
1329 assert (ifp);
paul718e3742002-12-13 20:15:29 +00001330
hasso508e53e2004-05-18 18:57:06 +00001331 oi = (struct ospf6_interface *) ifp->info;
1332 if (oi == NULL)
1333 oi = ospf6_interface_create (ifp);
1334 assert (oi);
1335
1336 if (oi->plist_name)
paul718e3742002-12-13 20:15:29 +00001337 {
hasso508e53e2004-05-18 18:57:06 +00001338 XFREE (MTYPE_PREFIX_LIST_STR, oi->plist_name);
1339 oi->plist_name = NULL;
paul718e3742002-12-13 20:15:29 +00001340 }
1341
hasso508e53e2004-05-18 18:57:06 +00001342 ospf6_interface_connected_route_update (oi->interface);
1343 OSPF6_LINK_LSA_SCHEDULE (oi);
1344 if (oi->state == OSPF6_INTERFACE_DR)
1345 {
1346 OSPF6_NETWORK_LSA_SCHEDULE (oi);
1347 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi);
1348 }
1349 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi->area);
paul718e3742002-12-13 20:15:29 +00001350
1351 return CMD_SUCCESS;
1352}
1353
1354int
hasso508e53e2004-05-18 18:57:06 +00001355config_write_ospf6_interface (struct vty *vty)
paul718e3742002-12-13 20:15:29 +00001356{
1357 listnode i;
hasso508e53e2004-05-18 18:57:06 +00001358 struct ospf6_interface *oi;
paul718e3742002-12-13 20:15:29 +00001359 struct interface *ifp;
1360
1361 for (i = listhead (iflist); i; nextnode (i))
1362 {
1363 ifp = (struct interface *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +00001364 oi = (struct ospf6_interface *) ifp->info;
1365 if (oi == NULL)
paul718e3742002-12-13 20:15:29 +00001366 continue;
1367
1368 vty_out (vty, "interface %s%s",
hasso508e53e2004-05-18 18:57:06 +00001369 oi->interface->name, VTY_NEWLINE);
1370
1371 if (ifp->desc)
1372 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
1373
paul718e3742002-12-13 20:15:29 +00001374 vty_out (vty, " ipv6 ospf6 cost %d%s",
hasso508e53e2004-05-18 18:57:06 +00001375 oi->cost, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001376 vty_out (vty, " ipv6 ospf6 hello-interval %d%s",
hasso508e53e2004-05-18 18:57:06 +00001377 oi->hello_interval, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001378 vty_out (vty, " ipv6 ospf6 dead-interval %d%s",
hasso508e53e2004-05-18 18:57:06 +00001379 oi->dead_interval, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001380 vty_out (vty, " ipv6 ospf6 retransmit-interval %d%s",
hasso508e53e2004-05-18 18:57:06 +00001381 oi->rxmt_interval, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001382 vty_out (vty, " ipv6 ospf6 priority %d%s",
hasso508e53e2004-05-18 18:57:06 +00001383 oi->priority, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001384 vty_out (vty, " ipv6 ospf6 transmit-delay %d%s",
hasso508e53e2004-05-18 18:57:06 +00001385 oi->transdelay, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001386 vty_out (vty, " ipv6 ospf6 instance-id %d%s",
hasso508e53e2004-05-18 18:57:06 +00001387 oi->instance_id, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001388
hasso508e53e2004-05-18 18:57:06 +00001389 if (oi->plist_name)
paul718e3742002-12-13 20:15:29 +00001390 vty_out (vty, " ipv6 ospf6 advertise prefix-list %s%s",
hasso508e53e2004-05-18 18:57:06 +00001391 oi->plist_name, VTY_NEWLINE);
paul718e3742002-12-13 20:15:29 +00001392
hasso508e53e2004-05-18 18:57:06 +00001393 if (CHECK_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE))
paul718e3742002-12-13 20:15:29 +00001394 vty_out (vty, " ipv6 ospf6 passive%s", VTY_NEWLINE);
1395
1396 vty_out (vty, "!%s", VTY_NEWLINE);
1397 }
1398 return 0;
1399}
1400
1401struct cmd_node interface_node =
1402{
1403 INTERFACE_NODE,
1404 "%s(config-if)# ",
paul718e3742002-12-13 20:15:29 +00001405};
1406
1407void
1408ospf6_interface_init ()
1409{
1410 /* Install interface node. */
hasso508e53e2004-05-18 18:57:06 +00001411 install_node (&interface_node, config_write_ospf6_interface);
paul718e3742002-12-13 20:15:29 +00001412
1413 install_element (VIEW_NODE, &show_ipv6_ospf6_interface_cmd);
hasso508e53e2004-05-18 18:57:06 +00001414 install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_cmd);
1415 install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_detail_cmd);
1416 install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_match_cmd);
paul718e3742002-12-13 20:15:29 +00001417 install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_cmd);
hasso508e53e2004-05-18 18:57:06 +00001418 install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_cmd);
1419 install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd);
1420 install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd);
paul718e3742002-12-13 20:15:29 +00001421 install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_cmd);
hasso508e53e2004-05-18 18:57:06 +00001422 install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_cmd);
1423 install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_detail_cmd);
1424 install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_match_cmd);
paul718e3742002-12-13 20:15:29 +00001425 install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_cmd);
hasso508e53e2004-05-18 18:57:06 +00001426 install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_cmd);
1427 install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd);
1428 install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd);
paul718e3742002-12-13 20:15:29 +00001429
hasso508e53e2004-05-18 18:57:06 +00001430 install_element (CONFIG_NODE, &interface_cmd);
paul718e3742002-12-13 20:15:29 +00001431 install_default (INTERFACE_NODE);
1432 install_element (INTERFACE_NODE, &interface_desc_cmd);
1433 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
1434 install_element (INTERFACE_NODE, &ipv6_ospf6_cost_cmd);
1435 install_element (INTERFACE_NODE, &ipv6_ospf6_deadinterval_cmd);
1436 install_element (INTERFACE_NODE, &ipv6_ospf6_hellointerval_cmd);
1437 install_element (INTERFACE_NODE, &ipv6_ospf6_priority_cmd);
1438 install_element (INTERFACE_NODE, &ipv6_ospf6_retransmitinterval_cmd);
1439 install_element (INTERFACE_NODE, &ipv6_ospf6_transmitdelay_cmd);
1440 install_element (INTERFACE_NODE, &ipv6_ospf6_instance_cmd);
hasso508e53e2004-05-18 18:57:06 +00001441
paul718e3742002-12-13 20:15:29 +00001442 install_element (INTERFACE_NODE, &ipv6_ospf6_passive_cmd);
1443 install_element (INTERFACE_NODE, &no_ipv6_ospf6_passive_cmd);
hasso508e53e2004-05-18 18:57:06 +00001444
1445 install_element (INTERFACE_NODE, &ipv6_ospf6_advertise_prefix_list_cmd);
1446 install_element (INTERFACE_NODE, &no_ipv6_ospf6_advertise_prefix_list_cmd);
1447}
1448
1449DEFUN (debug_ospf6_interface,
1450 debug_ospf6_interface_cmd,
1451 "debug ospf6 interface",
1452 DEBUG_STR
1453 OSPF6_STR
1454 "Debug OSPFv3 Interface\n"
1455 )
1456{
1457 OSPF6_DEBUG_INTERFACE_ON ();
1458 return CMD_SUCCESS;
1459}
1460
1461DEFUN (no_debug_ospf6_interface,
1462 no_debug_ospf6_interface_cmd,
1463 "no debug ospf6 interface",
1464 NO_STR
1465 DEBUG_STR
1466 OSPF6_STR
1467 "Debug OSPFv3 Interface\n"
1468 )
1469{
1470 OSPF6_DEBUG_INTERFACE_ON ();
1471 return CMD_SUCCESS;
1472}
1473
1474int
1475config_write_ospf6_debug_interface (struct vty *vty)
1476{
1477 if (IS_OSPF6_DEBUG_INTERFACE)
1478 vty_out (vty, "debug ospf6 interface%s", VTY_NEWLINE);
1479 return 0;
1480}
1481
1482void
1483install_element_ospf6_debug_interface ()
1484{
1485 install_element (ENABLE_NODE, &debug_ospf6_interface_cmd);
1486 install_element (ENABLE_NODE, &no_debug_ospf6_interface_cmd);
1487 install_element (CONFIG_NODE, &debug_ospf6_interface_cmd);
1488 install_element (CONFIG_NODE, &no_debug_ospf6_interface_cmd);
paul718e3742002-12-13 20:15:29 +00001489}
1490
1491