1 /* Interface related function for RIP.
2 * Copyright (C) 1997, 98 Kunihiro Ishiguro <kunihiro@zebra.org>
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
25 #include "sockunion.h"
38 #include "zebra/connected.h"
40 #include "ripd/ripd.h"
41 #include "ripd/rip_debug.h"
42 #include "ripd/rip_interface.h"
44 DEFINE_HOOK(rip_ifaddr_add
, (struct connected
*ifc
), (ifc
))
45 DEFINE_HOOK(rip_ifaddr_del
, (struct connected
*ifc
), (ifc
))
47 /* static prototypes */
48 static void rip_enable_apply (struct interface
*);
49 static void rip_passive_interface_apply (struct interface
*);
50 static int rip_if_down(struct interface
*ifp
);
51 static int rip_enable_if_lookup (const char *ifname
);
52 static int rip_enable_network_lookup2 (struct connected
*connected
);
53 static void rip_enable_apply_all (void);
55 const struct message ri_version_msg
[] =
57 {RI_RIP_VERSION_1
, "1"},
58 {RI_RIP_VERSION_2
, "2"},
59 {RI_RIP_VERSION_1_AND_2
, "1 2"},
60 {RI_RIP_VERSION_NONE
, "none"},
64 extern struct zebra_privs_t ripd_privs
;
66 /* RIP enabled network vector. */
67 vector rip_enable_interface
;
69 /* RIP enabled interface table. */
70 struct route_table
*rip_enable_network
;
72 /* Vector to store passive-interface name. */
73 static int passive_default
; /* are we in passive-interface default mode? */
74 vector Vrip_passive_nondefault
;
76 /* Join to the RIP version 2 multicast group. */
78 ipv4_multicast_join (int sock
,
85 ret
= setsockopt_ipv4_multicast (sock
,
92 zlog_info("can't setsockopt IP_ADD_MEMBERSHIP %s", safe_strerror(errno
));
97 /* Leave from the RIP version 2 multicast group. */
99 ipv4_multicast_leave (int sock
,
100 struct in_addr group
,
106 ret
= setsockopt_ipv4_multicast (sock
,
113 zlog_info("can't setsockopt IP_DROP_MEMBERSHIP");
118 static void rip_interface_reset (struct rip_interface
*);
120 /* Allocate new RIP's interface configuration. */
121 static struct rip_interface
*
122 rip_interface_new (void)
124 struct rip_interface
*ri
;
126 ri
= XCALLOC (MTYPE_RIP_INTERFACE
, sizeof (struct rip_interface
));
128 rip_interface_reset (ri
);
134 rip_interface_multicast_set (int sock
, struct connected
*connected
)
138 assert (connected
!= NULL
);
140 addr
= CONNECTED_ID(connected
)->u
.prefix4
;
142 if (setsockopt_ipv4_multicast_if (sock
, addr
, connected
->ifp
->ifindex
) < 0)
144 zlog_warn ("Can't setsockopt IP_MULTICAST_IF on fd %d to "
145 "ifindex %d for interface %s",
146 sock
, connected
->ifp
->ifindex
,
147 connected
->ifp
->name
);
153 /* Send RIP request packet to specified interface. */
155 rip_request_interface_send (struct interface
*ifp
, u_char version
)
157 struct sockaddr_in to
;
159 /* RIPv2 support multicast. */
160 if (version
== RIPv2
&& if_is_multicast (ifp
))
163 if (IS_RIP_DEBUG_EVENT
)
164 zlog_debug ("multicast request on %s", ifp
->name
);
166 rip_request_send (NULL
, ifp
, version
, NULL
);
170 /* RIPv1 and non multicast interface. */
171 if (if_is_pointopoint (ifp
) || if_is_broadcast (ifp
))
173 struct listnode
*cnode
, *cnnode
;
174 struct connected
*connected
;
176 if (IS_RIP_DEBUG_EVENT
)
177 zlog_debug ("broadcast request to %s", ifp
->name
);
179 for (ALL_LIST_ELEMENTS (ifp
->connected
, cnode
, cnnode
, connected
))
181 if (connected
->address
->family
== AF_INET
)
183 memset (&to
, 0, sizeof (struct sockaddr_in
));
184 to
.sin_port
= htons (RIP_PORT_DEFAULT
);
185 if (connected
->destination
)
186 /* use specified broadcast or peer destination addr */
187 to
.sin_addr
= connected
->destination
->u
.prefix4
;
188 else if (connected
->address
->prefixlen
< IPV4_MAX_PREFIXLEN
)
189 /* calculate the appropriate broadcast address */
191 ipv4_broadcast_addr(connected
->address
->u
.prefix4
.s_addr
,
192 connected
->address
->prefixlen
);
194 /* do not know where to send the packet */
197 if (IS_RIP_DEBUG_EVENT
)
198 zlog_debug ("SEND request to %s", inet_ntoa (to
.sin_addr
));
200 rip_request_send (&to
, ifp
, version
, connected
);
206 /* This will be executed when interface goes up. */
208 rip_request_interface (struct interface
*ifp
)
210 struct rip_interface
*ri
;
212 /* In default ripd doesn't send RIP_REQUEST to the loopback interface. */
213 if (if_is_loopback (ifp
))
216 /* If interface is down, don't send RIP packet. */
217 if (! if_is_operative (ifp
))
220 /* Fetch RIP interface information. */
224 /* If there is no version configuration in the interface,
225 use rip's version setting. */
227 int vsend
= ((ri
->ri_send
== RI_RIP_UNSPEC
) ?
228 rip
->version_send
: ri
->ri_send
);
230 rip_request_interface_send (ifp
, RIPv1
);
232 rip_request_interface_send (ifp
, RIPv2
);
237 /* Send RIP request to the neighbor. */
239 rip_request_neighbor (struct in_addr addr
)
241 struct sockaddr_in to
;
243 memset (&to
, 0, sizeof (struct sockaddr_in
));
244 to
.sin_port
= htons (RIP_PORT_DEFAULT
);
247 rip_request_send (&to
, NULL
, rip
->version_send
, NULL
);
250 /* Request routes at all interfaces. */
252 rip_request_neighbor_all (void)
254 struct route_node
*rp
;
259 if (IS_RIP_DEBUG_EVENT
)
260 zlog_debug ("request to the all neighbor");
262 /* Send request to all neighbor. */
263 for (rp
= route_top (rip
->neighbor
); rp
; rp
= route_next (rp
))
265 rip_request_neighbor (rp
->p
.u
.prefix4
);
269 /* Multicast packet receive socket. */
271 rip_multicast_join (struct interface
*ifp
, int sock
)
273 struct listnode
*cnode
;
274 struct connected
*ifc
;
276 if (if_is_operative (ifp
) && if_is_multicast (ifp
))
278 if (IS_RIP_DEBUG_EVENT
)
279 zlog_debug ("multicast join at %s", ifp
->name
);
281 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, cnode
, ifc
))
283 struct prefix_ipv4
*p
;
284 struct in_addr group
;
286 p
= (struct prefix_ipv4
*) ifc
->address
;
288 if (p
->family
!= AF_INET
)
291 group
.s_addr
= htonl (INADDR_RIP_GROUP
);
292 if (ipv4_multicast_join (sock
, group
, p
->prefix
, ifp
->ifindex
) < 0)
301 /* Leave from multicast group. */
303 rip_multicast_leave (struct interface
*ifp
, int sock
)
305 struct listnode
*cnode
;
306 struct connected
*connected
;
308 if (if_is_up (ifp
) && if_is_multicast (ifp
))
310 if (IS_RIP_DEBUG_EVENT
)
311 zlog_debug ("multicast leave from %s", ifp
->name
);
313 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, cnode
, connected
))
315 struct prefix_ipv4
*p
;
316 struct in_addr group
;
318 p
= (struct prefix_ipv4
*) connected
->address
;
320 if (p
->family
!= AF_INET
)
323 group
.s_addr
= htonl (INADDR_RIP_GROUP
);
324 if (ipv4_multicast_leave (sock
, group
, p
->prefix
, ifp
->ifindex
) == 0)
330 /* Is there and address on interface that I could use ? */
332 rip_if_ipv4_address_check (struct interface
*ifp
)
335 struct connected
*connected
;
338 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, nn
, connected
))
342 p
= connected
->address
;
344 if (p
->family
== AF_INET
)
354 /* Does this address belongs to me ? */
356 if_check_address (struct in_addr addr
)
358 struct listnode
*node
;
359 struct interface
*ifp
;
361 for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT
), node
, ifp
))
363 struct listnode
*cnode
;
364 struct connected
*connected
;
366 for (ALL_LIST_ELEMENTS_RO (ifp
->connected
, cnode
, connected
))
368 struct prefix_ipv4
*p
;
370 p
= (struct prefix_ipv4
*) connected
->address
;
372 if (p
->family
!= AF_INET
)
375 if (IPV4_ADDR_CMP (&p
->prefix
, &addr
) == 0)
382 /* Inteface link down message processing. */
384 rip_interface_down (int command
, struct zclient
*zclient
, zebra_size_t length
,
387 struct interface
*ifp
;
392 /* zebra_interface_state_read() updates interface structure in
394 ifp
= zebra_interface_state_read (s
, vrf_id
);
401 if (IS_RIP_DEBUG_ZEBRA
)
402 zlog_debug ("interface %s index %d flags %llx metric %d mtu %d is down",
403 ifp
->name
, ifp
->ifindex
, (unsigned long long)ifp
->flags
,
404 ifp
->metric
, ifp
->mtu
);
409 /* Inteface link up message processing */
411 rip_interface_up (int command
, struct zclient
*zclient
, zebra_size_t length
,
414 struct interface
*ifp
;
416 /* zebra_interface_state_read () updates interface structure in
418 ifp
= zebra_interface_state_read (zclient
->ibuf
, vrf_id
);
423 if (IS_RIP_DEBUG_ZEBRA
)
424 zlog_debug ("interface %s index %d flags %#llx metric %d mtu %d is up",
425 ifp
->name
, ifp
->ifindex
, (unsigned long long) ifp
->flags
,
426 ifp
->metric
, ifp
->mtu
);
428 /* Check if this interface is RIP enabled or not.*/
429 rip_enable_apply (ifp
);
431 /* Check for a passive interface */
432 rip_passive_interface_apply (ifp
);
434 /* Apply distribute list to the all interface. */
435 rip_distribute_update_interface (ifp
);
440 /* Inteface addition message from zebra. */
442 rip_interface_add (int command
, struct zclient
*zclient
, zebra_size_t length
,
445 struct interface
*ifp
;
447 ifp
= zebra_interface_add_read (zclient
->ibuf
, vrf_id
);
449 if (IS_RIP_DEBUG_ZEBRA
)
450 zlog_debug ("interface add %s index %d flags %#llx metric %d mtu %d",
451 ifp
->name
, ifp
->ifindex
, (unsigned long long) ifp
->flags
,
452 ifp
->metric
, ifp
->mtu
);
454 /* Check if this interface is RIP enabled or not.*/
455 rip_enable_apply (ifp
);
457 /* Check for a passive interface */
458 rip_passive_interface_apply (ifp
);
460 /* Apply distribute list to the all interface. */
461 rip_distribute_update_interface (ifp
);
463 /* rip_request_neighbor_all (); */
465 /* Check interface routemap. */
466 rip_if_rmap_update_interface (ifp
);
472 rip_interface_delete (int command
, struct zclient
*zclient
,
473 zebra_size_t length
, vrf_id_t vrf_id
)
475 struct interface
*ifp
;
480 /* zebra_interface_state_read() updates interface structure in iflist */
481 ifp
= zebra_interface_state_read (s
, vrf_id
);
486 if (if_is_up (ifp
)) {
490 zlog_info("interface delete %s index %d flags %#llx metric %d mtu %d",
491 ifp
->name
, ifp
->ifindex
, (unsigned long long) ifp
->flags
,
492 ifp
->metric
, ifp
->mtu
);
494 /* To support pseudo interface do not free interface structure. */
495 /* if_delete(ifp); */
496 ifp
->ifindex
= IFINDEX_DELETED
;
502 rip_interface_clean (struct rip_interface
*ri
)
504 ri
->enable_network
= 0;
505 ri
->enable_interface
= 0;
510 thread_cancel (ri
->t_wakeup
);
516 rip_interfaces_clean (void)
518 struct listnode
*node
;
519 struct interface
*ifp
;
521 for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT
), node
, ifp
))
522 rip_interface_clean (ifp
->info
);
526 rip_interface_reset (struct rip_interface
*ri
)
528 /* Default authentication type is simple password for Cisco
530 ri
->auth_type
= RIP_NO_AUTH
;
531 ri
->md5_auth_len
= RIP_AUTH_MD5_COMPAT_SIZE
;
533 /* Set default split-horizon behavior. If the interface is Frame
534 Relay or SMDS is enabled, the default value for split-horizon is
535 off. But currently Zebra does detect Frame Relay or SMDS
536 interface. So all interface is set to split horizon. */
537 ri
->split_horizon_default
= RIP_SPLIT_HORIZON
;
538 ri
->split_horizon
= ri
->split_horizon_default
;
540 ri
->ri_send
= RI_RIP_UNSPEC
;
541 ri
->ri_receive
= RI_RIP_UNSPEC
;
543 ri
->v2_broadcast
= 0;
552 free (ri
->key_chain
);
553 ri
->key_chain
= NULL
;
556 ri
->list
[RIP_FILTER_IN
] = NULL
;
557 ri
->list
[RIP_FILTER_OUT
] = NULL
;
559 ri
->prefix
[RIP_FILTER_IN
] = NULL
;
560 ri
->prefix
[RIP_FILTER_OUT
] = NULL
;
562 ri
->recv_badpackets
= 0;
563 ri
->recv_badroutes
= 0;
564 ri
->sent_updates
= 0;
568 rip_interface_clean (ri
);
572 rip_interfaces_reset (void)
574 struct listnode
*node
;
575 struct interface
*ifp
;
577 for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT
), node
, ifp
))
578 rip_interface_reset (ifp
->info
);
582 rip_if_down(struct interface
*ifp
)
584 struct route_node
*rp
;
585 struct rip_info
*rinfo
;
586 struct rip_interface
*ri
= NULL
;
587 struct list
*list
= NULL
;
588 struct listnode
*listnode
= NULL
, *nextnode
= NULL
;
591 for (rp
= route_top (rip
->table
); rp
; rp
= route_next (rp
))
592 if ((list
= rp
->info
) != NULL
)
593 for (ALL_LIST_ELEMENTS (list
, listnode
, nextnode
, rinfo
))
594 if (rinfo
->ifindex
== ifp
->ifindex
)
595 rip_ecmp_delete (rinfo
);
601 if (IS_RIP_DEBUG_EVENT
)
602 zlog_debug ("turn off %s", ifp
->name
);
604 /* Leave from multicast group. */
605 rip_multicast_leave (ifp
, rip
->sock
);
614 /* Needed for stop RIP process. */
618 struct interface
*ifp
;
619 struct listnode
*node
, *nnode
;
621 for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT
), node
, nnode
, ifp
))
626 rip_apply_address_add (struct connected
*ifc
)
628 struct prefix_ipv4 address
;
634 if (! if_is_up(ifc
->ifp
))
639 memset (&address
, 0, sizeof (address
));
640 address
.family
= p
->family
;
641 address
.prefix
= p
->u
.prefix4
;
642 address
.prefixlen
= p
->prefixlen
;
643 apply_mask_ipv4(&address
);
645 /* Check if this interface is RIP enabled or not
646 or Check if this address's prefix is RIP enabled */
647 if ((rip_enable_if_lookup(ifc
->ifp
->name
) >= 0) ||
648 (rip_enable_network_lookup2(ifc
) >= 0))
649 rip_redistribute_add(ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
650 &address
, ifc
->ifp
->ifindex
, NULL
, 0, 0, 0);
655 rip_interface_address_add (int command
, struct zclient
*zclient
,
656 zebra_size_t length
, vrf_id_t vrf_id
)
658 struct connected
*ifc
;
661 ifc
= zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD
,
662 zclient
->ibuf
, vrf_id
);
669 if (p
->family
== AF_INET
)
671 if (IS_RIP_DEBUG_ZEBRA
)
672 zlog_debug ("connected address %s/%d is added",
673 inet_ntoa (p
->u
.prefix4
), p
->prefixlen
);
675 rip_enable_apply(ifc
->ifp
);
676 /* Check if this prefix needs to be redistributed */
677 rip_apply_address_add(ifc
);
679 hook_call(rip_ifaddr_add
, ifc
);
686 rip_apply_address_del (struct connected
*ifc
) {
687 struct prefix_ipv4 address
;
693 if (! if_is_up(ifc
->ifp
))
698 memset (&address
, 0, sizeof (address
));
699 address
.family
= p
->family
;
700 address
.prefix
= p
->u
.prefix4
;
701 address
.prefixlen
= p
->prefixlen
;
702 apply_mask_ipv4(&address
);
704 rip_redistribute_delete(ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
705 &address
, ifc
->ifp
->ifindex
);
709 rip_interface_address_delete (int command
, struct zclient
*zclient
,
710 zebra_size_t length
, vrf_id_t vrf_id
)
712 struct connected
*ifc
;
715 ifc
= zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE
,
716 zclient
->ibuf
, vrf_id
);
721 if (p
->family
== AF_INET
)
723 if (IS_RIP_DEBUG_ZEBRA
)
724 zlog_debug ("connected address %s/%d is deleted",
725 inet_ntoa (p
->u
.prefix4
), p
->prefixlen
);
727 hook_call(rip_ifaddr_del
, ifc
);
729 /* Chech wether this prefix needs to be removed */
730 rip_apply_address_del(ifc
);
734 connected_free (ifc
);
741 /* Check interface is enabled by network statement. */
742 /* Check wether the interface has at least a connected prefix that
743 * is within the ripng_enable_network table. */
745 rip_enable_network_lookup_if (struct interface
*ifp
)
747 struct listnode
*node
, *nnode
;
748 struct connected
*connected
;
749 struct prefix_ipv4 address
;
751 for (ALL_LIST_ELEMENTS (ifp
->connected
, node
, nnode
, connected
))
754 struct route_node
*node
;
756 p
= connected
->address
;
758 if (p
->family
== AF_INET
)
760 address
.family
= AF_INET
;
761 address
.prefix
= p
->u
.prefix4
;
762 address
.prefixlen
= IPV4_MAX_BITLEN
;
764 node
= route_node_match (rip_enable_network
,
765 (struct prefix
*)&address
);
768 route_unlock_node (node
);
776 /* Check wether connected is within the ripng_enable_network table. */
778 rip_enable_network_lookup2 (struct connected
*connected
)
780 struct prefix_ipv4 address
;
783 p
= connected
->address
;
785 if (p
->family
== AF_INET
) {
786 struct route_node
*node
;
788 address
.family
= p
->family
;
789 address
.prefix
= p
->u
.prefix4
;
790 address
.prefixlen
= IPV4_MAX_BITLEN
;
792 /* LPM on p->family, p->u.prefix4/IPV4_MAX_BITLEN within rip_enable_network */
793 node
= route_node_match (rip_enable_network
,
794 (struct prefix
*)&address
);
797 route_unlock_node (node
);
804 /* Add RIP enable network. */
806 rip_enable_network_add (struct prefix
*p
)
808 struct route_node
*node
;
810 node
= route_node_get (rip_enable_network
, p
);
814 route_unlock_node (node
);
818 node
->info
= (void *)1;
820 /* XXX: One should find a better solution than a generic one */
821 rip_enable_apply_all();
826 /* Delete RIP enable network. */
828 rip_enable_network_delete (struct prefix
*p
)
830 struct route_node
*node
;
832 node
= route_node_lookup (rip_enable_network
, p
);
837 /* Unlock info lock. */
838 route_unlock_node (node
);
840 /* Unlock lookup lock. */
841 route_unlock_node (node
);
843 /* XXX: One should find a better solution than a generic one */
844 rip_enable_apply_all ();
851 /* Check interface is enabled by ifname statement. */
853 rip_enable_if_lookup (const char *ifname
)
858 for (i
= 0; i
< vector_active (rip_enable_interface
); i
++)
859 if ((str
= vector_slot (rip_enable_interface
, i
)) != NULL
)
860 if (strcmp (str
, ifname
) == 0)
865 /* Add interface to rip_enable_if. */
867 rip_enable_if_add (const char *ifname
)
871 ret
= rip_enable_if_lookup (ifname
);
875 vector_set (rip_enable_interface
, strdup (ifname
));
877 rip_enable_apply_all(); /* TODOVJ */
882 /* Delete interface from rip_enable_if. */
884 rip_enable_if_delete (const char *ifname
)
889 index
= rip_enable_if_lookup (ifname
);
893 str
= vector_slot (rip_enable_interface
, index
);
895 vector_unset (rip_enable_interface
, index
);
897 rip_enable_apply_all(); /* TODOVJ */
902 /* Join to multicast group and send request to the interface. */
904 rip_interface_wakeup (struct thread
*t
)
906 struct interface
*ifp
;
907 struct rip_interface
*ri
;
910 ifp
= THREAD_ARG (t
);
915 /* Join to multicast group. */
916 if (rip_multicast_join (ifp
, rip
->sock
) < 0)
918 zlog_err ("multicast join failed, interface %s not running", ifp
->name
);
922 /* Set running flag. */
925 /* Send RIP request to the interface. */
926 rip_request_interface (ifp
);
932 rip_connect_set (struct interface
*ifp
, int set
)
934 struct listnode
*node
, *nnode
;
935 struct connected
*connected
;
936 struct prefix_ipv4 address
;
938 for (ALL_LIST_ELEMENTS (ifp
->connected
, node
, nnode
, connected
))
941 p
= connected
->address
;
943 if (p
->family
!= AF_INET
)
946 address
.family
= AF_INET
;
947 address
.prefix
= p
->u
.prefix4
;
948 address
.prefixlen
= p
->prefixlen
;
949 apply_mask_ipv4 (&address
);
952 /* Check once more wether this prefix is within a "network IF_OR_PREF" one */
953 if ((rip_enable_if_lookup(connected
->ifp
->name
) >= 0) ||
954 (rip_enable_network_lookup2(connected
) >= 0))
955 rip_redistribute_add (ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
956 &address
, connected
->ifp
->ifindex
,
960 rip_redistribute_delete (ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
961 &address
, connected
->ifp
->ifindex
);
962 if (rip_redistribute_check (ZEBRA_ROUTE_CONNECT
))
963 rip_redistribute_add (ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_REDISTRIBUTE
,
964 &address
, connected
->ifp
->ifindex
,
970 /* Update interface status. */
972 rip_enable_apply (struct interface
*ifp
)
975 struct rip_interface
*ri
= NULL
;
977 /* Check interface. */
978 if (! if_is_operative (ifp
))
983 /* Check network configuration. */
984 ret
= rip_enable_network_lookup_if (ifp
);
986 /* If the interface is matched. */
988 ri
->enable_network
= 1;
990 ri
->enable_network
= 0;
992 /* Check interface name configuration. */
993 ret
= rip_enable_if_lookup (ifp
->name
);
995 ri
->enable_interface
= 1;
997 ri
->enable_interface
= 0;
999 /* any interface MUST have an IPv4 address */
1000 if ( ! rip_if_ipv4_address_check (ifp
) )
1002 ri
->enable_network
= 0;
1003 ri
->enable_interface
= 0;
1006 /* Update running status of the interface. */
1007 if (ri
->enable_network
|| ri
->enable_interface
)
1010 if (IS_RIP_DEBUG_EVENT
)
1011 zlog_debug ("turn on %s", ifp
->name
);
1013 /* Add interface wake up thread. */
1014 thread_add_timer(master
, rip_interface_wakeup
, ifp
, 1,
1016 rip_connect_set (ifp
, 1);
1023 /* Might as well clean up the route table as well
1024 * rip_if_down sets to 0 ri->running, and displays "turn off %s"
1028 rip_connect_set (ifp
, 0);
1033 /* Apply network configuration to all interface. */
1035 rip_enable_apply_all ()
1037 struct interface
*ifp
;
1038 struct listnode
*node
, *nnode
;
1040 /* Check each interface. */
1041 for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT
), node
, nnode
, ifp
))
1042 rip_enable_apply (ifp
);
1046 rip_neighbor_lookup (struct sockaddr_in
*from
)
1048 struct prefix_ipv4 p
;
1049 struct route_node
*node
;
1051 memset (&p
, 0, sizeof (struct prefix_ipv4
));
1053 p
.prefix
= from
->sin_addr
;
1054 p
.prefixlen
= IPV4_MAX_BITLEN
;
1056 node
= route_node_lookup (rip
->neighbor
, (struct prefix
*) &p
);
1059 route_unlock_node (node
);
1065 /* Add new RIP neighbor to the neighbor tree. */
1067 rip_neighbor_add (struct prefix_ipv4
*p
)
1069 struct route_node
*node
;
1071 node
= route_node_get (rip
->neighbor
, (struct prefix
*) p
);
1076 node
->info
= rip
->neighbor
;
1081 /* Delete RIP neighbor from the neighbor tree. */
1083 rip_neighbor_delete (struct prefix_ipv4
*p
)
1085 struct route_node
*node
;
1087 /* Lock for look up. */
1088 node
= route_node_lookup (rip
->neighbor
, (struct prefix
*) p
);
1094 /* Unlock lookup lock. */
1095 route_unlock_node (node
);
1097 /* Unlock real neighbor information lock. */
1098 route_unlock_node (node
);
1103 /* Clear all network and neighbor configuration. */
1105 rip_clean_network ()
1109 struct route_node
*rn
;
1111 /* rip_enable_network. */
1112 for (rn
= route_top (rip_enable_network
); rn
; rn
= route_next (rn
))
1116 route_unlock_node (rn
);
1119 /* rip_enable_interface. */
1120 for (i
= 0; i
< vector_active (rip_enable_interface
); i
++)
1121 if ((str
= vector_slot (rip_enable_interface
, i
)) != NULL
)
1124 vector_slot (rip_enable_interface
, i
) = NULL
;
1128 /* Utility function for looking up passive interface settings. */
1130 rip_passive_nondefault_lookup (const char *ifname
)
1135 for (i
= 0; i
< vector_active (Vrip_passive_nondefault
); i
++)
1136 if ((str
= vector_slot (Vrip_passive_nondefault
, i
)) != NULL
)
1137 if (strcmp (str
, ifname
) == 0)
1143 rip_passive_interface_apply (struct interface
*ifp
)
1145 struct rip_interface
*ri
;
1149 ri
->passive
= ((rip_passive_nondefault_lookup (ifp
->name
) < 0) ?
1150 passive_default
: !passive_default
);
1152 if (IS_RIP_DEBUG_ZEBRA
)
1153 zlog_debug ("interface %s: passive = %d",ifp
->name
,ri
->passive
);
1157 rip_passive_interface_apply_all (void)
1159 struct interface
*ifp
;
1160 struct listnode
*node
, *nnode
;
1162 for (ALL_LIST_ELEMENTS (vrf_iflist (VRF_DEFAULT
), node
, nnode
, ifp
))
1163 rip_passive_interface_apply (ifp
);
1166 /* Passive interface. */
1168 rip_passive_nondefault_set (struct vty
*vty
, const char *ifname
)
1170 if (rip_passive_nondefault_lookup (ifname
) >= 0)
1173 vector_set (Vrip_passive_nondefault
, strdup (ifname
));
1175 rip_passive_interface_apply_all ();
1181 rip_passive_nondefault_unset (struct vty
*vty
, const char *ifname
)
1186 i
= rip_passive_nondefault_lookup (ifname
);
1190 str
= vector_slot (Vrip_passive_nondefault
, i
);
1192 vector_unset (Vrip_passive_nondefault
, i
);
1194 rip_passive_interface_apply_all ();
1199 /* Free all configured RIP passive-interface settings. */
1201 rip_passive_nondefault_clean (void)
1206 for (i
= 0; i
< vector_active (Vrip_passive_nondefault
); i
++)
1207 if ((str
= vector_slot (Vrip_passive_nondefault
, i
)) != NULL
)
1210 vector_slot (Vrip_passive_nondefault
, i
) = NULL
;
1212 rip_passive_interface_apply_all ();
1215 /* RIP enable network or interface configuration. */
1218 "network <A.B.C.D/M|WORD>",
1219 "Enable routing on an IP network\n"
1220 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
1223 int idx_ipv4_word
= 1;
1225 struct prefix_ipv4 p
;
1227 ret
= str2prefix_ipv4 (argv
[idx_ipv4_word
]->arg
, &p
);
1230 ret
= rip_enable_network_add ((struct prefix
*) &p
);
1232 ret
= rip_enable_if_add (argv
[idx_ipv4_word
]->arg
);
1236 vty_outln (vty
, "There is a same network configuration %s",
1237 argv
[idx_ipv4_word
]->arg
);
1244 /* RIP enable network or interface configuration. */
1245 DEFUN (no_rip_network
,
1247 "no network <A.B.C.D/M|WORD>",
1249 "Enable routing on an IP network\n"
1250 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
1253 int idx_ipv4_word
= 2;
1255 struct prefix_ipv4 p
;
1257 ret
= str2prefix_ipv4 (argv
[idx_ipv4_word
]->arg
, &p
);
1260 ret
= rip_enable_network_delete ((struct prefix
*) &p
);
1262 ret
= rip_enable_if_delete (argv
[idx_ipv4_word
]->arg
);
1266 vty_outln (vty
, "Can't find network configuration %s",
1267 argv
[idx_ipv4_word
]->arg
);
1274 /* RIP neighbor configuration set. */
1275 DEFUN (rip_neighbor
,
1278 "Specify a neighbor router\n"
1279 "Neighbor address\n")
1283 struct prefix_ipv4 p
;
1285 ret
= str2prefix_ipv4 (argv
[idx_ipv4
]->arg
, &p
);
1289 vty_outln (vty
, "Please specify address by A.B.C.D");
1293 rip_neighbor_add (&p
);
1298 /* RIP neighbor configuration unset. */
1299 DEFUN (no_rip_neighbor
,
1300 no_rip_neighbor_cmd
,
1301 "no neighbor A.B.C.D",
1303 "Specify a neighbor router\n"
1304 "Neighbor address\n")
1308 struct prefix_ipv4 p
;
1310 ret
= str2prefix_ipv4 (argv
[idx_ipv4
]->arg
, &p
);
1314 vty_outln (vty
, "Please specify address by A.B.C.D");
1318 rip_neighbor_delete (&p
);
1323 DEFUN (ip_rip_receive_version
,
1324 ip_rip_receive_version_cmd
,
1325 "ip rip receive version <(1-2)|none>",
1327 "Routing Information Protocol\n"
1328 "Advertisement reception\n"
1333 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1335 struct rip_interface
*ri
;
1339 switch (argv
[idx_type
]->arg
[0])
1342 ri
->ri_receive
= RI_RIP_VERSION_1
;
1345 ri
->ri_receive
= RI_RIP_VERSION_2
;
1348 ri
->ri_receive
= RI_RIP_VERSION_NONE
;
1357 DEFUN (ip_rip_receive_version_1
,
1358 ip_rip_receive_version_1_cmd
,
1359 "ip rip receive version <1 2|2 1>",
1361 "Routing Information Protocol\n"
1362 "Advertisement reception\n"
1369 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1370 struct rip_interface
*ri
;
1374 /* Version 1 and 2. */
1375 ri
->ri_receive
= RI_RIP_VERSION_1_AND_2
;
1379 DEFUN (no_ip_rip_receive_version
,
1380 no_ip_rip_receive_version_cmd
,
1381 "no ip rip receive version [(1-2)]",
1384 "Routing Information Protocol\n"
1385 "Advertisement reception\n"
1389 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1390 struct rip_interface
*ri
;
1394 ri
->ri_receive
= RI_RIP_UNSPEC
;
1399 DEFUN (ip_rip_send_version
,
1400 ip_rip_send_version_cmd
,
1401 "ip rip send version (1-2)",
1403 "Routing Information Protocol\n"
1404 "Advertisement transmission\n"
1408 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1410 struct rip_interface
*ri
;
1415 if (atoi (argv
[idx_type
]->arg
) == 1)
1417 ri
->ri_send
= RI_RIP_VERSION_1
;
1420 if (atoi (argv
[idx_type
]->arg
) == 2)
1422 ri
->ri_send
= RI_RIP_VERSION_2
;
1428 DEFUN (ip_rip_send_version_1
,
1429 ip_rip_send_version_1_cmd
,
1430 "ip rip send version <1 2|2 1>",
1432 "Routing Information Protocol\n"
1433 "Advertisement transmission\n"
1440 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1441 struct rip_interface
*ri
;
1445 /* Version 1 and 2. */
1446 ri
->ri_send
= RI_RIP_VERSION_1_AND_2
;
1450 DEFUN (no_ip_rip_send_version
,
1451 no_ip_rip_send_version_cmd
,
1452 "no ip rip send version [(1-2)]",
1455 "Routing Information Protocol\n"
1456 "Advertisement transmission\n"
1460 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1461 struct rip_interface
*ri
;
1465 ri
->ri_send
= RI_RIP_UNSPEC
;
1470 DEFUN (ip_rip_v2_broadcast
,
1471 ip_rip_v2_broadcast_cmd
,
1472 "ip rip v2-broadcast",
1474 "Routing Information Protocol\n"
1475 "Send ip broadcast v2 update\n")
1477 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1478 struct rip_interface
*ri
;
1482 ri
->v2_broadcast
= 1;
1486 DEFUN (no_ip_rip_v2_broadcast
,
1487 no_ip_rip_v2_broadcast_cmd
,
1488 "no ip rip v2-broadcast",
1491 "Routing Information Protocol\n"
1492 "Send ip broadcast v2 update\n")
1494 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1495 struct rip_interface
*ri
;
1499 ri
->v2_broadcast
= 0;
1503 DEFUN (ip_rip_authentication_mode
,
1504 ip_rip_authentication_mode_cmd
,
1505 "ip rip authentication mode <md5|text> [auth-length <rfc|old-ripd>]",
1507 "Routing Information Protocol\n"
1508 "Authentication control\n"
1509 "Authentication mode\n"
1510 "Keyed message digest\n"
1511 "Clear text authentication\n"
1512 "MD5 authentication data length\n"
1514 "Old ripd compatible\n")
1516 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1517 char *cryptmode
= argv
[4]->text
;
1518 char *authlen
= (argc
> 5) ? argv
[6]->text
: NULL
;
1519 struct rip_interface
*ri
;
1524 if (strmatch ("md5", cryptmode
))
1525 auth_type
= RIP_AUTH_MD5
;
1527 assert (strmatch ("text", cryptmode
));
1528 auth_type
= RIP_AUTH_SIMPLE_PASSWORD
;
1531 ri
->auth_type
= auth_type
;
1535 if (auth_type
!= RIP_AUTH_MD5
)
1537 vty_outln (vty
, "auth length argument only valid for md5");
1540 if (strmatch ("rfc", authlen
))
1541 ri
->md5_auth_len
= RIP_AUTH_MD5_SIZE
;
1544 assert (strmatch ("old-ripd", authlen
));
1545 ri
->md5_auth_len
= RIP_AUTH_MD5_COMPAT_SIZE
;
1552 DEFUN (no_ip_rip_authentication_mode
,
1553 no_ip_rip_authentication_mode_cmd
,
1554 "no ip rip authentication mode [<md5|text> [auth-length <rfc|old-ripd>]]",
1557 "Routing Information Protocol\n"
1558 "Authentication control\n"
1559 "Authentication mode\n"
1560 "Keyed message digest\n"
1561 "Clear text authentication\n"
1562 "MD5 authentication data length\n"
1564 "Old ripd compatible\n")
1566 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1567 struct rip_interface
*ri
;
1571 ri
->auth_type
= RIP_NO_AUTH
;
1572 ri
->md5_auth_len
= RIP_AUTH_MD5_COMPAT_SIZE
;
1577 DEFUN (ip_rip_authentication_string
,
1578 ip_rip_authentication_string_cmd
,
1579 "ip rip authentication string LINE",
1581 "Routing Information Protocol\n"
1582 "Authentication control\n"
1583 "Authentication string\n"
1584 "Authentication string\n")
1586 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1588 struct rip_interface
*ri
;
1592 if (strlen (argv
[idx_line
]->arg
) > 16)
1595 "%% RIPv2 authentication string must be shorter than 16");
1601 vty_outln (vty
, "%% key-chain configuration exists");
1606 free (ri
->auth_str
);
1608 ri
->auth_str
= strdup (argv
[idx_line
]->arg
);
1613 DEFUN (no_ip_rip_authentication_string
,
1614 no_ip_rip_authentication_string_cmd
,
1615 "no ip rip authentication string [LINE]",
1618 "Routing Information Protocol\n"
1619 "Authentication control\n"
1620 "Authentication string\n"
1621 "Authentication string\n")
1623 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1624 struct rip_interface
*ri
;
1629 free (ri
->auth_str
);
1631 ri
->auth_str
= NULL
;
1637 DEFUN (ip_rip_authentication_key_chain
,
1638 ip_rip_authentication_key_chain_cmd
,
1639 "ip rip authentication key-chain LINE",
1641 "Routing Information Protocol\n"
1642 "Authentication control\n"
1643 "Authentication key-chain\n"
1644 "name of key-chain\n")
1646 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1648 struct rip_interface
*ri
;
1654 vty_outln (vty
,"%% authentication string configuration exists");
1659 free (ri
->key_chain
);
1661 ri
->key_chain
= strdup (argv
[idx_line
]->arg
);
1666 DEFUN (no_ip_rip_authentication_key_chain
,
1667 no_ip_rip_authentication_key_chain_cmd
,
1668 "no ip rip authentication key-chain [LINE]",
1671 "Routing Information Protocol\n"
1672 "Authentication control\n"
1673 "Authentication key-chain\n"
1674 "name of key-chain\n")
1676 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1677 struct rip_interface
*ri
;
1682 free (ri
->key_chain
);
1684 ri
->key_chain
= NULL
;
1690 /* CHANGED: ip rip split-horizon
1691 Cisco and Zebra's command is
1694 DEFUN (ip_rip_split_horizon
,
1695 ip_rip_split_horizon_cmd
,
1696 "ip rip split-horizon",
1698 "Routing Information Protocol\n"
1699 "Perform split horizon\n")
1701 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1702 struct rip_interface
*ri
;
1706 ri
->split_horizon
= RIP_SPLIT_HORIZON
;
1710 DEFUN (ip_rip_split_horizon_poisoned_reverse
,
1711 ip_rip_split_horizon_poisoned_reverse_cmd
,
1712 "ip rip split-horizon poisoned-reverse",
1714 "Routing Information Protocol\n"
1715 "Perform split horizon\n"
1716 "With poisoned-reverse\n")
1718 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1719 struct rip_interface
*ri
;
1723 ri
->split_horizon
= RIP_SPLIT_HORIZON_POISONED_REVERSE
;
1727 /* CHANGED: no ip rip split-horizon
1728 Cisco and Zebra's command is
1731 DEFUN (no_ip_rip_split_horizon
,
1732 no_ip_rip_split_horizon_cmd
,
1733 "no ip rip split-horizon",
1736 "Routing Information Protocol\n"
1737 "Perform split horizon\n")
1739 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1740 struct rip_interface
*ri
;
1744 ri
->split_horizon
= RIP_NO_SPLIT_HORIZON
;
1748 DEFUN (no_ip_rip_split_horizon_poisoned_reverse
,
1749 no_ip_rip_split_horizon_poisoned_reverse_cmd
,
1750 "no ip rip split-horizon poisoned-reverse",
1753 "Routing Information Protocol\n"
1754 "Perform split horizon\n"
1755 "With poisoned-reverse\n")
1757 VTY_DECLVAR_CONTEXT(interface
, ifp
);
1758 struct rip_interface
*ri
;
1762 switch( ri
->split_horizon
)
1764 case RIP_SPLIT_HORIZON_POISONED_REVERSE
:
1765 ri
->split_horizon
= RIP_SPLIT_HORIZON
;
1773 DEFUN (rip_passive_interface
,
1774 rip_passive_interface_cmd
,
1775 "passive-interface <IFNAME|default>",
1776 "Suppress routing updates on an interface\n"
1778 "default for all interfaces\n")
1780 if (argv
[1]->type
== WORD_TKN
) { // user passed 'default'
1781 passive_default
= 1;
1782 rip_passive_nondefault_clean();
1785 if (passive_default
)
1786 return rip_passive_nondefault_unset (vty
, argv
[1]->arg
);
1788 return rip_passive_nondefault_set (vty
, argv
[1]->arg
);
1791 DEFUN (no_rip_passive_interface
,
1792 no_rip_passive_interface_cmd
,
1793 "no passive-interface <IFNAME|default>",
1795 "Suppress routing updates on an interface\n"
1797 "default for all interfaces\n")
1799 if (argv
[2]->type
== WORD_TKN
) {
1800 passive_default
= 0;
1801 rip_passive_nondefault_clean();
1804 if (passive_default
)
1805 return rip_passive_nondefault_set (vty
, argv
[2]->arg
);
1807 return rip_passive_nondefault_unset (vty
, argv
[2]->arg
);
1810 /* Write rip configuration of each interface. */
1812 rip_interface_config_write (struct vty
*vty
)
1814 struct listnode
*node
;
1815 struct interface
*ifp
;
1817 for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT
), node
, ifp
))
1819 struct rip_interface
*ri
;
1821 if (ifp
->ifindex
== IFINDEX_DELETED
)
1826 /* Do not display the interface if there is no
1827 * configuration about it.
1830 (ri
->split_horizon
== ri
->split_horizon_default
) &&
1831 (ri
->ri_send
== RI_RIP_UNSPEC
) &&
1832 (ri
->ri_receive
== RI_RIP_UNSPEC
) &&
1833 (ri
->auth_type
!= RIP_AUTH_MD5
) &&
1834 (!ri
->v2_broadcast
) &&
1835 (ri
->md5_auth_len
!= RIP_AUTH_MD5_SIZE
) &&
1840 vty_outln (vty
, "interface %s",ifp
->name
);
1843 vty_outln (vty
, " description %s",ifp
->desc
);
1845 /* Split horizon. */
1846 if (ri
->split_horizon
!= ri
->split_horizon_default
)
1848 switch (ri
->split_horizon
) {
1849 case RIP_SPLIT_HORIZON
:
1850 vty_outln (vty
, " ip rip split-horizon");
1852 case RIP_SPLIT_HORIZON_POISONED_REVERSE
:
1853 vty_outln (vty
," ip rip split-horizon poisoned-reverse");
1855 case RIP_NO_SPLIT_HORIZON
:
1857 vty_outln (vty
, " no ip rip split-horizon");
1862 /* RIP version setting. */
1863 if (ri
->ri_send
!= RI_RIP_UNSPEC
)
1864 vty_outln (vty
, " ip rip send version %s",
1865 lookup_msg(ri_version_msg
, ri
->ri_send
, NULL
));
1867 if (ri
->ri_receive
!= RI_RIP_UNSPEC
)
1868 vty_outln (vty
, " ip rip receive version %s ",
1869 lookup_msg(ri_version_msg
, ri
->ri_receive
, NULL
));
1871 if (ri
->v2_broadcast
)
1872 vty_outln (vty
, " ip rip v2-broadcast");
1874 /* RIP authentication. */
1875 if (ri
->auth_type
== RIP_AUTH_SIMPLE_PASSWORD
)
1876 vty_outln (vty
, " ip rip authentication mode text");
1878 if (ri
->auth_type
== RIP_AUTH_MD5
)
1880 vty_out (vty
, " ip rip authentication mode md5");
1881 if (ri
->md5_auth_len
== RIP_AUTH_MD5_COMPAT_SIZE
)
1882 vty_out (vty
, " auth-length old-ripd");
1884 vty_out (vty
, " auth-length rfc");
1885 vty_out (vty
, VTYNL
);
1889 vty_outln (vty
, " ip rip authentication string %s",
1893 vty_outln (vty
, " ip rip authentication key-chain %s",
1896 vty_outln (vty
, "!");
1902 config_write_rip_network (struct vty
*vty
, int config_mode
)
1906 struct route_node
*node
;
1908 /* Network type RIP enable interface statement. */
1909 for (node
= route_top (rip_enable_network
); node
; node
= route_next (node
))
1911 vty_outln (vty
, "%s%s/%d",
1912 config_mode
? " network " : " ",
1913 inet_ntoa (node
->p
.u
.prefix4
),
1916 /* Interface name RIP enable statement. */
1917 for (i
= 0; i
< vector_active (rip_enable_interface
); i
++)
1918 if ((ifname
= vector_slot (rip_enable_interface
, i
)) != NULL
)
1919 vty_outln (vty
, "%s%s",
1920 config_mode
? " network " : " ",
1923 /* RIP neighbors listing. */
1924 for (node
= route_top (rip
->neighbor
); node
; node
= route_next (node
))
1926 vty_outln (vty
, "%s%s",
1927 config_mode
? " neighbor " : " ",
1928 inet_ntoa(node
->p
.u
.prefix4
));
1930 /* RIP passive interface listing. */
1932 if (passive_default
)
1933 vty_outln (vty
, " passive-interface default");
1934 for (i
= 0; i
< vector_active (Vrip_passive_nondefault
); i
++)
1935 if ((ifname
= vector_slot (Vrip_passive_nondefault
, i
)) != NULL
)
1936 vty_outln (vty
, " %spassive-interface %s",
1937 (passive_default
? "no " : ""), ifname
);
1943 static struct cmd_node interface_node
=
1950 /* Called when interface structure allocated. */
1952 rip_interface_new_hook (struct interface
*ifp
)
1954 ifp
->info
= rip_interface_new ();
1958 /* Called when interface structure deleted. */
1960 rip_interface_delete_hook (struct interface
*ifp
)
1962 XFREE (MTYPE_RIP_INTERFACE
, ifp
->info
);
1967 /* Allocate and initialize interface vector. */
1971 /* Default initial size of interface vector. */
1972 if_add_hook (IF_NEW_HOOK
, rip_interface_new_hook
);
1973 if_add_hook (IF_DELETE_HOOK
, rip_interface_delete_hook
);
1975 /* RIP network init. */
1976 rip_enable_interface
= vector_init (1);
1977 rip_enable_network
= route_table_init ();
1979 /* RIP passive interface. */
1980 Vrip_passive_nondefault
= vector_init (1);
1982 /* Install interface node. */
1983 install_node (&interface_node
, rip_interface_config_write
);
1986 /* Install commands. */
1987 install_element (RIP_NODE
, &rip_network_cmd
);
1988 install_element (RIP_NODE
, &no_rip_network_cmd
);
1989 install_element (RIP_NODE
, &rip_neighbor_cmd
);
1990 install_element (RIP_NODE
, &no_rip_neighbor_cmd
);
1992 install_element (RIP_NODE
, &rip_passive_interface_cmd
);
1993 install_element (RIP_NODE
, &no_rip_passive_interface_cmd
);
1995 install_element (INTERFACE_NODE
, &ip_rip_send_version_cmd
);
1996 install_element (INTERFACE_NODE
, &ip_rip_send_version_1_cmd
);
1997 install_element (INTERFACE_NODE
, &no_ip_rip_send_version_cmd
);
1999 install_element (INTERFACE_NODE
, &ip_rip_receive_version_cmd
);
2000 install_element (INTERFACE_NODE
, &ip_rip_receive_version_1_cmd
);
2001 install_element (INTERFACE_NODE
, &no_ip_rip_receive_version_cmd
);
2003 install_element (INTERFACE_NODE
, &ip_rip_v2_broadcast_cmd
);
2004 install_element (INTERFACE_NODE
, &no_ip_rip_v2_broadcast_cmd
);
2006 install_element (INTERFACE_NODE
, &ip_rip_authentication_mode_cmd
);
2007 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_mode_cmd
);
2009 install_element (INTERFACE_NODE
, &ip_rip_authentication_key_chain_cmd
);
2010 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_key_chain_cmd
);
2012 install_element (INTERFACE_NODE
, &ip_rip_authentication_string_cmd
);
2013 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_string_cmd
);
2015 install_element (INTERFACE_NODE
, &ip_rip_split_horizon_cmd
);
2016 install_element (INTERFACE_NODE
, &ip_rip_split_horizon_poisoned_reverse_cmd
);
2017 install_element (INTERFACE_NODE
, &no_ip_rip_split_horizon_cmd
);
2018 install_element (INTERFACE_NODE
, &no_ip_rip_split_horizon_poisoned_reverse_cmd
);