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 XMALLOC (MTYPE_OSPF6_IF
, sizeof (struct ospf6_interface
));
102 memset (oi
, 0, sizeof (struct ospf6_interface
));
105 zlog_err ("Can't malloc ospf6_interface for ifindex %d", ifp
->ifindex
);
106 return (struct ospf6_interface
*) NULL
;
109 oi
->area
= (struct ospf6_area
*) NULL
;
110 oi
->neighbor_list
= list_new ();
111 oi
->neighbor_list
->cmp
= ospf6_neighbor_cmp
;
112 oi
->linklocal_addr
= (struct in6_addr
*) NULL
;
117 oi
->hello_interval
= 10;
118 oi
->dead_interval
= 40;
119 oi
->rxmt_interval
= 5;
121 oi
->state
= OSPF6_INTERFACE_DOWN
;
124 /* Try to adjust I/O buffer size with IfMtu */
125 oi
->ifmtu
= ifp
->mtu6
;
126 iobuflen
= ospf6_iobuf_size (ifp
->mtu6
);
127 if (oi
->ifmtu
> iobuflen
)
129 if (IS_OSPF6_DEBUG_INTERFACE
)
130 zlog_debug ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
131 ifp
->name
, iobuflen
);
132 oi
->ifmtu
= iobuflen
;
135 oi
->lsupdate_list
= ospf6_lsdb_create (oi
);
136 oi
->lsack_list
= ospf6_lsdb_create (oi
);
137 oi
->lsdb
= ospf6_lsdb_create (oi
);
138 oi
->lsdb
->hook_add
= ospf6_interface_lsdb_hook
;
139 oi
->lsdb
->hook_remove
= ospf6_interface_lsdb_hook
;
140 oi
->lsdb_self
= ospf6_lsdb_create (oi
);
142 oi
->route_connected
= OSPF6_ROUTE_TABLE_CREATE (INTERFACE
, CONNECTED_ROUTES
);
143 oi
->route_connected
->scope
= oi
;
153 ospf6_interface_delete (struct ospf6_interface
*oi
)
155 struct listnode
*node
, *nnode
;
156 struct ospf6_neighbor
*on
;
158 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
159 ospf6_neighbor_delete (on
);
161 list_delete (oi
->neighbor_list
);
163 THREAD_OFF (oi
->thread_send_hello
);
164 THREAD_OFF (oi
->thread_send_lsupdate
);
165 THREAD_OFF (oi
->thread_send_lsack
);
167 ospf6_lsdb_remove_all (oi
->lsdb
);
168 ospf6_lsdb_remove_all (oi
->lsupdate_list
);
169 ospf6_lsdb_remove_all (oi
->lsack_list
);
171 ospf6_lsdb_delete (oi
->lsdb
);
172 ospf6_lsdb_delete (oi
->lsdb_self
);
174 ospf6_lsdb_delete (oi
->lsupdate_list
);
175 ospf6_lsdb_delete (oi
->lsack_list
);
177 ospf6_route_table_delete (oi
->route_connected
);
180 oi
->interface
->info
= NULL
;
184 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
186 XFREE (MTYPE_OSPF6_IF
, oi
);
190 ospf6_interface_enable (struct ospf6_interface
*oi
)
192 UNSET_FLAG (oi
->flag
, OSPF6_INTERFACE_DISABLE
);
194 oi
->thread_send_hello
=
195 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
199 ospf6_interface_disable (struct ospf6_interface
*oi
)
201 struct listnode
*node
, *nnode
;
202 struct ospf6_neighbor
*on
;
204 SET_FLAG (oi
->flag
, OSPF6_INTERFACE_DISABLE
);
206 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
207 ospf6_neighbor_delete (on
);
209 list_delete_all_node (oi
->neighbor_list
);
211 ospf6_lsdb_remove_all (oi
->lsdb
);
212 ospf6_lsdb_remove_all (oi
->lsupdate_list
);
213 ospf6_lsdb_remove_all (oi
->lsack_list
);
215 THREAD_OFF (oi
->thread_send_hello
);
216 THREAD_OFF (oi
->thread_send_lsupdate
);
217 THREAD_OFF (oi
->thread_send_lsack
);
220 static struct in6_addr
*
221 ospf6_interface_get_linklocal_address (struct interface
*ifp
)
225 struct in6_addr
*l
= (struct in6_addr
*) NULL
;
227 /* for each connected address */
228 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, n
, c
))
230 /* if family not AF_INET6, ignore */
231 if (c
->address
->family
!= AF_INET6
)
234 /* linklocal scope check */
235 if (IN6_IS_ADDR_LINKLOCAL (&c
->address
->u
.prefix6
))
236 l
= &c
->address
->u
.prefix6
;
242 ospf6_interface_if_add (struct interface
*ifp
)
244 struct ospf6_interface
*oi
;
245 unsigned int iobuflen
;
247 oi
= (struct ospf6_interface
*) ifp
->info
;
251 /* Try to adjust I/O buffer size with IfMtu */
253 oi
->ifmtu
= ifp
->mtu6
;
254 iobuflen
= ospf6_iobuf_size (ifp
->mtu6
);
255 if (oi
->ifmtu
> iobuflen
)
257 if (IS_OSPF6_DEBUG_INTERFACE
)
258 zlog_debug ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
259 ifp
->name
, iobuflen
);
260 oi
->ifmtu
= iobuflen
;
263 /* interface start */
265 thread_add_event (master
, interface_up
, oi
, 0);
269 ospf6_interface_if_del (struct interface
*ifp
)
271 struct ospf6_interface
*oi
;
273 oi
= (struct ospf6_interface
*) ifp
->info
;
279 thread_execute (master
, interface_down
, oi
, 0);
281 listnode_delete (oi
->area
->if_list
, oi
);
282 oi
->area
= (struct ospf6_area
*) NULL
;
285 oi
->interface
= NULL
;
288 ospf6_interface_delete (oi
);
292 ospf6_interface_state_update (struct interface
*ifp
)
294 struct ospf6_interface
*oi
;
296 oi
= (struct ospf6_interface
*) ifp
->info
;
299 if (oi
->area
== NULL
)
303 thread_add_event (master
, interface_up
, oi
, 0);
305 thread_add_event (master
, interface_down
, oi
, 0);
311 ospf6_interface_connected_route_update (struct interface
*ifp
)
313 struct ospf6_interface
*oi
;
314 struct ospf6_route
*route
;
316 struct listnode
*node
, *nnode
;
318 oi
= (struct ospf6_interface
*) ifp
->info
;
322 /* reset linklocal pointer */
323 oi
->linklocal_addr
= ospf6_interface_get_linklocal_address (ifp
);
325 /* if area is null, do not make connected-route list */
326 if (oi
->area
== NULL
)
329 /* update "route to advertise" interface route table */
330 ospf6_route_remove_all (oi
->route_connected
);
332 for (ALL_LIST_ELEMENTS (oi
->interface
->connected
, node
, nnode
, c
))
334 if (c
->address
->family
!= AF_INET6
)
337 CONTINUE_IF_ADDRESS_LINKLOCAL (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
338 CONTINUE_IF_ADDRESS_UNSPECIFIED (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
339 CONTINUE_IF_ADDRESS_LOOPBACK (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
340 CONTINUE_IF_ADDRESS_V4COMPAT (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
341 CONTINUE_IF_ADDRESS_V4MAPPED (IS_OSPF6_DEBUG_INTERFACE
, c
->address
);
346 struct prefix_list
*plist
;
347 enum prefix_list_type ret
;
350 prefix2str (c
->address
, buf
, sizeof (buf
));
351 plist
= prefix_list_lookup (AFI_IP6
, oi
->plist_name
);
352 ret
= prefix_list_apply (plist
, (void *) c
->address
);
353 if (ret
== PREFIX_DENY
)
355 if (IS_OSPF6_DEBUG_INTERFACE
)
356 zlog_debug ("%s on %s filtered by prefix-list %s ",
357 buf
, oi
->interface
->name
, oi
->plist_name
);
362 route
= ospf6_route_create ();
363 memcpy (&route
->prefix
, c
->address
, sizeof (struct prefix
));
364 apply_mask (&route
->prefix
);
365 route
->type
= OSPF6_DEST_TYPE_NETWORK
;
366 route
->path
.area_id
= oi
->area
->area_id
;
367 route
->path
.type
= OSPF6_PATH_TYPE_INTRA
;
368 route
->path
.cost
= oi
->cost
;
369 route
->nexthop
[0].ifindex
= oi
->interface
->ifindex
;
370 inet_pton (AF_INET6
, "::1", &route
->nexthop
[0].address
);
371 ospf6_route_add (route
, oi
->route_connected
);
374 /* create new Link-LSA */
375 OSPF6_LINK_LSA_SCHEDULE (oi
);
376 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
377 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
381 ospf6_interface_state_change (u_char next_state
, struct ospf6_interface
*oi
)
385 prev_state
= oi
->state
;
386 oi
->state
= next_state
;
388 if (prev_state
== next_state
)
392 if (IS_OSPF6_DEBUG_INTERFACE
)
394 zlog_debug ("Interface state change %s: %s -> %s", oi
->interface
->name
,
395 ospf6_interface_state_str
[prev_state
],
396 ospf6_interface_state_str
[next_state
]);
399 if ((prev_state
== OSPF6_INTERFACE_DR
||
400 prev_state
== OSPF6_INTERFACE_BDR
) &&
401 (next_state
!= OSPF6_INTERFACE_DR
&&
402 next_state
!= OSPF6_INTERFACE_BDR
))
403 ospf6_leave_alldrouters (oi
->interface
->ifindex
);
404 if ((prev_state
!= OSPF6_INTERFACE_DR
&&
405 prev_state
!= OSPF6_INTERFACE_BDR
) &&
406 (next_state
== OSPF6_INTERFACE_DR
||
407 next_state
== OSPF6_INTERFACE_BDR
))
408 ospf6_join_alldrouters (oi
->interface
->ifindex
);
410 OSPF6_ROUTER_LSA_SCHEDULE (oi
->area
);
411 if (next_state
== OSPF6_INTERFACE_DOWN
)
413 OSPF6_NETWORK_LSA_EXECUTE (oi
);
414 OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT (oi
);
415 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
417 else if (prev_state
== OSPF6_INTERFACE_DR
||
418 next_state
== OSPF6_INTERFACE_DR
)
420 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
421 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
422 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
427 /* DR Election, RFC2328 section 9.4 */
429 #define IS_ELIGIBLE(n) \
430 ((n)->state >= OSPF6_NEIGHBOR_TWOWAY && (n)->priority != 0)
432 static struct ospf6_neighbor
*
433 better_bdrouter (struct ospf6_neighbor
*a
, struct ospf6_neighbor
*b
)
435 if ((a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
== a
->router_id
) &&
436 (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
== b
->router_id
))
438 else if (a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
== a
->router_id
)
440 else if (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
== b
->router_id
)
443 if (a
->bdrouter
== a
->router_id
&& b
->bdrouter
!= b
->router_id
)
445 if (a
->bdrouter
!= a
->router_id
&& b
->bdrouter
== b
->router_id
)
448 if (a
->priority
> b
->priority
)
450 if (a
->priority
< b
->priority
)
453 if (ntohl (a
->router_id
) > ntohl (b
->router_id
))
455 if (ntohl (a
->router_id
) < ntohl (b
->router_id
))
458 zlog_warn ("Router-ID duplicate ?");
462 static struct ospf6_neighbor
*
463 better_drouter (struct ospf6_neighbor
*a
, struct ospf6_neighbor
*b
)
465 if ((a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
!= a
->router_id
) &&
466 (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
!= b
->router_id
))
468 else if (a
== NULL
|| ! IS_ELIGIBLE (a
) || a
->drouter
!= a
->router_id
)
470 else if (b
== NULL
|| ! IS_ELIGIBLE (b
) || b
->drouter
!= b
->router_id
)
473 if (a
->drouter
== a
->router_id
&& b
->drouter
!= b
->router_id
)
475 if (a
->drouter
!= a
->router_id
&& b
->drouter
== b
->router_id
)
478 if (a
->priority
> b
->priority
)
480 if (a
->priority
< b
->priority
)
483 if (ntohl (a
->router_id
) > ntohl (b
->router_id
))
485 if (ntohl (a
->router_id
) < ntohl (b
->router_id
))
488 zlog_warn ("Router-ID duplicate ?");
493 dr_election (struct ospf6_interface
*oi
)
495 struct listnode
*node
, *nnode
;
496 struct ospf6_neighbor
*on
, *drouter
, *bdrouter
, myself
;
497 struct ospf6_neighbor
*best_drouter
, *best_bdrouter
;
498 u_char next_state
= 0;
500 drouter
= bdrouter
= NULL
;
501 best_drouter
= best_bdrouter
= NULL
;
503 /* pseudo neighbor myself, including noting current DR/BDR (1) */
504 memset (&myself
, 0, sizeof (myself
));
505 inet_ntop (AF_INET
, &oi
->area
->ospf6
->router_id
, myself
.name
,
506 sizeof (myself
.name
));
507 myself
.state
= OSPF6_NEIGHBOR_TWOWAY
;
508 myself
.drouter
= oi
->drouter
;
509 myself
.bdrouter
= oi
->bdrouter
;
510 myself
.priority
= oi
->priority
;
511 myself
.router_id
= oi
->area
->ospf6
->router_id
;
513 /* Electing BDR (2) */
514 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
515 bdrouter
= better_bdrouter (bdrouter
, on
);
517 best_bdrouter
= bdrouter
;
518 bdrouter
= better_bdrouter (best_bdrouter
, &myself
);
520 /* Electing DR (3) */
521 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
522 drouter
= better_drouter (drouter
, on
);
524 best_drouter
= drouter
;
525 drouter
= better_drouter (best_drouter
, &myself
);
529 /* the router itself is newly/no longer DR/BDR (4) */
530 if ((drouter
== &myself
&& myself
.drouter
!= myself
.router_id
) ||
531 (drouter
!= &myself
&& myself
.drouter
== myself
.router_id
) ||
532 (bdrouter
== &myself
&& myself
.bdrouter
!= myself
.router_id
) ||
533 (bdrouter
!= &myself
&& myself
.bdrouter
== myself
.router_id
))
535 myself
.drouter
= (drouter
? drouter
->router_id
: htonl (0));
536 myself
.bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl (0));
538 /* compatible to Electing BDR (2) */
539 bdrouter
= better_bdrouter (best_bdrouter
, &myself
);
541 /* compatible to Electing DR (3) */
542 drouter
= better_drouter (best_drouter
, &myself
);
547 /* Set interface state accordingly (5) */
548 if (drouter
&& drouter
== &myself
)
549 next_state
= OSPF6_INTERFACE_DR
;
550 else if (bdrouter
&& bdrouter
== &myself
)
551 next_state
= OSPF6_INTERFACE_BDR
;
553 next_state
= OSPF6_INTERFACE_DROTHER
;
555 /* If NBMA, schedule Start for each neighbor having priority of 0 (6) */
558 /* If DR or BDR change, invoke AdjOK? for each neighbor (7) */
559 /* RFC 2328 section 12.4. Originating LSAs (3) will be handled
560 accordingly after AdjOK */
561 if (oi
->drouter
!= (drouter
? drouter
->router_id
: htonl (0)) ||
562 oi
->bdrouter
!= (bdrouter
? bdrouter
->router_id
: htonl (0)))
564 if (IS_OSPF6_DEBUG_INTERFACE
)
565 zlog_debug ("DR Election on %s: DR: %s BDR: %s", oi
->interface
->name
,
566 (drouter
? drouter
->name
: "0.0.0.0"),
567 (bdrouter
? bdrouter
->name
: "0.0.0.0"));
569 for (ALL_LIST_ELEMENTS_RO (oi
->neighbor_list
, node
, on
))
571 if (on
->state
< OSPF6_NEIGHBOR_TWOWAY
)
573 /* Schedule AdjOK. */
574 thread_add_event (master
, adj_ok
, on
, 0);
578 oi
->drouter
= (drouter
? drouter
->router_id
: htonl (0));
579 oi
->bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl (0));
584 /* Interface State Machine */
586 interface_up (struct thread
*thread
)
588 struct ospf6_interface
*oi
;
590 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
591 assert (oi
&& oi
->interface
);
593 if (IS_OSPF6_DEBUG_INTERFACE
)
594 zlog_debug ("Interface Event %s: [InterfaceUp]",
595 oi
->interface
->name
);
597 /* check physical interface is up */
598 if (! if_is_up (oi
->interface
))
600 if (IS_OSPF6_DEBUG_INTERFACE
)
601 zlog_debug ("Interface %s is down, can't execute [InterfaceUp]",
602 oi
->interface
->name
);
606 /* if already enabled, do nothing */
607 if (oi
->state
> OSPF6_INTERFACE_DOWN
)
609 if (IS_OSPF6_DEBUG_INTERFACE
)
610 zlog_debug ("Interface %s already enabled",
611 oi
->interface
->name
);
615 /* Join AllSPFRouters */
616 ospf6_join_allspfrouters (oi
->interface
->ifindex
);
618 /* Update interface route */
619 ospf6_interface_connected_route_update (oi
->interface
);
622 if (! CHECK_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
))
623 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
625 /* decide next interface state */
626 if (if_is_pointopoint (oi
->interface
))
627 ospf6_interface_state_change (OSPF6_INTERFACE_POINTTOPOINT
, oi
);
628 else if (oi
->priority
== 0)
629 ospf6_interface_state_change (OSPF6_INTERFACE_DROTHER
, oi
);
632 ospf6_interface_state_change (OSPF6_INTERFACE_WAITING
, oi
);
633 thread_add_timer (master
, wait_timer
, oi
, oi
->dead_interval
);
640 wait_timer (struct thread
*thread
)
642 struct ospf6_interface
*oi
;
644 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
645 assert (oi
&& oi
->interface
);
647 if (IS_OSPF6_DEBUG_INTERFACE
)
648 zlog_debug ("Interface Event %s: [WaitTimer]",
649 oi
->interface
->name
);
651 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
652 ospf6_interface_state_change (dr_election (oi
), oi
);
658 backup_seen (struct thread
*thread
)
660 struct ospf6_interface
*oi
;
662 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
663 assert (oi
&& oi
->interface
);
665 if (IS_OSPF6_DEBUG_INTERFACE
)
666 zlog_debug ("Interface Event %s: [BackupSeen]",
667 oi
->interface
->name
);
669 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
670 ospf6_interface_state_change (dr_election (oi
), oi
);
676 neighbor_change (struct thread
*thread
)
678 struct ospf6_interface
*oi
;
680 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
681 assert (oi
&& oi
->interface
);
683 if (IS_OSPF6_DEBUG_INTERFACE
)
684 zlog_debug ("Interface Event %s: [NeighborChange]",
685 oi
->interface
->name
);
687 if (oi
->state
== OSPF6_INTERFACE_DROTHER
||
688 oi
->state
== OSPF6_INTERFACE_BDR
||
689 oi
->state
== OSPF6_INTERFACE_DR
)
690 ospf6_interface_state_change (dr_election (oi
), oi
);
696 loopind (struct thread
*thread
)
698 struct ospf6_interface
*oi
;
700 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
701 assert (oi
&& oi
->interface
);
703 if (IS_OSPF6_DEBUG_INTERFACE
)
704 zlog_debug ("Interface Event %s: [LoopInd]",
705 oi
->interface
->name
);
713 interface_down (struct thread
*thread
)
715 struct ospf6_interface
*oi
;
716 struct listnode
*node
, *nnode
;
717 struct ospf6_neighbor
*on
;
719 oi
= (struct ospf6_interface
*) THREAD_ARG (thread
);
720 assert (oi
&& oi
->interface
);
722 if (IS_OSPF6_DEBUG_INTERFACE
)
723 zlog_debug ("Interface Event %s: [InterfaceDown]",
724 oi
->interface
->name
);
726 /* Leave AllSPFRouters */
727 if (oi
->state
> OSPF6_INTERFACE_DOWN
)
728 ospf6_leave_allspfrouters (oi
->interface
->ifindex
);
730 ospf6_interface_state_change (OSPF6_INTERFACE_DOWN
, oi
);
732 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
733 ospf6_neighbor_delete (on
);
735 list_delete_all_node (oi
->neighbor_list
);
741 /* show specified interface structure */
743 ospf6_interface_show (struct vty
*vty
, struct interface
*ifp
)
745 struct ospf6_interface
*oi
;
749 char strbuf
[64], drouter
[32], bdrouter
[32];
750 const char *updown
[3] = {"down", "up", NULL
};
752 struct timeval res
, now
;
754 struct ospf6_lsa
*lsa
;
756 /* check physical interface type */
757 if (if_is_loopback (ifp
))
759 else if (if_is_broadcast (ifp
))
761 else if (if_is_pointopoint (ifp
))
762 type
= "POINTOPOINT";
766 vty_out (vty
, "%s is %s, type %s%s",
767 ifp
->name
, updown
[if_is_up (ifp
)], type
,
769 vty_out (vty
, " Interface ID: %d%s", ifp
->ifindex
, VNL
);
771 if (ifp
->info
== NULL
)
773 vty_out (vty
, " OSPF not enabled on this interface%s", VNL
);
777 oi
= (struct ospf6_interface
*) ifp
->info
;
779 vty_out (vty
, " Internet Address:%s", VNL
);
781 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, i
, c
))
784 prefix2str (p
, strbuf
, sizeof (strbuf
));
788 vty_out (vty
, " inet : %s%s", strbuf
,
792 vty_out (vty
, " inet6: %s%s", strbuf
,
796 vty_out (vty
, " ??? : %s%s", strbuf
,
804 vty_out (vty
, " Instance ID %d, Interface MTU %d (autodetect: %d)%s",
805 oi
->instance_id
, oi
->ifmtu
, ifp
->mtu6
, VNL
);
806 inet_ntop (AF_INET
, &oi
->area
->area_id
,
807 strbuf
, sizeof (strbuf
));
808 vty_out (vty
, " Area ID %s, Cost %hu%s", strbuf
, oi
->cost
,
812 vty_out (vty
, " Not Attached to Area%s", VNL
);
814 vty_out (vty
, " State %s, Transmit Delay %d sec, Priority %d%s",
815 ospf6_interface_state_str
[oi
->state
],
816 oi
->transdelay
, oi
->priority
,
818 vty_out (vty
, " Timer intervals configured:%s", VNL
);
819 vty_out (vty
, " Hello %d, Dead %d, Retransmit %d%s",
820 oi
->hello_interval
, oi
->dead_interval
, oi
->rxmt_interval
,
823 inet_ntop (AF_INET
, &oi
->drouter
, drouter
, sizeof (drouter
));
824 inet_ntop (AF_INET
, &oi
->bdrouter
, bdrouter
, sizeof (bdrouter
));
825 vty_out (vty
, " DR: %s BDR: %s%s", drouter
, bdrouter
, VNL
);
827 vty_out (vty
, " Number of I/F scoped LSAs is %u%s",
828 oi
->lsdb
->count
, VNL
);
830 gettimeofday (&now
, (struct timezone
*) NULL
);
833 if (oi
->thread_send_lsupdate
)
834 timersub (&oi
->thread_send_lsupdate
->u
.sands
, &now
, &res
);
835 timerstring (&res
, duration
, sizeof (duration
));
836 vty_out (vty
, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s",
837 oi
->lsupdate_list
->count
, duration
,
838 (oi
->thread_send_lsupdate
? "on" : "off"),
840 for (lsa
= ospf6_lsdb_head (oi
->lsupdate_list
); lsa
;
841 lsa
= ospf6_lsdb_next (lsa
))
842 vty_out (vty
, " %s%s", lsa
->name
, VNL
);
845 if (oi
->thread_send_lsack
)
846 timersub (&oi
->thread_send_lsack
->u
.sands
, &now
, &res
);
847 timerstring (&res
, duration
, sizeof (duration
));
848 vty_out (vty
, " %d Pending LSAs for LSAck in Time %s [thread %s]%s",
849 oi
->lsack_list
->count
, duration
,
850 (oi
->thread_send_lsack
? "on" : "off"),
852 for (lsa
= ospf6_lsdb_head (oi
->lsack_list
); lsa
;
853 lsa
= ospf6_lsdb_next (lsa
))
854 vty_out (vty
, " %s%s", lsa
->name
, VNL
);
860 DEFUN (show_ipv6_ospf6_interface
,
861 show_ipv6_ospf6_interface_ifname_cmd
,
862 "show ipv6 ospf6 interface IFNAME",
870 struct interface
*ifp
;
875 ifp
= if_lookup_by_name (argv
[0]);
878 vty_out (vty
, "No such Interface: %s%s", argv
[0],
882 ospf6_interface_show (vty
, ifp
);
886 for (ALL_LIST_ELEMENTS_RO (iflist
, i
, ifp
))
887 ospf6_interface_show (vty
, ifp
);
893 ALIAS (show_ipv6_ospf6_interface
,
894 show_ipv6_ospf6_interface_cmd
,
895 "show ipv6 ospf6 interface",
902 DEFUN (show_ipv6_ospf6_interface_ifname_prefix
,
903 show_ipv6_ospf6_interface_ifname_prefix_cmd
,
904 "show ipv6 ospf6 interface IFNAME prefix",
910 "Display connected prefixes to advertise\n"
913 struct interface
*ifp
;
914 struct ospf6_interface
*oi
;
916 ifp
= if_lookup_by_name (argv
[0]);
919 vty_out (vty
, "No such Interface: %s%s", argv
[0], VNL
);
926 vty_out (vty
, "OSPFv3 is not enabled on %s%s", argv
[0], VNL
);
932 ospf6_route_table_show (vty
, argc
, argv
, oi
->route_connected
);
937 ALIAS (show_ipv6_ospf6_interface_ifname_prefix
,
938 show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
,
939 "show ipv6 ospf6 interface IFNAME prefix (X:X::X:X|X:X::X:X/M|detail)",
945 "Display connected prefixes to advertise\n"
946 OSPF6_ROUTE_ADDRESS_STR
947 OSPF6_ROUTE_PREFIX_STR
948 "Dispaly details of the prefixes\n"
951 ALIAS (show_ipv6_ospf6_interface_ifname_prefix
,
952 show_ipv6_ospf6_interface_ifname_prefix_match_cmd
,
953 "show ipv6 ospf6 interface IFNAME prefix X:X::X:X/M (match|detail)",
959 "Display connected prefixes to advertise\n"
960 OSPF6_ROUTE_PREFIX_STR
961 OSPF6_ROUTE_MATCH_STR
962 "Dispaly details of the prefixes\n"
965 DEFUN (show_ipv6_ospf6_interface_prefix
,
966 show_ipv6_ospf6_interface_prefix_cmd
,
967 "show ipv6 ospf6 interface prefix",
972 "Display connected prefixes to advertise\n"
976 struct ospf6_interface
*oi
;
977 struct interface
*ifp
;
979 for (ALL_LIST_ELEMENTS_RO (iflist
, i
, ifp
))
981 oi
= (struct ospf6_interface
*) ifp
->info
;
985 ospf6_route_table_show (vty
, argc
, argv
, oi
->route_connected
);
991 ALIAS (show_ipv6_ospf6_interface_prefix
,
992 show_ipv6_ospf6_interface_prefix_detail_cmd
,
993 "show ipv6 ospf6 interface prefix (X:X::X:X|X:X::X:X/M|detail)",
998 "Display connected prefixes to advertise\n"
999 OSPF6_ROUTE_ADDRESS_STR
1000 OSPF6_ROUTE_PREFIX_STR
1001 "Dispaly details of the prefixes\n"
1004 ALIAS (show_ipv6_ospf6_interface_prefix
,
1005 show_ipv6_ospf6_interface_prefix_match_cmd
,
1006 "show ipv6 ospf6 interface prefix X:X::X:X/M (match|detail)",
1011 "Display connected prefixes to advertise\n"
1012 OSPF6_ROUTE_PREFIX_STR
1013 OSPF6_ROUTE_MATCH_STR
1014 "Dispaly details of the prefixes\n"
1018 /* interface variable set command */
1019 DEFUN (ipv6_ospf6_ifmtu
,
1020 ipv6_ospf6_ifmtu_cmd
,
1021 "ipv6 ospf6 ifmtu <1-65535>",
1025 "OSPFv3 Interface MTU\n"
1028 struct ospf6_interface
*oi
;
1029 struct interface
*ifp
;
1030 unsigned int ifmtu
, iobuflen
;
1031 struct listnode
*node
, *nnode
;
1032 struct ospf6_neighbor
*on
;
1034 ifp
= (struct interface
*) vty
->index
;
1037 oi
= (struct ospf6_interface
*) ifp
->info
;
1039 oi
= ospf6_interface_create (ifp
);
1042 ifmtu
= strtol (argv
[0], NULL
, 10);
1044 if (oi
->ifmtu
== ifmtu
)
1047 if (ifp
->mtu6
!= 0 && ifp
->mtu6
< ifmtu
)
1049 vty_out (vty
, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)%s",
1050 ifp
->name
, ifp
->mtu6
, VNL
);
1054 if (oi
->ifmtu
< ifmtu
)
1056 iobuflen
= ospf6_iobuf_size (ifmtu
);
1057 if (iobuflen
< ifmtu
)
1059 vty_out (vty
, "%s's ifmtu is adjusted to I/O buffer size (%d).%s",
1060 ifp
->name
, iobuflen
, VNL
);
1061 oi
->ifmtu
= iobuflen
;
1069 /* re-establish adjacencies */
1070 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
1072 THREAD_OFF (on
->inactivity_timer
);
1073 thread_add_event (master
, inactivity_timer
, on
, 0);
1079 DEFUN (no_ipv6_ospf6_ifmtu
,
1080 no_ipv6_ospf6_ifmtu_cmd
,
1081 "no ipv6 ospf6 ifmtu",
1088 struct ospf6_interface
*oi
;
1089 struct interface
*ifp
;
1090 unsigned int iobuflen
;
1091 struct listnode
*node
, *nnode
;
1092 struct ospf6_neighbor
*on
;
1094 ifp
= (struct interface
*) vty
->index
;
1097 oi
= (struct ospf6_interface
*) ifp
->info
;
1099 oi
= ospf6_interface_create (ifp
);
1102 if (oi
->ifmtu
< ifp
->mtu
)
1104 iobuflen
= ospf6_iobuf_size (ifp
->mtu
);
1105 if (iobuflen
< ifp
->mtu
)
1107 vty_out (vty
, "%s's ifmtu is adjusted to I/O buffer size (%d).%s",
1108 ifp
->name
, iobuflen
, VNL
);
1109 oi
->ifmtu
= iobuflen
;
1112 oi
->ifmtu
= ifp
->mtu
;
1115 oi
->ifmtu
= ifp
->mtu
;
1117 /* re-establish adjacencies */
1118 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
1120 THREAD_OFF (on
->inactivity_timer
);
1121 thread_add_event (master
, inactivity_timer
, on
, 0);
1127 DEFUN (ipv6_ospf6_cost
,
1128 ipv6_ospf6_cost_cmd
,
1129 "ipv6 ospf6 cost <1-65535>",
1133 "Outgoing metric of this interface\n"
1136 struct ospf6_interface
*oi
;
1137 struct interface
*ifp
;
1138 unsigned long int lcost
;
1140 ifp
= (struct interface
*) vty
->index
;
1143 oi
= (struct ospf6_interface
*) ifp
->info
;
1145 oi
= ospf6_interface_create (ifp
);
1148 lcost
= strtol (argv
[0], NULL
, 10);
1150 if (lcost
> UINT32_MAX
)
1152 vty_out (vty
, "Cost %ld is out of range%s", lcost
, VNL
);
1156 if (oi
->cost
== lcost
)
1161 /* update cost held in route_connected list in ospf6_interface */
1162 ospf6_interface_connected_route_update (oi
->interface
);
1164 /* execute LSA hooks */
1167 OSPF6_LINK_LSA_SCHEDULE (oi
);
1168 OSPF6_ROUTER_LSA_SCHEDULE (oi
->area
);
1169 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1170 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1171 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1177 DEFUN (ipv6_ospf6_hellointerval
,
1178 ipv6_ospf6_hellointerval_cmd
,
1179 "ipv6 ospf6 hello-interval <1-65535>",
1182 "Interval time of Hello packets\n"
1186 struct ospf6_interface
*oi
;
1187 struct interface
*ifp
;
1189 ifp
= (struct interface
*) vty
->index
;
1192 oi
= (struct ospf6_interface
*) ifp
->info
;
1194 oi
= ospf6_interface_create (ifp
);
1197 oi
->hello_interval
= strtol (argv
[0], NULL
, 10);
1201 /* interface variable set command */
1202 DEFUN (ipv6_ospf6_deadinterval
,
1203 ipv6_ospf6_deadinterval_cmd
,
1204 "ipv6 ospf6 dead-interval <1-65535>",
1207 "Interval time after which a neighbor is declared down\n"
1211 struct ospf6_interface
*oi
;
1212 struct interface
*ifp
;
1214 ifp
= (struct interface
*) vty
->index
;
1217 oi
= (struct ospf6_interface
*) ifp
->info
;
1219 oi
= ospf6_interface_create (ifp
);
1222 oi
->dead_interval
= strtol (argv
[0], NULL
, 10);
1226 /* interface variable set command */
1227 DEFUN (ipv6_ospf6_transmitdelay
,
1228 ipv6_ospf6_transmitdelay_cmd
,
1229 "ipv6 ospf6 transmit-delay <1-3600>",
1232 "Transmit delay of this interface\n"
1236 struct ospf6_interface
*oi
;
1237 struct interface
*ifp
;
1239 ifp
= (struct interface
*) vty
->index
;
1242 oi
= (struct ospf6_interface
*) ifp
->info
;
1244 oi
= ospf6_interface_create (ifp
);
1247 oi
->transdelay
= strtol (argv
[0], NULL
, 10);
1251 /* interface variable set command */
1252 DEFUN (ipv6_ospf6_retransmitinterval
,
1253 ipv6_ospf6_retransmitinterval_cmd
,
1254 "ipv6 ospf6 retransmit-interval <1-65535>",
1257 "Time between retransmitting lost link state advertisements\n"
1261 struct ospf6_interface
*oi
;
1262 struct interface
*ifp
;
1264 ifp
= (struct interface
*) vty
->index
;
1267 oi
= (struct ospf6_interface
*) ifp
->info
;
1269 oi
= ospf6_interface_create (ifp
);
1272 oi
->rxmt_interval
= strtol (argv
[0], NULL
, 10);
1276 /* interface variable set command */
1277 DEFUN (ipv6_ospf6_priority
,
1278 ipv6_ospf6_priority_cmd
,
1279 "ipv6 ospf6 priority <0-255>",
1286 struct ospf6_interface
*oi
;
1287 struct interface
*ifp
;
1289 ifp
= (struct interface
*) vty
->index
;
1292 oi
= (struct ospf6_interface
*) ifp
->info
;
1294 oi
= ospf6_interface_create (ifp
);
1297 oi
->priority
= strtol (argv
[0], NULL
, 10);
1300 ospf6_interface_state_change (dr_election (oi
), oi
);
1305 DEFUN (ipv6_ospf6_instance
,
1306 ipv6_ospf6_instance_cmd
,
1307 "ipv6 ospf6 instance-id <0-255>",
1310 "Instance ID for this interface\n"
1311 "Instance ID value\n"
1314 struct ospf6_interface
*oi
;
1315 struct interface
*ifp
;
1317 ifp
= (struct interface
*)vty
->index
;
1320 oi
= (struct ospf6_interface
*)ifp
->info
;
1322 oi
= ospf6_interface_create (ifp
);
1325 oi
->instance_id
= strtol (argv
[0], NULL
, 10);
1329 DEFUN (ipv6_ospf6_passive
,
1330 ipv6_ospf6_passive_cmd
,
1331 "ipv6 ospf6 passive",
1334 "passive interface, No adjacency will be formed on this interface\n"
1337 struct ospf6_interface
*oi
;
1338 struct interface
*ifp
;
1339 struct listnode
*node
, *nnode
;
1340 struct ospf6_neighbor
*on
;
1342 ifp
= (struct interface
*) vty
->index
;
1345 oi
= (struct ospf6_interface
*) ifp
->info
;
1347 oi
= ospf6_interface_create (ifp
);
1350 SET_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1351 THREAD_OFF (oi
->thread_send_hello
);
1353 for (ALL_LIST_ELEMENTS (oi
->neighbor_list
, node
, nnode
, on
))
1355 THREAD_OFF (on
->inactivity_timer
);
1356 thread_add_event (master
, inactivity_timer
, on
, 0);
1362 DEFUN (no_ipv6_ospf6_passive
,
1363 no_ipv6_ospf6_passive_cmd
,
1364 "no ipv6 ospf6 passive",
1368 "passive interface: No Adjacency will be formed on this I/F\n"
1371 struct ospf6_interface
*oi
;
1372 struct interface
*ifp
;
1374 ifp
= (struct interface
*) vty
->index
;
1377 oi
= (struct ospf6_interface
*) ifp
->info
;
1379 oi
= ospf6_interface_create (ifp
);
1382 UNSET_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1383 THREAD_OFF (oi
->thread_send_hello
);
1384 oi
->thread_send_hello
=
1385 thread_add_event (master
, ospf6_hello_send
, oi
, 0);
1390 DEFUN (ipv6_ospf6_advertise_prefix_list
,
1391 ipv6_ospf6_advertise_prefix_list_cmd
,
1392 "ipv6 ospf6 advertise prefix-list WORD",
1395 "Advertising options\n"
1396 "Filter prefix using prefix-list\n"
1397 "Prefix list name\n"
1400 struct ospf6_interface
*oi
;
1401 struct interface
*ifp
;
1403 ifp
= (struct interface
*) vty
->index
;
1406 oi
= (struct ospf6_interface
*) ifp
->info
;
1408 oi
= ospf6_interface_create (ifp
);
1412 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
1413 oi
->plist_name
= XSTRDUP (MTYPE_PREFIX_LIST_STR
, argv
[0]);
1415 ospf6_interface_connected_route_update (oi
->interface
);
1416 OSPF6_LINK_LSA_SCHEDULE (oi
);
1417 if (oi
->state
== OSPF6_INTERFACE_DR
)
1419 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1420 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1422 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1427 DEFUN (no_ipv6_ospf6_advertise_prefix_list
,
1428 no_ipv6_ospf6_advertise_prefix_list_cmd
,
1429 "no ipv6 ospf6 advertise prefix-list",
1433 "Advertising options\n"
1434 "Filter prefix using prefix-list\n"
1437 struct ospf6_interface
*oi
;
1438 struct interface
*ifp
;
1440 ifp
= (struct interface
*) vty
->index
;
1443 oi
= (struct ospf6_interface
*) ifp
->info
;
1445 oi
= ospf6_interface_create (ifp
);
1450 XFREE (MTYPE_PREFIX_LIST_STR
, oi
->plist_name
);
1451 oi
->plist_name
= NULL
;
1454 ospf6_interface_connected_route_update (oi
->interface
);
1455 OSPF6_LINK_LSA_SCHEDULE (oi
);
1456 if (oi
->state
== OSPF6_INTERFACE_DR
)
1458 OSPF6_NETWORK_LSA_SCHEDULE (oi
);
1459 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (oi
);
1461 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB (oi
->area
);
1467 config_write_ospf6_interface (struct vty
*vty
)
1470 struct ospf6_interface
*oi
;
1471 struct interface
*ifp
;
1473 for (ALL_LIST_ELEMENTS_RO (iflist
, i
, ifp
))
1475 oi
= (struct ospf6_interface
*) ifp
->info
;
1479 vty_out (vty
, "interface %s%s",
1480 oi
->interface
->name
, VNL
);
1483 vty_out (vty
, " description %s%s", ifp
->desc
, VNL
);
1485 if (ifp
->mtu6
!= oi
->ifmtu
)
1486 vty_out (vty
, " ipv6 ospf6 ifmtu %d%s", oi
->ifmtu
, VNL
);
1487 vty_out (vty
, " ipv6 ospf6 cost %d%s",
1489 vty_out (vty
, " ipv6 ospf6 hello-interval %d%s",
1490 oi
->hello_interval
, VNL
);
1491 vty_out (vty
, " ipv6 ospf6 dead-interval %d%s",
1492 oi
->dead_interval
, VNL
);
1493 vty_out (vty
, " ipv6 ospf6 retransmit-interval %d%s",
1494 oi
->rxmt_interval
, VNL
);
1495 vty_out (vty
, " ipv6 ospf6 priority %d%s",
1497 vty_out (vty
, " ipv6 ospf6 transmit-delay %d%s",
1498 oi
->transdelay
, VNL
);
1499 vty_out (vty
, " ipv6 ospf6 instance-id %d%s",
1500 oi
->instance_id
, VNL
);
1503 vty_out (vty
, " ipv6 ospf6 advertise prefix-list %s%s",
1504 oi
->plist_name
, VNL
);
1506 if (CHECK_FLAG (oi
->flag
, OSPF6_INTERFACE_PASSIVE
))
1507 vty_out (vty
, " ipv6 ospf6 passive%s", VNL
);
1509 vty_out (vty
, "!%s", VNL
);
1514 struct cmd_node interface_node
=
1522 ospf6_interface_init (void)
1524 /* Install interface node. */
1525 install_node (&interface_node
, config_write_ospf6_interface
);
1527 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_cmd
);
1528 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_cmd
);
1529 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_detail_cmd
);
1530 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_match_cmd
);
1531 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_cmd
);
1532 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_cmd
);
1533 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
);
1534 install_element (VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd
);
1535 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_cmd
);
1536 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_cmd
);
1537 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_detail_cmd
);
1538 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_prefix_match_cmd
);
1539 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_cmd
);
1540 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_cmd
);
1541 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd
);
1542 install_element (ENABLE_NODE
, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd
);
1544 install_element (CONFIG_NODE
, &interface_cmd
);
1545 install_default (INTERFACE_NODE
);
1546 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
1547 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
1548 install_element (INTERFACE_NODE
, &ipv6_ospf6_cost_cmd
);
1549 install_element (INTERFACE_NODE
, &ipv6_ospf6_ifmtu_cmd
);
1550 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_ifmtu_cmd
);
1551 install_element (INTERFACE_NODE
, &ipv6_ospf6_deadinterval_cmd
);
1552 install_element (INTERFACE_NODE
, &ipv6_ospf6_hellointerval_cmd
);
1553 install_element (INTERFACE_NODE
, &ipv6_ospf6_priority_cmd
);
1554 install_element (INTERFACE_NODE
, &ipv6_ospf6_retransmitinterval_cmd
);
1555 install_element (INTERFACE_NODE
, &ipv6_ospf6_transmitdelay_cmd
);
1556 install_element (INTERFACE_NODE
, &ipv6_ospf6_instance_cmd
);
1558 install_element (INTERFACE_NODE
, &ipv6_ospf6_passive_cmd
);
1559 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_passive_cmd
);
1561 install_element (INTERFACE_NODE
, &ipv6_ospf6_advertise_prefix_list_cmd
);
1562 install_element (INTERFACE_NODE
, &no_ipv6_ospf6_advertise_prefix_list_cmd
);
1565 DEFUN (debug_ospf6_interface
,
1566 debug_ospf6_interface_cmd
,
1567 "debug ospf6 interface",
1570 "Debug OSPFv3 Interface\n"
1573 OSPF6_DEBUG_INTERFACE_ON ();
1577 DEFUN (no_debug_ospf6_interface
,
1578 no_debug_ospf6_interface_cmd
,
1579 "no debug ospf6 interface",
1583 "Debug OSPFv3 Interface\n"
1586 OSPF6_DEBUG_INTERFACE_OFF ();
1591 config_write_ospf6_debug_interface (struct vty
*vty
)
1593 if (IS_OSPF6_DEBUG_INTERFACE
)
1594 vty_out (vty
, "debug ospf6 interface%s", VNL
);
1599 install_element_ospf6_debug_interface (void)
1601 install_element (ENABLE_NODE
, &debug_ospf6_interface_cmd
);
1602 install_element (ENABLE_NODE
, &no_debug_ospf6_interface_cmd
);
1603 install_element (CONFIG_NODE
, &debug_ospf6_interface_cmd
);
1604 install_element (CONFIG_NODE
, &no_debug_ospf6_interface_cmd
);