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 DEFINE_MTYPE_STATIC(RIPNGD
, RIPNG_IF
, "ripng interface")
54 /* Static utility function. */
55 static void ripng_enable_apply(struct interface
*);
56 static void ripng_passive_interface_apply(struct interface
*);
57 static int ripng_enable_if_lookup(struct ripng
*ripng
, const char *ifname
);
58 static int ripng_enable_network_lookup2(struct connected
*);
59 static void ripng_enable_apply_all(struct ripng
*ripng
);
61 /* Join to the all rip routers multicast group. */
62 static int ripng_multicast_join(struct interface
*ifp
, int sock
)
65 struct ipv6_mreq mreq
;
68 if (if_is_multicast(ifp
)) {
69 memset(&mreq
, 0, sizeof(mreq
));
70 inet_pton(AF_INET6
, RIPNG_GROUP
, &mreq
.ipv6mr_multiaddr
);
71 mreq
.ipv6mr_interface
= ifp
->ifindex
;
74 * NetBSD 1.6.2 requires root to join groups on gif(4).
75 * While this is bogus, privs are available and easy to use
76 * for this call as a workaround.
78 frr_with_privs(&ripngd_privs
) {
80 ret
= setsockopt(sock
, IPPROTO_IPV6
, IPV6_JOIN_GROUP
,
81 (char *)&mreq
, sizeof(mreq
));
86 if (ret
< 0 && save_errno
== EADDRINUSE
) {
88 * Group is already joined. This occurs due to sloppy
90 * management, in particular declining to leave the
92 * an interface that has just gone down.
94 zlog_warn("ripng join on %s EADDRINUSE (ignoring)",
96 return 0; /* not an error */
100 zlog_warn("can't setsockopt IPV6_JOIN_GROUP: %s",
101 safe_strerror(save_errno
));
103 if (IS_RIPNG_DEBUG_EVENT
)
105 "RIPng %s join to all-rip-routers multicast group",
114 /* Leave from the all rip routers multicast group. */
115 static int ripng_multicast_leave(struct interface
*ifp
, int sock
)
118 struct ipv6_mreq mreq
;
120 if (if_is_multicast(ifp
)) {
121 memset(&mreq
, 0, sizeof(mreq
));
122 inet_pton(AF_INET6
, RIPNG_GROUP
, &mreq
.ipv6mr_multiaddr
);
123 mreq
.ipv6mr_interface
= ifp
->ifindex
;
125 ret
= setsockopt(sock
, IPPROTO_IPV6
, IPV6_LEAVE_GROUP
,
126 (char *)&mreq
, sizeof(mreq
));
128 zlog_warn("can't setsockopt IPV6_LEAVE_GROUP: %s",
129 safe_strerror(errno
));
131 if (IS_RIPNG_DEBUG_EVENT
)
133 "RIPng %s leave from all-rip-routers multicast group",
143 /* How many link local IPv6 address could be used on the interface ? */
144 static int ripng_if_ipv6_lladdress_check(struct interface
*ifp
)
147 struct connected
*connected
;
150 for (ALL_LIST_ELEMENTS_RO(ifp
->connected
, nn
, connected
)) {
152 p
= connected
->address
;
154 if ((p
->family
== AF_INET6
)
155 && IN6_IS_ADDR_LINKLOCAL(&p
->u
.prefix6
))
162 static int ripng_if_down(struct interface
*ifp
)
165 struct ripng_info
*rinfo
;
166 struct ripng_interface
*ri
;
168 struct list
*list
= NULL
;
169 struct listnode
*listnode
= NULL
, *nextnode
= NULL
;
175 for (rp
= agg_route_top(ripng
->table
); rp
;
176 rp
= agg_route_next(rp
))
177 if ((list
= rp
->info
) != NULL
)
178 for (ALL_LIST_ELEMENTS(list
, listnode
, nextnode
,
180 if (rinfo
->ifindex
== ifp
->ifindex
)
181 ripng_ecmp_delete(ripng
, rinfo
);
185 if (IS_RIPNG_DEBUG_EVENT
)
186 zlog_debug("turn off %s", ifp
->name
);
188 /* Leave from multicast group. */
190 ripng_multicast_leave(ifp
, ripng
->sock
);
198 /* Inteface link up message processing. */
199 static int ripng_ifp_up(struct interface
*ifp
)
201 if (IS_RIPNG_DEBUG_ZEBRA
)
203 "interface up %s vrf %u index %d flags %llx metric %d mtu %d",
204 ifp
->name
, ifp
->vrf_id
, ifp
->ifindex
,
205 (unsigned long long)ifp
->flags
, ifp
->metric
, ifp
->mtu6
);
207 ripng_interface_sync(ifp
);
209 /* Check if this interface is RIPng enabled or not. */
210 ripng_enable_apply(ifp
);
212 /* Check for a passive interface. */
213 ripng_passive_interface_apply(ifp
);
215 /* Apply distribute list to the all interface. */
216 ripng_distribute_update_interface(ifp
);
221 /* Inteface link down message processing. */
222 static int ripng_ifp_down(struct interface
*ifp
)
224 ripng_interface_sync(ifp
);
227 if (IS_RIPNG_DEBUG_ZEBRA
)
229 "interface down %s vrf %u index %d flags %#llx metric %d mtu %d",
230 ifp
->name
, ifp
->vrf_id
, ifp
->ifindex
,
231 (unsigned long long)ifp
->flags
, ifp
->metric
, ifp
->mtu6
);
236 /* Inteface addition message from zebra. */
237 static int ripng_ifp_create(struct interface
*ifp
)
239 ripng_interface_sync(ifp
);
241 if (IS_RIPNG_DEBUG_ZEBRA
)
243 "RIPng interface add %s vrf %u index %d flags %#llx metric %d mtu %d",
244 ifp
->name
, ifp
->vrf_id
, ifp
->ifindex
,
245 (unsigned long long)ifp
->flags
, ifp
->metric
, ifp
->mtu6
);
247 /* Check is this interface is RIP enabled or not.*/
248 ripng_enable_apply(ifp
);
250 /* Apply distribute list to the interface. */
251 ripng_distribute_update_interface(ifp
);
253 /* Check interface routemap. */
254 ripng_if_rmap_update_interface(ifp
);
259 static int ripng_ifp_destroy(struct interface
*ifp
)
261 ripng_interface_sync(ifp
);
267 "interface delete %s vrf %u index %d flags %#llx metric %d mtu %d",
268 ifp
->name
, ifp
->vrf_id
, ifp
->ifindex
,
269 (unsigned long long)ifp
->flags
, ifp
->metric
, ifp
->mtu6
);
274 /* VRF update for an interface. */
275 int ripng_interface_vrf_update(ZAPI_CALLBACK_ARGS
)
277 struct interface
*ifp
;
280 ifp
= zebra_interface_vrf_update_read(zclient
->ibuf
, vrf_id
,
285 if (IS_RIPNG_DEBUG_ZEBRA
)
286 zlog_debug("interface %s VRF change vrf_id %u new vrf id %u",
287 ifp
->name
, vrf_id
, new_vrf_id
);
289 if_update_to_new_vrf(ifp
, new_vrf_id
);
290 ripng_interface_sync(ifp
);
295 void ripng_interface_clean(struct ripng
*ripng
)
297 struct interface
*ifp
;
298 struct ripng_interface
*ri
;
300 FOR_ALL_INTERFACES (ripng
->vrf
, ifp
) {
303 ri
->enable_network
= 0;
304 ri
->enable_interface
= 0;
308 thread_cancel(ri
->t_wakeup
);
314 static void ripng_apply_address_add(struct connected
*ifc
)
316 struct ripng_interface
*ri
= ifc
->ifp
->info
;
317 struct ripng
*ripng
= ri
->ripng
;
318 struct prefix_ipv6 address
;
324 if (!if_is_up(ifc
->ifp
))
329 memset(&address
, 0, sizeof(address
));
330 address
.family
= p
->family
;
331 address
.prefix
= p
->u
.prefix6
;
332 address
.prefixlen
= p
->prefixlen
;
333 apply_mask_ipv6(&address
);
335 /* Check if this interface is RIP enabled or not
336 or Check if this address's prefix is RIP enabled */
337 if ((ripng_enable_if_lookup(ripng
, ifc
->ifp
->name
) >= 0)
338 || (ripng_enable_network_lookup2(ifc
) >= 0))
339 ripng_redistribute_add(ripng
, ZEBRA_ROUTE_CONNECT
,
340 RIPNG_ROUTE_INTERFACE
, &address
,
341 ifc
->ifp
->ifindex
, NULL
, 0);
344 int ripng_interface_address_add(ZAPI_CALLBACK_ARGS
)
349 c
= zebra_interface_address_read(ZEBRA_INTERFACE_ADDRESS_ADD
,
350 zclient
->ibuf
, vrf_id
);
357 if (p
->family
== AF_INET6
) {
358 struct ripng_interface
*ri
= c
->ifp
->info
;
360 if (IS_RIPNG_DEBUG_ZEBRA
)
361 zlog_debug("RIPng connected address %s/%d add",
362 inet6_ntoa(p
->u
.prefix6
), p
->prefixlen
);
364 /* Check is this prefix needs to be redistributed. */
365 ripng_apply_address_add(c
);
367 /* Let's try once again whether the interface could be activated
370 /* Check if this interface is RIP enabled or not.*/
371 ripng_enable_apply(c
->ifp
);
373 /* Apply distribute list to the interface. */
374 ripng_distribute_update_interface(c
->ifp
);
376 /* Check interface routemap. */
377 ripng_if_rmap_update_interface(c
->ifp
);
384 static void ripng_apply_address_del(struct connected
*ifc
)
386 struct ripng_interface
*ri
= ifc
->ifp
->info
;
387 struct ripng
*ripng
= ri
->ripng
;
388 struct prefix_ipv6 address
;
394 if (!if_is_up(ifc
->ifp
))
399 memset(&address
, 0, sizeof(address
));
400 address
.family
= p
->family
;
401 address
.prefix
= p
->u
.prefix6
;
402 address
.prefixlen
= p
->prefixlen
;
403 apply_mask_ipv6(&address
);
405 ripng_redistribute_delete(ripng
, ZEBRA_ROUTE_CONNECT
,
406 RIPNG_ROUTE_INTERFACE
, &address
,
410 int ripng_interface_address_delete(ZAPI_CALLBACK_ARGS
)
412 struct connected
*ifc
;
414 char buf
[INET6_ADDRSTRLEN
];
416 ifc
= zebra_interface_address_read(ZEBRA_INTERFACE_ADDRESS_DELETE
,
417 zclient
->ibuf
, vrf_id
);
422 if (p
->family
== AF_INET6
) {
423 if (IS_RIPNG_DEBUG_ZEBRA
)
425 "RIPng connected address %s/%d delete",
426 inet_ntop(AF_INET6
, &p
->u
.prefix6
, buf
,
430 /* Check wether this prefix needs to be removed. */
431 ripng_apply_address_del(ifc
);
433 connected_free(&ifc
);
439 /* Lookup RIPng enable network. */
440 /* Check wether the interface has at least a connected prefix that
441 * is within the ripng->enable_network table. */
442 static int ripng_enable_network_lookup_if(struct interface
*ifp
)
444 struct ripng_interface
*ri
= ifp
->info
;
445 struct ripng
*ripng
= ri
->ripng
;
446 struct listnode
*node
;
447 struct connected
*connected
;
448 struct prefix_ipv6 address
;
453 for (ALL_LIST_ELEMENTS_RO(ifp
->connected
, node
, connected
)) {
457 p
= connected
->address
;
459 if (p
->family
== AF_INET6
) {
460 address
.family
= AF_INET6
;
461 address
.prefix
= p
->u
.prefix6
;
462 address
.prefixlen
= IPV6_MAX_BITLEN
;
464 n
= agg_node_match(ripng
->enable_network
,
465 (struct prefix
*)&address
);
475 /* Check wether connected is within the ripng->enable_network table. */
476 static int ripng_enable_network_lookup2(struct connected
*connected
)
478 struct ripng_interface
*ri
= connected
->ifp
->info
;
479 struct ripng
*ripng
= ri
->ripng
;
480 struct prefix_ipv6 address
;
486 p
= connected
->address
;
488 if (p
->family
== AF_INET6
) {
489 struct agg_node
*node
;
491 address
.family
= p
->family
;
492 address
.prefix
= p
->u
.prefix6
;
493 address
.prefixlen
= IPV6_MAX_BITLEN
;
495 /* LPM on p->family, p->u.prefix6/IPV6_MAX_BITLEN within
496 * ripng->enable_network */
497 node
= agg_node_match(ripng
->enable_network
,
498 (struct prefix
*)&address
);
501 agg_unlock_node(node
);
509 /* Add RIPng enable network. */
510 int ripng_enable_network_add(struct ripng
*ripng
, struct prefix
*p
)
512 struct agg_node
*node
;
514 node
= agg_node_get(ripng
->enable_network
, p
);
517 agg_unlock_node(node
);
518 return NB_ERR_INCONSISTENCY
;
520 node
->info
= (void *)1;
522 /* XXX: One should find a better solution than a generic one */
523 ripng_enable_apply_all(ripng
);
528 /* Delete RIPng enable network. */
529 int ripng_enable_network_delete(struct ripng
*ripng
, struct prefix
*p
)
531 struct agg_node
*node
;
533 node
= agg_node_lookup(ripng
->enable_network
, p
);
537 /* Unlock info lock. */
538 agg_unlock_node(node
);
540 /* Unlock lookup lock. */
541 agg_unlock_node(node
);
546 return NB_ERR_INCONSISTENCY
;
549 /* Lookup function. */
550 static int ripng_enable_if_lookup(struct ripng
*ripng
, const char *ifname
)
558 for (i
= 0; i
< vector_active(ripng
->enable_if
); i
++)
559 if ((str
= vector_slot(ripng
->enable_if
, i
)) != NULL
)
560 if (strcmp(str
, ifname
) == 0)
565 int ripng_enable_if_add(struct ripng
*ripng
, const char *ifname
)
569 ret
= ripng_enable_if_lookup(ripng
, ifname
);
571 return NB_ERR_INCONSISTENCY
;
573 vector_set(ripng
->enable_if
, strdup(ifname
));
575 ripng_enable_apply_all(ripng
);
580 int ripng_enable_if_delete(struct ripng
*ripng
, const char *ifname
)
585 index
= ripng_enable_if_lookup(ripng
, ifname
);
587 return NB_ERR_INCONSISTENCY
;
589 str
= vector_slot(ripng
->enable_if
, index
);
591 vector_unset(ripng
->enable_if
, index
);
593 ripng_enable_apply_all(ripng
);
598 /* Wake up interface. */
599 static int ripng_interface_wakeup(struct thread
*t
)
601 struct interface
*ifp
;
602 struct ripng_interface
*ri
;
610 /* Join to multicast group. */
611 if (ripng_multicast_join(ifp
, ri
->ripng
->sock
) < 0) {
612 flog_err_sys(EC_LIB_SOCKET
,
613 "multicast join failed, interface %s not running",
618 /* Set running flag. */
621 /* Send RIP request to the interface. */
627 static void ripng_connect_set(struct interface
*ifp
, int set
)
629 struct ripng_interface
*ri
= ifp
->info
;
630 struct ripng
*ripng
= ri
->ripng
;
631 struct listnode
*node
, *nnode
;
632 struct connected
*connected
;
633 struct prefix_ipv6 address
;
635 for (ALL_LIST_ELEMENTS(ifp
->connected
, node
, nnode
, connected
)) {
637 p
= connected
->address
;
639 if (p
->family
!= AF_INET6
)
642 address
.family
= AF_INET6
;
643 address
.prefix
= p
->u
.prefix6
;
644 address
.prefixlen
= p
->prefixlen
;
645 apply_mask_ipv6(&address
);
648 /* Check once more wether this prefix is within a
649 * "network IF_OR_PREF" one */
650 if ((ripng_enable_if_lookup(ripng
, connected
->ifp
->name
)
652 || (ripng_enable_network_lookup2(connected
) >= 0))
653 ripng_redistribute_add(
654 ripng
, ZEBRA_ROUTE_CONNECT
,
655 RIPNG_ROUTE_INTERFACE
, &address
,
656 connected
->ifp
->ifindex
, NULL
, 0);
658 ripng_redistribute_delete(ripng
, ZEBRA_ROUTE_CONNECT
,
659 RIPNG_ROUTE_INTERFACE
,
661 connected
->ifp
->ifindex
);
662 if (ripng_redistribute_check(ripng
,
663 ZEBRA_ROUTE_CONNECT
))
664 ripng_redistribute_add(
665 ripng
, ZEBRA_ROUTE_CONNECT
,
666 RIPNG_ROUTE_REDISTRIBUTE
, &address
,
667 connected
->ifp
->ifindex
, NULL
, 0);
672 /* Check RIPng is enabed on this interface. */
673 void ripng_enable_apply(struct interface
*ifp
)
676 struct ripng_interface
*ri
= NULL
;
678 /* Check interface. */
684 /* Is this interface a candidate for RIPng ? */
685 ret
= ripng_enable_network_lookup_if(ifp
);
687 /* If the interface is matched. */
689 ri
->enable_network
= 1;
691 ri
->enable_network
= 0;
693 /* Check interface name configuration. */
694 ret
= ripng_enable_if_lookup(ri
->ripng
, ifp
->name
);
696 ri
->enable_interface
= 1;
698 ri
->enable_interface
= 0;
700 /* any candidate interface MUST have a link-local IPv6 address */
701 if ((!ripng_if_ipv6_lladdress_check(ifp
))
702 && (ri
->enable_network
|| ri
->enable_interface
)) {
703 ri
->enable_network
= 0;
704 ri
->enable_interface
= 0;
705 zlog_warn("Interface %s does not have any link-local address",
709 /* Update running status of the interface. */
710 if (ri
->enable_network
|| ri
->enable_interface
) {
711 zlog_info("RIPng INTERFACE ON %s", ifp
->name
);
713 /* Add interface wake up thread. */
714 thread_add_timer(master
, ripng_interface_wakeup
, ifp
, 1,
717 ripng_connect_set(ifp
, 1);
720 /* Might as well clean up the route table as well
721 * ripng_if_down sets to 0 ri->running, and displays
726 ripng_connect_set(ifp
, 0);
731 /* Set distribute list to all interfaces. */
732 static void ripng_enable_apply_all(struct ripng
*ripng
)
734 struct interface
*ifp
;
736 FOR_ALL_INTERFACES (ripng
->vrf
, ifp
)
737 ripng_enable_apply(ifp
);
740 /* Clear all network and neighbor configuration */
741 void ripng_clean_network(struct ripng
*ripng
)
747 /* ripng->enable_network */
748 for (rn
= agg_route_top(ripng
->enable_network
); rn
;
749 rn
= agg_route_next(rn
))
755 /* ripng->enable_if */
756 for (i
= 0; i
< vector_active(ripng
->enable_if
); i
++)
757 if ((str
= vector_slot(ripng
->enable_if
, i
)) != NULL
) {
759 vector_slot(ripng
->enable_if
, i
) = NULL
;
763 /* Utility function for looking up passive interface settings. */
764 static int ripng_passive_interface_lookup(struct ripng
*ripng
,
770 for (i
= 0; i
< vector_active(ripng
->passive_interface
); i
++)
771 if ((str
= vector_slot(ripng
->passive_interface
, i
)) != NULL
)
772 if (strcmp(str
, ifname
) == 0)
777 void ripng_passive_interface_apply(struct interface
*ifp
)
780 struct ripng_interface
*ri
;
788 ret
= ripng_passive_interface_lookup(ripng
, ifp
->name
);
795 static void ripng_passive_interface_apply_all(struct ripng
*ripng
)
797 struct interface
*ifp
;
799 FOR_ALL_INTERFACES (ripng
->vrf
, ifp
)
800 ripng_passive_interface_apply(ifp
);
803 /* Passive interface. */
804 int ripng_passive_interface_set(struct ripng
*ripng
, const char *ifname
)
806 if (ripng_passive_interface_lookup(ripng
, ifname
) >= 0)
807 return NB_ERR_INCONSISTENCY
;
809 vector_set(ripng
->passive_interface
, strdup(ifname
));
811 ripng_passive_interface_apply_all(ripng
);
816 int ripng_passive_interface_unset(struct ripng
*ripng
, const char *ifname
)
821 i
= ripng_passive_interface_lookup(ripng
, ifname
);
823 return NB_ERR_INCONSISTENCY
;
825 str
= vector_slot(ripng
->passive_interface
, i
);
827 vector_unset(ripng
->passive_interface
, i
);
829 ripng_passive_interface_apply_all(ripng
);
834 /* Free all configured RIP passive-interface settings. */
835 void ripng_passive_interface_clean(struct ripng
*ripng
)
840 for (i
= 0; i
< vector_active(ripng
->passive_interface
); i
++)
841 if ((str
= vector_slot(ripng
->passive_interface
, i
)) != NULL
) {
843 vector_slot(ripng
->passive_interface
, i
) = NULL
;
845 ripng_passive_interface_apply_all(ripng
);
848 /* Write RIPng enable network and interface to the vty. */
849 int ripng_network_write(struct vty
*vty
, struct ripng
*ripng
)
853 struct agg_node
*node
;
856 /* Write enable network. */
857 for (node
= agg_route_top(ripng
->enable_network
); node
;
858 node
= agg_route_next(node
))
860 struct prefix
*p
= &node
->p
;
861 vty_out(vty
, " %s/%d\n",
862 inet_ntop(p
->family
, &p
->u
.prefix
, buf
, BUFSIZ
),
866 /* Write enable interface. */
867 for (i
= 0; i
< vector_active(ripng
->enable_if
); i
++)
868 if ((ifname
= vector_slot(ripng
->enable_if
, i
)) != NULL
)
869 vty_out(vty
, " %s\n", ifname
);
874 static struct ripng_interface
*ri_new(void)
876 struct ripng_interface
*ri
;
878 ri
= XCALLOC(MTYPE_RIPNG_IF
, sizeof(struct ripng_interface
));
880 /* Set default split-horizon behavior. If the interface is Frame
881 Relay or SMDS is enabled, the default value for split-horizon is
882 off. But currently Zebra does detect Frame Relay or SMDS
883 interface. So all interface is set to split horizon. */
885 yang_get_default_enum("%s/split-horizon", RIPNG_IFACE
);
890 void ripng_interface_sync(struct interface
*ifp
)
894 vrf
= vrf_lookup_by_id(ifp
->vrf_id
);
896 struct ripng_interface
*ri
;
900 ri
->ripng
= vrf
->info
;
904 static int ripng_if_new_hook(struct interface
*ifp
)
906 ifp
->info
= ri_new();
907 ripng_interface_sync(ifp
);
912 /* Called when interface structure deleted. */
913 static int ripng_if_delete_hook(struct interface
*ifp
)
915 XFREE(MTYPE_RIPNG_IF
, ifp
->info
);
920 /* Configuration write function for ripngd. */
921 static int interface_config_write(struct vty
*vty
)
926 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
927 struct interface
*ifp
;
929 FOR_ALL_INTERFACES (vrf
, ifp
) {
930 struct lyd_node
*dnode
;
932 dnode
= yang_dnode_get(
933 running_config
->dnode
,
934 "/frr-interface:lib/interface[name='%s'][vrf='%s']",
935 ifp
->name
, vrf
->name
);
940 nb_cli_show_dnode_cmds(vty
, dnode
, false);
947 /* ripngd's interface node. */
948 static struct cmd_node interface_node
= {
949 INTERFACE_NODE
, "%s(config-if)# ", 1 /* VTYSH */
952 /* Initialization of interface. */
953 void ripng_if_init(void)
955 /* Interface initialize. */
956 hook_register_prio(if_add
, 0, ripng_if_new_hook
);
957 hook_register_prio(if_del
, 0, ripng_if_delete_hook
);
959 /* Install interface node. */
960 install_node(&interface_node
, interface_config_write
);
962 if_zapi_callbacks(ripng_ifp_create
, ripng_ifp_up
,
963 ripng_ifp_down
, ripng_ifp_destroy
);