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 along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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"
44 #include "ospf6_bfd.h"
45 #include "ospf6_zebra.h"
47 DEFINE_MTYPE_STATIC(OSPF6D
, CFG_PLIST_NAME
, "configured prefix list names")
48 DEFINE_QOBJ_TYPE(ospf6_interface
)
49 DEFINE_HOOK(ospf6_interface_change
,
50 (struct ospf6_interface
* oi
, int state
, int old_state
),
51 (oi
, state
, old_state
))
53 unsigned char conf_debug_ospf6_interface
= 0;
55 const char *const ospf6_interface_state_str
[] = {
56 "None", "Down", "Loopback", "Waiting", "PointToPoint",
57 "DROther", "BDR", "DR", NULL
};
59 struct ospf6_interface
*ospf6_interface_lookup_by_ifindex(ifindex_t ifindex
)
61 struct ospf6_interface
*oi
;
62 struct interface
*ifp
;
64 ifp
= if_lookup_by_index(ifindex
, VRF_DEFAULT
);
66 return (struct ospf6_interface
*)NULL
;
68 oi
= (struct ospf6_interface
*)ifp
->info
;
72 /* schedule routing table recalculation */
73 static void ospf6_interface_lsdb_hook(struct ospf6_lsa
*lsa
,
76 struct ospf6_interface
*oi
;
82 switch (ntohs(lsa
->header
->type
)) {
83 case OSPF6_LSTYPE_LINK
:
84 if (oi
->state
== OSPF6_INTERFACE_DR
)
85 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(oi
);
87 ospf6_spf_schedule(oi
->area
->ospf6
, reason
);
95 static void ospf6_interface_lsdb_hook_add(struct ospf6_lsa
*lsa
)
97 ospf6_interface_lsdb_hook(lsa
, ospf6_lsadd_to_spf_reason(lsa
));
100 static void ospf6_interface_lsdb_hook_remove(struct ospf6_lsa
*lsa
)
102 ospf6_interface_lsdb_hook(lsa
, ospf6_lsremove_to_spf_reason(lsa
));
105 static uint8_t ospf6_default_iftype(struct interface
*ifp
)
107 if (if_is_pointopoint(ifp
))
108 return OSPF_IFTYPE_POINTOPOINT
;
109 else if (if_is_loopback(ifp
))
110 return OSPF_IFTYPE_LOOPBACK
;
112 return OSPF_IFTYPE_BROADCAST
;
115 static uint32_t ospf6_interface_get_cost(struct ospf6_interface
*oi
)
117 /* If all else fails, use default OSPF cost */
121 /* interface speed and bw can be 0 in some platforms,
122 * use ospf default bw. If bw is configured then it would
125 if (!oi
->interface
->bandwidth
&& oi
->interface
->speed
) {
126 bw
= oi
->interface
->speed
;
128 bw
= oi
->interface
->bandwidth
? oi
->interface
->bandwidth
129 : OSPF6_INTERFACE_BANDWIDTH
;
132 refbw
= ospf6
? ospf6
->ref_bandwidth
: OSPF6_REFERENCE_BANDWIDTH
;
134 /* A specifed ip ospf cost overrides a calculated one. */
135 if (CHECK_FLAG(oi
->flag
, OSPF6_INTERFACE_NOAUTOCOST
))
138 cost
= (uint32_t)((double)refbw
/ (double)bw
+ (double)0.5);
141 else if (cost
> UINT32_MAX
)
148 static void ospf6_interface_force_recalculate_cost(struct ospf6_interface
*oi
)
150 /* update cost held in route_connected list in ospf6_interface */
151 ospf6_interface_connected_route_update(oi
->interface
);
153 /* execute LSA hooks */
155 OSPF6_LINK_LSA_SCHEDULE(oi
);
156 OSPF6_ROUTER_LSA_SCHEDULE(oi
->area
);
157 OSPF6_NETWORK_LSA_SCHEDULE(oi
);
158 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(oi
);
159 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oi
->area
);
163 static void ospf6_interface_recalculate_cost(struct ospf6_interface
*oi
)
167 newcost
= ospf6_interface_get_cost(oi
);
168 if (newcost
== oi
->cost
)
172 ospf6_interface_force_recalculate_cost(oi
);
175 /* Create new ospf6 interface structure */
176 struct ospf6_interface
*ospf6_interface_create(struct interface
*ifp
)
178 struct ospf6_interface
*oi
;
179 unsigned int iobuflen
;
181 oi
= XCALLOC(MTYPE_OSPF6_IF
, sizeof(struct ospf6_interface
));
183 oi
->area
= (struct ospf6_area
*)NULL
;
184 oi
->neighbor_list
= list_new();
185 oi
->neighbor_list
->cmp
= ospf6_neighbor_cmp
;
186 oi
->linklocal_addr
= (struct in6_addr
*)NULL
;
187 oi
->instance_id
= OSPF6_INTERFACE_INSTANCE_ID
;
188 oi
->transdelay
= OSPF6_INTERFACE_TRANSDELAY
;
189 oi
->priority
= OSPF6_INTERFACE_PRIORITY
;
191 oi
->hello_interval
= OSPF_HELLO_INTERVAL_DEFAULT
;
192 oi
->dead_interval
= OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
;
193 oi
->rxmt_interval
= OSPF_RETRANSMIT_INTERVAL_DEFAULT
;
194 oi
->type
= ospf6_default_iftype(ifp
);
195 oi
->state
= OSPF6_INTERFACE_DOWN
;
200 /* Try to adjust I/O buffer size with IfMtu */
201 oi
->ifmtu
= ifp
->mtu6
;
202 iobuflen
= ospf6_iobuf_size(ifp
->mtu6
);
203 if (oi
->ifmtu
> iobuflen
) {
204 if (IS_OSPF6_DEBUG_INTERFACE
)
206 "Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
207 ifp
->name
, iobuflen
);
208 oi
->ifmtu
= iobuflen
;
211 QOBJ_REG(oi
, ospf6_interface
);
213 oi
->lsupdate_list
= ospf6_lsdb_create(oi
);
214 oi
->lsack_list
= ospf6_lsdb_create(oi
);
215 oi
->lsdb
= ospf6_lsdb_create(oi
);
216 oi
->lsdb
->hook_add
= ospf6_interface_lsdb_hook_add
;
217 oi
->lsdb
->hook_remove
= ospf6_interface_lsdb_hook_remove
;
218 oi
->lsdb_self
= ospf6_lsdb_create(oi
);
220 oi
->route_connected
=
221 OSPF6_ROUTE_TABLE_CREATE(INTERFACE
, CONNECTED_ROUTES
);
222 oi
->route_connected
->scope
= oi
;
229 oi
->cost
= ospf6_interface_get_cost(oi
);
234 void ospf6_interface_delete(struct ospf6_interface
*oi
)
236 struct listnode
*node
, *nnode
;
237 struct ospf6_neighbor
*on
;
241 for (ALL_LIST_ELEMENTS(oi
->neighbor_list
, node
, nnode
, on
))
242 ospf6_neighbor_delete(on
);
244 list_delete(&oi
->neighbor_list
);
246 THREAD_OFF(oi
->thread_send_hello
);
247 THREAD_OFF(oi
->thread_send_lsupdate
);
248 THREAD_OFF(oi
->thread_send_lsack
);
249 THREAD_OFF(oi
->thread_sso
);
251 ospf6_lsdb_remove_all(oi
->lsdb
);
252 ospf6_lsdb_remove_all(oi
->lsupdate_list
);
253 ospf6_lsdb_remove_all(oi
->lsack_list
);
255 ospf6_lsdb_delete(oi
->lsdb
);
256 ospf6_lsdb_delete(oi
->lsdb_self
);
258 ospf6_lsdb_delete(oi
->lsupdate_list
);
259 ospf6_lsdb_delete(oi
->lsack_list
);
261 ospf6_route_table_delete(oi
->route_connected
);
264 oi
->interface
->info
= NULL
;
268 XFREE(MTYPE_CFG_PLIST_NAME
, oi
->plist_name
);
270 ospf6_bfd_info_free(&(oi
->bfd_info
));
272 /* disable from area list if possible */
273 ospf6_area_interface_delete(oi
);
275 XFREE(MTYPE_OSPF6_IF
, oi
);
278 void ospf6_interface_enable(struct ospf6_interface
*oi
)
280 UNSET_FLAG(oi
->flag
, OSPF6_INTERFACE_DISABLE
);
281 ospf6_interface_state_update(oi
->interface
);
284 void ospf6_interface_disable(struct ospf6_interface
*oi
)
286 SET_FLAG(oi
->flag
, OSPF6_INTERFACE_DISABLE
);
288 thread_execute(master
, interface_down
, oi
, 0);
290 ospf6_lsdb_remove_all(oi
->lsdb
);
291 ospf6_lsdb_remove_all(oi
->lsdb_self
);
292 ospf6_lsdb_remove_all(oi
->lsupdate_list
);
293 ospf6_lsdb_remove_all(oi
->lsack_list
);
295 THREAD_OFF(oi
->thread_send_hello
);
296 THREAD_OFF(oi
->thread_send_lsupdate
);
297 THREAD_OFF(oi
->thread_send_lsack
);
298 THREAD_OFF(oi
->thread_sso
);
300 THREAD_OFF(oi
->thread_network_lsa
);
301 THREAD_OFF(oi
->thread_link_lsa
);
302 THREAD_OFF(oi
->thread_intra_prefix_lsa
);
303 THREAD_OFF(oi
->thread_as_extern_lsa
);
306 static struct in6_addr
*
307 ospf6_interface_get_linklocal_address(struct interface
*ifp
)
311 struct in6_addr
*l
= (struct in6_addr
*)NULL
;
313 /* for each connected address */
314 for (ALL_LIST_ELEMENTS_RO(ifp
->connected
, n
, c
)) {
315 /* if family not AF_INET6, ignore */
316 if (c
->address
->family
!= AF_INET6
)
319 /* linklocal scope check */
320 if (IN6_IS_ADDR_LINKLOCAL(&c
->address
->u
.prefix6
))
321 l
= &c
->address
->u
.prefix6
;
326 void ospf6_interface_if_add(struct interface
*ifp
)
328 struct ospf6_interface
*oi
;
329 unsigned int iobuflen
;
331 oi
= (struct ospf6_interface
*)ifp
->info
;
335 /* Try to adjust I/O buffer size with IfMtu */
337 oi
->ifmtu
= ifp
->mtu6
;
338 iobuflen
= ospf6_iobuf_size(ifp
->mtu6
);
339 if (oi
->ifmtu
> iobuflen
) {
340 if (IS_OSPF6_DEBUG_INTERFACE
)
342 "Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
343 ifp
->name
, iobuflen
);
344 oi
->ifmtu
= iobuflen
;
347 /* interface start */
348 ospf6_interface_state_update(oi
->interface
);
351 void ospf6_interface_state_update(struct interface
*ifp
)
353 struct ospf6_interface
*oi
;
354 unsigned int iobuflen
;
356 oi
= (struct ospf6_interface
*)ifp
->info
;
359 if (CHECK_FLAG(oi
->flag
, OSPF6_INTERFACE_DISABLE
))
362 /* Adjust the mtu values if the kernel told us something new */
363 if (ifp
->mtu6
!= oi
->ifmtu
) {
364 /* If nothing configured, accept it and check for buffer size */
366 oi
->ifmtu
= ifp
->mtu6
;
367 iobuflen
= ospf6_iobuf_size(ifp
->mtu6
);
368 if (oi
->ifmtu
> iobuflen
) {
369 if (IS_OSPF6_DEBUG_INTERFACE
)
371 "Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
372 ifp
->name
, iobuflen
);
373 oi
->ifmtu
= iobuflen
;
375 } else if (oi
->c_ifmtu
> ifp
->mtu6
) {
376 oi
->ifmtu
= ifp
->mtu6
;
378 "Configured mtu %u on %s overridden by kernel %u",
379 oi
->c_ifmtu
, ifp
->name
, ifp
->mtu6
);
381 oi
->ifmtu
= oi
->c_ifmtu
;
384 if (if_is_operative(ifp
)
385 && (ospf6_interface_get_linklocal_address(oi
->interface
)
386 || if_is_loopback(oi
->interface
)))
387 thread_execute(master
, interface_up
, oi
, 0);
389 thread_execute(master
, interface_down
, oi
, 0);
394 void ospf6_interface_connected_route_update(struct interface
*ifp
)
396 struct ospf6_interface
*oi
;
397 struct ospf6_route
*route
;
399 struct listnode
*node
, *nnode
;
400 struct in6_addr nh_addr
;
402 oi
= (struct ospf6_interface
*)ifp
->info
;
406 /* reset linklocal pointer */
407 oi
->linklocal_addr
= ospf6_interface_get_linklocal_address(ifp
);
409 /* if area is null, do not make connected-route list */
410 if (oi
->area
== NULL
)
413 if (CHECK_FLAG(oi
->flag
, OSPF6_INTERFACE_DISABLE
))
416 /* update "route to advertise" interface route table */
417 ospf6_route_remove_all(oi
->route_connected
);
419 for (ALL_LIST_ELEMENTS(oi
->interface
->connected
, node
, nnode
, c
)) {
420 if (c
->address
->family
!= AF_INET6
)
423 CONTINUE_IF_ADDRESS_LINKLOCAL(IS_OSPF6_DEBUG_INTERFACE
,
425 CONTINUE_IF_ADDRESS_UNSPECIFIED(IS_OSPF6_DEBUG_INTERFACE
,
427 CONTINUE_IF_ADDRESS_LOOPBACK(IS_OSPF6_DEBUG_INTERFACE
,
429 CONTINUE_IF_ADDRESS_V4COMPAT(IS_OSPF6_DEBUG_INTERFACE
,
431 CONTINUE_IF_ADDRESS_V4MAPPED(IS_OSPF6_DEBUG_INTERFACE
,
435 if (oi
->plist_name
) {
436 struct prefix_list
*plist
;
437 enum prefix_list_type ret
;
438 char buf
[PREFIX2STR_BUFFER
];
440 prefix2str(c
->address
, buf
, sizeof(buf
));
441 plist
= prefix_list_lookup(AFI_IP6
, oi
->plist_name
);
442 ret
= prefix_list_apply(plist
, (void *)c
->address
);
443 if (ret
== PREFIX_DENY
) {
444 if (IS_OSPF6_DEBUG_INTERFACE
)
446 "%s on %s filtered by prefix-list %s ",
447 buf
, oi
->interface
->name
,
453 route
= ospf6_route_create();
454 memcpy(&route
->prefix
, c
->address
, sizeof(struct prefix
));
455 apply_mask(&route
->prefix
);
456 route
->type
= OSPF6_DEST_TYPE_NETWORK
;
457 route
->path
.area_id
= oi
->area
->area_id
;
458 route
->path
.type
= OSPF6_PATH_TYPE_INTRA
;
459 route
->path
.cost
= oi
->cost
;
460 inet_pton(AF_INET6
, "::1", &nh_addr
);
461 ospf6_route_add_nexthop(route
, oi
->interface
->ifindex
,
463 ospf6_route_add(route
, oi
->route_connected
);
466 /* create new Link-LSA */
467 OSPF6_LINK_LSA_SCHEDULE(oi
);
468 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(oi
);
469 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oi
->area
);
472 static void ospf6_interface_state_change(uint8_t next_state
,
473 struct ospf6_interface
*oi
)
477 prev_state
= oi
->state
;
478 oi
->state
= next_state
;
480 if (prev_state
== next_state
)
484 if (IS_OSPF6_DEBUG_INTERFACE
) {
485 zlog_debug("Interface state change %s: %s -> %s",
487 ospf6_interface_state_str
[prev_state
],
488 ospf6_interface_state_str
[next_state
]);
492 if ((prev_state
== OSPF6_INTERFACE_DR
493 || prev_state
== OSPF6_INTERFACE_BDR
)
494 && (next_state
!= OSPF6_INTERFACE_DR
495 && next_state
!= OSPF6_INTERFACE_BDR
))
496 ospf6_sso(oi
->interface
->ifindex
, &alldrouters6
,
499 if ((prev_state
!= OSPF6_INTERFACE_DR
500 && prev_state
!= OSPF6_INTERFACE_BDR
)
501 && (next_state
== OSPF6_INTERFACE_DR
502 || next_state
== OSPF6_INTERFACE_BDR
))
503 ospf6_sso(oi
->interface
->ifindex
, &alldrouters6
,
506 OSPF6_ROUTER_LSA_SCHEDULE(oi
->area
);
507 if (next_state
== OSPF6_INTERFACE_DOWN
) {
508 OSPF6_NETWORK_LSA_EXECUTE(oi
);
509 OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT(oi
);
510 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oi
->area
);
511 OSPF6_INTRA_PREFIX_LSA_EXECUTE_TRANSIT(oi
);
512 } else if (prev_state
== OSPF6_INTERFACE_DR
513 || next_state
== OSPF6_INTERFACE_DR
) {
514 OSPF6_NETWORK_LSA_SCHEDULE(oi
);
515 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(oi
);
516 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oi
->area
);
519 hook_call(ospf6_interface_change
, oi
, next_state
, prev_state
);
523 /* DR Election, RFC2328 section 9.4 */
525 #define IS_ELIGIBLE(n) \
526 ((n)->state >= OSPF6_NEIGHBOR_TWOWAY && (n)->priority != 0)
528 static struct ospf6_neighbor
*better_bdrouter(struct ospf6_neighbor
*a
,
529 struct ospf6_neighbor
*b
)
531 if ((a
== NULL
|| !IS_ELIGIBLE(a
) || a
->drouter
== a
->router_id
)
532 && (b
== NULL
|| !IS_ELIGIBLE(b
) || b
->drouter
== b
->router_id
))
534 else if (a
== NULL
|| !IS_ELIGIBLE(a
) || a
->drouter
== a
->router_id
)
536 else if (b
== NULL
|| !IS_ELIGIBLE(b
) || b
->drouter
== b
->router_id
)
539 if (a
->bdrouter
== a
->router_id
&& b
->bdrouter
!= b
->router_id
)
541 if (a
->bdrouter
!= a
->router_id
&& b
->bdrouter
== b
->router_id
)
544 if (a
->priority
> b
->priority
)
546 if (a
->priority
< b
->priority
)
549 if (ntohl(a
->router_id
) > ntohl(b
->router_id
))
551 if (ntohl(a
->router_id
) < ntohl(b
->router_id
))
554 zlog_warn("Router-ID duplicate ?");
558 static struct ospf6_neighbor
*better_drouter(struct ospf6_neighbor
*a
,
559 struct ospf6_neighbor
*b
)
561 if ((a
== NULL
|| !IS_ELIGIBLE(a
) || a
->drouter
!= a
->router_id
)
562 && (b
== NULL
|| !IS_ELIGIBLE(b
) || b
->drouter
!= b
->router_id
))
564 else if (a
== NULL
|| !IS_ELIGIBLE(a
) || a
->drouter
!= a
->router_id
)
566 else if (b
== NULL
|| !IS_ELIGIBLE(b
) || b
->drouter
!= b
->router_id
)
569 if (a
->drouter
== a
->router_id
&& b
->drouter
!= b
->router_id
)
571 if (a
->drouter
!= a
->router_id
&& b
->drouter
== b
->router_id
)
574 if (a
->priority
> b
->priority
)
576 if (a
->priority
< b
->priority
)
579 if (ntohl(a
->router_id
) > ntohl(b
->router_id
))
581 if (ntohl(a
->router_id
) < ntohl(b
->router_id
))
584 zlog_warn("Router-ID duplicate ?");
588 static uint8_t dr_election(struct ospf6_interface
*oi
)
590 struct listnode
*node
, *nnode
;
591 struct ospf6_neighbor
*on
, *drouter
, *bdrouter
, myself
;
592 struct ospf6_neighbor
*best_drouter
, *best_bdrouter
;
593 uint8_t next_state
= 0;
595 drouter
= bdrouter
= NULL
;
596 best_drouter
= best_bdrouter
= NULL
;
598 /* pseudo neighbor myself, including noting current DR/BDR (1) */
599 memset(&myself
, 0, sizeof(myself
));
600 inet_ntop(AF_INET
, &oi
->area
->ospf6
->router_id
, myself
.name
,
601 sizeof(myself
.name
));
602 myself
.state
= OSPF6_NEIGHBOR_TWOWAY
;
603 myself
.drouter
= oi
->drouter
;
604 myself
.bdrouter
= oi
->bdrouter
;
605 myself
.priority
= oi
->priority
;
606 myself
.router_id
= oi
->area
->ospf6
->router_id
;
608 /* Electing BDR (2) */
609 for (ALL_LIST_ELEMENTS(oi
->neighbor_list
, node
, nnode
, on
))
610 bdrouter
= better_bdrouter(bdrouter
, on
);
612 best_bdrouter
= bdrouter
;
613 bdrouter
= better_bdrouter(best_bdrouter
, &myself
);
615 /* Electing DR (3) */
616 for (ALL_LIST_ELEMENTS(oi
->neighbor_list
, node
, nnode
, on
))
617 drouter
= better_drouter(drouter
, on
);
619 best_drouter
= drouter
;
620 drouter
= better_drouter(best_drouter
, &myself
);
624 /* the router itself is newly/no longer DR/BDR (4) */
625 if ((drouter
== &myself
&& myself
.drouter
!= myself
.router_id
)
626 || (drouter
!= &myself
&& myself
.drouter
== myself
.router_id
)
627 || (bdrouter
== &myself
&& myself
.bdrouter
!= myself
.router_id
)
628 || (bdrouter
!= &myself
&& myself
.bdrouter
== myself
.router_id
)) {
629 myself
.drouter
= (drouter
? drouter
->router_id
: htonl(0));
630 myself
.bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl(0));
632 /* compatible to Electing BDR (2) */
633 bdrouter
= better_bdrouter(best_bdrouter
, &myself
);
635 /* compatible to Electing DR (3) */
636 drouter
= better_drouter(best_drouter
, &myself
);
641 /* Set interface state accordingly (5) */
642 if (drouter
&& drouter
== &myself
)
643 next_state
= OSPF6_INTERFACE_DR
;
644 else if (bdrouter
&& bdrouter
== &myself
)
645 next_state
= OSPF6_INTERFACE_BDR
;
647 next_state
= OSPF6_INTERFACE_DROTHER
;
649 /* If NBMA, schedule Start for each neighbor having priority of 0 (6) */
652 /* If DR or BDR change, invoke AdjOK? for each neighbor (7) */
653 /* RFC 2328 section 12.4. Originating LSAs (3) will be handled
654 accordingly after AdjOK */
655 if (oi
->drouter
!= (drouter
? drouter
->router_id
: htonl(0))
656 || oi
->bdrouter
!= (bdrouter
? bdrouter
->router_id
: htonl(0))) {
657 if (IS_OSPF6_DEBUG_INTERFACE
)
658 zlog_debug("DR Election on %s: DR: %s BDR: %s",
660 (drouter
? drouter
->name
: "0.0.0.0"),
661 (bdrouter
? bdrouter
->name
: "0.0.0.0"));
663 for (ALL_LIST_ELEMENTS_RO(oi
->neighbor_list
, node
, on
)) {
664 if (on
->state
< OSPF6_NEIGHBOR_TWOWAY
)
666 /* Schedule AdjOK. */
667 thread_add_event(master
, adj_ok
, on
, 0, NULL
);
671 oi
->drouter
= (drouter
? drouter
->router_id
: htonl(0));
672 oi
->bdrouter
= (bdrouter
? bdrouter
->router_id
: htonl(0));
677 /* Interface State Machine */
678 int interface_up(struct thread
*thread
)
680 struct ospf6_interface
*oi
;
682 oi
= (struct ospf6_interface
*)THREAD_ARG(thread
);
683 assert(oi
&& oi
->interface
);
686 oi
->type
= ospf6_default_iftype(oi
->interface
);
689 * Remove old pointer. If this thread wasn't a timer this
690 * operation won't make a difference, because it is already NULL.
692 oi
->thread_sso
= NULL
;
694 if (IS_OSPF6_DEBUG_INTERFACE
)
695 zlog_debug("Interface Event %s: [InterfaceUp]",
696 oi
->interface
->name
);
698 /* check physical interface is up */
699 if (!if_is_operative(oi
->interface
)) {
700 if (IS_OSPF6_DEBUG_INTERFACE
)
702 "Interface %s is down, can't execute [InterfaceUp]",
703 oi
->interface
->name
);
707 /* check interface has a link-local address */
708 if (!(ospf6_interface_get_linklocal_address(oi
->interface
)
709 || if_is_loopback(oi
->interface
))) {
710 if (IS_OSPF6_DEBUG_INTERFACE
)
712 "Interface %s has no link local address, can't execute [InterfaceUp]",
713 oi
->interface
->name
);
718 ospf6_interface_recalculate_cost(oi
);
720 /* if already enabled, do nothing */
721 if (oi
->state
> OSPF6_INTERFACE_DOWN
) {
722 if (IS_OSPF6_DEBUG_INTERFACE
)
723 zlog_debug("Interface %s already enabled",
724 oi
->interface
->name
);
728 /* If no area assigned, return */
729 if (oi
->area
== NULL
) {
731 "%s: Not scheduleing Hello for %s as there is no area assigned yet",
732 __func__
, oi
->interface
->name
);
738 * XXX: Schedule IPv6 group join for later, otherwise we might
739 * lose the multicast group registration caused by IPv6 group
742 if (oi
->sso_try_cnt
== 0) {
744 zlog_info("Scheduling %s for sso", oi
->interface
->name
);
745 thread_add_timer(master
, interface_up
, oi
,
746 OSPF6_INTERFACE_SSO_RETRY_INT
,
750 #endif /* __FreeBSD__ */
752 /* Join AllSPFRouters */
753 if (ospf6_sso(oi
->interface
->ifindex
, &allspfrouters6
, IPV6_JOIN_GROUP
)
755 if (oi
->sso_try_cnt
++ < OSPF6_INTERFACE_SSO_RETRY_MAX
) {
757 "Scheduling %s for sso retry, trial count: %d",
758 oi
->interface
->name
, oi
->sso_try_cnt
);
759 thread_add_timer(master
, interface_up
, oi
,
760 OSPF6_INTERFACE_SSO_RETRY_INT
,
765 oi
->sso_try_cnt
= 0; /* Reset on success */
767 /* Update interface route */
768 ospf6_interface_connected_route_update(oi
->interface
);
771 if (!CHECK_FLAG(oi
->flag
, OSPF6_INTERFACE_PASSIVE
)
772 && !if_is_loopback(oi
->interface
)) {
773 oi
->thread_send_hello
= NULL
;
774 thread_add_event(master
, ospf6_hello_send
, oi
, 0,
775 &oi
->thread_send_hello
);
778 /* decide next interface state */
779 if (oi
->type
== OSPF_IFTYPE_POINTOPOINT
) {
780 ospf6_interface_state_change(OSPF6_INTERFACE_POINTTOPOINT
, oi
);
781 } else if (oi
->priority
== 0)
782 ospf6_interface_state_change(OSPF6_INTERFACE_DROTHER
, oi
);
784 ospf6_interface_state_change(OSPF6_INTERFACE_WAITING
, oi
);
785 thread_add_timer(master
, wait_timer
, oi
, oi
->dead_interval
,
792 int wait_timer(struct thread
*thread
)
794 struct ospf6_interface
*oi
;
796 oi
= (struct ospf6_interface
*)THREAD_ARG(thread
);
797 assert(oi
&& oi
->interface
);
799 if (IS_OSPF6_DEBUG_INTERFACE
)
800 zlog_debug("Interface Event %s: [WaitTimer]",
801 oi
->interface
->name
);
803 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
804 ospf6_interface_state_change(dr_election(oi
), oi
);
809 int backup_seen(struct thread
*thread
)
811 struct ospf6_interface
*oi
;
813 oi
= (struct ospf6_interface
*)THREAD_ARG(thread
);
814 assert(oi
&& oi
->interface
);
816 if (IS_OSPF6_DEBUG_INTERFACE
)
817 zlog_debug("Interface Event %s: [BackupSeen]",
818 oi
->interface
->name
);
820 if (oi
->state
== OSPF6_INTERFACE_WAITING
)
821 ospf6_interface_state_change(dr_election(oi
), oi
);
826 int neighbor_change(struct thread
*thread
)
828 struct ospf6_interface
*oi
;
830 oi
= (struct ospf6_interface
*)THREAD_ARG(thread
);
831 assert(oi
&& oi
->interface
);
833 if (IS_OSPF6_DEBUG_INTERFACE
)
834 zlog_debug("Interface Event %s: [NeighborChange]",
835 oi
->interface
->name
);
837 if (oi
->state
== OSPF6_INTERFACE_DROTHER
838 || oi
->state
== OSPF6_INTERFACE_BDR
839 || oi
->state
== OSPF6_INTERFACE_DR
)
840 ospf6_interface_state_change(dr_election(oi
), oi
);
845 int interface_down(struct thread
*thread
)
847 struct ospf6_interface
*oi
;
848 struct listnode
*node
, *nnode
;
849 struct ospf6_neighbor
*on
;
851 oi
= (struct ospf6_interface
*)THREAD_ARG(thread
);
852 assert(oi
&& oi
->interface
);
854 if (IS_OSPF6_DEBUG_INTERFACE
)
855 zlog_debug("Interface Event %s: [InterfaceDown]",
856 oi
->interface
->name
);
859 THREAD_OFF(oi
->thread_send_hello
);
861 /* Stop trying to set socket options. */
862 THREAD_OFF(oi
->thread_sso
);
864 /* Leave AllSPFRouters */
865 if (oi
->state
> OSPF6_INTERFACE_DOWN
)
866 ospf6_sso(oi
->interface
->ifindex
, &allspfrouters6
,
869 ospf6_interface_state_change(OSPF6_INTERFACE_DOWN
, oi
);
871 for (ALL_LIST_ELEMENTS(oi
->neighbor_list
, node
, nnode
, on
))
872 ospf6_neighbor_delete(on
);
874 list_delete_all_node(oi
->neighbor_list
);
876 /* When interface state is reset, also reset information about
877 * DR election, as it is no longer valid. */
878 oi
->drouter
= oi
->prev_drouter
= htonl(0);
879 oi
->bdrouter
= oi
->prev_bdrouter
= htonl(0);
884 static const char *ospf6_iftype_str(uint8_t iftype
)
887 case OSPF_IFTYPE_LOOPBACK
:
889 case OSPF_IFTYPE_BROADCAST
:
891 case OSPF_IFTYPE_POINTOPOINT
:
892 return "POINTOPOINT";
897 /* show specified interface structure */
898 static int ospf6_interface_show(struct vty
*vty
, struct interface
*ifp
)
900 struct ospf6_interface
*oi
;
904 char strbuf
[PREFIX2STR_BUFFER
], drouter
[32], bdrouter
[32];
905 uint8_t default_iftype
;
906 struct timeval res
, now
;
908 struct ospf6_lsa
*lsa
;
910 default_iftype
= ospf6_default_iftype(ifp
);
912 vty_out(vty
, "%s is %s, type %s\n", ifp
->name
,
913 (if_is_operative(ifp
) ? "up" : "down"),
914 ospf6_iftype_str(default_iftype
));
915 vty_out(vty
, " Interface ID: %d\n", ifp
->ifindex
);
917 if (ifp
->info
== NULL
) {
918 vty_out(vty
, " OSPF not enabled on this interface\n");
921 oi
= (struct ospf6_interface
*)ifp
->info
;
923 if (if_is_operative(ifp
) && oi
->type
!= default_iftype
)
924 vty_out(vty
, " Operating as type %s\n",
925 ospf6_iftype_str(oi
->type
));
927 vty_out(vty
, " Internet Address:\n");
929 for (ALL_LIST_ELEMENTS_RO(ifp
->connected
, i
, c
)) {
931 prefix2str(p
, strbuf
, sizeof(strbuf
));
934 vty_out(vty
, " inet : %s\n", strbuf
);
937 vty_out(vty
, " inet6: %s\n", strbuf
);
940 vty_out(vty
, " ??? : %s\n", strbuf
);
947 " Instance ID %d, Interface MTU %d (autodetect: %d)\n",
948 oi
->instance_id
, oi
->ifmtu
, ifp
->mtu6
);
949 vty_out(vty
, " MTU mismatch detection: %s\n",
950 oi
->mtu_ignore
? "disabled" : "enabled");
951 inet_ntop(AF_INET
, &oi
->area
->area_id
, strbuf
, sizeof(strbuf
));
952 vty_out(vty
, " Area ID %s, Cost %u\n", strbuf
, oi
->cost
);
954 vty_out(vty
, " Not Attached to Area\n");
956 vty_out(vty
, " State %s, Transmit Delay %d sec, Priority %d\n",
957 ospf6_interface_state_str
[oi
->state
], oi
->transdelay
,
959 vty_out(vty
, " Timer intervals configured:\n");
960 vty_out(vty
, " Hello %d, Dead %d, Retransmit %d\n",
961 oi
->hello_interval
, oi
->dead_interval
, oi
->rxmt_interval
);
963 inet_ntop(AF_INET
, &oi
->drouter
, drouter
, sizeof(drouter
));
964 inet_ntop(AF_INET
, &oi
->bdrouter
, bdrouter
, sizeof(bdrouter
));
965 vty_out(vty
, " DR: %s BDR: %s\n", drouter
, bdrouter
);
967 vty_out(vty
, " Number of I/F scoped LSAs is %u\n", oi
->lsdb
->count
);
972 if (oi
->thread_send_lsupdate
)
973 timersub(&oi
->thread_send_lsupdate
->u
.sands
, &now
, &res
);
974 timerstring(&res
, duration
, sizeof(duration
));
976 " %d Pending LSAs for LSUpdate in Time %s [thread %s]\n",
977 oi
->lsupdate_list
->count
, duration
,
978 (oi
->thread_send_lsupdate
? "on" : "off"));
979 for (ALL_LSDB(oi
->lsupdate_list
, lsa
))
980 vty_out(vty
, " %s\n", lsa
->name
);
983 if (oi
->thread_send_lsack
)
984 timersub(&oi
->thread_send_lsack
->u
.sands
, &now
, &res
);
985 timerstring(&res
, duration
, sizeof(duration
));
986 vty_out(vty
, " %d Pending LSAs for LSAck in Time %s [thread %s]\n",
987 oi
->lsack_list
->count
, duration
,
988 (oi
->thread_send_lsack
? "on" : "off"));
989 for (ALL_LSDB(oi
->lsack_list
, lsa
))
990 vty_out(vty
, " %s\n", lsa
->name
);
991 ospf6_bfd_show_info(vty
, oi
->bfd_info
, 1);
996 DEFUN (show_ipv6_ospf6_interface
,
997 show_ipv6_ospf6_interface_ifname_cmd
,
998 "show ipv6 ospf6 interface [IFNAME]",
1005 struct vrf
*vrf
= vrf_lookup_by_id(VRF_DEFAULT
);
1007 struct interface
*ifp
;
1010 ifp
= if_lookup_by_name(argv
[idx_ifname
]->arg
, VRF_DEFAULT
);
1012 vty_out(vty
, "No such Interface: %s\n",
1013 argv
[idx_ifname
]->arg
);
1016 ospf6_interface_show(vty
, ifp
);
1018 FOR_ALL_INTERFACES (vrf
, ifp
)
1019 ospf6_interface_show(vty
, ifp
);
1025 static int ospf6_interface_show_traffic(struct vty
*vty
, uint32_t vrf_id
,
1026 struct interface
*intf_ifp
,
1029 struct interface
*ifp
;
1030 struct vrf
*vrf
= NULL
;
1031 struct ospf6_interface
*oi
= NULL
;
1033 vrf
= vrf_lookup_by_id(vrf_id
);
1035 if (!display_once
) {
1037 vty_out(vty
, "%-12s%-17s%-17s%-17s%-17s%-17s\n", "Interface",
1038 " HELLO", " DB-Desc", " LS-Req", " LS-Update",
1040 vty_out(vty
, "%-10s%-18s%-18s%-17s%-17s%-17s\n", "",
1041 " Rx/Tx", " Rx/Tx", " Rx/Tx", " Rx/Tx",
1044 "--------------------------------------------------------------------------------------------\n");
1047 if (intf_ifp
== NULL
) {
1048 FOR_ALL_INTERFACES (vrf
, ifp
) {
1050 oi
= (struct ospf6_interface
*)ifp
->info
;
1055 "%-10s %8u/%-8u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u\n",
1056 oi
->interface
->name
, oi
->hello_in
,
1057 oi
->hello_out
, oi
->db_desc_in
, oi
->db_desc_out
,
1058 oi
->ls_req_in
, oi
->ls_req_out
, oi
->ls_upd_in
,
1059 oi
->ls_upd_out
, oi
->ls_ack_in
, oi
->ls_ack_out
);
1062 oi
= intf_ifp
->info
;
1067 "%-10s %8u/%-8u %7u/%-7u %7u/%-7u %7u/%-7u %7u/%-7u\n",
1068 oi
->interface
->name
, oi
->hello_in
, oi
->hello_out
,
1069 oi
->db_desc_in
, oi
->db_desc_out
, oi
->ls_req_in
,
1070 oi
->ls_req_out
, oi
->ls_upd_in
, oi
->ls_upd_out
,
1071 oi
->ls_ack_in
, oi
->ls_ack_out
);
1077 /* show interface */
1078 DEFUN (show_ipv6_ospf6_interface_traffic
,
1079 show_ipv6_ospf6_interface_traffic_cmd
,
1080 "show ipv6 ospf6 interface traffic [IFNAME]",
1085 "Protocol Packet counters\n"
1089 int display_once
= 0;
1090 char *intf_name
= NULL
;
1091 struct interface
*ifp
= NULL
;
1093 if (argv_find(argv
, argc
, "IFNAME", &idx_ifname
)) {
1094 intf_name
= argv
[idx_ifname
]->arg
;
1095 ifp
= if_lookup_by_name(intf_name
, VRF_DEFAULT
);
1097 vty_out(vty
, "No such Interface: %s\n", intf_name
);
1100 if (ifp
->info
== NULL
) {
1102 " OSPF not enabled on this interface %s\n",
1108 ospf6_interface_show_traffic(vty
, VRF_DEFAULT
, ifp
, display_once
);
1115 DEFUN (show_ipv6_ospf6_interface_ifname_prefix
,
1116 show_ipv6_ospf6_interface_ifname_prefix_cmd
,
1117 "show ipv6 ospf6 interface IFNAME prefix\
1120 |<X:X::X:X|X:X::X:X/M> [<match|detail>]\
1127 "Display connected prefixes to advertise\n"
1128 "Display details of the prefixes\n"
1129 OSPF6_ROUTE_ADDRESS_STR
1130 OSPF6_ROUTE_PREFIX_STR
1131 OSPF6_ROUTE_MATCH_STR
1132 "Display details of the prefixes\n")
1136 struct interface
*ifp
;
1137 struct ospf6_interface
*oi
;
1139 ifp
= if_lookup_by_name(argv
[idx_ifname
]->arg
, VRF_DEFAULT
);
1141 vty_out(vty
, "No such Interface: %s\n", argv
[idx_ifname
]->arg
);
1147 vty_out(vty
, "OSPFv3 is not enabled on %s\n",
1148 argv
[idx_ifname
]->arg
);
1152 ospf6_route_table_show(vty
, idx_prefix
, argc
, argv
,
1153 oi
->route_connected
);
1158 DEFUN (show_ipv6_ospf6_interface_prefix
,
1159 show_ipv6_ospf6_interface_prefix_cmd
,
1160 "show ipv6 ospf6 interface prefix\
1163 |<X:X::X:X|X:X::X:X/M> [<match|detail>]\
1169 "Display connected prefixes to advertise\n"
1170 "Display details of the prefixes\n"
1171 OSPF6_ROUTE_ADDRESS_STR
1172 OSPF6_ROUTE_PREFIX_STR
1173 OSPF6_ROUTE_MATCH_STR
1174 "Display details of the prefixes\n")
1176 struct vrf
*vrf
= vrf_lookup_by_id(VRF_DEFAULT
);
1178 struct ospf6_interface
*oi
;
1179 struct interface
*ifp
;
1181 FOR_ALL_INTERFACES (vrf
, ifp
) {
1182 oi
= (struct ospf6_interface
*)ifp
->info
;
1186 ospf6_route_table_show(vty
, idx_prefix
, argc
, argv
,
1187 oi
->route_connected
);
1193 /* interface variable set command */
1194 DEFUN (ipv6_ospf6_ifmtu
,
1195 ipv6_ospf6_ifmtu_cmd
,
1196 "ipv6 ospf6 ifmtu (1-65535)",
1200 "OSPFv3 Interface MTU\n"
1203 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1205 struct ospf6_interface
*oi
;
1206 unsigned int ifmtu
, iobuflen
;
1207 struct listnode
*node
, *nnode
;
1208 struct ospf6_neighbor
*on
;
1212 oi
= (struct ospf6_interface
*)ifp
->info
;
1214 oi
= ospf6_interface_create(ifp
);
1217 ifmtu
= strtol(argv
[idx_number
]->arg
, NULL
, 10);
1219 if (oi
->c_ifmtu
== ifmtu
)
1222 if (ifp
->mtu6
!= 0 && ifp
->mtu6
< ifmtu
) {
1224 "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)\n",
1225 ifp
->name
, ifp
->mtu6
);
1226 return CMD_WARNING_CONFIG_FAILED
;
1229 if (oi
->ifmtu
< ifmtu
) {
1230 iobuflen
= ospf6_iobuf_size(ifmtu
);
1231 if (iobuflen
< ifmtu
) {
1233 "%s's ifmtu is adjusted to I/O buffer size (%d).\n",
1234 ifp
->name
, iobuflen
);
1235 oi
->ifmtu
= oi
->c_ifmtu
= iobuflen
;
1237 oi
->ifmtu
= oi
->c_ifmtu
= ifmtu
;
1239 oi
->ifmtu
= oi
->c_ifmtu
= ifmtu
;
1241 /* re-establish adjacencies */
1242 for (ALL_LIST_ELEMENTS(oi
->neighbor_list
, node
, nnode
, on
)) {
1243 THREAD_OFF(on
->inactivity_timer
);
1244 thread_add_event(master
, inactivity_timer
, on
, 0, NULL
);
1250 DEFUN (no_ipv6_ospf6_ifmtu
,
1251 no_ipv6_ospf6_ifmtu_cmd
,
1252 "no ipv6 ospf6 ifmtu [(1-65535)]",
1257 "OSPFv3 Interface MTU\n"
1260 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1261 struct ospf6_interface
*oi
;
1262 unsigned int iobuflen
;
1263 struct listnode
*node
, *nnode
;
1264 struct ospf6_neighbor
*on
;
1268 oi
= (struct ospf6_interface
*)ifp
->info
;
1270 oi
= ospf6_interface_create(ifp
);
1273 if (oi
->ifmtu
< ifp
->mtu
) {
1274 iobuflen
= ospf6_iobuf_size(ifp
->mtu
);
1275 if (iobuflen
< ifp
->mtu
) {
1277 "%s's ifmtu is adjusted to I/O buffer size (%d).\n",
1278 ifp
->name
, iobuflen
);
1279 oi
->ifmtu
= iobuflen
;
1281 oi
->ifmtu
= ifp
->mtu
;
1283 oi
->ifmtu
= ifp
->mtu
;
1287 /* re-establish adjacencies */
1288 for (ALL_LIST_ELEMENTS(oi
->neighbor_list
, node
, nnode
, on
)) {
1289 THREAD_OFF(on
->inactivity_timer
);
1290 thread_add_event(master
, inactivity_timer
, on
, 0, NULL
);
1296 DEFUN (ipv6_ospf6_cost
,
1297 ipv6_ospf6_cost_cmd
,
1298 "ipv6 ospf6 cost (1-65535)",
1302 "Outgoing metric of this interface\n")
1304 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1306 struct ospf6_interface
*oi
;
1307 unsigned long int lcost
;
1311 oi
= (struct ospf6_interface
*)ifp
->info
;
1313 oi
= ospf6_interface_create(ifp
);
1316 lcost
= strtol(argv
[idx_number
]->arg
, NULL
, 10);
1318 if (lcost
> UINT32_MAX
) {
1319 vty_out(vty
, "Cost %ld is out of range\n", lcost
);
1320 return CMD_WARNING_CONFIG_FAILED
;
1323 if (oi
->cost
== lcost
)
1327 SET_FLAG(oi
->flag
, OSPF6_INTERFACE_NOAUTOCOST
);
1329 ospf6_interface_force_recalculate_cost(oi
);
1334 DEFUN (no_ipv6_ospf6_cost
,
1335 no_ipv6_ospf6_cost_cmd
,
1336 "no ipv6 ospf6 cost [(1-65535)]",
1340 "Calculate interface cost from bandwidth\n"
1341 "Outgoing metric of this interface\n")
1343 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1344 struct ospf6_interface
*oi
;
1347 oi
= (struct ospf6_interface
*)ifp
->info
;
1349 oi
= ospf6_interface_create(ifp
);
1352 UNSET_FLAG(oi
->flag
, OSPF6_INTERFACE_NOAUTOCOST
);
1354 ospf6_interface_recalculate_cost(oi
);
1359 DEFUN (auto_cost_reference_bandwidth
,
1360 auto_cost_reference_bandwidth_cmd
,
1361 "auto-cost reference-bandwidth (1-4294967)",
1362 "Calculate OSPF interface cost according to bandwidth\n"
1363 "Use reference bandwidth method to assign OSPF cost\n"
1364 "The reference bandwidth in terms of Mbits per second\n")
1366 VTY_DECLVAR_CONTEXT(ospf6
, o
);
1368 struct ospf6_area
*oa
;
1369 struct ospf6_interface
*oi
;
1370 struct listnode
*i
, *j
;
1373 refbw
= strtol(argv
[idx_number
]->arg
, NULL
, 10);
1374 if (refbw
< 1 || refbw
> 4294967) {
1375 vty_out(vty
, "reference-bandwidth value is invalid\n");
1376 return CMD_WARNING_CONFIG_FAILED
;
1379 /* If reference bandwidth is changed. */
1380 if ((refbw
) == o
->ref_bandwidth
)
1383 o
->ref_bandwidth
= refbw
;
1384 for (ALL_LIST_ELEMENTS_RO(o
->area_list
, i
, oa
))
1385 for (ALL_LIST_ELEMENTS_RO(oa
->if_list
, j
, oi
))
1386 ospf6_interface_recalculate_cost(oi
);
1391 DEFUN (no_auto_cost_reference_bandwidth
,
1392 no_auto_cost_reference_bandwidth_cmd
,
1393 "no auto-cost reference-bandwidth [(1-4294967)]",
1395 "Calculate OSPF interface cost according to bandwidth\n"
1396 "Use reference bandwidth method to assign OSPF cost\n"
1397 "The reference bandwidth in terms of Mbits per second\n")
1399 VTY_DECLVAR_CONTEXT(ospf6
, o
);
1400 struct ospf6_area
*oa
;
1401 struct ospf6_interface
*oi
;
1402 struct listnode
*i
, *j
;
1404 if (o
->ref_bandwidth
== OSPF6_REFERENCE_BANDWIDTH
)
1407 o
->ref_bandwidth
= OSPF6_REFERENCE_BANDWIDTH
;
1408 for (ALL_LIST_ELEMENTS_RO(o
->area_list
, i
, oa
))
1409 for (ALL_LIST_ELEMENTS_RO(oa
->if_list
, j
, oi
))
1410 ospf6_interface_recalculate_cost(oi
);
1416 DEFUN (ipv6_ospf6_hellointerval
,
1417 ipv6_ospf6_hellointerval_cmd
,
1418 "ipv6 ospf6 hello-interval (1-65535)",
1421 "Time between HELLO packets\n"
1424 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1426 struct ospf6_interface
*oi
;
1429 oi
= (struct ospf6_interface
*)ifp
->info
;
1431 oi
= ospf6_interface_create(ifp
);
1434 oi
->hello_interval
= strmatch(argv
[0]->text
, "no")
1435 ? OSPF_HELLO_INTERVAL_DEFAULT
1436 : strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1440 ALIAS (ipv6_ospf6_hellointerval
,
1441 no_ipv6_ospf6_hellointerval_cmd
,
1442 "no ipv6 ospf6 hello-interval [(1-65535)]",
1446 "Time between HELLO packets\n"
1449 /* interface variable set command */
1450 DEFUN (ipv6_ospf6_deadinterval
,
1451 ipv6_ospf6_deadinterval_cmd
,
1452 "ipv6 ospf6 dead-interval (1-65535)",
1455 "Interval time after which a neighbor is declared down\n"
1458 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1460 struct ospf6_interface
*oi
;
1463 oi
= (struct ospf6_interface
*)ifp
->info
;
1465 oi
= ospf6_interface_create(ifp
);
1468 oi
->dead_interval
= strmatch(argv
[0]->arg
, "no")
1469 ? OSPF_ROUTER_DEAD_INTERVAL_DEFAULT
1470 : strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1474 ALIAS (ipv6_ospf6_deadinterval
,
1475 no_ipv6_ospf6_deadinterval_cmd
,
1476 "no ipv6 ospf6 dead-interval [(1-65535)]",
1480 "Interval time after which a neighbor is declared down\n"
1483 /* interface variable set command */
1484 DEFUN (ipv6_ospf6_transmitdelay
,
1485 ipv6_ospf6_transmitdelay_cmd
,
1486 "ipv6 ospf6 transmit-delay (1-3600)",
1489 "Link state transmit delay\n"
1492 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1494 struct ospf6_interface
*oi
;
1497 oi
= (struct ospf6_interface
*)ifp
->info
;
1499 oi
= ospf6_interface_create(ifp
);
1502 oi
->transdelay
= strmatch(argv
[0]->text
, "no")
1503 ? OSPF6_INTERFACE_TRANSDELAY
1504 : strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1508 ALIAS (ipv6_ospf6_transmitdelay
,
1509 no_ipv6_ospf6_transmitdelay_cmd
,
1510 "no ipv6 ospf6 transmit-delay [(1-3600)]",
1514 "Link state transmit delay\n"
1517 /* interface variable set command */
1518 DEFUN (ipv6_ospf6_retransmitinterval
,
1519 ipv6_ospf6_retransmitinterval_cmd
,
1520 "ipv6 ospf6 retransmit-interval (1-65535)",
1523 "Time between retransmitting lost link state advertisements\n"
1526 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1528 struct ospf6_interface
*oi
;
1531 oi
= (struct ospf6_interface
*)ifp
->info
;
1533 oi
= ospf6_interface_create(ifp
);
1536 oi
->rxmt_interval
= strmatch(argv
[0]->text
, "no")
1537 ? OSPF_RETRANSMIT_INTERVAL_DEFAULT
1538 : strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1542 ALIAS (ipv6_ospf6_retransmitinterval
,
1543 no_ipv6_ospf6_retransmitinterval_cmd
,
1544 "no ipv6 ospf6 retransmit-interval [(1-65535)]",
1548 "Time between retransmitting lost link state advertisements\n"
1551 /* interface variable set command */
1552 DEFUN (ipv6_ospf6_priority
,
1553 ipv6_ospf6_priority_cmd
,
1554 "ipv6 ospf6 priority (0-255)",
1560 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1562 struct ospf6_interface
*oi
;
1565 oi
= (struct ospf6_interface
*)ifp
->info
;
1567 oi
= ospf6_interface_create(ifp
);
1570 oi
->priority
= strmatch(argv
[0]->text
, "no")
1571 ? OSPF6_INTERFACE_PRIORITY
1572 : strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1574 if (oi
->area
&& (oi
->state
== OSPF6_INTERFACE_DROTHER
1575 || oi
->state
== OSPF6_INTERFACE_BDR
1576 || oi
->state
== OSPF6_INTERFACE_DR
))
1577 ospf6_interface_state_change(dr_election(oi
), oi
);
1582 ALIAS (ipv6_ospf6_priority
,
1583 no_ipv6_ospf6_priority_cmd
,
1584 "no ipv6 ospf6 priority [(0-255)]",
1591 DEFUN (ipv6_ospf6_instance
,
1592 ipv6_ospf6_instance_cmd
,
1593 "ipv6 ospf6 instance-id (0-255)",
1596 "Instance ID for this interface\n"
1597 "Instance ID value\n")
1599 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1601 struct ospf6_interface
*oi
;
1604 oi
= (struct ospf6_interface
*)ifp
->info
;
1606 oi
= ospf6_interface_create(ifp
);
1609 oi
->instance_id
= strmatch(argv
[0]->text
, "no")
1610 ? OSPF6_INTERFACE_INSTANCE_ID
1611 : strtoul(argv
[idx_number
]->arg
, NULL
, 10);
1615 ALIAS (ipv6_ospf6_instance
,
1616 no_ipv6_ospf6_instance_cmd
,
1617 "no ipv6 ospf6 instance-id [(0-255)]",
1621 "Instance ID for this interface\n"
1622 "Instance ID value\n")
1624 DEFUN (ipv6_ospf6_passive
,
1625 ipv6_ospf6_passive_cmd
,
1626 "ipv6 ospf6 passive",
1629 "Passive interface; no adjacency will be formed on this interface\n"
1632 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1633 struct ospf6_interface
*oi
;
1634 struct listnode
*node
, *nnode
;
1635 struct ospf6_neighbor
*on
;
1639 oi
= (struct ospf6_interface
*)ifp
->info
;
1641 oi
= ospf6_interface_create(ifp
);
1644 SET_FLAG(oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1645 THREAD_OFF(oi
->thread_send_hello
);
1646 THREAD_OFF(oi
->thread_sso
);
1648 for (ALL_LIST_ELEMENTS(oi
->neighbor_list
, node
, nnode
, on
)) {
1649 THREAD_OFF(on
->inactivity_timer
);
1650 thread_add_event(master
, inactivity_timer
, on
, 0, NULL
);
1656 DEFUN (no_ipv6_ospf6_passive
,
1657 no_ipv6_ospf6_passive_cmd
,
1658 "no ipv6 ospf6 passive",
1662 "passive interface: No Adjacency will be formed on this I/F\n"
1665 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1666 struct ospf6_interface
*oi
;
1669 oi
= (struct ospf6_interface
*)ifp
->info
;
1671 oi
= ospf6_interface_create(ifp
);
1674 UNSET_FLAG(oi
->flag
, OSPF6_INTERFACE_PASSIVE
);
1675 THREAD_OFF(oi
->thread_send_hello
);
1676 THREAD_OFF(oi
->thread_sso
);
1677 thread_add_event(master
, ospf6_hello_send
, oi
, 0,
1678 &oi
->thread_send_hello
);
1683 DEFUN (ipv6_ospf6_mtu_ignore
,
1684 ipv6_ospf6_mtu_ignore_cmd
,
1685 "ipv6 ospf6 mtu-ignore",
1688 "Disable MTU mismatch detection on this interface\n"
1691 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1692 struct ospf6_interface
*oi
;
1695 oi
= (struct ospf6_interface
*)ifp
->info
;
1697 oi
= ospf6_interface_create(ifp
);
1705 DEFUN (no_ipv6_ospf6_mtu_ignore
,
1706 no_ipv6_ospf6_mtu_ignore_cmd
,
1707 "no ipv6 ospf6 mtu-ignore",
1711 "Disable MTU mismatch detection on this interface\n"
1714 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1715 struct ospf6_interface
*oi
;
1718 oi
= (struct ospf6_interface
*)ifp
->info
;
1720 oi
= ospf6_interface_create(ifp
);
1728 DEFUN (ipv6_ospf6_advertise_prefix_list
,
1729 ipv6_ospf6_advertise_prefix_list_cmd
,
1730 "ipv6 ospf6 advertise prefix-list WORD",
1733 "Advertising options\n"
1734 "Filter prefix using prefix-list\n"
1735 "Prefix list name\n"
1738 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1740 struct ospf6_interface
*oi
;
1743 oi
= (struct ospf6_interface
*)ifp
->info
;
1745 oi
= ospf6_interface_create(ifp
);
1749 XFREE(MTYPE_CFG_PLIST_NAME
, oi
->plist_name
);
1750 oi
->plist_name
= XSTRDUP(MTYPE_CFG_PLIST_NAME
, argv
[idx_word
]->arg
);
1752 ospf6_interface_connected_route_update(oi
->interface
);
1755 OSPF6_LINK_LSA_SCHEDULE(oi
);
1756 if (oi
->state
== OSPF6_INTERFACE_DR
) {
1757 OSPF6_NETWORK_LSA_SCHEDULE(oi
);
1758 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(oi
);
1760 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oi
->area
);
1766 DEFUN (no_ipv6_ospf6_advertise_prefix_list
,
1767 no_ipv6_ospf6_advertise_prefix_list_cmd
,
1768 "no ipv6 ospf6 advertise prefix-list [WORD]",
1772 "Advertising options\n"
1773 "Filter prefix using prefix-list\n"
1774 "Prefix list name\n")
1776 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1777 struct ospf6_interface
*oi
;
1780 oi
= (struct ospf6_interface
*)ifp
->info
;
1782 oi
= ospf6_interface_create(ifp
);
1786 XFREE(MTYPE_CFG_PLIST_NAME
, oi
->plist_name
);
1788 ospf6_interface_connected_route_update(oi
->interface
);
1791 OSPF6_LINK_LSA_SCHEDULE(oi
);
1792 if (oi
->state
== OSPF6_INTERFACE_DR
) {
1793 OSPF6_NETWORK_LSA_SCHEDULE(oi
);
1794 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(oi
);
1796 OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oi
->area
);
1802 DEFUN (ipv6_ospf6_network
,
1803 ipv6_ospf6_network_cmd
,
1804 "ipv6 ospf6 network <broadcast|point-to-point>",
1808 "Specify OSPF6 broadcast network\n"
1809 "Specify OSPF6 point-to-point network\n"
1812 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1813 int idx_network
= 3;
1814 struct ospf6_interface
*oi
;
1817 oi
= (struct ospf6_interface
*)ifp
->info
;
1819 oi
= ospf6_interface_create(ifp
);
1823 oi
->type_cfg
= true;
1825 if (strncmp(argv
[idx_network
]->arg
, "b", 1) == 0) {
1826 if (oi
->type
== OSPF_IFTYPE_BROADCAST
)
1829 oi
->type
= OSPF_IFTYPE_BROADCAST
;
1830 } else if (strncmp(argv
[idx_network
]->arg
, "point-to-p", 10) == 0) {
1831 if (oi
->type
== OSPF_IFTYPE_POINTOPOINT
) {
1834 oi
->type
= OSPF_IFTYPE_POINTOPOINT
;
1837 /* Reset the interface */
1838 thread_execute(master
, interface_down
, oi
, 0);
1839 thread_execute(master
, interface_up
, oi
, 0);
1844 DEFUN (no_ipv6_ospf6_network
,
1845 no_ipv6_ospf6_network_cmd
,
1846 "no ipv6 ospf6 network [<broadcast|point-to-point>]",
1850 "Set default network type\n"
1851 "Specify OSPF6 broadcast network\n"
1852 "Specify OSPF6 point-to-point network\n")
1854 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1855 struct ospf6_interface
*oi
;
1860 oi
= (struct ospf6_interface
*)ifp
->info
;
1865 oi
->type_cfg
= false;
1867 type
= ospf6_default_iftype(ifp
);
1868 if (oi
->type
== type
) {
1873 /* Reset the interface */
1874 thread_execute(master
, interface_down
, oi
, 0);
1875 thread_execute(master
, interface_up
, oi
, 0);
1880 static int config_write_ospf6_interface(struct vty
*vty
)
1882 struct vrf
*vrf
= vrf_lookup_by_id(VRF_DEFAULT
);
1883 struct ospf6_interface
*oi
;
1884 struct interface
*ifp
;
1886 FOR_ALL_INTERFACES (vrf
, ifp
) {
1887 oi
= (struct ospf6_interface
*)ifp
->info
;
1891 vty_frame(vty
, "interface %s\n", oi
->interface
->name
);
1894 vty_out(vty
, " description %s\n", ifp
->desc
);
1896 vty_out(vty
, " ipv6 ospf6 ifmtu %d\n", oi
->c_ifmtu
);
1898 if (CHECK_FLAG(oi
->flag
, OSPF6_INTERFACE_NOAUTOCOST
))
1899 vty_out(vty
, " ipv6 ospf6 cost %d\n", oi
->cost
);
1901 if (oi
->hello_interval
!= OSPF6_INTERFACE_HELLO_INTERVAL
)
1902 vty_out(vty
, " ipv6 ospf6 hello-interval %d\n",
1903 oi
->hello_interval
);
1905 if (oi
->dead_interval
!= OSPF6_INTERFACE_DEAD_INTERVAL
)
1906 vty_out(vty
, " ipv6 ospf6 dead-interval %d\n",
1909 if (oi
->rxmt_interval
!= OSPF6_INTERFACE_RXMT_INTERVAL
)
1910 vty_out(vty
, " ipv6 ospf6 retransmit-interval %d\n",
1913 if (oi
->priority
!= OSPF6_INTERFACE_PRIORITY
)
1914 vty_out(vty
, " ipv6 ospf6 priority %d\n", oi
->priority
);
1916 if (oi
->transdelay
!= OSPF6_INTERFACE_TRANSDELAY
)
1917 vty_out(vty
, " ipv6 ospf6 transmit-delay %d\n",
1920 if (oi
->instance_id
!= OSPF6_INTERFACE_INSTANCE_ID
)
1921 vty_out(vty
, " ipv6 ospf6 instance-id %d\n",
1925 vty_out(vty
, " ipv6 ospf6 advertise prefix-list %s\n",
1928 if (CHECK_FLAG(oi
->flag
, OSPF6_INTERFACE_PASSIVE
))
1929 vty_out(vty
, " ipv6 ospf6 passive\n");
1932 vty_out(vty
, " ipv6 ospf6 mtu-ignore\n");
1934 if (oi
->type_cfg
&& oi
->type
== OSPF_IFTYPE_POINTOPOINT
)
1935 vty_out(vty
, " ipv6 ospf6 network point-to-point\n");
1936 else if (oi
->type_cfg
&& oi
->type
== OSPF_IFTYPE_BROADCAST
)
1937 vty_out(vty
, " ipv6 ospf6 network broadcast\n");
1939 ospf6_bfd_write_config(vty
, oi
);
1941 vty_endframe(vty
, "!\n");
1946 static struct cmd_node interface_node
= {
1947 INTERFACE_NODE
, "%s(config-if)# ", 1 /* VTYSH */
1950 static int ospf6_ifp_create(struct interface
*ifp
)
1952 if (IS_OSPF6_DEBUG_ZEBRA(RECV
))
1953 zlog_debug("Zebra Interface add: %s index %d mtu %d", ifp
->name
,
1954 ifp
->ifindex
, ifp
->mtu6
);
1955 ospf6_interface_if_add(ifp
);
1960 static int ospf6_ifp_up(struct interface
*ifp
)
1962 if (IS_OSPF6_DEBUG_ZEBRA(RECV
))
1964 "Zebra Interface state change: "
1965 "%s index %d flags %llx metric %d mtu %d bandwidth %d",
1966 ifp
->name
, ifp
->ifindex
, (unsigned long long)ifp
->flags
,
1967 ifp
->metric
, ifp
->mtu6
, ifp
->bandwidth
);
1969 ospf6_interface_state_update(ifp
);
1974 static int ospf6_ifp_down(struct interface
*ifp
)
1976 if (IS_OSPF6_DEBUG_ZEBRA(RECV
))
1978 "Zebra Interface state change: "
1979 "%s index %d flags %llx metric %d mtu %d bandwidth %d",
1980 ifp
->name
, ifp
->ifindex
, (unsigned long long)ifp
->flags
,
1981 ifp
->metric
, ifp
->mtu6
, ifp
->bandwidth
);
1983 ospf6_interface_state_update(ifp
);
1988 static int ospf6_ifp_destroy(struct interface
*ifp
)
1991 zlog_warn("Zebra: got delete of %s, but interface is still up",
1994 if (IS_OSPF6_DEBUG_ZEBRA(RECV
))
1995 zlog_debug("Zebra Interface delete: %s index %d mtu %d",
1996 ifp
->name
, ifp
->ifindex
, ifp
->mtu6
);
2001 void ospf6_interface_init(void)
2003 /* Install interface node. */
2004 install_node(&interface_node
, config_write_ospf6_interface
);
2006 if_zapi_callbacks(ospf6_ifp_create
, ospf6_ifp_up
,
2007 ospf6_ifp_down
, ospf6_ifp_destroy
);
2009 install_element(VIEW_NODE
, &show_ipv6_ospf6_interface_prefix_cmd
);
2010 install_element(VIEW_NODE
, &show_ipv6_ospf6_interface_ifname_cmd
);
2011 install_element(VIEW_NODE
,
2012 &show_ipv6_ospf6_interface_ifname_prefix_cmd
);
2013 install_element(VIEW_NODE
, &show_ipv6_ospf6_interface_traffic_cmd
);
2015 install_element(INTERFACE_NODE
, &ipv6_ospf6_cost_cmd
);
2016 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_cost_cmd
);
2017 install_element(INTERFACE_NODE
, &ipv6_ospf6_ifmtu_cmd
);
2018 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_ifmtu_cmd
);
2020 install_element(INTERFACE_NODE
, &ipv6_ospf6_deadinterval_cmd
);
2021 install_element(INTERFACE_NODE
, &ipv6_ospf6_hellointerval_cmd
);
2022 install_element(INTERFACE_NODE
, &ipv6_ospf6_priority_cmd
);
2023 install_element(INTERFACE_NODE
, &ipv6_ospf6_retransmitinterval_cmd
);
2024 install_element(INTERFACE_NODE
, &ipv6_ospf6_transmitdelay_cmd
);
2025 install_element(INTERFACE_NODE
, &ipv6_ospf6_instance_cmd
);
2026 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_deadinterval_cmd
);
2027 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_hellointerval_cmd
);
2028 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_priority_cmd
);
2029 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_retransmitinterval_cmd
);
2030 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_transmitdelay_cmd
);
2031 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_instance_cmd
);
2033 install_element(INTERFACE_NODE
, &ipv6_ospf6_passive_cmd
);
2034 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_passive_cmd
);
2036 install_element(INTERFACE_NODE
, &ipv6_ospf6_mtu_ignore_cmd
);
2037 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_mtu_ignore_cmd
);
2039 install_element(INTERFACE_NODE
, &ipv6_ospf6_advertise_prefix_list_cmd
);
2040 install_element(INTERFACE_NODE
,
2041 &no_ipv6_ospf6_advertise_prefix_list_cmd
);
2043 install_element(INTERFACE_NODE
, &ipv6_ospf6_network_cmd
);
2044 install_element(INTERFACE_NODE
, &no_ipv6_ospf6_network_cmd
);
2046 /* reference bandwidth commands */
2047 install_element(OSPF6_NODE
, &auto_cost_reference_bandwidth_cmd
);
2048 install_element(OSPF6_NODE
, &no_auto_cost_reference_bandwidth_cmd
);
2051 /* Clear the specified interface structure */
2052 static void ospf6_interface_clear(struct vty
*vty
, struct interface
*ifp
)
2054 struct ospf6_interface
*oi
;
2056 if (!if_is_operative(ifp
))
2059 if (ifp
->info
== NULL
)
2062 oi
= (struct ospf6_interface
*)ifp
->info
;
2064 if (IS_OSPF6_DEBUG_INTERFACE
)
2065 zlog_debug("Interface %s: clear by reset", ifp
->name
);
2067 /* Reset the interface */
2068 thread_execute(master
, interface_down
, oi
, 0);
2069 thread_execute(master
, interface_up
, oi
, 0);
2072 /* Clear interface */
2073 DEFUN (clear_ipv6_ospf6_interface
,
2074 clear_ipv6_ospf6_interface_cmd
,
2075 "clear ipv6 ospf6 interface [IFNAME]",
2083 struct vrf
*vrf
= vrf_lookup_by_id(VRF_DEFAULT
);
2085 struct interface
*ifp
;
2087 if (argc
== 4) /* Clear all the ospfv3 interfaces. */
2089 FOR_ALL_INTERFACES (vrf
, ifp
)
2090 ospf6_interface_clear(vty
, ifp
);
2091 } else /* Interface name is specified. */
2093 if ((ifp
= if_lookup_by_name(argv
[idx_ifname
]->arg
,
2096 vty_out(vty
, "No such Interface: %s\n",
2097 argv
[idx_ifname
]->arg
);
2100 ospf6_interface_clear(vty
, ifp
);
2106 void install_element_ospf6_clear_interface(void)
2108 install_element(ENABLE_NODE
, &clear_ipv6_ospf6_interface_cmd
);
2111 DEFUN (debug_ospf6_interface
,
2112 debug_ospf6_interface_cmd
,
2113 "debug ospf6 interface",
2116 "Debug OSPFv3 Interface\n"
2119 OSPF6_DEBUG_INTERFACE_ON();
2123 DEFUN (no_debug_ospf6_interface
,
2124 no_debug_ospf6_interface_cmd
,
2125 "no debug ospf6 interface",
2129 "Debug OSPFv3 Interface\n"
2132 OSPF6_DEBUG_INTERFACE_OFF();
2136 int config_write_ospf6_debug_interface(struct vty
*vty
)
2138 if (IS_OSPF6_DEBUG_INTERFACE
)
2139 vty_out(vty
, "debug ospf6 interface\n");
2143 void install_element_ospf6_debug_interface(void)
2145 install_element(ENABLE_NODE
, &debug_ospf6_interface_cmd
);
2146 install_element(ENABLE_NODE
, &no_debug_ospf6_interface_cmd
);
2147 install_element(CONFIG_NODE
, &debug_ospf6_interface_cmd
);
2148 install_element(CONFIG_NODE
, &no_debug_ospf6_interface_cmd
);