2 * Copyright (C) 2003 Yasuhiro Ohara
4 * This file is part of GNU Zebra.
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
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.
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.
32 #include "ospf6_lsa.h"
33 #include "ospf6_lsdb.h"
34 #include "ospf6_network.h"
35 #include "ospf6_message.h"
36 #include "ospf6_route.h"
37 #include "ospf6_top.h"
38 #include "ospf6_area.h"
39 #include "ospf6_interface.h"
40 #include "ospf6_neighbor.h"
41 #include "ospf6_intra.h"
42 #include "ospf6_spf.h"
45 unsigned char conf_debug_ospf6_interface
= 0;
47 const char *ospf6_interface_state_str
[] =
60 struct ospf6_interface
*
61 ospf6_interface_lookup_by_ifindex (int ifindex
)
63 struct ospf6_interface
*oi
;
64 struct interface
*ifp
;
66 ifp
= if_lookup_by_index (ifindex
);
68 return (struct ospf6_interface
*) NULL
;
70 oi
= (struct ospf6_interface
*) ifp
->info
;
74 /* schedule routing table recalculation */
76 ospf6_interface_lsdb_hook (struct ospf6_lsa
*lsa
)
78 switch (ntohs (lsa
->header
->type
))
80 case OSPF6_LSTYPE_LINK
:
81 if (OSPF6_INTERFACE (lsa
->lsdb
->data
)->state
== OSPF6_INTERFACE_DR
)
82 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (OSPF6_INTERFACE (lsa
->lsdb
->data
));
83 ospf6_spf_schedule (OSPF6_INTERFACE (lsa
->lsdb
->data
)->area
);
91 /* Create new ospf6 interface structure */
92 struct ospf6_interface
*
93 ospf6_interface_create (struct interface
*ifp
)
95 struct ospf6_interface
*oi
;
96 unsigned int iobuflen
;
98 oi
= (struct ospf6_interface
*)
99 XCALLOC (MTYPE_OSPF6_IF
, sizeof (struct ospf6_interface
));
103 zlog_err ("Can't malloc ospf6_interface for ifindex %d", ifp
->ifindex
);
104 return (struct ospf6_interface
*) NULL
;
107 oi
->area
= (struct ospf6_area
*) NULL
;
108 oi
->neighbor_list
= list_new ();
109 oi
->neighbor_list
->cmp
= ospf6_neighbor_cmp
;
110 oi
->linklocal_addr
= (struct in6_addr
*) NULL
;
115 oi
->hello_interval
= 10;
116 oi
->dead_interval
= 40;
117 oi
->rxmt_interval
= 5;
119 oi
->state
= OSPF6_INTERFACE_DOWN
;
122 /* Try to adjust I/O buffer size with IfMtu */
123 oi
->ifmtu
= ifp
->mtu6
;
124 iobuflen
= ospf6_iobuf_size (ifp
->mtu6
);
125 if (oi
->ifmtu
> iobuflen
)
127 if (IS_OSPF6_DEBUG_INTERFACE
)
128 zlog_debug ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
129 ifp
->name
, iobuflen
);
130 oi
->ifmtu
= iobuflen
;
133 oi
->lsupdate_list
= ospf6_lsdb_create (oi
);
134 oi
->lsack_list
= ospf6_lsdb_create (oi
);
135 oi
->lsdb
= ospf6_lsdb_create (oi
);
136 oi
->lsdb
->hook_add
= ospf6_interface_lsdb_hook
;
137 oi
->lsdb
->hook_remove
= ospf6_interface_lsdb_hook
;
138 oi
->lsdb_self
= ospf6_lsdb_create (oi
);
140 oi
->route_connected
= OSPF6_ROUTE_TABLE_CREATE (INTERFACE
, CONNECTED_ROUTES
);
141 oi
->route_connected
->scope
= oi
;
151 ospf6_interface_delete (struct ospf6_interface
*oi
)
153 struct listnode
*node
, *nnode
;
154 struct ospf6_neighbor
*on
;
156 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
157 ospf6_neighbor_delete (on
);
159 list_delete (oi
->neighbor_list
);
161 THREAD_OFF (oi
->thread_send_hello
);
162 THREAD_OFF (oi
->thread_send_lsupdate
);
163 THREAD_OFF (oi
->thread_send_lsack
);
165 ospf6_lsdb_remove_all (oi
->lsdb
);
166 ospf6_lsdb_remove_all (oi
->lsupdate_list
);
167 ospf6_lsdb_remove_all (oi
->lsack_list
);
169 ospf6_lsdb_delete (oi
->lsdb
);
170 ospf6_lsdb_delete (oi
->lsdb_self
);
172 ospf6_lsdb_delete (oi
->lsupdate_list
);
173 ospf6_lsdb_delete (oi
->lsack_list
);
175 ospf6_route_table_delete (oi
->route_connected
);
178 oi
->interface
->info
= NULL
;
182 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
184 XFREE (MTYPE_OSPF6_IF
, oi
);
188 ospf6_interface_enable (struct ospf6_interface
*oi
)
190 UNSET_FLAG (oi
->flag
, OSPF6_INTERFACE_DISABLE
);
192 oi
->thread_send_hello
=
193 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
197 ospf6_interface_disable (struct ospf6_interface
*oi
)
199 struct listnode
*node
, *nnode
;
200 struct ospf6_neighbor
*on
;
202 SET_FLAG (oi
->flag
, OSPF6_INTERFACE_DISABLE
);
204 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
205 ospf6_neighbor_delete (on
);
207 list_delete_all_node (oi
->neighbor_list
);
209 ospf6_lsdb_remove_all (oi
->lsdb
);
210 ospf6_lsdb_remove_all (oi
->lsupdate_list
);
211 ospf6_lsdb_remove_all (oi
->lsack_list
);
213 THREAD_OFF (oi
->thread_send_hello
);
214 THREAD_OFF (oi
->thread_send_lsupdate
);
215 THREAD_OFF (oi
->thread_send_lsack
);
218 static struct in6_addr
*
219 ospf6_interface_get_linklocal_address (struct interface
*ifp
)
223 struct in6_addr
*l
= (struct in6_addr
*) NULL
;
225 /* for each connected address */
226 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, n
, c
))
228 /* if family not AF_INET6, ignore */
229 if (c
->address
->family
!= AF_INET6
)
232 /* linklocal scope check */
233 if (IN6_IS_ADDR_LINKLOCAL (&c
->address
->u
.prefix6
))
234 l
= &c
->address
->u
.prefix6
;
240 ospf6_interface_if_add (struct interface
*ifp
)
242 struct ospf6_interface
*oi
;
243 unsigned int iobuflen
;
245 oi
= (struct ospf6_interface
*) ifp
->info
;
249 /* Try to adjust I/O buffer size with IfMtu */
251 oi
->ifmtu
= ifp
->mtu6
;
252 iobuflen
= ospf6_iobuf_size (ifp
->mtu6
);
253 if (oi
->ifmtu
> iobuflen
)
255 if (IS_OSPF6_DEBUG_INTERFACE
)
256 zlog_debug ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
257 ifp
->name
, iobuflen
);
258 oi
->ifmtu
= iobuflen
;
261 /* interface start */
263 thread_add_event (master
, interface_up
, oi
, 0);
267 ospf6_interface_if_del (struct interface
*ifp
)
269 struct ospf6_interface
*oi
;
271 oi
= (struct ospf6_interface
*) ifp
->info
;
277 thread_execute (master
, interface_down
, oi
, 0);
279 listnode_delete (oi
->area
->if_list
, oi
);
280 oi
->area
= (struct ospf6_area
*) NULL
;
283 oi
->interface
= NULL
;
286 ospf6_interface_delete (oi
);
290 ospf6_interface_state_update (struct interface
*ifp
)
292 struct ospf6_interface
*oi
;
294 oi
= (struct ospf6_interface
*) ifp
->info
;
297 if (oi
->area
== NULL
)
301 thread_add_event (master
, interface_up
, oi
, 0);
303 thread_add_event (master
, interface_down
, oi
, 0);
309 ospf6_interface_connected_route_update (struct interface
*ifp
)
311 struct ospf6_interface
*oi
;
312 struct ospf6_route
*route
;
314 struct listnode
*node
, *nnode
;
316 oi
= (struct ospf6_interface
*) ifp
->info
;
320 /* reset linklocal pointer */
321 oi
->linklocal_addr
= ospf6_interface_get_linklocal_address (ifp
);
323 /* if area is null, do not make connected-route list */
324 if (oi
->area
== NULL
)
327 /* update "route to advertise" interface route table */
328 ospf6_route_remove_all (oi
->route_connected
);
330 for (ALL_LIST_ELEMENTS (oi
->interface
->connected
, node
, nnode
, c
))
332 if (c
->address
->family
!= AF_INET6
)
335 CONTINUE_IF_ADDRESS_LINKLOCAL (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
336 CONTINUE_IF_ADDRESS_UNSPECIFIED (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
337 CONTINUE_IF_ADDRESS_LOOPBACK (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
338 CONTINUE_IF_ADDRESS_V4COMPAT (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
339 CONTINUE_IF_ADDRESS_V4MAPPED (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
344 struct prefix_list
*plist
;
345 enum prefix_list_type ret
;
348 prefix2str (c
->address
, buf
, sizeof (buf
));
349 plist
= prefix_list_lookup (AFI_IP6
, oi
->plist_name
);
350 ret
= prefix_list_apply (plist
, (void *) c
->address
);
351 if (ret
== PREFIX_DENY
)
353 if (IS_OSPF6_DEBUG_INTERFACE
)
354 zlog_debug ("%s on %s filtered by prefix-list %s ",
355 buf
, oi
->interface
->name
, oi
->plist_name
);
360 route
= ospf6_route_create ();
361 memcpy (&route
->prefix
, c
->address
, sizeof (struct prefix
));
362 apply_mask (&route
->prefix
);
363 route
->type
= OSPF6_DEST_TYPE_NETWORK
;
364 route
->path
.area_id
= oi
->area
->area_id
;
365 route
->path
.type
= OSPF6_PATH_TYPE_INTRA
;
366 route
->path
.cost
= oi
->cost
;
367 route
->nexthop
[0].ifindex
= oi
->interface
->ifindex
;
368 inet_pton (AF_INET6
, "::1", &route
->nexthop
[0].address
);
369 ospf6_route_add (route
, oi
->route_connected
);
372 /* create new Link-LSA */
373 OSPF6_LINK_LSA_SCHEDULE (oi
);
374 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
375 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
379 ospf6_interface_state_change (u_char next_state
, struct ospf6_interface
*oi
)
383 prev_state
= oi
->state
;
384 oi
->state
= next_state
;
386 if (prev_state
== next_state
)
390 if (IS_OSPF6_DEBUG_INTERFACE
)
392 zlog_debug ("Interface state change %s: %s -> %s", oi
->interface
->name
,
393 ospf6_interface_state_str
[prev_state
],
394 ospf6_interface_state_str
[next_state
]);
397 if ((prev_state
== OSPF6_INTERFACE_DR
||
398 prev_state
== OSPF6_INTERFACE_BDR
) &&
399 (next_state
!= OSPF6_INTERFACE_DR
&&
400 next_state
!= OSPF6_INTERFACE_BDR
))
401 ospf6_leave_alldrouters (oi
->interface
->ifindex
);
402 if ((prev_state
!= OSPF6_INTERFACE_DR
&&
403 prev_state
!= OSPF6_INTERFACE_BDR
) &&
404 (next_state
== OSPF6_INTERFACE_DR
||
405 next_state
== OSPF6_INTERFACE_BDR
))
406 ospf6_join_alldrouters (oi
->interface
->ifindex
);
408 OSPF6_ROUTER_LSA_SCHEDULE (oi
->area
);
409 if (next_state
== OSPF6_INTERFACE_DOWN
)
411 OSPF6_NETWORK_LSA_EXECUTE (oi
);
412 OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT (oi
);
413 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
415 else if (prev_state
== OSPF6_INTERFACE_DR
||
416 next_state
== OSPF6_INTERFACE_DR
)
418 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
419 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
420 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
425 /* DR Election, RFC2328 section 9.4 */
427 #define IS_ELIGIBLE(n) \
428 ((n)->state >= OSPF6_NEIGHBOR_TWOWAY && (n)->priority != 0)
430 static struct ospf6_neighbor
*
431 better_bdrouter (struct ospf6_neighbor
*a
, struct ospf6_neighbor
*b
)
433 if ((a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
== a
->router_id
) &&
434 (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
== b
->router_id
))
436 else if (a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
== a
->router_id
)
438 else if (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
== b
->router_id
)
441 if (a
->bdrouter
== a
->router_id
&& b
->bdrouter
!= b
->router_id
)
443 if (a
->bdrouter
!= a
->router_id
&& b
->bdrouter
== b
->router_id
)
446 if (a
->priority
> b
->priority
)
448 if (a
->priority
< b
->priority
)
451 if (ntohl (a
->router_id
) > ntohl (b
->router_id
))
453 if (ntohl (a
->router_id
) < ntohl (b
->router_id
))
456 zlog_warn ("Router-ID duplicate ?");
460 static struct ospf6_neighbor
*
461 better_drouter (struct ospf6_neighbor
*a
, struct ospf6_neighbor
*b
)
463 if ((a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
!= a
->router_id
) &&
464 (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
!= b
->router_id
))
466 else if (a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
!= a
->router_id
)
468 else if (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
!= b
->router_id
)
471 if (a
->drouter
== a
->router_id
&& b
->drouter
!= b
->router_id
)
473 if (a
->drouter
!= a
->router_id
&& b
->drouter
== b
->router_id
)
476 if (a
->priority
> b
->priority
)
478 if (a
->priority
< b
->priority
)
481 if (ntohl (a
->router_id
) > ntohl (b
->router_id
))
483 if (ntohl (a
->router_id
) < ntohl (b
->router_id
))
486 zlog_warn ("Router-ID duplicate ?");
491 dr_election (struct ospf6_interface
*oi
)
493 struct listnode
*node
, *nnode
;
494 struct ospf6_neighbor
*on
, *drouter
, *bdrouter
, myself
;
495 struct ospf6_neighbor
*best_drouter
, *best_bdrouter
;
496 u_char next_state
= 0;
498 drouter
= bdrouter
= NULL
;
499 best_drouter
= best_bdrouter
= NULL
;
501 /* pseudo neighbor myself, including noting current DR/BDR (1) */
502 memset (&myself
, 0, sizeof (myself
));
503 inet_ntop (AF_INET
, &oi
->area
->ospf6
->router_id
, myself
.name
,
504 sizeof (myself
.name
));
505 myself
.state
= OSPF6_NEIGHBOR_TWOWAY
;
506 myself
.drouter
= oi
->drouter
;
507 myself
.bdrouter
= oi
->bdrouter
;
508 myself
.priority
= oi
->priority
;
509 myself
.router_id
= oi
->area
->ospf6
->router_id
;
511 /* Electing BDR (2) */
512 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
513 bdrouter
= better_bdrouter (bdrouter
, on
);
515 best_bdrouter
= bdrouter
;
516 bdrouter
= better_bdrouter (best_bdrouter
, &myself
);
518 /* Electing DR (3) */
519 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
520 drouter
= better_drouter (drouter
, on
);
522 best_drouter
= drouter
;
523 drouter
= better_drouter (best_drouter
, &myself
);
527 /* the router itself is newly/no longer DR/BDR (4) */
528 if ((drouter
== &myself
&& myself
.drouter
!= myself
.router_id
) ||
529 (drouter
!= &myself
&& myself
.drouter
== myself
.router_id
) ||
530 (bdrouter
== &myself
&& myself
.bdrouter
!= myself
.router_id
) ||
531 (bdrouter
!= &myself
&& myself
.bdrouter
== myself
.router_id
))
533 myself
.drouter
= (drouter
? drouter
->router_id
: htonl (0));
534 myself
.bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl (0));
536 /* compatible to Electing BDR (2) */
537 bdrouter
= better_bdrouter (best_bdrouter
, &myself
);
539 /* compatible to Electing DR (3) */
540 drouter
= better_drouter (best_drouter
, &myself
);
545 /* Set interface state accordingly (5) */
546 if (drouter
&& drouter
== &myself
)
547 next_state
= OSPF6_INTERFACE_DR
;
548 else if (bdrouter
&& bdrouter
== &myself
)
549 next_state
= OSPF6_INTERFACE_BDR
;
551 next_state
= OSPF6_INTERFACE_DROTHER
;
553 /* If NBMA, schedule Start for each neighbor having priority of 0 (6) */
556 /* If DR or BDR change, invoke AdjOK? for each neighbor (7) */
557 /* RFC 2328 section 12.4. Originating LSAs (3) will be handled
558 accordingly after AdjOK */
559 if (oi
->drouter
!= (drouter
? drouter
->router_id
: htonl (0)) ||
560 oi
->bdrouter
!= (bdrouter
? bdrouter
->router_id
: htonl (0)))
562 if (IS_OSPF6_DEBUG_INTERFACE
)
563 zlog_debug ("DR Election on %s: DR: %s BDR: %s", oi
->interface
->name
,
564 (drouter
? drouter
->name
: "0.0.0.0"),
565 (bdrouter
? bdrouter
->name
: "0.0.0.0"));
567 for (ALL_LIST_ELEMENTS_RO (oi
->neighbor_list
, node
, on
))
569 if (on
->state
< OSPF6_NEIGHBOR_TWOWAY
)
571 /* Schedule AdjOK. */
572 thread_add_event (master
, adj_ok
, on
, 0);
576 oi
->drouter
= (drouter
? drouter
->router_id
: htonl (0));
577 oi
->bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl (0));
582 /* Interface State Machine */
584 interface_up (struct thread
*thread
)
586 struct ospf6_interface
*oi
;
588 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
589 assert (oi
&& oi
->interface
);
591 if (IS_OSPF6_DEBUG_INTERFACE
)
592 zlog_debug ("Interface Event %s: [InterfaceUp]",
593 oi
->interface
->name
);
595 /* check physical interface is up */
596 if (! if_is_up (oi
->interface
))
598 if (IS_OSPF6_DEBUG_INTERFACE
)
599 zlog_debug ("Interface %s is down, can't execute [InterfaceUp]",
600 oi
->interface
->name
);
604 /* if already enabled, do nothing */
605 if (oi
->state
> OSPF6_INTERFACE_DOWN
)
607 if (IS_OSPF6_DEBUG_INTERFACE
)
608 zlog_debug ("Interface %s already enabled",
609 oi
->interface
->name
);
613 /* Join AllSPFRouters */
614 ospf6_join_allspfrouters (oi
->interface
->ifindex
);
616 /* Update interface route */
617 ospf6_interface_connected_route_update (oi
->interface
);
620 if (! CHECK_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
))
621 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
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
);
630 ospf6_interface_state_change (OSPF6_INTERFACE_WAITING
, oi
);
631 thread_add_timer (master
, wait_timer
, oi
, oi
->dead_interval
);
638 wait_timer (struct thread
*thread
)
640 struct ospf6_interface
*oi
;
642 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
643 assert (oi
&& oi
->interface
);
645 if (IS_OSPF6_DEBUG_INTERFACE
)
646 zlog_debug ("Interface Event %s: [WaitTimer]",
647 oi
->interface
->name
);
649 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
650 ospf6_interface_state_change (dr_election (oi
), oi
);
656 backup_seen (struct thread
*thread
)
658 struct ospf6_interface
*oi
;
660 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
661 assert (oi
&& oi
->interface
);
663 if (IS_OSPF6_DEBUG_INTERFACE
)
664 zlog_debug ("Interface Event %s: [BackupSeen]",
665 oi
->interface
->name
);
667 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
668 ospf6_interface_state_change (dr_election (oi
), oi
);
674 neighbor_change (struct thread
*thread
)
676 struct ospf6_interface
*oi
;
678 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
679 assert (oi
&& oi
->interface
);
681 if (IS_OSPF6_DEBUG_INTERFACE
)
682 zlog_debug ("Interface Event %s: [NeighborChange]",
683 oi
->interface
->name
);
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
);
694 loopind (struct thread
*thread
)
696 struct ospf6_interface
*oi
;
698 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
699 assert (oi
&& oi
->interface
);
701 if (IS_OSPF6_DEBUG_INTERFACE
)
702 zlog_debug ("Interface Event %s: [LoopInd]",
703 oi
->interface
->name
);
711 interface_down (struct thread
*thread
)
713 struct ospf6_interface
*oi
;
714 struct listnode
*node
, *nnode
;
715 struct ospf6_neighbor
*on
;
717 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
718 assert (oi
&& oi
->interface
);
720 if (IS_OSPF6_DEBUG_INTERFACE
)
721 zlog_debug ("Interface Event %s: [InterfaceDown]",
722 oi
->interface
->name
);
724 /* Leave AllSPFRouters */
725 if (oi
->state
> OSPF6_INTERFACE_DOWN
)
726 ospf6_leave_allspfrouters (oi
->interface
->ifindex
);
728 ospf6_interface_state_change (OSPF6_INTERFACE_DOWN
, oi
);
730 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
731 ospf6_neighbor_delete (on
);
733 list_delete_all_node (oi
->neighbor_list
);
739 /* show specified interface structure */
741 ospf6_interface_show (struct vty
*vty
, struct interface
*ifp
)
743 struct ospf6_interface
*oi
;
747 char strbuf
[64], drouter
[32], bdrouter
[32];
748 const char *updown
[3] = {"down", "up", NULL
};
750 struct timeval res
, now
;
752 struct ospf6_lsa
*lsa
;
754 /* check physical interface type */
755 if (if_is_loopback (ifp
))
757 else if (if_is_broadcast (ifp
))
759 else if (if_is_pointopoint (ifp
))
760 type
= "POINTOPOINT";
764 vty_out (vty
, "%s is %s, type %s%s",
765 ifp
->name
, updown
[if_is_up (ifp
)], type
,
767 vty_out (vty
, " Interface ID: %d%s", ifp
->ifindex
, VNL
);
769 if (ifp
->info
== NULL
)
771 vty_out (vty
, " OSPF not enabled on this interface%s", VNL
);
775 oi
= (struct ospf6_interface
*) ifp
->info
;
777 vty_out (vty
, " Internet Address:%s", VNL
);
779 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, i
, c
))
782 prefix2str (p
, strbuf
, sizeof (strbuf
));
786 vty_out (vty
, " inet : %s%s", strbuf
,
790 vty_out (vty
, " inet6: %s%s", strbuf
,
794 vty_out (vty
, " ??? : %s%s", strbuf
,
802 vty_out (vty
, " Instance ID %d, Interface MTU %d (autodetect: %d)%s",
803 oi
->instance_id
, oi
->ifmtu
, ifp
->mtu6
, VNL
);
804 inet_ntop (AF_INET
, &oi
->area
->area_id
,
805 strbuf
, sizeof (strbuf
));
806 vty_out (vty
, " Area ID %s, Cost %hu%s", strbuf
, oi
->cost
,
810 vty_out (vty
, " Not Attached to Area%s", VNL
);
812 vty_out (vty
, " State %s, Transmit Delay %d sec, Priority %d%s",
813 ospf6_interface_state_str
[oi
->state
],
814 oi
->transdelay
, oi
->priority
,
816 vty_out (vty
, " Timer intervals configured:%s", VNL
);
817 vty_out (vty
, " Hello %d, Dead %d, Retransmit %d%s",
818 oi
->hello_interval
, oi
->dead_interval
, oi
->rxmt_interval
,
821 inet_ntop (AF_INET
, &oi
->drouter
, drouter
, sizeof (drouter
));
822 inet_ntop (AF_INET
, &oi
->bdrouter
, bdrouter
, sizeof (bdrouter
));
823 vty_out (vty
, " DR: %s BDR: %s%s", drouter
, bdrouter
, VNL
);
825 vty_out (vty
, " Number of I/F scoped LSAs is %u%s",
826 oi
->lsdb
->count
, VNL
);
828 quagga_gettime (QUAGGA_CLK_MONOTONIC
, &now
);
831 if (oi
->thread_send_lsupdate
)
832 timersub (&oi
->thread_send_lsupdate
->u
.sands
, &now
, &res
);
833 timerstring (&res
, duration
, sizeof (duration
));
834 vty_out (vty
, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s",
835 oi
->lsupdate_list
->count
, duration
,
836 (oi
->thread_send_lsupdate
? "on" : "off"),
838 for (lsa
= ospf6_lsdb_head (oi
->lsupdate_list
); lsa
;
839 lsa
= ospf6_lsdb_next (lsa
))
840 vty_out (vty
, " %s%s", lsa
->name
, VNL
);
843 if (oi
->thread_send_lsack
)
844 timersub (&oi
->thread_send_lsack
->u
.sands
, &now
, &res
);
845 timerstring (&res
, duration
, sizeof (duration
));
846 vty_out (vty
, " %d Pending LSAs for LSAck in Time %s [thread %s]%s",
847 oi
->lsack_list
->count
, duration
,
848 (oi
->thread_send_lsack
? "on" : "off"),
850 for (lsa
= ospf6_lsdb_head (oi
->lsack_list
); lsa
;
851 lsa
= ospf6_lsdb_next (lsa
))
852 vty_out (vty
, " %s%s", lsa
->name
, VNL
);
858 DEFUN (show_ipv6_ospf6_interface
,
859 show_ipv6_ospf6_interface_ifname_cmd
,
860 "show ipv6 ospf6 interface IFNAME",
868 struct interface
*ifp
;
873 ifp
= if_lookup_by_name (argv
[0]);
876 vty_out (vty
, "No such Interface: %s%s", argv
[0],
880 ospf6_interface_show (vty
, ifp
);
884 for (ALL_LIST_ELEMENTS_RO (iflist
, i
, ifp
))
885 ospf6_interface_show (vty
, ifp
);
891 ALIAS (show_ipv6_ospf6_interface
,
892 show_ipv6_ospf6_interface_cmd
,
893 "show ipv6 ospf6 interface",
900 DEFUN (show_ipv6_ospf6_interface_ifname_prefix
,
901 show_ipv6_ospf6_interface_ifname_prefix_cmd
,
902 "show ipv6 ospf6 interface IFNAME prefix",
908 "Display connected prefixes to advertise\n"
911 struct interface
*ifp
;
912 struct ospf6_interface
*oi
;
914 ifp
= if_lookup_by_name (argv
[0]);
917 vty_out (vty
, "No such Interface: %s%s", argv
[0], VNL
);
924 vty_out (vty
, "OSPFv3 is not enabled on %s%s", argv
[0], VNL
);
930 ospf6_route_table_show (vty
, argc
, argv
, oi
->route_connected
);
935 ALIAS (show_ipv6_ospf6_interface_ifname_prefix
,
936 show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
,
937 "show ipv6 ospf6 interface IFNAME prefix (X:X::X:X|X:X::X:X/M|detail)",
943 "Display connected prefixes to advertise\n"
944 OSPF6_ROUTE_ADDRESS_STR
945 OSPF6_ROUTE_PREFIX_STR
946 "Dispaly details of the prefixes\n"
949 ALIAS (show_ipv6_ospf6_interface_ifname_prefix
,
950 show_ipv6_ospf6_interface_ifname_prefix_match_cmd
,
951 "show ipv6 ospf6 interface IFNAME prefix X:X::X:X/M (match|detail)",
957 "Display connected prefixes to advertise\n"
958 OSPF6_ROUTE_PREFIX_STR
959 OSPF6_ROUTE_MATCH_STR
960 "Dispaly details of the prefixes\n"
963 DEFUN (show_ipv6_ospf6_interface_prefix
,
964 show_ipv6_ospf6_interface_prefix_cmd
,
965 "show ipv6 ospf6 interface prefix",
970 "Display connected prefixes to advertise\n"
974 struct ospf6_interface
*oi
;
975 struct interface
*ifp
;
977 for (ALL_LIST_ELEMENTS_RO (iflist
, i
, ifp
))
979 oi
= (struct ospf6_interface
*) ifp
->info
;
983 ospf6_route_table_show (vty
, argc
, argv
, oi
->route_connected
);
989 ALIAS (show_ipv6_ospf6_interface_prefix
,
990 show_ipv6_ospf6_interface_prefix_detail_cmd
,
991 "show ipv6 ospf6 interface prefix (X:X::X:X|X:X::X:X/M|detail)",
996 "Display connected prefixes to advertise\n"
997 OSPF6_ROUTE_ADDRESS_STR
998 OSPF6_ROUTE_PREFIX_STR
999 "Dispaly details of the prefixes\n"
1002 ALIAS (show_ipv6_ospf6_interface_prefix
,
1003 show_ipv6_ospf6_interface_prefix_match_cmd
,
1004 "show ipv6 ospf6 interface prefix X:X::X:X/M (match|detail)",
1009 "Display connected prefixes to advertise\n"
1010 OSPF6_ROUTE_PREFIX_STR
1011 OSPF6_ROUTE_MATCH_STR
1012 "Dispaly details of the prefixes\n"
1016 /* interface variable set command */
1017 DEFUN (ipv6_ospf6_ifmtu
,
1018 ipv6_ospf6_ifmtu_cmd
,
1019 "ipv6 ospf6 ifmtu <1-65535>",
1023 "OSPFv3 Interface MTU\n"
1026 struct ospf6_interface
*oi
;
1027 struct interface
*ifp
;
1028 unsigned int ifmtu
, iobuflen
;
1029 struct listnode
*node
, *nnode
;
1030 struct ospf6_neighbor
*on
;
1032 ifp
= (struct interface
*) vty
->index
;
1035 oi
= (struct ospf6_interface
*) ifp
->info
;
1037 oi
= ospf6_interface_create (ifp
);
1040 ifmtu
= strtol (argv
[0], NULL
, 10);
1042 if (oi
->ifmtu
== ifmtu
)
1045 if (ifp
->mtu6
!= 0 && ifp
->mtu6
< ifmtu
)
1047 vty_out (vty
, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)%s",
1048 ifp
->name
, ifp
->mtu6
, VNL
);
1052 if (oi
->ifmtu
< ifmtu
)
1054 iobuflen
= ospf6_iobuf_size (ifmtu
);
1055 if (iobuflen
< ifmtu
)
1057 vty_out (vty
, "%s's ifmtu is adjusted to I/O buffer size (%d).%s",
1058 ifp
->name
, iobuflen
, VNL
);
1059 oi
->ifmtu
= iobuflen
;
1067 /* re-establish adjacencies */
1068 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
1070 THREAD_OFF (on
->inactivity_timer
);
1071 thread_add_event (master
, inactivity_timer
, on
, 0);
1077 DEFUN (no_ipv6_ospf6_ifmtu
,
1078 no_ipv6_ospf6_ifmtu_cmd
,
1079 "no ipv6 ospf6 ifmtu",
1086 struct ospf6_interface
*oi
;
1087 struct interface
*ifp
;
1088 unsigned int iobuflen
;
1089 struct listnode
*node
, *nnode
;
1090 struct ospf6_neighbor
*on
;
1092 ifp
= (struct interface
*) vty
->index
;
1095 oi
= (struct ospf6_interface
*) ifp
->info
;
1097 oi
= ospf6_interface_create (ifp
);
1100 if (oi
->ifmtu
< ifp
->mtu
)
1102 iobuflen
= ospf6_iobuf_size (ifp
->mtu
);
1103 if (iobuflen
< ifp
->mtu
)
1105 vty_out (vty
, "%s's ifmtu is adjusted to I/O buffer size (%d).%s",
1106 ifp
->name
, iobuflen
, VNL
);
1107 oi
->ifmtu
= iobuflen
;
1110 oi
->ifmtu
= ifp
->mtu
;
1113 oi
->ifmtu
= ifp
->mtu
;
1115 /* re-establish adjacencies */
1116 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
1118 THREAD_OFF (on
->inactivity_timer
);
1119 thread_add_event (master
, inactivity_timer
, on
, 0);
1125 DEFUN (ipv6_ospf6_cost
,
1126 ipv6_ospf6_cost_cmd
,
1127 "ipv6 ospf6 cost <1-65535>",
1131 "Outgoing metric of this interface\n"
1134 struct ospf6_interface
*oi
;
1135 struct interface
*ifp
;
1136 unsigned long int lcost
;
1138 ifp
= (struct interface
*) vty
->index
;
1141 oi
= (struct ospf6_interface
*) ifp
->info
;
1143 oi
= ospf6_interface_create (ifp
);
1146 lcost
= strtol (argv
[0], NULL
, 10);
1148 if (lcost
> UINT32_MAX
)
1150 vty_out (vty
, "Cost %ld is out of range%s", lcost
, VNL
);
1154 if (oi
->cost
== lcost
)
1159 /* update cost held in route_connected list in ospf6_interface */
1160 ospf6_interface_connected_route_update (oi
->interface
);
1162 /* execute LSA hooks */
1165 OSPF6_LINK_LSA_SCHEDULE (oi
);
1166 OSPF6_ROUTER_LSA_SCHEDULE (oi
->area
);
1167 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1168 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1169 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1175 DEFUN (ipv6_ospf6_hellointerval
,
1176 ipv6_ospf6_hellointerval_cmd
,
1177 "ipv6 ospf6 hello-interval <1-65535>",
1180 "Interval time of Hello packets\n"
1184 struct ospf6_interface
*oi
;
1185 struct interface
*ifp
;
1187 ifp
= (struct interface
*) vty
->index
;
1190 oi
= (struct ospf6_interface
*) ifp
->info
;
1192 oi
= ospf6_interface_create (ifp
);
1195 oi
->hello_interval
= strtol (argv
[0], NULL
, 10);
1199 /* interface variable set command */
1200 DEFUN (ipv6_ospf6_deadinterval
,
1201 ipv6_ospf6_deadinterval_cmd
,
1202 "ipv6 ospf6 dead-interval <1-65535>",
1205 "Interval time after which a neighbor is declared down\n"
1209 struct ospf6_interface
*oi
;
1210 struct interface
*ifp
;
1212 ifp
= (struct interface
*) vty
->index
;
1215 oi
= (struct ospf6_interface
*) ifp
->info
;
1217 oi
= ospf6_interface_create (ifp
);
1220 oi
->dead_interval
= strtol (argv
[0], NULL
, 10);
1224 /* interface variable set command */
1225 DEFUN (ipv6_ospf6_transmitdelay
,
1226 ipv6_ospf6_transmitdelay_cmd
,
1227 "ipv6 ospf6 transmit-delay <1-3600>",
1230 "Transmit delay of this interface\n"
1234 struct ospf6_interface
*oi
;
1235 struct interface
*ifp
;
1237 ifp
= (struct interface
*) vty
->index
;
1240 oi
= (struct ospf6_interface
*) ifp
->info
;
1242 oi
= ospf6_interface_create (ifp
);
1245 oi
->transdelay
= strtol (argv
[0], NULL
, 10);
1249 /* interface variable set command */
1250 DEFUN (ipv6_ospf6_retransmitinterval
,
1251 ipv6_ospf6_retransmitinterval_cmd
,
1252 "ipv6 ospf6 retransmit-interval <1-65535>",
1255 "Time between retransmitting lost link state advertisements\n"
1259 struct ospf6_interface
*oi
;
1260 struct interface
*ifp
;
1262 ifp
= (struct interface
*) vty
->index
;
1265 oi
= (struct ospf6_interface
*) ifp
->info
;
1267 oi
= ospf6_interface_create (ifp
);
1270 oi
->rxmt_interval
= strtol (argv
[0], NULL
, 10);
1274 /* interface variable set command */
1275 DEFUN (ipv6_ospf6_priority
,
1276 ipv6_ospf6_priority_cmd
,
1277 "ipv6 ospf6 priority <0-255>",
1284 struct ospf6_interface
*oi
;
1285 struct interface
*ifp
;
1287 ifp
= (struct interface
*) vty
->index
;
1290 oi
= (struct ospf6_interface
*) ifp
->info
;
1292 oi
= ospf6_interface_create (ifp
);
1295 oi
->priority
= strtol (argv
[0], NULL
, 10);
1298 ospf6_interface_state_change (dr_election (oi
), oi
);
1303 DEFUN (ipv6_ospf6_instance
,
1304 ipv6_ospf6_instance_cmd
,
1305 "ipv6 ospf6 instance-id <0-255>",
1308 "Instance ID for this interface\n"
1309 "Instance ID value\n"
1312 struct ospf6_interface
*oi
;
1313 struct interface
*ifp
;
1315 ifp
= (struct interface
*)vty
->index
;
1318 oi
= (struct ospf6_interface
*)ifp
->info
;
1320 oi
= ospf6_interface_create (ifp
);
1323 oi
->instance_id
= strtol (argv
[0], NULL
, 10);
1327 DEFUN (ipv6_ospf6_passive
,
1328 ipv6_ospf6_passive_cmd
,
1329 "ipv6 ospf6 passive",
1332 "passive interface, No adjacency will be formed on this interface\n"
1335 struct ospf6_interface
*oi
;
1336 struct interface
*ifp
;
1337 struct listnode
*node
, *nnode
;
1338 struct ospf6_neighbor
*on
;
1340 ifp
= (struct interface
*) vty
->index
;
1343 oi
= (struct ospf6_interface
*) ifp
->info
;
1345 oi
= ospf6_interface_create (ifp
);
1348 SET_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1349 THREAD_OFF (oi
->thread_send_hello
);
1351 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
1353 THREAD_OFF (on
->inactivity_timer
);
1354 thread_add_event (master
, inactivity_timer
, on
, 0);
1360 DEFUN (no_ipv6_ospf6_passive
,
1361 no_ipv6_ospf6_passive_cmd
,
1362 "no ipv6 ospf6 passive",
1366 "passive interface: No Adjacency will be formed on this I/F\n"
1369 struct ospf6_interface
*oi
;
1370 struct interface
*ifp
;
1372 ifp
= (struct interface
*) vty
->index
;
1375 oi
= (struct ospf6_interface
*) ifp
->info
;
1377 oi
= ospf6_interface_create (ifp
);
1380 UNSET_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1381 THREAD_OFF (oi
->thread_send_hello
);
1382 oi
->thread_send_hello
=
1383 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
1388 DEFUN (ipv6_ospf6_advertise_prefix_list
,
1389 ipv6_ospf6_advertise_prefix_list_cmd
,
1390 "ipv6 ospf6 advertise prefix-list WORD",
1393 "Advertising options\n"
1394 "Filter prefix using prefix-list\n"
1395 "Prefix list name\n"
1398 struct ospf6_interface
*oi
;
1399 struct interface
*ifp
;
1401 ifp
= (struct interface
*) vty
->index
;
1404 oi
= (struct ospf6_interface
*) ifp
->info
;
1406 oi
= ospf6_interface_create (ifp
);
1410 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
1411 oi
->plist_name
= XSTRDUP (MTYPE_PREFIX_LIST_STR
, argv
[0]);
1413 ospf6_interface_connected_route_update (oi
->interface
);
1414 OSPF6_LINK_LSA_SCHEDULE (oi
);
1415 if (oi
->state
== OSPF6_INTERFACE_DR
)
1417 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1418 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1420 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1425 DEFUN (no_ipv6_ospf6_advertise_prefix_list
,
1426 no_ipv6_ospf6_advertise_prefix_list_cmd
,
1427 "no ipv6 ospf6 advertise prefix-list",
1431 "Advertising options\n"
1432 "Filter prefix using prefix-list\n"
1435 struct ospf6_interface
*oi
;
1436 struct interface
*ifp
;
1438 ifp
= (struct interface
*) vty
->index
;
1441 oi
= (struct ospf6_interface
*) ifp
->info
;
1443 oi
= ospf6_interface_create (ifp
);
1448 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
1449 oi
->plist_name
= NULL
;
1452 ospf6_interface_connected_route_update (oi
->interface
);
1453 OSPF6_LINK_LSA_SCHEDULE (oi
);
1454 if (oi
->state
== OSPF6_INTERFACE_DR
)
1456 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1457 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1459 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1465 config_write_ospf6_interface (struct vty
*vty
)
1468 struct ospf6_interface
*oi
;
1469 struct interface
*ifp
;
1471 for (ALL_LIST_ELEMENTS_RO (iflist
, i
, ifp
))
1473 oi
= (struct ospf6_interface
*) ifp
->info
;
1477 vty_out (vty
, "interface %s%s",
1478 oi
->interface
->name
, VNL
);
1481 vty_out (vty
, " description %s%s", ifp
->desc
, VNL
);
1483 if (ifp
->mtu6
!= oi
->ifmtu
)
1484 vty_out (vty
, " ipv6 ospf6 ifmtu %d%s", oi
->ifmtu
, VNL
);
1485 vty_out (vty
, " ipv6 ospf6 cost %d%s",
1487 vty_out (vty
, " ipv6 ospf6 hello-interval %d%s",
1488 oi
->hello_interval
, VNL
);
1489 vty_out (vty
, " ipv6 ospf6 dead-interval %d%s",
1490 oi
->dead_interval
, VNL
);
1491 vty_out (vty
, " ipv6 ospf6 retransmit-interval %d%s",
1492 oi
->rxmt_interval
, VNL
);
1493 vty_out (vty
, " ipv6 ospf6 priority %d%s",
1495 vty_out (vty
, " ipv6 ospf6 transmit-delay %d%s",
1496 oi
->transdelay
, VNL
);
1497 vty_out (vty
, " ipv6 ospf6 instance-id %d%s",
1498 oi
->instance_id
, VNL
);
1501 vty_out (vty
, " ipv6 ospf6 advertise prefix-list %s%s",
1502 oi
->plist_name
, VNL
);
1504 if (CHECK_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
))
1505 vty_out (vty
, " ipv6 ospf6 passive%s", VNL
);
1507 vty_out (vty
, "!%s", VNL
);
1512 static struct cmd_node interface_node
=
1520 ospf6_interface_init (void)
1522 /* Install interface node. */
1523 install_node (&interface_node
, config_write_ospf6_interface
);
1525 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_cmd
);
1526 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_cmd
);
1527 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_detail_cmd
);
1528 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_match_cmd
);
1529 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_cmd
);
1530 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_cmd
);
1531 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
);
1532 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd
);
1533 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_cmd
);
1534 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_cmd
);
1535 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_detail_cmd
);
1536 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_match_cmd
);
1537 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_cmd
);
1538 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_cmd
);
1539 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
);
1540 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd
);
1542 install_element (CONFIG_NODE
, &interface_cmd
);
1543 install_default (INTERFACE_NODE
);
1544 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
1545 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
1546 install_element (INTERFACE_NODE
, &ipv6_ospf6_cost_cmd
);
1547 install_element (INTERFACE_NODE
, &ipv6_ospf6_ifmtu_cmd
);
1548 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_ifmtu_cmd
);
1549 install_element (INTERFACE_NODE
, &ipv6_ospf6_deadinterval_cmd
);
1550 install_element (INTERFACE_NODE
, &ipv6_ospf6_hellointerval_cmd
);
1551 install_element (INTERFACE_NODE
, &ipv6_ospf6_priority_cmd
);
1552 install_element (INTERFACE_NODE
, &ipv6_ospf6_retransmitinterval_cmd
);
1553 install_element (INTERFACE_NODE
, &ipv6_ospf6_transmitdelay_cmd
);
1554 install_element (INTERFACE_NODE
, &ipv6_ospf6_instance_cmd
);
1556 install_element (INTERFACE_NODE
, &ipv6_ospf6_passive_cmd
);
1557 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_passive_cmd
);
1559 install_element (INTERFACE_NODE
, &ipv6_ospf6_advertise_prefix_list_cmd
);
1560 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_advertise_prefix_list_cmd
);
1563 DEFUN (debug_ospf6_interface
,
1564 debug_ospf6_interface_cmd
,
1565 "debug ospf6 interface",
1568 "Debug OSPFv3 Interface\n"
1571 OSPF6_DEBUG_INTERFACE_ON ();
1575 DEFUN (no_debug_ospf6_interface
,
1576 no_debug_ospf6_interface_cmd
,
1577 "no debug ospf6 interface",
1581 "Debug OSPFv3 Interface\n"
1584 OSPF6_DEBUG_INTERFACE_OFF ();
1589 config_write_ospf6_debug_interface (struct vty
*vty
)
1591 if (IS_OSPF6_DEBUG_INTERFACE
)
1592 vty_out (vty
, "debug ospf6 interface%s", VNL
);
1597 install_element_ospf6_debug_interface (void)
1599 install_element (ENABLE_NODE
, &debug_ospf6_interface_cmd
);
1600 install_element (ENABLE_NODE
, &no_debug_ospf6_interface_cmd
);
1601 install_element (CONFIG_NODE
, &debug_ospf6_interface_cmd
);
1602 install_element (CONFIG_NODE
, &no_debug_ospf6_interface_cmd
);