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
;
123 /* Try to adjust I/O buffer size with IfMtu */
124 oi
->ifmtu
= ifp
->mtu6
;
125 iobuflen
= ospf6_iobuf_size (ifp
->mtu6
);
126 if (oi
->ifmtu
> iobuflen
)
128 if (IS_OSPF6_DEBUG_INTERFACE
)
129 zlog_debug ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
130 ifp
->name
, iobuflen
);
131 oi
->ifmtu
= iobuflen
;
134 oi
->lsupdate_list
= ospf6_lsdb_create (oi
);
135 oi
->lsack_list
= ospf6_lsdb_create (oi
);
136 oi
->lsdb
= ospf6_lsdb_create (oi
);
137 oi
->lsdb
->hook_add
= ospf6_interface_lsdb_hook
;
138 oi
->lsdb
->hook_remove
= ospf6_interface_lsdb_hook
;
139 oi
->lsdb_self
= ospf6_lsdb_create (oi
);
141 oi
->route_connected
= OSPF6_ROUTE_TABLE_CREATE (INTERFACE
, CONNECTED_ROUTES
);
142 oi
->route_connected
->scope
= oi
;
152 ospf6_interface_delete (struct ospf6_interface
*oi
)
154 struct listnode
*node
, *nnode
;
155 struct ospf6_neighbor
*on
;
157 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
158 ospf6_neighbor_delete (on
);
160 list_delete (oi
->neighbor_list
);
162 THREAD_OFF (oi
->thread_send_hello
);
163 THREAD_OFF (oi
->thread_send_lsupdate
);
164 THREAD_OFF (oi
->thread_send_lsack
);
166 ospf6_lsdb_remove_all (oi
->lsdb
);
167 ospf6_lsdb_remove_all (oi
->lsupdate_list
);
168 ospf6_lsdb_remove_all (oi
->lsack_list
);
170 ospf6_lsdb_delete (oi
->lsdb
);
171 ospf6_lsdb_delete (oi
->lsdb_self
);
173 ospf6_lsdb_delete (oi
->lsupdate_list
);
174 ospf6_lsdb_delete (oi
->lsack_list
);
176 ospf6_route_table_delete (oi
->route_connected
);
179 oi
->interface
->info
= NULL
;
183 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
185 XFREE (MTYPE_OSPF6_IF
, oi
);
189 ospf6_interface_enable (struct ospf6_interface
*oi
)
191 UNSET_FLAG (oi
->flag
, OSPF6_INTERFACE_DISABLE
);
193 oi
->thread_send_hello
=
194 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
198 ospf6_interface_disable (struct ospf6_interface
*oi
)
200 struct listnode
*node
, *nnode
;
201 struct ospf6_neighbor
*on
;
203 SET_FLAG (oi
->flag
, OSPF6_INTERFACE_DISABLE
);
205 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
206 ospf6_neighbor_delete (on
);
208 list_delete_all_node (oi
->neighbor_list
);
210 ospf6_lsdb_remove_all (oi
->lsdb
);
211 ospf6_lsdb_remove_all (oi
->lsupdate_list
);
212 ospf6_lsdb_remove_all (oi
->lsack_list
);
214 THREAD_OFF (oi
->thread_send_hello
);
215 THREAD_OFF (oi
->thread_send_lsupdate
);
216 THREAD_OFF (oi
->thread_send_lsack
);
219 static struct in6_addr
*
220 ospf6_interface_get_linklocal_address (struct interface
*ifp
)
224 struct in6_addr
*l
= (struct in6_addr
*) NULL
;
226 /* for each connected address */
227 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, n
, c
))
229 /* if family not AF_INET6, ignore */
230 if (c
->address
->family
!= AF_INET6
)
233 /* linklocal scope check */
234 if (IN6_IS_ADDR_LINKLOCAL (&c
->address
->u
.prefix6
))
235 l
= &c
->address
->u
.prefix6
;
241 ospf6_interface_if_add (struct interface
*ifp
)
243 struct ospf6_interface
*oi
;
244 unsigned int iobuflen
;
246 oi
= (struct ospf6_interface
*) ifp
->info
;
250 /* Try to adjust I/O buffer size with IfMtu */
252 oi
->ifmtu
= ifp
->mtu6
;
253 iobuflen
= ospf6_iobuf_size (ifp
->mtu6
);
254 if (oi
->ifmtu
> iobuflen
)
256 if (IS_OSPF6_DEBUG_INTERFACE
)
257 zlog_debug ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
258 ifp
->name
, iobuflen
);
259 oi
->ifmtu
= iobuflen
;
262 /* interface start */
264 thread_add_event (master
, interface_up
, oi
, 0);
268 ospf6_interface_if_del (struct interface
*ifp
)
270 struct ospf6_interface
*oi
;
272 oi
= (struct ospf6_interface
*) ifp
->info
;
278 thread_execute (master
, interface_down
, oi
, 0);
280 listnode_delete (oi
->area
->if_list
, oi
);
281 oi
->area
= (struct ospf6_area
*) NULL
;
284 oi
->interface
= NULL
;
287 ospf6_interface_delete (oi
);
291 ospf6_interface_state_update (struct interface
*ifp
)
293 struct ospf6_interface
*oi
;
295 oi
= (struct ospf6_interface
*) ifp
->info
;
298 if (oi
->area
== NULL
)
302 thread_add_event (master
, interface_up
, oi
, 0);
304 thread_add_event (master
, interface_down
, oi
, 0);
310 ospf6_interface_connected_route_update (struct interface
*ifp
)
312 struct ospf6_interface
*oi
;
313 struct ospf6_route
*route
;
315 struct listnode
*node
, *nnode
;
317 oi
= (struct ospf6_interface
*) ifp
->info
;
321 /* reset linklocal pointer */
322 oi
->linklocal_addr
= ospf6_interface_get_linklocal_address (ifp
);
324 /* if area is null, do not make connected-route list */
325 if (oi
->area
== NULL
)
328 /* update "route to advertise" interface route table */
329 ospf6_route_remove_all (oi
->route_connected
);
331 for (ALL_LIST_ELEMENTS (oi
->interface
->connected
, node
, nnode
, c
))
333 if (c
->address
->family
!= AF_INET6
)
336 CONTINUE_IF_ADDRESS_LINKLOCAL (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
337 CONTINUE_IF_ADDRESS_UNSPECIFIED (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
338 CONTINUE_IF_ADDRESS_LOOPBACK (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
339 CONTINUE_IF_ADDRESS_V4COMPAT (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
340 CONTINUE_IF_ADDRESS_V4MAPPED (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
345 struct prefix_list
*plist
;
346 enum prefix_list_type ret
;
349 prefix2str (c
->address
, buf
, sizeof (buf
));
350 plist
= prefix_list_lookup (AFI_IP6
, oi
->plist_name
);
351 ret
= prefix_list_apply (plist
, (void *) c
->address
);
352 if (ret
== PREFIX_DENY
)
354 if (IS_OSPF6_DEBUG_INTERFACE
)
355 zlog_debug ("%s on %s filtered by prefix-list %s ",
356 buf
, oi
->interface
->name
, oi
->plist_name
);
361 route
= ospf6_route_create ();
362 memcpy (&route
->prefix
, c
->address
, sizeof (struct prefix
));
363 apply_mask (&route
->prefix
);
364 route
->type
= OSPF6_DEST_TYPE_NETWORK
;
365 route
->path
.area_id
= oi
->area
->area_id
;
366 route
->path
.type
= OSPF6_PATH_TYPE_INTRA
;
367 route
->path
.cost
= oi
->cost
;
368 route
->nexthop
[0].ifindex
= oi
->interface
->ifindex
;
369 inet_pton (AF_INET6
, "::1", &route
->nexthop
[0].address
);
370 ospf6_route_add (route
, oi
->route_connected
);
373 /* create new Link-LSA */
374 OSPF6_LINK_LSA_SCHEDULE (oi
);
375 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
376 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
380 ospf6_interface_state_change (u_char next_state
, struct ospf6_interface
*oi
)
384 prev_state
= oi
->state
;
385 oi
->state
= next_state
;
387 if (prev_state
== next_state
)
391 if (IS_OSPF6_DEBUG_INTERFACE
)
393 zlog_debug ("Interface state change %s: %s -> %s", oi
->interface
->name
,
394 ospf6_interface_state_str
[prev_state
],
395 ospf6_interface_state_str
[next_state
]);
398 if ((prev_state
== OSPF6_INTERFACE_DR
||
399 prev_state
== OSPF6_INTERFACE_BDR
) &&
400 (next_state
!= OSPF6_INTERFACE_DR
&&
401 next_state
!= OSPF6_INTERFACE_BDR
))
402 ospf6_leave_alldrouters (oi
->interface
->ifindex
);
403 if ((prev_state
!= OSPF6_INTERFACE_DR
&&
404 prev_state
!= OSPF6_INTERFACE_BDR
) &&
405 (next_state
== OSPF6_INTERFACE_DR
||
406 next_state
== OSPF6_INTERFACE_BDR
))
407 ospf6_join_alldrouters (oi
->interface
->ifindex
);
409 OSPF6_ROUTER_LSA_SCHEDULE (oi
->area
);
410 if (next_state
== OSPF6_INTERFACE_DOWN
)
412 OSPF6_NETWORK_LSA_EXECUTE (oi
);
413 OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT (oi
);
414 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
416 else if (prev_state
== OSPF6_INTERFACE_DR
||
417 next_state
== OSPF6_INTERFACE_DR
)
419 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
420 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
421 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
426 /* DR Election, RFC2328 section 9.4 */
428 #define IS_ELIGIBLE(n) \
429 ((n)->state >= OSPF6_NEIGHBOR_TWOWAY && (n)->priority != 0)
431 static struct ospf6_neighbor
*
432 better_bdrouter (struct ospf6_neighbor
*a
, struct ospf6_neighbor
*b
)
434 if ((a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
== a
->router_id
) &&
435 (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
== b
->router_id
))
437 else if (a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
== a
->router_id
)
439 else if (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
== b
->router_id
)
442 if (a
->bdrouter
== a
->router_id
&& b
->bdrouter
!= b
->router_id
)
444 if (a
->bdrouter
!= a
->router_id
&& b
->bdrouter
== b
->router_id
)
447 if (a
->priority
> b
->priority
)
449 if (a
->priority
< b
->priority
)
452 if (ntohl (a
->router_id
) > ntohl (b
->router_id
))
454 if (ntohl (a
->router_id
) < ntohl (b
->router_id
))
457 zlog_warn ("Router-ID duplicate ?");
461 static struct ospf6_neighbor
*
462 better_drouter (struct ospf6_neighbor
*a
, struct ospf6_neighbor
*b
)
464 if ((a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
!= a
->router_id
) &&
465 (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
!= b
->router_id
))
467 else if (a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
!= a
->router_id
)
469 else if (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
!= b
->router_id
)
472 if (a
->drouter
== a
->router_id
&& b
->drouter
!= b
->router_id
)
474 if (a
->drouter
!= a
->router_id
&& b
->drouter
== b
->router_id
)
477 if (a
->priority
> b
->priority
)
479 if (a
->priority
< b
->priority
)
482 if (ntohl (a
->router_id
) > ntohl (b
->router_id
))
484 if (ntohl (a
->router_id
) < ntohl (b
->router_id
))
487 zlog_warn ("Router-ID duplicate ?");
492 dr_election (struct ospf6_interface
*oi
)
494 struct listnode
*node
, *nnode
;
495 struct ospf6_neighbor
*on
, *drouter
, *bdrouter
, myself
;
496 struct ospf6_neighbor
*best_drouter
, *best_bdrouter
;
497 u_char next_state
= 0;
499 drouter
= bdrouter
= NULL
;
500 best_drouter
= best_bdrouter
= NULL
;
502 /* pseudo neighbor myself, including noting current DR/BDR (1) */
503 memset (&myself
, 0, sizeof (myself
));
504 inet_ntop (AF_INET
, &oi
->area
->ospf6
->router_id
, myself
.name
,
505 sizeof (myself
.name
));
506 myself
.state
= OSPF6_NEIGHBOR_TWOWAY
;
507 myself
.drouter
= oi
->drouter
;
508 myself
.bdrouter
= oi
->bdrouter
;
509 myself
.priority
= oi
->priority
;
510 myself
.router_id
= oi
->area
->ospf6
->router_id
;
512 /* Electing BDR (2) */
513 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
514 bdrouter
= better_bdrouter (bdrouter
, on
);
516 best_bdrouter
= bdrouter
;
517 bdrouter
= better_bdrouter (best_bdrouter
, &myself
);
519 /* Electing DR (3) */
520 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
521 drouter
= better_drouter (drouter
, on
);
523 best_drouter
= drouter
;
524 drouter
= better_drouter (best_drouter
, &myself
);
528 /* the router itself is newly/no longer DR/BDR (4) */
529 if ((drouter
== &myself
&& myself
.drouter
!= myself
.router_id
) ||
530 (drouter
!= &myself
&& myself
.drouter
== myself
.router_id
) ||
531 (bdrouter
== &myself
&& myself
.bdrouter
!= myself
.router_id
) ||
532 (bdrouter
!= &myself
&& myself
.bdrouter
== myself
.router_id
))
534 myself
.drouter
= (drouter
? drouter
->router_id
: htonl (0));
535 myself
.bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl (0));
537 /* compatible to Electing BDR (2) */
538 bdrouter
= better_bdrouter (best_bdrouter
, &myself
);
540 /* compatible to Electing DR (3) */
541 drouter
= better_drouter (best_drouter
, &myself
);
546 /* Set interface state accordingly (5) */
547 if (drouter
&& drouter
== &myself
)
548 next_state
= OSPF6_INTERFACE_DR
;
549 else if (bdrouter
&& bdrouter
== &myself
)
550 next_state
= OSPF6_INTERFACE_BDR
;
552 next_state
= OSPF6_INTERFACE_DROTHER
;
554 /* If NBMA, schedule Start for each neighbor having priority of 0 (6) */
557 /* If DR or BDR change, invoke AdjOK? for each neighbor (7) */
558 /* RFC 2328 section 12.4. Originating LSAs (3) will be handled
559 accordingly after AdjOK */
560 if (oi
->drouter
!= (drouter
? drouter
->router_id
: htonl (0)) ||
561 oi
->bdrouter
!= (bdrouter
? bdrouter
->router_id
: htonl (0)))
563 if (IS_OSPF6_DEBUG_INTERFACE
)
564 zlog_debug ("DR Election on %s: DR: %s BDR: %s", oi
->interface
->name
,
565 (drouter
? drouter
->name
: "0.0.0.0"),
566 (bdrouter
? bdrouter
->name
: "0.0.0.0"));
568 for (ALL_LIST_ELEMENTS_RO (oi
->neighbor_list
, node
, on
))
570 if (on
->state
< OSPF6_NEIGHBOR_TWOWAY
)
572 /* Schedule AdjOK. */
573 thread_add_event (master
, adj_ok
, on
, 0);
577 oi
->drouter
= (drouter
? drouter
->router_id
: htonl (0));
578 oi
->bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl (0));
583 /* Interface State Machine */
585 interface_up (struct thread
*thread
)
587 struct ospf6_interface
*oi
;
589 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
590 assert (oi
&& oi
->interface
);
592 if (IS_OSPF6_DEBUG_INTERFACE
)
593 zlog_debug ("Interface Event %s: [InterfaceUp]",
594 oi
->interface
->name
);
596 /* check physical interface is up */
597 if (! if_is_up (oi
->interface
))
599 if (IS_OSPF6_DEBUG_INTERFACE
)
600 zlog_debug ("Interface %s is down, can't execute [InterfaceUp]",
601 oi
->interface
->name
);
605 /* if already enabled, do nothing */
606 if (oi
->state
> OSPF6_INTERFACE_DOWN
)
608 if (IS_OSPF6_DEBUG_INTERFACE
)
609 zlog_debug ("Interface %s already enabled",
610 oi
->interface
->name
);
614 /* Join AllSPFRouters */
615 ospf6_join_allspfrouters (oi
->interface
->ifindex
);
617 /* Update interface route */
618 ospf6_interface_connected_route_update (oi
->interface
);
621 if (! CHECK_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
))
622 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
624 /* decide next interface state */
625 if (if_is_pointopoint (oi
->interface
))
626 ospf6_interface_state_change (OSPF6_INTERFACE_POINTTOPOINT
, oi
);
627 else if (oi
->priority
== 0)
628 ospf6_interface_state_change (OSPF6_INTERFACE_DROTHER
, oi
);
631 ospf6_interface_state_change (OSPF6_INTERFACE_WAITING
, oi
);
632 thread_add_timer (master
, wait_timer
, oi
, oi
->dead_interval
);
639 wait_timer (struct thread
*thread
)
641 struct ospf6_interface
*oi
;
643 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
644 assert (oi
&& oi
->interface
);
646 if (IS_OSPF6_DEBUG_INTERFACE
)
647 zlog_debug ("Interface Event %s: [WaitTimer]",
648 oi
->interface
->name
);
650 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
651 ospf6_interface_state_change (dr_election (oi
), oi
);
657 backup_seen (struct thread
*thread
)
659 struct ospf6_interface
*oi
;
661 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
662 assert (oi
&& oi
->interface
);
664 if (IS_OSPF6_DEBUG_INTERFACE
)
665 zlog_debug ("Interface Event %s: [BackupSeen]",
666 oi
->interface
->name
);
668 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
669 ospf6_interface_state_change (dr_election (oi
), oi
);
675 neighbor_change (struct thread
*thread
)
677 struct ospf6_interface
*oi
;
679 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
680 assert (oi
&& oi
->interface
);
682 if (IS_OSPF6_DEBUG_INTERFACE
)
683 zlog_debug ("Interface Event %s: [NeighborChange]",
684 oi
->interface
->name
);
686 if (oi
->state
== OSPF6_INTERFACE_DROTHER
||
687 oi
->state
== OSPF6_INTERFACE_BDR
||
688 oi
->state
== OSPF6_INTERFACE_DR
)
689 ospf6_interface_state_change (dr_election (oi
), oi
);
695 interface_down (struct thread
*thread
)
697 struct ospf6_interface
*oi
;
698 struct listnode
*node
, *nnode
;
699 struct ospf6_neighbor
*on
;
701 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
702 assert (oi
&& oi
->interface
);
704 if (IS_OSPF6_DEBUG_INTERFACE
)
705 zlog_debug ("Interface Event %s: [InterfaceDown]",
706 oi
->interface
->name
);
708 /* Leave AllSPFRouters */
709 if (oi
->state
> OSPF6_INTERFACE_DOWN
)
710 ospf6_leave_allspfrouters (oi
->interface
->ifindex
);
712 ospf6_interface_state_change (OSPF6_INTERFACE_DOWN
, oi
);
714 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
715 ospf6_neighbor_delete (on
);
717 list_delete_all_node (oi
->neighbor_list
);
723 /* show specified interface structure */
725 ospf6_interface_show (struct vty
*vty
, struct interface
*ifp
)
727 struct ospf6_interface
*oi
;
731 char strbuf
[64], drouter
[32], bdrouter
[32];
732 const char *updown
[3] = {"down", "up", NULL
};
734 struct timeval res
, now
;
736 struct ospf6_lsa
*lsa
;
738 /* check physical interface type */
739 if (if_is_loopback (ifp
))
741 else if (if_is_broadcast (ifp
))
743 else if (if_is_pointopoint (ifp
))
744 type
= "POINTOPOINT";
748 vty_out (vty
, "%s is %s, type %s%s",
749 ifp
->name
, updown
[if_is_up (ifp
)], type
,
751 vty_out (vty
, " Interface ID: %d%s", ifp
->ifindex
, VNL
);
753 if (ifp
->info
== NULL
)
755 vty_out (vty
, " OSPF not enabled on this interface%s", VNL
);
759 oi
= (struct ospf6_interface
*) ifp
->info
;
761 vty_out (vty
, " Internet Address:%s", VNL
);
763 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, i
, c
))
766 prefix2str (p
, strbuf
, sizeof (strbuf
));
770 vty_out (vty
, " inet : %s%s", strbuf
,
774 vty_out (vty
, " inet6: %s%s", strbuf
,
778 vty_out (vty
, " ??? : %s%s", strbuf
,
786 vty_out (vty
, " Instance ID %d, Interface MTU %d (autodetect: %d)%s",
787 oi
->instance_id
, oi
->ifmtu
, ifp
->mtu6
, VNL
);
788 vty_out (vty
, " MTU mismatch detection: %s%s", oi
->mtu_ignore
?
789 "disabled" : "enabled", VNL
);
790 inet_ntop (AF_INET
, &oi
->area
->area_id
,
791 strbuf
, sizeof (strbuf
));
792 vty_out (vty
, " Area ID %s, Cost %hu%s", strbuf
, oi
->cost
,
796 vty_out (vty
, " Not Attached to Area%s", VNL
);
798 vty_out (vty
, " State %s, Transmit Delay %d sec, Priority %d%s",
799 ospf6_interface_state_str
[oi
->state
],
800 oi
->transdelay
, oi
->priority
,
802 vty_out (vty
, " Timer intervals configured:%s", VNL
);
803 vty_out (vty
, " Hello %d, Dead %d, Retransmit %d%s",
804 oi
->hello_interval
, oi
->dead_interval
, oi
->rxmt_interval
,
807 inet_ntop (AF_INET
, &oi
->drouter
, drouter
, sizeof (drouter
));
808 inet_ntop (AF_INET
, &oi
->bdrouter
, bdrouter
, sizeof (bdrouter
));
809 vty_out (vty
, " DR: %s BDR: %s%s", drouter
, bdrouter
, VNL
);
811 vty_out (vty
, " Number of I/F scoped LSAs is %u%s",
812 oi
->lsdb
->count
, VNL
);
814 quagga_gettime (QUAGGA_CLK_MONOTONIC
, &now
);
817 if (oi
->thread_send_lsupdate
)
818 timersub (&oi
->thread_send_lsupdate
->u
.sands
, &now
, &res
);
819 timerstring (&res
, duration
, sizeof (duration
));
820 vty_out (vty
, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s",
821 oi
->lsupdate_list
->count
, duration
,
822 (oi
->thread_send_lsupdate
? "on" : "off"),
824 for (lsa
= ospf6_lsdb_head (oi
->lsupdate_list
); lsa
;
825 lsa
= ospf6_lsdb_next (lsa
))
826 vty_out (vty
, " %s%s", lsa
->name
, VNL
);
829 if (oi
->thread_send_lsack
)
830 timersub (&oi
->thread_send_lsack
->u
.sands
, &now
, &res
);
831 timerstring (&res
, duration
, sizeof (duration
));
832 vty_out (vty
, " %d Pending LSAs for LSAck in Time %s [thread %s]%s",
833 oi
->lsack_list
->count
, duration
,
834 (oi
->thread_send_lsack
? "on" : "off"),
836 for (lsa
= ospf6_lsdb_head (oi
->lsack_list
); lsa
;
837 lsa
= ospf6_lsdb_next (lsa
))
838 vty_out (vty
, " %s%s", lsa
->name
, VNL
);
844 DEFUN (show_ipv6_ospf6_interface
,
845 show_ipv6_ospf6_interface_ifname_cmd
,
846 "show ipv6 ospf6 interface IFNAME",
854 struct interface
*ifp
;
859 ifp
= if_lookup_by_name (argv
[0]);
862 vty_out (vty
, "No such Interface: %s%s", argv
[0],
866 ospf6_interface_show (vty
, ifp
);
870 for (ALL_LIST_ELEMENTS_RO (iflist
, i
, ifp
))
871 ospf6_interface_show (vty
, ifp
);
877 ALIAS (show_ipv6_ospf6_interface
,
878 show_ipv6_ospf6_interface_cmd
,
879 "show ipv6 ospf6 interface",
886 DEFUN (show_ipv6_ospf6_interface_ifname_prefix
,
887 show_ipv6_ospf6_interface_ifname_prefix_cmd
,
888 "show ipv6 ospf6 interface IFNAME prefix",
894 "Display connected prefixes to advertise\n"
897 struct interface
*ifp
;
898 struct ospf6_interface
*oi
;
900 ifp
= if_lookup_by_name (argv
[0]);
903 vty_out (vty
, "No such Interface: %s%s", argv
[0], VNL
);
910 vty_out (vty
, "OSPFv3 is not enabled on %s%s", argv
[0], VNL
);
916 ospf6_route_table_show (vty
, argc
, argv
, oi
->route_connected
);
921 ALIAS (show_ipv6_ospf6_interface_ifname_prefix
,
922 show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
,
923 "show ipv6 ospf6 interface IFNAME prefix (X:X::X:X|X:X::X:X/M|detail)",
929 "Display connected prefixes to advertise\n"
930 OSPF6_ROUTE_ADDRESS_STR
931 OSPF6_ROUTE_PREFIX_STR
932 "Dispaly details of the prefixes\n"
935 ALIAS (show_ipv6_ospf6_interface_ifname_prefix
,
936 show_ipv6_ospf6_interface_ifname_prefix_match_cmd
,
937 "show ipv6 ospf6 interface IFNAME prefix X:X::X:X/M (match|detail)",
943 "Display connected prefixes to advertise\n"
944 OSPF6_ROUTE_PREFIX_STR
945 OSPF6_ROUTE_MATCH_STR
946 "Dispaly details of the prefixes\n"
949 DEFUN (show_ipv6_ospf6_interface_prefix
,
950 show_ipv6_ospf6_interface_prefix_cmd
,
951 "show ipv6 ospf6 interface prefix",
956 "Display connected prefixes to advertise\n"
960 struct ospf6_interface
*oi
;
961 struct interface
*ifp
;
963 for (ALL_LIST_ELEMENTS_RO (iflist
, i
, ifp
))
965 oi
= (struct ospf6_interface
*) ifp
->info
;
969 ospf6_route_table_show (vty
, argc
, argv
, oi
->route_connected
);
975 ALIAS (show_ipv6_ospf6_interface_prefix
,
976 show_ipv6_ospf6_interface_prefix_detail_cmd
,
977 "show ipv6 ospf6 interface prefix (X:X::X:X|X:X::X:X/M|detail)",
982 "Display connected prefixes to advertise\n"
983 OSPF6_ROUTE_ADDRESS_STR
984 OSPF6_ROUTE_PREFIX_STR
985 "Dispaly details of the prefixes\n"
988 ALIAS (show_ipv6_ospf6_interface_prefix
,
989 show_ipv6_ospf6_interface_prefix_match_cmd
,
990 "show ipv6 ospf6 interface prefix X:X::X:X/M (match|detail)",
995 "Display connected prefixes to advertise\n"
996 OSPF6_ROUTE_PREFIX_STR
997 OSPF6_ROUTE_MATCH_STR
998 "Dispaly details of the prefixes\n"
1002 /* interface variable set command */
1003 DEFUN (ipv6_ospf6_ifmtu
,
1004 ipv6_ospf6_ifmtu_cmd
,
1005 "ipv6 ospf6 ifmtu <1-65535>",
1009 "OSPFv3 Interface MTU\n"
1012 struct ospf6_interface
*oi
;
1013 struct interface
*ifp
;
1014 unsigned int ifmtu
, iobuflen
;
1015 struct listnode
*node
, *nnode
;
1016 struct ospf6_neighbor
*on
;
1018 ifp
= (struct interface
*) vty
->index
;
1021 oi
= (struct ospf6_interface
*) ifp
->info
;
1023 oi
= ospf6_interface_create (ifp
);
1026 ifmtu
= strtol (argv
[0], NULL
, 10);
1028 if (oi
->ifmtu
== ifmtu
)
1031 if (ifp
->mtu6
!= 0 && ifp
->mtu6
< ifmtu
)
1033 vty_out (vty
, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)%s",
1034 ifp
->name
, ifp
->mtu6
, VNL
);
1038 if (oi
->ifmtu
< ifmtu
)
1040 iobuflen
= ospf6_iobuf_size (ifmtu
);
1041 if (iobuflen
< ifmtu
)
1043 vty_out (vty
, "%s's ifmtu is adjusted to I/O buffer size (%d).%s",
1044 ifp
->name
, iobuflen
, VNL
);
1045 oi
->ifmtu
= iobuflen
;
1053 /* re-establish adjacencies */
1054 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
1056 THREAD_OFF (on
->inactivity_timer
);
1057 thread_add_event (master
, inactivity_timer
, on
, 0);
1063 DEFUN (no_ipv6_ospf6_ifmtu
,
1064 no_ipv6_ospf6_ifmtu_cmd
,
1065 "no ipv6 ospf6 ifmtu",
1072 struct ospf6_interface
*oi
;
1073 struct interface
*ifp
;
1074 unsigned int iobuflen
;
1075 struct listnode
*node
, *nnode
;
1076 struct ospf6_neighbor
*on
;
1078 ifp
= (struct interface
*) vty
->index
;
1081 oi
= (struct ospf6_interface
*) ifp
->info
;
1083 oi
= ospf6_interface_create (ifp
);
1086 if (oi
->ifmtu
< ifp
->mtu
)
1088 iobuflen
= ospf6_iobuf_size (ifp
->mtu
);
1089 if (iobuflen
< ifp
->mtu
)
1091 vty_out (vty
, "%s's ifmtu is adjusted to I/O buffer size (%d).%s",
1092 ifp
->name
, iobuflen
, VNL
);
1093 oi
->ifmtu
= iobuflen
;
1096 oi
->ifmtu
= ifp
->mtu
;
1099 oi
->ifmtu
= ifp
->mtu
;
1101 /* re-establish adjacencies */
1102 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
1104 THREAD_OFF (on
->inactivity_timer
);
1105 thread_add_event (master
, inactivity_timer
, on
, 0);
1111 DEFUN (ipv6_ospf6_cost
,
1112 ipv6_ospf6_cost_cmd
,
1113 "ipv6 ospf6 cost <1-65535>",
1117 "Outgoing metric of this interface\n"
1120 struct ospf6_interface
*oi
;
1121 struct interface
*ifp
;
1122 unsigned long int lcost
;
1124 ifp
= (struct interface
*) vty
->index
;
1127 oi
= (struct ospf6_interface
*) ifp
->info
;
1129 oi
= ospf6_interface_create (ifp
);
1132 lcost
= strtol (argv
[0], NULL
, 10);
1134 if (lcost
> UINT32_MAX
)
1136 vty_out (vty
, "Cost %ld is out of range%s", lcost
, VNL
);
1140 if (oi
->cost
== lcost
)
1145 /* update cost held in route_connected list in ospf6_interface */
1146 ospf6_interface_connected_route_update (oi
->interface
);
1148 /* execute LSA hooks */
1151 OSPF6_LINK_LSA_SCHEDULE (oi
);
1152 OSPF6_ROUTER_LSA_SCHEDULE (oi
->area
);
1153 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1154 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1155 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1161 DEFUN (ipv6_ospf6_hellointerval
,
1162 ipv6_ospf6_hellointerval_cmd
,
1163 "ipv6 ospf6 hello-interval <1-65535>",
1166 "Interval time of Hello packets\n"
1170 struct ospf6_interface
*oi
;
1171 struct interface
*ifp
;
1173 ifp
= (struct interface
*) vty
->index
;
1176 oi
= (struct ospf6_interface
*) ifp
->info
;
1178 oi
= ospf6_interface_create (ifp
);
1181 oi
->hello_interval
= strtol (argv
[0], NULL
, 10);
1185 /* interface variable set command */
1186 DEFUN (ipv6_ospf6_deadinterval
,
1187 ipv6_ospf6_deadinterval_cmd
,
1188 "ipv6 ospf6 dead-interval <1-65535>",
1191 "Interval time after which a neighbor is declared down\n"
1195 struct ospf6_interface
*oi
;
1196 struct interface
*ifp
;
1198 ifp
= (struct interface
*) vty
->index
;
1201 oi
= (struct ospf6_interface
*) ifp
->info
;
1203 oi
= ospf6_interface_create (ifp
);
1206 oi
->dead_interval
= strtol (argv
[0], NULL
, 10);
1210 /* interface variable set command */
1211 DEFUN (ipv6_ospf6_transmitdelay
,
1212 ipv6_ospf6_transmitdelay_cmd
,
1213 "ipv6 ospf6 transmit-delay <1-3600>",
1216 "Transmit delay of this interface\n"
1220 struct ospf6_interface
*oi
;
1221 struct interface
*ifp
;
1223 ifp
= (struct interface
*) vty
->index
;
1226 oi
= (struct ospf6_interface
*) ifp
->info
;
1228 oi
= ospf6_interface_create (ifp
);
1231 oi
->transdelay
= strtol (argv
[0], NULL
, 10);
1235 /* interface variable set command */
1236 DEFUN (ipv6_ospf6_retransmitinterval
,
1237 ipv6_ospf6_retransmitinterval_cmd
,
1238 "ipv6 ospf6 retransmit-interval <1-65535>",
1241 "Time between retransmitting lost link state advertisements\n"
1245 struct ospf6_interface
*oi
;
1246 struct interface
*ifp
;
1248 ifp
= (struct interface
*) vty
->index
;
1251 oi
= (struct ospf6_interface
*) ifp
->info
;
1253 oi
= ospf6_interface_create (ifp
);
1256 oi
->rxmt_interval
= strtol (argv
[0], NULL
, 10);
1260 /* interface variable set command */
1261 DEFUN (ipv6_ospf6_priority
,
1262 ipv6_ospf6_priority_cmd
,
1263 "ipv6 ospf6 priority <0-255>",
1270 struct ospf6_interface
*oi
;
1271 struct interface
*ifp
;
1273 ifp
= (struct interface
*) vty
->index
;
1276 oi
= (struct ospf6_interface
*) ifp
->info
;
1278 oi
= ospf6_interface_create (ifp
);
1281 oi
->priority
= strtol (argv
[0], NULL
, 10);
1284 ospf6_interface_state_change (dr_election (oi
), oi
);
1289 DEFUN (ipv6_ospf6_instance
,
1290 ipv6_ospf6_instance_cmd
,
1291 "ipv6 ospf6 instance-id <0-255>",
1294 "Instance ID for this interface\n"
1295 "Instance ID value\n"
1298 struct ospf6_interface
*oi
;
1299 struct interface
*ifp
;
1301 ifp
= (struct interface
*)vty
->index
;
1304 oi
= (struct ospf6_interface
*)ifp
->info
;
1306 oi
= ospf6_interface_create (ifp
);
1309 oi
->instance_id
= strtol (argv
[0], NULL
, 10);
1313 DEFUN (ipv6_ospf6_passive
,
1314 ipv6_ospf6_passive_cmd
,
1315 "ipv6 ospf6 passive",
1318 "passive interface, No adjacency will be formed on this interface\n"
1321 struct ospf6_interface
*oi
;
1322 struct interface
*ifp
;
1323 struct listnode
*node
, *nnode
;
1324 struct ospf6_neighbor
*on
;
1326 ifp
= (struct interface
*) vty
->index
;
1329 oi
= (struct ospf6_interface
*) ifp
->info
;
1331 oi
= ospf6_interface_create (ifp
);
1334 SET_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1335 THREAD_OFF (oi
->thread_send_hello
);
1337 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
1339 THREAD_OFF (on
->inactivity_timer
);
1340 thread_add_event (master
, inactivity_timer
, on
, 0);
1346 DEFUN (no_ipv6_ospf6_passive
,
1347 no_ipv6_ospf6_passive_cmd
,
1348 "no ipv6 ospf6 passive",
1352 "passive interface: No Adjacency will be formed on this I/F\n"
1355 struct ospf6_interface
*oi
;
1356 struct interface
*ifp
;
1358 ifp
= (struct interface
*) vty
->index
;
1361 oi
= (struct ospf6_interface
*) ifp
->info
;
1363 oi
= ospf6_interface_create (ifp
);
1366 UNSET_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1367 THREAD_OFF (oi
->thread_send_hello
);
1368 oi
->thread_send_hello
=
1369 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
1374 DEFUN (ipv6_ospf6_mtu_ignore
,
1375 ipv6_ospf6_mtu_ignore_cmd
,
1376 "ipv6 ospf6 mtu-ignore",
1379 "Ignore MTU mismatch on this interface\n"
1382 struct ospf6_interface
*oi
;
1383 struct interface
*ifp
;
1385 ifp
= (struct interface
*) vty
->index
;
1388 oi
= (struct ospf6_interface
*) ifp
->info
;
1390 oi
= ospf6_interface_create (ifp
);
1398 DEFUN (no_ipv6_ospf6_mtu_ignore
,
1399 no_ipv6_ospf6_mtu_ignore_cmd
,
1400 "no ipv6 ospf6 mtu-ignore",
1404 "Ignore MTU mismatch on this interface\n"
1407 struct ospf6_interface
*oi
;
1408 struct interface
*ifp
;
1410 ifp
= (struct interface
*) vty
->index
;
1413 oi
= (struct ospf6_interface
*) ifp
->info
;
1415 oi
= ospf6_interface_create (ifp
);
1423 DEFUN (ipv6_ospf6_advertise_prefix_list
,
1424 ipv6_ospf6_advertise_prefix_list_cmd
,
1425 "ipv6 ospf6 advertise prefix-list WORD",
1428 "Advertising options\n"
1429 "Filter prefix using prefix-list\n"
1430 "Prefix list name\n"
1433 struct ospf6_interface
*oi
;
1434 struct interface
*ifp
;
1436 ifp
= (struct interface
*) vty
->index
;
1439 oi
= (struct ospf6_interface
*) ifp
->info
;
1441 oi
= ospf6_interface_create (ifp
);
1445 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
1446 oi
->plist_name
= XSTRDUP (MTYPE_PREFIX_LIST_STR
, argv
[0]);
1448 ospf6_interface_connected_route_update (oi
->interface
);
1452 OSPF6_LINK_LSA_SCHEDULE (oi
);
1453 if (oi
->state
== OSPF6_INTERFACE_DR
)
1455 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1456 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1458 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1464 DEFUN (no_ipv6_ospf6_advertise_prefix_list
,
1465 no_ipv6_ospf6_advertise_prefix_list_cmd
,
1466 "no ipv6 ospf6 advertise prefix-list",
1470 "Advertising options\n"
1471 "Filter prefix using prefix-list\n"
1474 struct ospf6_interface
*oi
;
1475 struct interface
*ifp
;
1477 ifp
= (struct interface
*) vty
->index
;
1480 oi
= (struct ospf6_interface
*) ifp
->info
;
1482 oi
= ospf6_interface_create (ifp
);
1487 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
1488 oi
->plist_name
= NULL
;
1491 ospf6_interface_connected_route_update (oi
->interface
);
1495 OSPF6_LINK_LSA_SCHEDULE (oi
);
1496 if (oi
->state
== OSPF6_INTERFACE_DR
)
1498 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1499 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1501 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1508 config_write_ospf6_interface (struct vty
*vty
)
1511 struct ospf6_interface
*oi
;
1512 struct interface
*ifp
;
1514 for (ALL_LIST_ELEMENTS_RO (iflist
, i
, ifp
))
1516 oi
= (struct ospf6_interface
*) ifp
->info
;
1520 vty_out (vty
, "interface %s%s",
1521 oi
->interface
->name
, VNL
);
1524 vty_out (vty
, " description %s%s", ifp
->desc
, VNL
);
1526 if (ifp
->mtu6
!= oi
->ifmtu
)
1527 vty_out (vty
, " ipv6 ospf6 ifmtu %d%s", oi
->ifmtu
, VNL
);
1528 vty_out (vty
, " ipv6 ospf6 cost %d%s",
1530 vty_out (vty
, " ipv6 ospf6 hello-interval %d%s",
1531 oi
->hello_interval
, VNL
);
1532 vty_out (vty
, " ipv6 ospf6 dead-interval %d%s",
1533 oi
->dead_interval
, VNL
);
1534 vty_out (vty
, " ipv6 ospf6 retransmit-interval %d%s",
1535 oi
->rxmt_interval
, VNL
);
1536 vty_out (vty
, " ipv6 ospf6 priority %d%s",
1538 vty_out (vty
, " ipv6 ospf6 transmit-delay %d%s",
1539 oi
->transdelay
, VNL
);
1540 vty_out (vty
, " ipv6 ospf6 instance-id %d%s",
1541 oi
->instance_id
, VNL
);
1544 vty_out (vty
, " ipv6 ospf6 advertise prefix-list %s%s",
1545 oi
->plist_name
, VNL
);
1547 if (CHECK_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
))
1548 vty_out (vty
, " ipv6 ospf6 passive%s", VNL
);
1551 vty_out (vty
, " ipv6 ospf6 mtu-ignore%s", VNL
);
1553 vty_out (vty
, "!%s", VNL
);
1558 static struct cmd_node interface_node
=
1566 ospf6_interface_init (void)
1568 /* Install interface node. */
1569 install_node (&interface_node
, config_write_ospf6_interface
);
1571 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_cmd
);
1572 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_cmd
);
1573 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_detail_cmd
);
1574 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_match_cmd
);
1575 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_cmd
);
1576 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_cmd
);
1577 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
);
1578 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd
);
1579 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_cmd
);
1580 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_cmd
);
1581 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_detail_cmd
);
1582 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_match_cmd
);
1583 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_cmd
);
1584 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_cmd
);
1585 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
);
1586 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd
);
1588 install_element (CONFIG_NODE
, &interface_cmd
);
1589 install_default (INTERFACE_NODE
);
1590 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
1591 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
1592 install_element (INTERFACE_NODE
, &ipv6_ospf6_cost_cmd
);
1593 install_element (INTERFACE_NODE
, &ipv6_ospf6_ifmtu_cmd
);
1594 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_ifmtu_cmd
);
1595 install_element (INTERFACE_NODE
, &ipv6_ospf6_deadinterval_cmd
);
1596 install_element (INTERFACE_NODE
, &ipv6_ospf6_hellointerval_cmd
);
1597 install_element (INTERFACE_NODE
, &ipv6_ospf6_priority_cmd
);
1598 install_element (INTERFACE_NODE
, &ipv6_ospf6_retransmitinterval_cmd
);
1599 install_element (INTERFACE_NODE
, &ipv6_ospf6_transmitdelay_cmd
);
1600 install_element (INTERFACE_NODE
, &ipv6_ospf6_instance_cmd
);
1602 install_element (INTERFACE_NODE
, &ipv6_ospf6_passive_cmd
);
1603 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_passive_cmd
);
1605 install_element (INTERFACE_NODE
, &ipv6_ospf6_mtu_ignore_cmd
);
1606 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_mtu_ignore_cmd
);
1608 install_element (INTERFACE_NODE
, &ipv6_ospf6_advertise_prefix_list_cmd
);
1609 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_advertise_prefix_list_cmd
);
1612 DEFUN (debug_ospf6_interface
,
1613 debug_ospf6_interface_cmd
,
1614 "debug ospf6 interface",
1617 "Debug OSPFv3 Interface\n"
1620 OSPF6_DEBUG_INTERFACE_ON ();
1624 DEFUN (no_debug_ospf6_interface
,
1625 no_debug_ospf6_interface_cmd
,
1626 "no debug ospf6 interface",
1630 "Debug OSPFv3 Interface\n"
1633 OSPF6_DEBUG_INTERFACE_OFF ();
1638 config_write_ospf6_debug_interface (struct vty
*vty
)
1640 if (IS_OSPF6_DEBUG_INTERFACE
)
1641 vty_out (vty
, "debug ospf6 interface%s", VNL
);
1646 install_element_ospf6_debug_interface (void)
1648 install_element (ENABLE_NODE
, &debug_ospf6_interface_cmd
);
1649 install_element (ENABLE_NODE
, &no_debug_ospf6_interface_cmd
);
1650 install_element (CONFIG_NODE
, &debug_ospf6_interface_cmd
);
1651 install_element (CONFIG_NODE
, &no_debug_ospf6_interface_cmd
);