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 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 struct ospf6_interface
*
75 ospf6_interface_lookup_by_name (char *ifname
)
77 struct ospf6_interface
*oi
;
78 struct interface
*ifp
;
80 ifp
= if_lookup_by_name (ifname
);
82 return (struct ospf6_interface
*) NULL
;
84 oi
= (struct ospf6_interface
*) ifp
->info
;
88 /* schedule routing table recalculation */
90 ospf6_interface_lsdb_hook (struct ospf6_lsa
*lsa
)
92 switch (ntohs (lsa
->header
->type
))
94 case OSPF6_LSTYPE_LINK
:
95 if (OSPF6_INTERFACE (lsa
->lsdb
->data
)->state
== OSPF6_INTERFACE_DR
)
96 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (OSPF6_INTERFACE (lsa
->lsdb
->data
));
97 ospf6_spf_schedule (OSPF6_INTERFACE (lsa
->lsdb
->data
)->area
);
105 /* Create new ospf6 interface structure */
106 struct ospf6_interface
*
107 ospf6_interface_create (struct interface
*ifp
)
109 struct ospf6_interface
*oi
;
112 oi
= (struct ospf6_interface
*)
113 XMALLOC (MTYPE_OSPF6_IF
, sizeof (struct ospf6_interface
));
116 memset (oi
, 0, sizeof (struct ospf6_interface
));
119 zlog_err ("Can't malloc ospf6_interface for ifindex %d", ifp
->ifindex
);
120 return (struct ospf6_interface
*) NULL
;
123 oi
->area
= (struct ospf6_area
*) NULL
;
124 oi
->neighbor_list
= list_new ();
125 oi
->neighbor_list
->cmp
= ospf6_neighbor_cmp
;
126 oi
->linklocal_addr
= (struct in6_addr
*) NULL
;
131 oi
->hello_interval
= 10;
132 oi
->dead_interval
= 40;
133 oi
->rxmt_interval
= 5;
135 oi
->state
= OSPF6_INTERFACE_DOWN
;
138 /* Try to adjust I/O buffer size with IfMtu */
139 oi
->ifmtu
= ifp
->mtu
;
140 iobuflen
= ospf6_iobuf_size (ifp
->mtu
);
141 if (oi
->ifmtu
> iobuflen
)
143 if (IS_OSPF6_DEBUG_INTERFACE
)
144 zlog_info ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
145 ifp
->name
, iobuflen
);
146 oi
->ifmtu
= iobuflen
;
149 oi
->lsupdate_list
= ospf6_lsdb_create (oi
);
150 oi
->lsack_list
= ospf6_lsdb_create (oi
);
151 oi
->lsdb
= ospf6_lsdb_create (oi
);
152 oi
->lsdb
->hook_add
= ospf6_interface_lsdb_hook
;
153 oi
->lsdb
->hook_remove
= ospf6_interface_lsdb_hook
;
154 oi
->lsdb_self
= ospf6_lsdb_create (oi
);
156 oi
->route_connected
= ospf6_route_table_create ();
166 ospf6_interface_delete (struct ospf6_interface
*oi
)
169 struct ospf6_neighbor
*on
;
171 for (n
= listhead (oi
->neighbor_list
); n
; nextnode (n
))
173 on
= (struct ospf6_neighbor
*) getdata (n
);
174 ospf6_neighbor_delete (on
);
176 list_delete (oi
->neighbor_list
);
178 THREAD_OFF (oi
->thread_send_hello
);
179 THREAD_OFF (oi
->thread_send_lsupdate
);
180 THREAD_OFF (oi
->thread_send_lsack
);
182 ospf6_lsdb_remove_all (oi
->lsdb
);
183 ospf6_lsdb_remove_all (oi
->lsupdate_list
);
184 ospf6_lsdb_remove_all (oi
->lsack_list
);
186 ospf6_lsdb_delete (oi
->lsdb
);
187 ospf6_lsdb_delete (oi
->lsdb_self
);
189 ospf6_lsdb_delete (oi
->lsupdate_list
);
190 ospf6_lsdb_delete (oi
->lsack_list
);
192 ospf6_route_table_delete (oi
->route_connected
);
195 oi
->interface
->info
= NULL
;
199 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
201 XFREE (MTYPE_OSPF6_IF
, oi
);
205 ospf6_interface_enable (struct ospf6_interface
*oi
)
207 UNSET_FLAG (oi
->flag
, OSPF6_INTERFACE_DISABLE
);
209 oi
->thread_send_hello
=
210 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
214 ospf6_interface_disable (struct ospf6_interface
*oi
)
217 struct ospf6_neighbor
*on
;
219 SET_FLAG (oi
->flag
, OSPF6_INTERFACE_DISABLE
);
221 for (i
= listhead (oi
->neighbor_list
); i
; nextnode (i
))
223 on
= (struct ospf6_neighbor
*) getdata (i
);
224 ospf6_neighbor_delete (on
);
226 list_delete_all_node (oi
->neighbor_list
);
228 ospf6_lsdb_remove_all (oi
->lsdb
);
229 ospf6_lsdb_remove_all (oi
->lsupdate_list
);
230 ospf6_lsdb_remove_all (oi
->lsack_list
);
232 THREAD_OFF (oi
->thread_send_hello
);
233 THREAD_OFF (oi
->thread_send_lsupdate
);
234 THREAD_OFF (oi
->thread_send_lsack
);
237 static struct in6_addr
*
238 ospf6_interface_get_linklocal_address (struct interface
*ifp
)
242 struct in6_addr
*l
= (struct in6_addr
*) NULL
;
244 /* for each connected address */
245 for (n
= listhead (ifp
->connected
); n
; nextnode (n
))
247 c
= (struct connected
*) getdata (n
);
249 /* if family not AF_INET6, ignore */
250 if (c
->address
->family
!= AF_INET6
)
253 /* linklocal scope check */
254 if (IN6_IS_ADDR_LINKLOCAL (&c
->address
->u
.prefix6
))
255 l
= &c
->address
->u
.prefix6
;
261 ospf6_interface_if_add (struct interface
*ifp
)
263 struct ospf6_interface
*oi
;
266 oi
= (struct ospf6_interface
*) ifp
->info
;
270 /* Try to adjust I/O buffer size with IfMtu */
272 oi
->ifmtu
= ifp
->mtu
;
273 iobuflen
= ospf6_iobuf_size (ifp
->mtu
);
274 if (oi
->ifmtu
> iobuflen
)
276 if (IS_OSPF6_DEBUG_INTERFACE
)
277 zlog_info ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
278 ifp
->name
, iobuflen
);
279 oi
->ifmtu
= iobuflen
;
282 /* interface start */
284 thread_add_event (master
, interface_up
, oi
, 0);
288 ospf6_interface_if_del (struct interface
*ifp
)
290 struct ospf6_interface
*oi
;
292 oi
= (struct ospf6_interface
*) ifp
->info
;
298 thread_execute (master
, interface_down
, oi
, 0);
300 listnode_delete (oi
->area
->if_list
, oi
);
301 oi
->area
= (struct ospf6_area
*) NULL
;
304 oi
->interface
= NULL
;
307 ospf6_interface_delete (oi
);
311 ospf6_interface_state_update (struct interface
*ifp
)
313 struct ospf6_interface
*oi
;
315 oi
= (struct ospf6_interface
*) ifp
->info
;
318 if (oi
->area
== NULL
)
322 thread_add_event (master
, interface_up
, oi
, 0);
324 thread_add_event (master
, interface_down
, oi
, 0);
330 ospf6_interface_connected_route_update (struct interface
*ifp
)
332 struct ospf6_interface
*oi
;
333 struct ospf6_route
*route
;
337 oi
= (struct ospf6_interface
*) ifp
->info
;
341 /* reset linklocal pointer */
342 oi
->linklocal_addr
= ospf6_interface_get_linklocal_address (ifp
);
344 /* if area is null, do not make connected-route list */
345 if (oi
->area
== NULL
)
348 /* update "route to advertise" interface route table */
349 ospf6_route_remove_all (oi
->route_connected
);
350 for (i
= listhead (oi
->interface
->connected
); i
; nextnode (i
))
352 c
= (struct connected
*) getdata (i
);
354 if (c
->address
->family
!= AF_INET6
)
357 CONTINUE_IF_ADDRESS_LINKLOCAL (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
358 CONTINUE_IF_ADDRESS_UNSPECIFIED (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
359 CONTINUE_IF_ADDRESS_LOOPBACK (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
360 CONTINUE_IF_ADDRESS_V4COMPAT (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
361 CONTINUE_IF_ADDRESS_V4MAPPED (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
366 struct prefix_list
*plist
;
367 enum prefix_list_type ret
;
370 prefix2str (c
->address
, buf
, sizeof (buf
));
371 plist
= prefix_list_lookup (AFI_IP6
, oi
->plist_name
);
372 ret
= prefix_list_apply (plist
, (void *) c
->address
);
373 if (ret
== PREFIX_DENY
)
375 if (IS_OSPF6_DEBUG_INTERFACE
)
376 zlog_info ("%s on %s filtered by prefix-list %s ",
377 buf
, oi
->interface
->name
, oi
->plist_name
);
382 route
= ospf6_route_create ();
383 memcpy (&route
->prefix
, c
->address
, sizeof (struct prefix
));
384 apply_mask (&route
->prefix
);
385 route
->type
= OSPF6_DEST_TYPE_NETWORK
;
386 route
->path
.area_id
= oi
->area
->area_id
;
387 route
->path
.type
= OSPF6_PATH_TYPE_INTRA
;
388 route
->path
.cost
= oi
->cost
;
389 route
->nexthop
[0].ifindex
= oi
->interface
->ifindex
;
390 inet_pton (AF_INET6
, "::1", &route
->nexthop
[0].address
);
391 ospf6_route_add (route
, oi
->route_connected
);
394 /* create new Link-LSA */
395 OSPF6_LINK_LSA_SCHEDULE (oi
);
396 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
397 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
401 ospf6_interface_state_change (u_char next_state
, struct ospf6_interface
*oi
)
405 prev_state
= oi
->state
;
406 oi
->state
= next_state
;
408 if (prev_state
== next_state
)
412 if (IS_OSPF6_DEBUG_INTERFACE
)
414 zlog_info ("Interface state change %s: %s -> %s", oi
->interface
->name
,
415 ospf6_interface_state_str
[prev_state
],
416 ospf6_interface_state_str
[next_state
]);
419 if ((prev_state
== OSPF6_INTERFACE_DR
||
420 prev_state
== OSPF6_INTERFACE_BDR
) &&
421 (next_state
!= OSPF6_INTERFACE_DR
&&
422 next_state
!= OSPF6_INTERFACE_BDR
))
423 ospf6_leave_alldrouters (oi
->interface
->ifindex
);
424 if ((prev_state
!= OSPF6_INTERFACE_DR
&&
425 prev_state
!= OSPF6_INTERFACE_BDR
) &&
426 (next_state
== OSPF6_INTERFACE_DR
||
427 next_state
== OSPF6_INTERFACE_BDR
))
428 ospf6_join_alldrouters (oi
->interface
->ifindex
);
430 OSPF6_ROUTER_LSA_SCHEDULE (oi
->area
);
431 if (next_state
== OSPF6_INTERFACE_DOWN
)
433 OSPF6_NETWORK_LSA_EXECUTE (oi
);
434 OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT (oi
);
435 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
437 else if (prev_state
== OSPF6_INTERFACE_DR
||
438 next_state
== OSPF6_INTERFACE_DR
)
440 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
441 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
442 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
447 /* DR Election, RFC2328 section 9.4 */
449 #define IS_ELIGIBLE(n) \
450 ((n)->state >= OSPF6_NEIGHBOR_TWOWAY && (n)->priority != 0)
452 static struct ospf6_neighbor
*
453 better_bdrouter (struct ospf6_neighbor
*a
, struct ospf6_neighbor
*b
)
455 if ((a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
== a
->router_id
) &&
456 (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
== b
->router_id
))
458 else if (a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
== a
->router_id
)
460 else if (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
== b
->router_id
)
463 if (a
->bdrouter
== a
->router_id
&& b
->bdrouter
!= b
->router_id
)
465 if (a
->bdrouter
!= a
->router_id
&& b
->bdrouter
== b
->router_id
)
468 if (a
->priority
> b
->priority
)
470 if (a
->priority
< b
->priority
)
473 if (ntohl (a
->router_id
) > ntohl (b
->router_id
))
475 if (ntohl (a
->router_id
) < ntohl (b
->router_id
))
478 zlog_warn ("Router-ID duplicate ?");
482 static struct ospf6_neighbor
*
483 better_drouter (struct ospf6_neighbor
*a
, struct ospf6_neighbor
*b
)
485 if ((a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
!= a
->router_id
) &&
486 (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
!= b
->router_id
))
488 else if (a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
!= a
->router_id
)
490 else if (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
!= b
->router_id
)
493 if (a
->drouter
== a
->router_id
&& b
->drouter
!= b
->router_id
)
495 if (a
->drouter
!= a
->router_id
&& b
->drouter
== b
->router_id
)
498 if (a
->priority
> b
->priority
)
500 if (a
->priority
< b
->priority
)
503 if (ntohl (a
->router_id
) > ntohl (b
->router_id
))
505 if (ntohl (a
->router_id
) < ntohl (b
->router_id
))
508 zlog_warn ("Router-ID duplicate ?");
513 dr_election (struct ospf6_interface
*oi
)
516 struct ospf6_neighbor
*on
, *drouter
, *bdrouter
, myself
;
517 struct ospf6_neighbor
*best_drouter
, *best_bdrouter
;
518 u_char next_state
= 0;
520 drouter
= bdrouter
= NULL
;
521 best_drouter
= best_bdrouter
= NULL
;
523 /* pseudo neighbor myself, including noting current DR/BDR (1) */
524 memset (&myself
, 0, sizeof (myself
));
525 inet_ntop (AF_INET
, &oi
->area
->ospf6
->router_id
, myself
.name
,
526 sizeof (myself
.name
));
527 myself
.state
= OSPF6_NEIGHBOR_TWOWAY
;
528 myself
.drouter
= oi
->drouter
;
529 myself
.bdrouter
= oi
->bdrouter
;
530 myself
.priority
= oi
->priority
;
531 myself
.router_id
= oi
->area
->ospf6
->router_id
;
533 /* Electing BDR (2) */
534 for (i
= listhead (oi
->neighbor_list
); i
; nextnode (i
))
536 on
= (struct ospf6_neighbor
*) getdata (i
);
537 bdrouter
= better_bdrouter (bdrouter
, on
);
539 best_bdrouter
= bdrouter
;
540 bdrouter
= better_bdrouter (best_bdrouter
, &myself
);
542 /* Electing DR (3) */
543 for (i
= listhead (oi
->neighbor_list
); i
; nextnode (i
))
545 on
= (struct ospf6_neighbor
*) getdata (i
);
546 drouter
= better_drouter (drouter
, on
);
548 best_drouter
= drouter
;
549 drouter
= better_drouter (best_drouter
, &myself
);
553 /* the router itself is newly/no longer DR/BDR (4) */
554 if ((drouter
== &myself
&& myself
.drouter
!= myself
.router_id
) ||
555 (drouter
!= &myself
&& myself
.drouter
== myself
.router_id
) ||
556 (bdrouter
== &myself
&& myself
.bdrouter
!= myself
.router_id
) ||
557 (bdrouter
!= &myself
&& myself
.bdrouter
== myself
.router_id
))
559 myself
.drouter
= (drouter
? drouter
->router_id
: htonl (0));
560 myself
.bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl (0));
562 /* compatible to Electing BDR (2) */
563 bdrouter
= better_bdrouter (best_bdrouter
, &myself
);
565 /* compatible to Electing DR (3) */
566 drouter
= better_drouter (best_drouter
, &myself
);
571 /* Set interface state accordingly (5) */
572 if (drouter
&& drouter
== &myself
)
573 next_state
= OSPF6_INTERFACE_DR
;
574 else if (bdrouter
&& bdrouter
== &myself
)
575 next_state
= OSPF6_INTERFACE_BDR
;
577 next_state
= OSPF6_INTERFACE_DROTHER
;
579 /* If NBMA, schedule Start for each neighbor having priority of 0 (6) */
582 /* If DR or BDR change, invoke AdjOK? for each neighbor (7) */
583 /* RFC 2328 section 12.4. Originating LSAs (3) will be handled
584 accordingly after AdjOK */
585 if (oi
->drouter
!= (drouter
? drouter
->router_id
: htonl (0)) ||
586 oi
->bdrouter
!= (bdrouter
? bdrouter
->router_id
: htonl (0)))
588 if (IS_OSPF6_DEBUG_INTERFACE
)
589 zlog_info ("DR Election on %s: DR: %s BDR: %s", oi
->interface
->name
,
590 (drouter
? drouter
->name
: "0.0.0.0"),
591 (bdrouter
? bdrouter
->name
: "0.0.0.0"));
593 for (i
= listhead (oi
->neighbor_list
); i
; nextnode (i
))
595 on
= (struct ospf6_neighbor
*) getdata (i
);
596 if (on
->state
< OSPF6_NEIGHBOR_TWOWAY
)
598 /* Schedule AdjOK. */
599 thread_add_event (master
, adj_ok
, on
, 0);
603 oi
->drouter
= (drouter
? drouter
->router_id
: htonl (0));
604 oi
->bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl (0));
609 /* Interface State Machine */
611 interface_up (struct thread
*thread
)
613 struct ospf6_interface
*oi
;
615 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
616 assert (oi
&& oi
->interface
);
618 if (IS_OSPF6_DEBUG_INTERFACE
)
619 zlog_info ("Interface Event %s: [InterfaceUp]",
620 oi
->interface
->name
);
622 /* check physical interface is up */
623 if (! if_is_up (oi
->interface
))
625 if (IS_OSPF6_DEBUG_INTERFACE
)
626 zlog_info ("Interface %s is down, can't execute [InterfaceUp]",
627 oi
->interface
->name
);
631 /* if already enabled, do nothing */
632 if (oi
->state
> OSPF6_INTERFACE_DOWN
)
634 if (IS_OSPF6_DEBUG_INTERFACE
)
635 zlog_info ("Interface %s already enabled",
636 oi
->interface
->name
);
640 /* Join AllSPFRouters */
641 ospf6_join_allspfrouters (oi
->interface
->ifindex
);
643 /* Update interface route */
644 ospf6_interface_connected_route_update (oi
->interface
);
647 if (! CHECK_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
))
648 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
650 /* decide next interface state */
651 if (if_is_pointopoint (oi
->interface
))
652 ospf6_interface_state_change (OSPF6_INTERFACE_POINTTOPOINT
, oi
);
653 else if (oi
->priority
== 0)
654 ospf6_interface_state_change (OSPF6_INTERFACE_DROTHER
, oi
);
657 ospf6_interface_state_change (OSPF6_INTERFACE_WAITING
, oi
);
658 thread_add_timer (master
, wait_timer
, oi
, oi
->dead_interval
);
665 wait_timer (struct thread
*thread
)
667 struct ospf6_interface
*oi
;
669 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
670 assert (oi
&& oi
->interface
);
672 if (IS_OSPF6_DEBUG_INTERFACE
)
673 zlog_info ("Interface Event %s: [WaitTimer]",
674 oi
->interface
->name
);
676 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
677 ospf6_interface_state_change (dr_election (oi
), oi
);
683 backup_seen (struct thread
*thread
)
685 struct ospf6_interface
*oi
;
687 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
688 assert (oi
&& oi
->interface
);
690 if (IS_OSPF6_DEBUG_INTERFACE
)
691 zlog_info ("Interface Event %s: [BackupSeen]",
692 oi
->interface
->name
);
694 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
695 ospf6_interface_state_change (dr_election (oi
), oi
);
701 neighbor_change (struct thread
*thread
)
703 struct ospf6_interface
*oi
;
705 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
706 assert (oi
&& oi
->interface
);
708 if (IS_OSPF6_DEBUG_INTERFACE
)
709 zlog_info ("Interface Event %s: [NeighborChange]",
710 oi
->interface
->name
);
712 if (oi
->state
== OSPF6_INTERFACE_DROTHER
||
713 oi
->state
== OSPF6_INTERFACE_BDR
||
714 oi
->state
== OSPF6_INTERFACE_DR
)
715 ospf6_interface_state_change (dr_election (oi
), oi
);
721 loopind (struct thread
*thread
)
723 struct ospf6_interface
*oi
;
725 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
726 assert (oi
&& oi
->interface
);
728 if (IS_OSPF6_DEBUG_INTERFACE
)
729 zlog_info ("Interface Event %s: [LoopInd]",
730 oi
->interface
->name
);
738 interface_down (struct thread
*thread
)
740 struct ospf6_interface
*oi
;
742 struct ospf6_neighbor
*on
;
744 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
745 assert (oi
&& oi
->interface
);
747 if (IS_OSPF6_DEBUG_INTERFACE
)
748 zlog_info ("Interface Event %s: [InterfaceDown]",
749 oi
->interface
->name
);
751 /* Leave AllSPFRouters */
752 if (oi
->state
> OSPF6_INTERFACE_DOWN
)
753 ospf6_leave_allspfrouters (oi
->interface
->ifindex
);
755 ospf6_interface_state_change (OSPF6_INTERFACE_DOWN
, oi
);
757 for (n
= listhead (oi
->neighbor_list
); n
; nextnode (n
))
759 on
= (struct ospf6_neighbor
*) getdata (n
);
760 ospf6_neighbor_delete (on
);
762 list_delete_all_node (oi
->neighbor_list
);
768 /* show specified interface structure */
770 ospf6_interface_show (struct vty
*vty
, struct interface
*ifp
)
772 struct ospf6_interface
*oi
;
776 char strbuf
[64], drouter
[32], bdrouter
[32];
777 char *updown
[3] = {"down", "up", NULL
};
779 struct timeval res
, now
;
781 struct ospf6_lsa
*lsa
;
783 /* check physical interface type */
784 if (if_is_loopback (ifp
))
786 else if (if_is_broadcast (ifp
))
788 else if (if_is_pointopoint (ifp
))
789 type
= "POINTOPOINT";
793 vty_out (vty
, "%s is %s, type %s%s",
794 ifp
->name
, updown
[if_is_up (ifp
)], type
,
796 vty_out (vty
, " Interface ID: %d%s", ifp
->ifindex
, VNL
);
798 if (ifp
->info
== NULL
)
800 vty_out (vty
, " OSPF not enabled on this interface%s", VNL
);
804 oi
= (struct ospf6_interface
*) ifp
->info
;
806 vty_out (vty
, " Internet Address:%s", VNL
);
807 for (i
= listhead (ifp
->connected
); i
; nextnode (i
))
809 c
= (struct connected
*)getdata (i
);
811 prefix2str (p
, strbuf
, sizeof (strbuf
));
815 vty_out (vty
, " inet : %s%s", strbuf
,
819 vty_out (vty
, " inet6: %s%s", strbuf
,
823 vty_out (vty
, " ??? : %s%s", strbuf
,
831 vty_out (vty
, " Instance ID %d, Interface MTU %d (autodetect: %d)%s",
832 oi
->instance_id
, oi
->ifmtu
, ifp
->mtu
, VNL
);
833 inet_ntop (AF_INET
, &oi
->area
->area_id
,
834 strbuf
, sizeof (strbuf
));
835 vty_out (vty
, " Area ID %s, Cost %hu%s", strbuf
, oi
->cost
,
839 vty_out (vty
, " Not Attached to Area%s", VNL
);
841 vty_out (vty
, " State %s, Transmit Delay %d sec, Priority %d%s",
842 ospf6_interface_state_str
[oi
->state
],
843 oi
->transdelay
, oi
->priority
,
845 vty_out (vty
, " Timer intervals configured:%s", VNL
);
846 vty_out (vty
, " Hello %d, Dead %d, Retransmit %d%s",
847 oi
->hello_interval
, oi
->dead_interval
, oi
->rxmt_interval
,
850 inet_ntop (AF_INET
, &oi
->drouter
, drouter
, sizeof (drouter
));
851 inet_ntop (AF_INET
, &oi
->bdrouter
, bdrouter
, sizeof (bdrouter
));
852 vty_out (vty
, " DR: %s BDR: %s%s", drouter
, bdrouter
, VNL
);
854 vty_out (vty
, " Number of I/F scoped LSAs is %u%s",
855 oi
->lsdb
->count
, VNL
);
857 gettimeofday (&now
, (struct timezone
*) NULL
);
860 if (oi
->thread_send_lsupdate
)
861 timersub (&oi
->thread_send_lsupdate
->u
.sands
, &now
, &res
);
862 timerstring (&res
, duration
, sizeof (duration
));
863 vty_out (vty
, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s",
864 oi
->lsupdate_list
->count
, duration
,
865 (oi
->thread_send_lsupdate
? "on" : "off"),
867 for (lsa
= ospf6_lsdb_head (oi
->lsupdate_list
); lsa
;
868 lsa
= ospf6_lsdb_next (lsa
))
869 vty_out (vty
, " %s%s", lsa
->name
, VNL
);
872 if (oi
->thread_send_lsack
)
873 timersub (&oi
->thread_send_lsack
->u
.sands
, &now
, &res
);
874 timerstring (&res
, duration
, sizeof (duration
));
875 vty_out (vty
, " %d Pending LSAs for LSAck in Time %s [thread %s]%s",
876 oi
->lsack_list
->count
, duration
,
877 (oi
->thread_send_lsack
? "on" : "off"),
879 for (lsa
= ospf6_lsdb_head (oi
->lsack_list
); lsa
;
880 lsa
= ospf6_lsdb_next (lsa
))
881 vty_out (vty
, " %s%s", lsa
->name
, VNL
);
887 DEFUN (show_ipv6_ospf6_interface
,
888 show_ipv6_ospf6_interface_ifname_cmd
,
889 "show ipv6 ospf6 interface IFNAME",
897 struct interface
*ifp
;
902 ifp
= if_lookup_by_name (argv
[0]);
905 vty_out (vty
, "No such Interface: %s%s", argv
[0],
909 ospf6_interface_show (vty
, ifp
);
913 for (i
= listhead (iflist
); i
; nextnode (i
))
915 ifp
= (struct interface
*) getdata (i
);
916 ospf6_interface_show (vty
, ifp
);
923 ALIAS (show_ipv6_ospf6_interface
,
924 show_ipv6_ospf6_interface_cmd
,
925 "show ipv6 ospf6 interface",
932 DEFUN (show_ipv6_ospf6_interface_ifname_prefix
,
933 show_ipv6_ospf6_interface_ifname_prefix_cmd
,
934 "show ipv6 ospf6 interface IFNAME prefix",
940 "Display connected prefixes to advertise\n"
943 struct interface
*ifp
;
944 struct ospf6_interface
*oi
;
946 ifp
= if_lookup_by_name (argv
[0]);
949 vty_out (vty
, "No such Interface: %s%s", argv
[0], VNL
);
956 vty_out (vty
, "OSPFv3 is not enabled on %s%s", argv
[0], VNL
);
962 ospf6_route_table_show (vty
, argc
, argv
, oi
->route_connected
);
967 ALIAS (show_ipv6_ospf6_interface_ifname_prefix
,
968 show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
,
969 "show ipv6 ospf6 interface IFNAME prefix (X:X::X:X|X:X::X:X/M|detail)",
975 "Display connected prefixes to advertise\n"
976 OSPF6_ROUTE_ADDRESS_STR
977 OSPF6_ROUTE_PREFIX_STR
978 "Dispaly details of the prefixes\n"
981 ALIAS (show_ipv6_ospf6_interface_ifname_prefix
,
982 show_ipv6_ospf6_interface_ifname_prefix_match_cmd
,
983 "show ipv6 ospf6 interface IFNAME prefix X:X::X:X/M (match|detail)",
989 "Display connected prefixes to advertise\n"
990 OSPF6_ROUTE_PREFIX_STR
991 OSPF6_ROUTE_MATCH_STR
992 "Dispaly details of the prefixes\n"
995 DEFUN (show_ipv6_ospf6_interface_prefix
,
996 show_ipv6_ospf6_interface_prefix_cmd
,
997 "show ipv6 ospf6 interface prefix",
1002 "Display connected prefixes to advertise\n"
1006 struct ospf6_interface
*oi
;
1007 struct interface
*ifp
;
1009 for (i
= listhead (iflist
); i
; nextnode (i
))
1011 ifp
= (struct interface
*) getdata (i
);
1012 oi
= (struct ospf6_interface
*) ifp
->info
;
1016 ospf6_route_table_show (vty
, argc
, argv
, oi
->route_connected
);
1022 ALIAS (show_ipv6_ospf6_interface_prefix
,
1023 show_ipv6_ospf6_interface_prefix_detail_cmd
,
1024 "show ipv6 ospf6 interface prefix (X:X::X:X|X:X::X:X/M|detail)",
1029 "Display connected prefixes to advertise\n"
1030 OSPF6_ROUTE_ADDRESS_STR
1031 OSPF6_ROUTE_PREFIX_STR
1032 "Dispaly details of the prefixes\n"
1035 ALIAS (show_ipv6_ospf6_interface_prefix
,
1036 show_ipv6_ospf6_interface_prefix_match_cmd
,
1037 "show ipv6 ospf6 interface prefix X:X::X:X/M (match|detail)",
1042 "Display connected prefixes to advertise\n"
1043 OSPF6_ROUTE_PREFIX_STR
1044 OSPF6_ROUTE_MATCH_STR
1045 "Dispaly details of the prefixes\n"
1049 /* interface variable set command */
1050 DEFUN (ipv6_ospf6_ifmtu
,
1051 ipv6_ospf6_ifmtu_cmd
,
1052 "ipv6 ospf6 ifmtu <1-65535>",
1056 "OSPFv3 Interface MTU\n"
1059 struct ospf6_interface
*oi
;
1060 struct interface
*ifp
;
1061 int ifmtu
, iobuflen
;
1063 struct ospf6_neighbor
*on
;
1065 ifp
= (struct interface
*) vty
->index
;
1068 oi
= (struct ospf6_interface
*) ifp
->info
;
1070 oi
= ospf6_interface_create (ifp
);
1073 ifmtu
= strtol (argv
[0], NULL
, 10);
1075 if (oi
->ifmtu
== ifmtu
)
1078 if (ifp
->mtu
!= 0 && ifp
->mtu
< ifmtu
)
1080 vty_out (vty
, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)%s",
1081 ifp
->name
, ifp
->mtu
, VNL
);
1085 if (oi
->ifmtu
< ifmtu
)
1087 iobuflen
= ospf6_iobuf_size (ifmtu
);
1088 if (iobuflen
< ifmtu
)
1090 vty_out (vty
, "%s's ifmtu is adjusted to I/O buffer size (%d).%s",
1091 ifp
->name
, iobuflen
, VNL
);
1092 oi
->ifmtu
= iobuflen
;
1100 /* re-establish adjacencies */
1101 for (node
= listhead (oi
->neighbor_list
); node
; nextnode (node
))
1103 on
= (struct ospf6_neighbor
*) getdata (node
);
1104 THREAD_OFF (on
->inactivity_timer
);
1105 thread_add_event (master
, inactivity_timer
, on
, 0);
1111 DEFUN (no_ipv6_ospf6_ifmtu
,
1112 no_ipv6_ospf6_ifmtu_cmd
,
1113 "no ipv6 ospf6 ifmtu",
1120 struct ospf6_interface
*oi
;
1121 struct interface
*ifp
;
1124 struct ospf6_neighbor
*on
;
1126 ifp
= (struct interface
*) vty
->index
;
1129 oi
= (struct ospf6_interface
*) ifp
->info
;
1131 oi
= ospf6_interface_create (ifp
);
1134 if (oi
->ifmtu
< ifp
->mtu
)
1136 iobuflen
= ospf6_iobuf_size (ifp
->mtu
);
1137 if (iobuflen
< ifp
->mtu
)
1139 vty_out (vty
, "%s's ifmtu is adjusted to I/O buffer size (%d).%s",
1140 ifp
->name
, iobuflen
, VNL
);
1141 oi
->ifmtu
= iobuflen
;
1144 oi
->ifmtu
= ifp
->mtu
;
1147 oi
->ifmtu
= ifp
->mtu
;
1149 /* re-establish adjacencies */
1150 for (node
= listhead (oi
->neighbor_list
); node
; nextnode (node
))
1152 on
= (struct ospf6_neighbor
*) getdata (node
);
1153 THREAD_OFF (on
->inactivity_timer
);
1154 thread_add_event (master
, inactivity_timer
, on
, 0);
1160 DEFUN (ipv6_ospf6_cost
,
1161 ipv6_ospf6_cost_cmd
,
1162 "ipv6 ospf6 cost <1-65535>",
1166 "Outgoing metric of this interface\n"
1169 struct ospf6_interface
*oi
;
1170 struct interface
*ifp
;
1172 ifp
= (struct interface
*) vty
->index
;
1175 oi
= (struct ospf6_interface
*) ifp
->info
;
1177 oi
= ospf6_interface_create (ifp
);
1180 if (oi
->cost
== strtol (argv
[0], NULL
, 10))
1183 oi
->cost
= strtol (argv
[0], NULL
, 10);
1185 /* update cost held in route_connected list in ospf6_interface */
1186 ospf6_interface_connected_route_update (oi
->interface
);
1188 /* execute LSA hooks */
1191 OSPF6_LINK_LSA_SCHEDULE (oi
);
1192 OSPF6_ROUTER_LSA_SCHEDULE (oi
->area
);
1193 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1194 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1195 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1201 DEFUN (ipv6_ospf6_hellointerval
,
1202 ipv6_ospf6_hellointerval_cmd
,
1203 "ipv6 ospf6 hello-interval <1-65535>",
1206 "Interval time of Hello packets\n"
1210 struct ospf6_interface
*oi
;
1211 struct interface
*ifp
;
1213 ifp
= (struct interface
*) vty
->index
;
1216 oi
= (struct ospf6_interface
*) ifp
->info
;
1218 oi
= ospf6_interface_create (ifp
);
1221 oi
->hello_interval
= strtol (argv
[0], NULL
, 10);
1225 /* interface variable set command */
1226 DEFUN (ipv6_ospf6_deadinterval
,
1227 ipv6_ospf6_deadinterval_cmd
,
1228 "ipv6 ospf6 dead-interval <1-65535>",
1231 "Interval time after which a neighbor is declared down\n"
1235 struct ospf6_interface
*oi
;
1236 struct interface
*ifp
;
1238 ifp
= (struct interface
*) vty
->index
;
1241 oi
= (struct ospf6_interface
*) ifp
->info
;
1243 oi
= ospf6_interface_create (ifp
);
1246 oi
->dead_interval
= strtol (argv
[0], NULL
, 10);
1250 /* interface variable set command */
1251 DEFUN (ipv6_ospf6_transmitdelay
,
1252 ipv6_ospf6_transmitdelay_cmd
,
1253 "ipv6 ospf6 transmit-delay <1-3600>",
1256 "Transmit delay of this interface\n"
1260 struct ospf6_interface
*oi
;
1261 struct interface
*ifp
;
1263 ifp
= (struct interface
*) vty
->index
;
1266 oi
= (struct ospf6_interface
*) ifp
->info
;
1268 oi
= ospf6_interface_create (ifp
);
1271 oi
->transdelay
= strtol (argv
[0], NULL
, 10);
1275 /* interface variable set command */
1276 DEFUN (ipv6_ospf6_retransmitinterval
,
1277 ipv6_ospf6_retransmitinterval_cmd
,
1278 "ipv6 ospf6 retransmit-interval <1-65535>",
1281 "Time between retransmitting lost link state advertisements\n"
1285 struct ospf6_interface
*oi
;
1286 struct interface
*ifp
;
1288 ifp
= (struct interface
*) vty
->index
;
1291 oi
= (struct ospf6_interface
*) ifp
->info
;
1293 oi
= ospf6_interface_create (ifp
);
1296 oi
->rxmt_interval
= strtol (argv
[0], NULL
, 10);
1300 /* interface variable set command */
1301 DEFUN (ipv6_ospf6_priority
,
1302 ipv6_ospf6_priority_cmd
,
1303 "ipv6 ospf6 priority <0-255>",
1310 struct ospf6_interface
*oi
;
1311 struct interface
*ifp
;
1313 ifp
= (struct interface
*) vty
->index
;
1316 oi
= (struct ospf6_interface
*) ifp
->info
;
1318 oi
= ospf6_interface_create (ifp
);
1321 oi
->priority
= strtol (argv
[0], NULL
, 10);
1324 ospf6_interface_state_change (dr_election (oi
), oi
);
1329 DEFUN (ipv6_ospf6_instance
,
1330 ipv6_ospf6_instance_cmd
,
1331 "ipv6 ospf6 instance-id <0-255>",
1334 "Instance ID for this interface\n"
1335 "Instance ID value\n"
1338 struct ospf6_interface
*oi
;
1339 struct interface
*ifp
;
1341 ifp
= (struct interface
*)vty
->index
;
1344 oi
= (struct ospf6_interface
*)ifp
->info
;
1346 oi
= ospf6_interface_create (ifp
);
1349 oi
->instance_id
= strtol (argv
[0], NULL
, 10);
1353 DEFUN (ipv6_ospf6_passive
,
1354 ipv6_ospf6_passive_cmd
,
1355 "ipv6 ospf6 passive",
1358 "passive interface, No adjacency will be formed on this interface\n"
1361 struct ospf6_interface
*oi
;
1362 struct interface
*ifp
;
1364 struct ospf6_neighbor
*on
;
1366 ifp
= (struct interface
*) vty
->index
;
1369 oi
= (struct ospf6_interface
*) ifp
->info
;
1371 oi
= ospf6_interface_create (ifp
);
1374 SET_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1375 THREAD_OFF (oi
->thread_send_hello
);
1377 for (node
= listhead (oi
->neighbor_list
); node
; nextnode (node
))
1379 on
= (struct ospf6_neighbor
*) getdata (node
);
1380 THREAD_OFF (on
->inactivity_timer
);
1381 thread_add_event (master
, inactivity_timer
, on
, 0);
1387 DEFUN (no_ipv6_ospf6_passive
,
1388 no_ipv6_ospf6_passive_cmd
,
1389 "no ipv6 ospf6 passive",
1393 "passive interface: No Adjacency will be formed on this I/F\n"
1396 struct ospf6_interface
*oi
;
1397 struct interface
*ifp
;
1399 ifp
= (struct interface
*) vty
->index
;
1402 oi
= (struct ospf6_interface
*) ifp
->info
;
1404 oi
= ospf6_interface_create (ifp
);
1407 UNSET_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1408 THREAD_OFF (oi
->thread_send_hello
);
1409 oi
->thread_send_hello
=
1410 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
1415 DEFUN (ipv6_ospf6_advertise_prefix_list
,
1416 ipv6_ospf6_advertise_prefix_list_cmd
,
1417 "ipv6 ospf6 advertise prefix-list WORD",
1420 "Advertising options\n"
1421 "Filter prefix using prefix-list\n"
1422 "Prefix list name\n"
1425 struct ospf6_interface
*oi
;
1426 struct interface
*ifp
;
1428 ifp
= (struct interface
*) vty
->index
;
1431 oi
= (struct ospf6_interface
*) ifp
->info
;
1433 oi
= ospf6_interface_create (ifp
);
1437 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
1438 oi
->plist_name
= XSTRDUP (MTYPE_PREFIX_LIST_STR
, argv
[0]);
1440 ospf6_interface_connected_route_update (oi
->interface
);
1441 OSPF6_LINK_LSA_SCHEDULE (oi
);
1442 if (oi
->state
== OSPF6_INTERFACE_DR
)
1444 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1445 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1447 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1452 DEFUN (no_ipv6_ospf6_advertise_prefix_list
,
1453 no_ipv6_ospf6_advertise_prefix_list_cmd
,
1454 "no ipv6 ospf6 advertise prefix-list",
1458 "Advertising options\n"
1459 "Filter prefix using prefix-list\n"
1462 struct ospf6_interface
*oi
;
1463 struct interface
*ifp
;
1465 ifp
= (struct interface
*) vty
->index
;
1468 oi
= (struct ospf6_interface
*) ifp
->info
;
1470 oi
= ospf6_interface_create (ifp
);
1475 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
1476 oi
->plist_name
= NULL
;
1479 ospf6_interface_connected_route_update (oi
->interface
);
1480 OSPF6_LINK_LSA_SCHEDULE (oi
);
1481 if (oi
->state
== OSPF6_INTERFACE_DR
)
1483 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1484 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1486 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1492 config_write_ospf6_interface (struct vty
*vty
)
1495 struct ospf6_interface
*oi
;
1496 struct interface
*ifp
;
1498 for (i
= listhead (iflist
); i
; nextnode (i
))
1500 ifp
= (struct interface
*) getdata (i
);
1501 oi
= (struct ospf6_interface
*) ifp
->info
;
1505 vty_out (vty
, "interface %s%s",
1506 oi
->interface
->name
, VNL
);
1509 vty_out (vty
, " description %s%s", ifp
->desc
, VNL
);
1511 if (ifp
->mtu
!= oi
->ifmtu
)
1512 vty_out (vty
, " ipv6 ospf6 ifmtu %d%s", oi
->ifmtu
, VNL
);
1513 vty_out (vty
, " ipv6 ospf6 cost %d%s",
1515 vty_out (vty
, " ipv6 ospf6 hello-interval %d%s",
1516 oi
->hello_interval
, VNL
);
1517 vty_out (vty
, " ipv6 ospf6 dead-interval %d%s",
1518 oi
->dead_interval
, VNL
);
1519 vty_out (vty
, " ipv6 ospf6 retransmit-interval %d%s",
1520 oi
->rxmt_interval
, VNL
);
1521 vty_out (vty
, " ipv6 ospf6 priority %d%s",
1523 vty_out (vty
, " ipv6 ospf6 transmit-delay %d%s",
1524 oi
->transdelay
, VNL
);
1525 vty_out (vty
, " ipv6 ospf6 instance-id %d%s",
1526 oi
->instance_id
, VNL
);
1529 vty_out (vty
, " ipv6 ospf6 advertise prefix-list %s%s",
1530 oi
->plist_name
, VNL
);
1532 if (CHECK_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
))
1533 vty_out (vty
, " ipv6 ospf6 passive%s", VNL
);
1535 vty_out (vty
, "!%s", VNL
);
1540 struct cmd_node interface_node
=
1548 ospf6_interface_init ()
1550 /* Install interface node. */
1551 install_node (&interface_node
, config_write_ospf6_interface
);
1553 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_cmd
);
1554 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_cmd
);
1555 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_detail_cmd
);
1556 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_match_cmd
);
1557 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_cmd
);
1558 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_cmd
);
1559 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
);
1560 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd
);
1561 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_cmd
);
1562 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_cmd
);
1563 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_detail_cmd
);
1564 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_match_cmd
);
1565 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_cmd
);
1566 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_cmd
);
1567 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
);
1568 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd
);
1570 install_element (CONFIG_NODE
, &interface_cmd
);
1571 install_default (INTERFACE_NODE
);
1572 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
1573 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
1574 install_element (INTERFACE_NODE
, &ipv6_ospf6_cost_cmd
);
1575 install_element (INTERFACE_NODE
, &ipv6_ospf6_ifmtu_cmd
);
1576 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_ifmtu_cmd
);
1577 install_element (INTERFACE_NODE
, &ipv6_ospf6_deadinterval_cmd
);
1578 install_element (INTERFACE_NODE
, &ipv6_ospf6_hellointerval_cmd
);
1579 install_element (INTERFACE_NODE
, &ipv6_ospf6_priority_cmd
);
1580 install_element (INTERFACE_NODE
, &ipv6_ospf6_retransmitinterval_cmd
);
1581 install_element (INTERFACE_NODE
, &ipv6_ospf6_transmitdelay_cmd
);
1582 install_element (INTERFACE_NODE
, &ipv6_ospf6_instance_cmd
);
1584 install_element (INTERFACE_NODE
, &ipv6_ospf6_passive_cmd
);
1585 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_passive_cmd
);
1587 install_element (INTERFACE_NODE
, &ipv6_ospf6_advertise_prefix_list_cmd
);
1588 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_advertise_prefix_list_cmd
);
1591 DEFUN (debug_ospf6_interface
,
1592 debug_ospf6_interface_cmd
,
1593 "debug ospf6 interface",
1596 "Debug OSPFv3 Interface\n"
1599 OSPF6_DEBUG_INTERFACE_ON ();
1603 DEFUN (no_debug_ospf6_interface
,
1604 no_debug_ospf6_interface_cmd
,
1605 "no debug ospf6 interface",
1609 "Debug OSPFv3 Interface\n"
1612 OSPF6_DEBUG_INTERFACE_OFF ();
1617 config_write_ospf6_debug_interface (struct vty
*vty
)
1619 if (IS_OSPF6_DEBUG_INTERFACE
)
1620 vty_out (vty
, "debug ospf6 interface%s", VNL
);
1625 install_element_ospf6_debug_interface ()
1627 install_element (ENABLE_NODE
, &debug_ospf6_interface_cmd
);
1628 install_element (ENABLE_NODE
, &no_debug_ospf6_interface_cmd
);
1629 install_element (CONFIG_NODE
, &debug_ospf6_interface_cmd
);
1630 install_element (CONFIG_NODE
, &no_debug_ospf6_interface_cmd
);