2 * Interface related function for RIPng.
3 * Copyright (C) 1998 Kunihiro Ishiguro
5 * This file is part of GNU Zebra.
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 #include "agg_table.h"
38 #include "lib_errors.h"
39 #include "northbound_cli.h"
41 #include "ripngd/ripngd.h"
42 #include "ripngd/ripng_debug.h"
44 /* If RFC2133 definition is used. */
45 #ifndef IPV6_JOIN_GROUP
46 #define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
48 #ifndef IPV6_LEAVE_GROUP
49 #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
52 /* Static utility function. */
53 static void ripng_enable_apply(struct interface
*);
54 static void ripng_passive_interface_apply(struct interface
*);
55 static int ripng_enable_if_lookup(struct ripng
*ripng
, const char *ifname
);
56 static int ripng_enable_network_lookup2(struct connected
*);
57 static void ripng_enable_apply_all(struct ripng
*ripng
);
59 /* Join to the all rip routers multicast group. */
60 static int ripng_multicast_join(struct interface
*ifp
, int sock
)
63 struct ipv6_mreq mreq
;
66 if (if_is_multicast(ifp
)) {
67 memset(&mreq
, 0, sizeof(mreq
));
68 inet_pton(AF_INET6
, RIPNG_GROUP
, &mreq
.ipv6mr_multiaddr
);
69 mreq
.ipv6mr_interface
= ifp
->ifindex
;
72 * NetBSD 1.6.2 requires root to join groups on gif(4).
73 * While this is bogus, privs are available and easy to use
74 * for this call as a workaround.
76 frr_elevate_privs(&ripngd_privs
) {
78 ret
= setsockopt(sock
, IPPROTO_IPV6
, IPV6_JOIN_GROUP
,
79 (char *)&mreq
, sizeof(mreq
));
84 if (ret
< 0 && save_errno
== EADDRINUSE
) {
86 * Group is already joined. This occurs due to sloppy
88 * management, in particular declining to leave the
90 * an interface that has just gone down.
92 zlog_warn("ripng join on %s EADDRINUSE (ignoring)\n",
94 return 0; /* not an error */
98 zlog_warn("can't setsockopt IPV6_JOIN_GROUP: %s",
99 safe_strerror(save_errno
));
101 if (IS_RIPNG_DEBUG_EVENT
)
103 "RIPng %s join to all-rip-routers multicast group",
112 /* Leave from the all rip routers multicast group. */
113 static int ripng_multicast_leave(struct interface
*ifp
, int sock
)
116 struct ipv6_mreq mreq
;
118 if (if_is_multicast(ifp
)) {
119 memset(&mreq
, 0, sizeof(mreq
));
120 inet_pton(AF_INET6
, RIPNG_GROUP
, &mreq
.ipv6mr_multiaddr
);
121 mreq
.ipv6mr_interface
= ifp
->ifindex
;
123 ret
= setsockopt(sock
, IPPROTO_IPV6
, IPV6_LEAVE_GROUP
,
124 (char *)&mreq
, sizeof(mreq
));
126 zlog_warn("can't setsockopt IPV6_LEAVE_GROUP: %s\n",
127 safe_strerror(errno
));
129 if (IS_RIPNG_DEBUG_EVENT
)
131 "RIPng %s leave from all-rip-routers multicast group",
141 /* How many link local IPv6 address could be used on the interface ? */
142 static int ripng_if_ipv6_lladdress_check(struct interface
*ifp
)
145 struct connected
*connected
;
148 for (ALL_LIST_ELEMENTS_RO(ifp
->connected
, nn
, connected
)) {
150 p
= connected
->address
;
152 if ((p
->family
== AF_INET6
)
153 && IN6_IS_ADDR_LINKLOCAL(&p
->u
.prefix6
))
160 static int ripng_if_down(struct interface
*ifp
)
163 struct ripng_info
*rinfo
;
164 struct ripng_interface
*ri
;
166 struct list
*list
= NULL
;
167 struct listnode
*listnode
= NULL
, *nextnode
= NULL
;
173 for (rp
= agg_route_top(ripng
->table
); rp
;
174 rp
= agg_route_next(rp
))
175 if ((list
= rp
->info
) != NULL
)
176 for (ALL_LIST_ELEMENTS(list
, listnode
, nextnode
,
178 if (rinfo
->ifindex
== ifp
->ifindex
)
179 ripng_ecmp_delete(ripng
, rinfo
);
183 if (IS_RIPNG_DEBUG_EVENT
)
184 zlog_debug("turn off %s", ifp
->name
);
186 /* Leave from multicast group. */
187 ripng_multicast_leave(ifp
, ripng
->sock
);
195 /* Inteface link up message processing. */
196 int ripng_interface_up(int command
, struct zclient
*zclient
,
197 zebra_size_t length
, vrf_id_t vrf_id
)
200 struct interface
*ifp
;
202 /* zebra_interface_state_read() updates interface structure in iflist.
205 ifp
= zebra_interface_state_read(s
, vrf_id
);
210 if (IS_RIPNG_DEBUG_ZEBRA
)
212 "interface up %s index %d flags %llx metric %d mtu %d",
213 ifp
->name
, ifp
->ifindex
, (unsigned long long)ifp
->flags
,
214 ifp
->metric
, ifp
->mtu6
);
216 /* Check if this interface is RIPng enabled or not. */
217 ripng_enable_apply(ifp
);
219 /* Check for a passive interface. */
220 ripng_passive_interface_apply(ifp
);
222 /* Apply distribute list to the all interface. */
223 ripng_distribute_update_interface(ifp
);
228 /* Inteface link down message processing. */
229 int ripng_interface_down(int command
, struct zclient
*zclient
,
230 zebra_size_t length
, vrf_id_t vrf_id
)
233 struct interface
*ifp
;
235 /* zebra_interface_state_read() updates interface structure in iflist.
238 ifp
= zebra_interface_state_read(s
, vrf_id
);
245 if (IS_RIPNG_DEBUG_ZEBRA
)
247 "interface down %s index %d flags %#llx metric %d mtu %d",
248 ifp
->name
, ifp
->ifindex
, (unsigned long long)ifp
->flags
,
249 ifp
->metric
, ifp
->mtu6
);
254 /* Inteface addition message from zebra. */
255 int ripng_interface_add(int command
, struct zclient
*zclient
,
256 zebra_size_t length
, vrf_id_t vrf_id
)
258 struct interface
*ifp
;
260 ifp
= zebra_interface_add_read(zclient
->ibuf
, vrf_id
);
262 if (IS_RIPNG_DEBUG_ZEBRA
)
264 "RIPng interface add %s index %d flags %#llx metric %d mtu %d",
265 ifp
->name
, ifp
->ifindex
, (unsigned long long)ifp
->flags
,
266 ifp
->metric
, ifp
->mtu6
);
268 /* Check is this interface is RIP enabled or not.*/
269 ripng_enable_apply(ifp
);
271 /* Apply distribute list to the interface. */
272 ripng_distribute_update_interface(ifp
);
274 /* Check interface routemap. */
275 ripng_if_rmap_update_interface(ifp
);
280 int ripng_interface_delete(int command
, struct zclient
*zclient
,
281 zebra_size_t length
, vrf_id_t vrf_id
)
283 struct interface
*ifp
;
287 /* zebra_interface_state_read() updates interface structure in iflist
289 ifp
= zebra_interface_state_read(s
, vrf_id
);
298 zlog_info("interface delete %s index %d flags %#llx metric %d mtu %d",
299 ifp
->name
, ifp
->ifindex
, (unsigned long long)ifp
->flags
,
300 ifp
->metric
, ifp
->mtu6
);
302 /* To support pseudo interface do not free interface structure. */
303 /* if_delete(ifp); */
304 if_set_index(ifp
, IFINDEX_INTERNAL
);
309 void ripng_interface_clean(struct ripng
*ripng
)
311 struct vrf
*vrf
= vrf_lookup_by_id(ripng
->vrf_id
);
312 struct interface
*ifp
;
313 struct ripng_interface
*ri
;
315 FOR_ALL_INTERFACES (vrf
, ifp
) {
318 ri
->enable_network
= 0;
319 ri
->enable_interface
= 0;
323 thread_cancel(ri
->t_wakeup
);
329 static void ripng_apply_address_add(struct connected
*ifc
)
331 struct ripng_interface
*ri
= ifc
->ifp
->info
;
332 struct ripng
*ripng
= ri
->ripng
;
333 struct prefix_ipv6 address
;
339 if (!if_is_up(ifc
->ifp
))
344 memset(&address
, 0, sizeof(address
));
345 address
.family
= p
->family
;
346 address
.prefix
= p
->u
.prefix6
;
347 address
.prefixlen
= p
->prefixlen
;
348 apply_mask_ipv6(&address
);
350 /* Check if this interface is RIP enabled or not
351 or Check if this address's prefix is RIP enabled */
352 if ((ripng_enable_if_lookup(ripng
, ifc
->ifp
->name
) >= 0)
353 || (ripng_enable_network_lookup2(ifc
) >= 0))
354 ripng_redistribute_add(ripng
, ZEBRA_ROUTE_CONNECT
,
355 RIPNG_ROUTE_INTERFACE
, &address
,
356 ifc
->ifp
->ifindex
, NULL
, 0);
359 int ripng_interface_address_add(int command
, struct zclient
*zclient
,
360 zebra_size_t length
, vrf_id_t vrf_id
)
365 c
= zebra_interface_address_read(ZEBRA_INTERFACE_ADDRESS_ADD
,
366 zclient
->ibuf
, vrf_id
);
373 if (p
->family
== AF_INET6
) {
374 struct ripng_interface
*ri
= c
->ifp
->info
;
376 if (IS_RIPNG_DEBUG_ZEBRA
)
377 zlog_debug("RIPng connected address %s/%d add",
378 inet6_ntoa(p
->u
.prefix6
), p
->prefixlen
);
380 /* Check is this prefix needs to be redistributed. */
381 ripng_apply_address_add(c
);
383 /* Let's try once again whether the interface could be activated
386 /* Check if this interface is RIP enabled or not.*/
387 ripng_enable_apply(c
->ifp
);
389 /* Apply distribute list to the interface. */
390 ripng_distribute_update_interface(c
->ifp
);
392 /* Check interface routemap. */
393 ripng_if_rmap_update_interface(c
->ifp
);
400 static void ripng_apply_address_del(struct connected
*ifc
)
402 struct ripng_interface
*ri
= ifc
->ifp
->info
;
403 struct ripng
*ripng
= ri
->ripng
;
404 struct prefix_ipv6 address
;
410 if (!if_is_up(ifc
->ifp
))
415 memset(&address
, 0, sizeof(address
));
416 address
.family
= p
->family
;
417 address
.prefix
= p
->u
.prefix6
;
418 address
.prefixlen
= p
->prefixlen
;
419 apply_mask_ipv6(&address
);
421 ripng_redistribute_delete(ripng
, ZEBRA_ROUTE_CONNECT
,
422 RIPNG_ROUTE_INTERFACE
, &address
,
426 int ripng_interface_address_delete(int command
, struct zclient
*zclient
,
427 zebra_size_t length
, vrf_id_t vrf_id
)
429 struct connected
*ifc
;
431 char buf
[INET6_ADDRSTRLEN
];
433 ifc
= zebra_interface_address_read(ZEBRA_INTERFACE_ADDRESS_DELETE
,
434 zclient
->ibuf
, vrf_id
);
439 if (p
->family
== AF_INET6
) {
440 if (IS_RIPNG_DEBUG_ZEBRA
)
442 "RIPng connected address %s/%d delete",
443 inet_ntop(AF_INET6
, &p
->u
.prefix6
, buf
,
447 /* Check wether this prefix needs to be removed. */
448 ripng_apply_address_del(ifc
);
456 /* Lookup RIPng enable network. */
457 /* Check wether the interface has at least a connected prefix that
458 * is within the ripng->enable_network table. */
459 static int ripng_enable_network_lookup_if(struct interface
*ifp
)
461 struct ripng_interface
*ri
= ifp
->info
;
462 struct ripng
*ripng
= ri
->ripng
;
463 struct listnode
*node
;
464 struct connected
*connected
;
465 struct prefix_ipv6 address
;
470 for (ALL_LIST_ELEMENTS_RO(ifp
->connected
, node
, connected
)) {
474 p
= connected
->address
;
476 if (p
->family
== AF_INET6
) {
477 address
.family
= AF_INET6
;
478 address
.prefix
= p
->u
.prefix6
;
479 address
.prefixlen
= IPV6_MAX_BITLEN
;
481 n
= agg_node_match(ripng
->enable_network
,
482 (struct prefix
*)&address
);
492 /* Check wether connected is within the ripng->enable_network table. */
493 static int ripng_enable_network_lookup2(struct connected
*connected
)
495 struct ripng_interface
*ri
= connected
->ifp
->info
;
496 struct ripng
*ripng
= ri
->ripng
;
497 struct prefix_ipv6 address
;
503 p
= connected
->address
;
505 if (p
->family
== AF_INET6
) {
506 struct agg_node
*node
;
508 address
.family
= p
->family
;
509 address
.prefix
= p
->u
.prefix6
;
510 address
.prefixlen
= IPV6_MAX_BITLEN
;
512 /* LPM on p->family, p->u.prefix6/IPV6_MAX_BITLEN within
513 * ripng->enable_network */
514 node
= agg_node_match(ripng
->enable_network
,
515 (struct prefix
*)&address
);
518 agg_unlock_node(node
);
526 /* Add RIPng enable network. */
527 int ripng_enable_network_add(struct ripng
*ripng
, struct prefix
*p
)
529 struct agg_node
*node
;
531 node
= agg_node_get(ripng
->enable_network
, p
);
534 agg_unlock_node(node
);
535 return NB_ERR_INCONSISTENCY
;
537 node
->info
= (void *)1;
539 /* XXX: One should find a better solution than a generic one */
540 ripng_enable_apply_all(ripng
);
545 /* Delete RIPng enable network. */
546 int ripng_enable_network_delete(struct ripng
*ripng
, struct prefix
*p
)
548 struct agg_node
*node
;
550 node
= agg_node_lookup(ripng
->enable_network
, p
);
554 /* Unlock info lock. */
555 agg_unlock_node(node
);
557 /* Unlock lookup lock. */
558 agg_unlock_node(node
);
563 return NB_ERR_INCONSISTENCY
;
566 /* Lookup function. */
567 static int ripng_enable_if_lookup(struct ripng
*ripng
, const char *ifname
)
575 for (i
= 0; i
< vector_active(ripng
->enable_if
); i
++)
576 if ((str
= vector_slot(ripng
->enable_if
, i
)) != NULL
)
577 if (strcmp(str
, ifname
) == 0)
582 int ripng_enable_if_add(struct ripng
*ripng
, const char *ifname
)
586 ret
= ripng_enable_if_lookup(ripng
, ifname
);
588 return NB_ERR_INCONSISTENCY
;
590 vector_set(ripng
->enable_if
, strdup(ifname
));
592 ripng_enable_apply_all(ripng
);
597 int ripng_enable_if_delete(struct ripng
*ripng
, const char *ifname
)
602 index
= ripng_enable_if_lookup(ripng
, ifname
);
604 return NB_ERR_INCONSISTENCY
;
606 str
= vector_slot(ripng
->enable_if
, index
);
608 vector_unset(ripng
->enable_if
, index
);
610 ripng_enable_apply_all(ripng
);
615 /* Wake up interface. */
616 static int ripng_interface_wakeup(struct thread
*t
)
618 struct interface
*ifp
;
619 struct ripng_interface
*ri
;
627 /* Join to multicast group. */
628 if (ripng_multicast_join(ifp
, ri
->ripng
->sock
) < 0) {
629 flog_err_sys(EC_LIB_SOCKET
,
630 "multicast join failed, interface %s not running",
635 /* Set running flag. */
638 /* Send RIP request to the interface. */
644 static void ripng_connect_set(struct interface
*ifp
, int set
)
646 struct ripng_interface
*ri
= ifp
->info
;
647 struct ripng
*ripng
= ri
->ripng
;
648 struct listnode
*node
, *nnode
;
649 struct connected
*connected
;
650 struct prefix_ipv6 address
;
652 for (ALL_LIST_ELEMENTS(ifp
->connected
, node
, nnode
, connected
)) {
654 p
= connected
->address
;
656 if (p
->family
!= AF_INET6
)
659 address
.family
= AF_INET6
;
660 address
.prefix
= p
->u
.prefix6
;
661 address
.prefixlen
= p
->prefixlen
;
662 apply_mask_ipv6(&address
);
665 /* Check once more wether this prefix is within a
666 * "network IF_OR_PREF" one */
667 if ((ripng_enable_if_lookup(ripng
, connected
->ifp
->name
)
669 || (ripng_enable_network_lookup2(connected
) >= 0))
670 ripng_redistribute_add(
671 ripng
, ZEBRA_ROUTE_CONNECT
,
672 RIPNG_ROUTE_INTERFACE
, &address
,
673 connected
->ifp
->ifindex
, NULL
, 0);
675 ripng_redistribute_delete(ripng
, ZEBRA_ROUTE_CONNECT
,
676 RIPNG_ROUTE_INTERFACE
,
678 connected
->ifp
->ifindex
);
679 if (ripng_redistribute_check(ripng
,
680 ZEBRA_ROUTE_CONNECT
))
681 ripng_redistribute_add(
682 ripng
, ZEBRA_ROUTE_CONNECT
,
683 RIPNG_ROUTE_REDISTRIBUTE
, &address
,
684 connected
->ifp
->ifindex
, NULL
, 0);
689 /* Check RIPng is enabed on this interface. */
690 void ripng_enable_apply(struct interface
*ifp
)
693 struct ripng_interface
*ri
= NULL
;
695 /* Check interface. */
701 /* Is this interface a candidate for RIPng ? */
702 ret
= ripng_enable_network_lookup_if(ifp
);
704 /* If the interface is matched. */
706 ri
->enable_network
= 1;
708 ri
->enable_network
= 0;
710 /* Check interface name configuration. */
711 ret
= ripng_enable_if_lookup(ri
->ripng
, ifp
->name
);
713 ri
->enable_interface
= 1;
715 ri
->enable_interface
= 0;
717 /* any candidate interface MUST have a link-local IPv6 address */
718 if ((!ripng_if_ipv6_lladdress_check(ifp
))
719 && (ri
->enable_network
|| ri
->enable_interface
)) {
720 ri
->enable_network
= 0;
721 ri
->enable_interface
= 0;
722 zlog_warn("Interface %s does not have any link-local address",
726 /* Update running status of the interface. */
727 if (ri
->enable_network
|| ri
->enable_interface
) {
728 zlog_info("RIPng INTERFACE ON %s", ifp
->name
);
730 /* Add interface wake up thread. */
731 thread_add_timer(master
, ripng_interface_wakeup
, ifp
, 1,
734 ripng_connect_set(ifp
, 1);
737 /* Might as well clean up the route table as well
738 * ripng_if_down sets to 0 ri->running, and displays
743 ripng_connect_set(ifp
, 0);
748 /* Set distribute list to all interfaces. */
749 static void ripng_enable_apply_all(struct ripng
*ripng
)
751 struct vrf
*vrf
= vrf_lookup_by_id(ripng
->vrf_id
);
752 struct interface
*ifp
;
754 FOR_ALL_INTERFACES (vrf
, ifp
)
755 ripng_enable_apply(ifp
);
758 /* Clear all network and neighbor configuration */
759 void ripng_clean_network(struct ripng
*ripng
)
765 /* ripng->enable_network */
766 for (rn
= agg_route_top(ripng
->enable_network
); rn
;
767 rn
= agg_route_next(rn
))
773 /* ripng->enable_if */
774 for (i
= 0; i
< vector_active(ripng
->enable_if
); i
++)
775 if ((str
= vector_slot(ripng
->enable_if
, i
)) != NULL
) {
777 vector_slot(ripng
->enable_if
, i
) = NULL
;
781 /* Utility function for looking up passive interface settings. */
782 static int ripng_passive_interface_lookup(struct ripng
*ripng
,
788 for (i
= 0; i
< vector_active(ripng
->passive_interface
); i
++)
789 if ((str
= vector_slot(ripng
->passive_interface
, i
)) != NULL
)
790 if (strcmp(str
, ifname
) == 0)
795 void ripng_passive_interface_apply(struct interface
*ifp
)
798 struct ripng_interface
*ri
;
806 ret
= ripng_passive_interface_lookup(ripng
, ifp
->name
);
813 static void ripng_passive_interface_apply_all(struct ripng
*ripng
)
815 struct vrf
*vrf
= vrf_lookup_by_id(ripng
->vrf_id
);
816 struct interface
*ifp
;
818 FOR_ALL_INTERFACES (vrf
, ifp
)
819 ripng_passive_interface_apply(ifp
);
822 /* Passive interface. */
823 int ripng_passive_interface_set(struct ripng
*ripng
, const char *ifname
)
825 if (ripng_passive_interface_lookup(ripng
, ifname
) >= 0)
826 return NB_ERR_INCONSISTENCY
;
828 vector_set(ripng
->passive_interface
, strdup(ifname
));
830 ripng_passive_interface_apply_all(ripng
);
835 int ripng_passive_interface_unset(struct ripng
*ripng
, const char *ifname
)
840 i
= ripng_passive_interface_lookup(ripng
, ifname
);
842 return NB_ERR_INCONSISTENCY
;
844 str
= vector_slot(ripng
->passive_interface
, i
);
846 vector_unset(ripng
->passive_interface
, i
);
848 ripng_passive_interface_apply_all(ripng
);
853 /* Free all configured RIP passive-interface settings. */
854 void ripng_passive_interface_clean(struct ripng
*ripng
)
859 for (i
= 0; i
< vector_active(ripng
->passive_interface
); i
++)
860 if ((str
= vector_slot(ripng
->passive_interface
, i
)) != NULL
) {
862 vector_slot(ripng
->passive_interface
, i
) = NULL
;
864 ripng_passive_interface_apply_all(ripng
);
867 /* Write RIPng enable network and interface to the vty. */
868 int ripng_network_write(struct vty
*vty
, struct ripng
*ripng
)
872 struct agg_node
*node
;
875 /* Write enable network. */
876 for (node
= agg_route_top(ripng
->enable_network
); node
;
877 node
= agg_route_next(node
))
879 struct prefix
*p
= &node
->p
;
880 vty_out(vty
, " %s/%d\n",
881 inet_ntop(p
->family
, &p
->u
.prefix
, buf
, BUFSIZ
),
885 /* Write enable interface. */
886 for (i
= 0; i
< vector_active(ripng
->enable_if
); i
++)
887 if ((ifname
= vector_slot(ripng
->enable_if
, i
)) != NULL
)
888 vty_out(vty
, " %s\n", ifname
);
893 static struct ripng_interface
*ri_new(struct interface
*ifp
)
896 struct ripng_interface
*ri
;
898 ri
= XCALLOC(MTYPE_IF
, sizeof(struct ripng_interface
));
900 vrf
= vrf_lookup_by_id(ifp
->vrf_id
);
902 ri
->ripng
= vrf
->info
;
904 /* Set default split-horizon behavior. If the interface is Frame
905 Relay or SMDS is enabled, the default value for split-horizon is
906 off. But currently Zebra does detect Frame Relay or SMDS
907 interface. So all interface is set to split horizon. */
909 yang_get_default_enum("%s/split-horizon", RIPNG_IFACE
);
914 static int ripng_if_new_hook(struct interface
*ifp
)
916 ifp
->info
= ri_new(ifp
);
920 /* Called when interface structure deleted. */
921 static int ripng_if_delete_hook(struct interface
*ifp
)
923 XFREE(MTYPE_IF
, ifp
->info
);
928 /* Configuration write function for ripngd. */
929 static int interface_config_write(struct vty
*vty
)
931 struct vrf
*vrf
= vrf_lookup_by_id(VRF_DEFAULT
);
932 struct interface
*ifp
;
935 FOR_ALL_INTERFACES (vrf
, ifp
) {
936 struct lyd_node
*dnode
;
938 dnode
= yang_dnode_get(
939 running_config
->dnode
,
940 "/frr-interface:lib/interface[name='%s'][vrf='%s']",
941 ifp
->name
, vrf
->name
);
946 nb_cli_show_dnode_cmds(vty
, dnode
, false);
952 /* ripngd's interface node. */
953 static struct cmd_node interface_node
= {
954 INTERFACE_NODE
, "%s(config-if)# ", 1 /* VTYSH */
957 /* Initialization of interface. */
960 /* Interface initialize. */
961 hook_register_prio(if_add
, 0, ripng_if_new_hook
);
962 hook_register_prio(if_del
, 0, ripng_if_delete_hook
);
964 /* Install interface node. */
965 install_node(&interface_node
, interface_config_write
);