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
17 * along with GNU Zebra; see the file COPYING. If not, write to the Free
18 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 #include "sockunion.h"
39 #include "zebra/connected.h"
41 #include "ripd/ripd.h"
42 #include "ripd/rip_debug.h"
43 #include "ripd/rip_interface.h"
45 /* static prototypes */
46 static void rip_enable_apply (struct interface *);
47 static void rip_passive_interface_apply (struct interface *);
48 static int rip_if_down(struct interface *ifp);
49 static int rip_enable_if_lookup (const char *ifname);
50 static int rip_enable_network_lookup2 (struct connected *connected);
51 static void rip_enable_apply_all (void);
53 const struct message ri_version_msg[] =
55 {RI_RIP_VERSION_1, "1"},
56 {RI_RIP_VERSION_2, "2"},
57 {RI_RIP_VERSION_1_AND_2, "1 2"},
60 extern struct zebra_privs_t ripd_privs;
62 /* RIP enabled network vector. */
63 vector rip_enable_interface;
65 /* RIP enabled interface table. */
66 struct route_table *rip_enable_network;
68 /* Vector to store passive-interface name. */
69 static int passive_default; /* are we in passive-interface default mode? */
70 vector Vrip_passive_nondefault;
72 /* Join to the RIP version 2 multicast group. */
74 ipv4_multicast_join (int sock,
81 ret = setsockopt_ipv4_multicast (sock,
87 zlog (NULL, LOG_INFO, "can't setsockopt IP_ADD_MEMBERSHIP %s",
88 safe_strerror (errno));
93 /* Leave from the RIP version 2 multicast group. */
95 ipv4_multicast_leave (int sock,
102 ret = setsockopt_ipv4_multicast (sock,
108 zlog (NULL, LOG_INFO, "can't setsockopt IP_DROP_MEMBERSHIP");
113 static void rip_interface_reset (struct rip_interface *);
115 /* Allocate new RIP's interface configuration. */
116 static struct rip_interface *
117 rip_interface_new (void)
119 struct rip_interface *ri;
121 ri = XCALLOC (MTYPE_RIP_INTERFACE, sizeof (struct rip_interface));
123 rip_interface_reset (ri);
129 rip_interface_multicast_set (int sock, struct connected *connected)
131 assert (connected != NULL);
133 if (setsockopt_ipv4_multicast_if (sock, connected->ifp->ifindex) < 0)
135 zlog_warn ("Can't setsockopt IP_MULTICAST_IF on fd %d to "
136 "ifindex %d for interface %s",
137 sock, connected->ifp->ifindex,
138 connected->ifp->name);
144 /* Send RIP request packet to specified interface. */
146 rip_request_interface_send (struct interface *ifp, u_char version)
148 struct sockaddr_in to;
150 /* RIPv2 support multicast. */
151 if (version == RIPv2 && if_is_multicast (ifp))
154 if (IS_RIP_DEBUG_EVENT)
155 zlog_debug ("multicast request on %s", ifp->name);
157 rip_request_send (NULL, ifp, version, NULL);
161 /* RIPv1 and non multicast interface. */
162 if (if_is_pointopoint (ifp) || if_is_broadcast (ifp))
164 struct listnode *cnode, *cnnode;
165 struct connected *connected;
167 if (IS_RIP_DEBUG_EVENT)
168 zlog_debug ("broadcast request to %s", ifp->name);
170 for (ALL_LIST_ELEMENTS (ifp->connected, cnode, cnnode, connected))
172 if (connected->address->family == AF_INET)
174 memset (&to, 0, sizeof (struct sockaddr_in));
175 to.sin_port = htons (RIP_PORT_DEFAULT);
176 if (connected->destination)
177 /* use specified broadcast or peer destination addr */
178 to.sin_addr = connected->destination->u.prefix4;
179 else if (connected->address->prefixlen < IPV4_MAX_PREFIXLEN)
180 /* calculate the appropriate broadcast address */
182 ipv4_broadcast_addr(connected->address->u.prefix4.s_addr,
183 connected->address->prefixlen);
185 /* do not know where to send the packet */
188 if (IS_RIP_DEBUG_EVENT)
189 zlog_debug ("SEND request to %s", inet_ntoa (to.sin_addr));
191 rip_request_send (&to, ifp, version, connected);
197 /* This will be executed when interface goes up. */
199 rip_request_interface (struct interface *ifp)
201 struct rip_interface *ri;
203 /* In default ripd doesn't send RIP_REQUEST to the loopback interface. */
204 if (if_is_loopback (ifp))
207 /* If interface is down, don't send RIP packet. */
208 if (! if_is_operative (ifp))
211 /* Fetch RIP interface information. */
215 /* If there is no version configuration in the interface,
216 use rip's version setting. */
218 int vsend = ((ri->ri_send == RI_RIP_UNSPEC) ?
219 rip->version_send : ri->ri_send);
221 rip_request_interface_send (ifp, RIPv1);
223 rip_request_interface_send (ifp, RIPv2);
228 /* Send RIP request to the neighbor. */
230 rip_request_neighbor (struct in_addr addr)
232 struct sockaddr_in to;
234 memset (&to, 0, sizeof (struct sockaddr_in));
235 to.sin_port = htons (RIP_PORT_DEFAULT);
238 rip_request_send (&to, NULL, rip->version_send, NULL);
241 /* Request routes at all interfaces. */
243 rip_request_neighbor_all (void)
245 struct route_node *rp;
250 if (IS_RIP_DEBUG_EVENT)
251 zlog_debug ("request to the all neighbor");
253 /* Send request to all neighbor. */
254 for (rp = route_top (rip->neighbor); rp; rp = route_next (rp))
256 rip_request_neighbor (rp->p.u.prefix4);
260 /* Multicast packet receive socket. */
262 rip_multicast_join (struct interface *ifp, int sock)
264 struct listnode *cnode;
265 struct connected *ifc;
267 if (if_is_operative (ifp) && if_is_multicast (ifp))
269 if (IS_RIP_DEBUG_EVENT)
270 zlog_debug ("multicast join at %s", ifp->name);
272 for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, ifc))
274 struct prefix_ipv4 *p;
275 struct in_addr group;
277 p = (struct prefix_ipv4 *) ifc->address;
279 if (p->family != AF_INET)
282 group.s_addr = htonl (INADDR_RIP_GROUP);
283 if (ipv4_multicast_join (sock, group, p->prefix, ifp->ifindex) < 0)
292 /* Leave from multicast group. */
294 rip_multicast_leave (struct interface *ifp, int sock)
296 struct listnode *cnode;
297 struct connected *connected;
299 if (if_is_up (ifp) && if_is_multicast (ifp))
301 if (IS_RIP_DEBUG_EVENT)
302 zlog_debug ("multicast leave from %s", ifp->name);
304 for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, connected))
306 struct prefix_ipv4 *p;
307 struct in_addr group;
309 p = (struct prefix_ipv4 *) connected->address;
311 if (p->family != AF_INET)
314 group.s_addr = htonl (INADDR_RIP_GROUP);
315 if (ipv4_multicast_leave (sock, group, p->prefix, ifp->ifindex) == 0)
321 /* Is there and address on interface that I could use ? */
323 rip_if_ipv4_address_check (struct interface *ifp)
326 struct connected *connected;
329 for (ALL_LIST_ELEMENTS_RO (ifp->connected, nn, connected))
333 p = connected->address;
335 if (p->family == AF_INET)
345 /* Does this address belongs to me ? */
347 if_check_address (struct in_addr addr)
349 struct listnode *node;
350 struct interface *ifp;
352 for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
354 struct listnode *cnode;
355 struct connected *connected;
357 for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, connected))
359 struct prefix_ipv4 *p;
361 p = (struct prefix_ipv4 *) connected->address;
363 if (p->family != AF_INET)
366 if (IPV4_ADDR_CMP (&p->prefix, &addr) == 0)
373 /* Inteface link down message processing. */
375 rip_interface_down (int command, struct zclient *zclient, zebra_size_t length,
378 struct interface *ifp;
383 /* zebra_interface_state_read() updates interface structure in
385 ifp = zebra_interface_state_read (s, vrf_id);
392 if (IS_RIP_DEBUG_ZEBRA)
393 zlog_debug ("interface %s index %d flags %llx metric %d mtu %d is down",
394 ifp->name, ifp->ifindex, (unsigned long long)ifp->flags,
395 ifp->metric, ifp->mtu);
400 /* Inteface link up message processing */
402 rip_interface_up (int command, struct zclient *zclient, zebra_size_t length,
405 struct interface *ifp;
407 /* zebra_interface_state_read () updates interface structure in
409 ifp = zebra_interface_state_read (zclient->ibuf, vrf_id);
414 if (IS_RIP_DEBUG_ZEBRA)
415 zlog_debug ("interface %s index %d flags %#llx metric %d mtu %d is up",
416 ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
417 ifp->metric, ifp->mtu);
419 /* Check if this interface is RIP enabled or not.*/
420 rip_enable_apply (ifp);
422 /* Check for a passive interface */
423 rip_passive_interface_apply (ifp);
425 /* Apply distribute list to the all interface. */
426 rip_distribute_update_interface (ifp);
431 /* Inteface addition message from zebra. */
433 rip_interface_add (int command, struct zclient *zclient, zebra_size_t length,
436 struct interface *ifp;
438 ifp = zebra_interface_add_read (zclient->ibuf, vrf_id);
440 if (IS_RIP_DEBUG_ZEBRA)
441 zlog_debug ("interface add %s index %d flags %#llx metric %d mtu %d",
442 ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
443 ifp->metric, ifp->mtu);
445 /* Check if this interface is RIP enabled or not.*/
446 rip_enable_apply (ifp);
448 /* Check for a passive interface */
449 rip_passive_interface_apply (ifp);
451 /* Apply distribute list to the all interface. */
452 rip_distribute_update_interface (ifp);
454 /* rip_request_neighbor_all (); */
456 /* Check interface routemap. */
457 rip_if_rmap_update_interface (ifp);
463 rip_interface_delete (int command, struct zclient *zclient,
464 zebra_size_t length, vrf_id_t vrf_id)
466 struct interface *ifp;
471 /* zebra_interface_state_read() updates interface structure in iflist */
472 ifp = zebra_interface_state_read (s, vrf_id);
477 if (if_is_up (ifp)) {
481 zlog_info("interface delete %s index %d flags %#llx metric %d mtu %d",
482 ifp->name, ifp->ifindex, (unsigned long long) ifp->flags,
483 ifp->metric, ifp->mtu);
485 /* To support pseudo interface do not free interface structure. */
486 /* if_delete(ifp); */
487 ifp->ifindex = IFINDEX_INTERNAL;
493 rip_interface_clean (struct rip_interface *ri)
495 ri->enable_network = 0;
496 ri->enable_interface = 0;
501 thread_cancel (ri->t_wakeup);
507 rip_interfaces_clean (void)
509 struct listnode *node;
510 struct interface *ifp;
512 for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
513 rip_interface_clean (ifp->info);
517 rip_interface_reset (struct rip_interface *ri)
519 /* Default authentication type is simple password for Cisco
521 ri->auth_type = RIP_NO_AUTH;
522 ri->md5_auth_len = RIP_AUTH_MD5_COMPAT_SIZE;
524 /* Set default split-horizon behavior. If the interface is Frame
525 Relay or SMDS is enabled, the default value for split-horizon is
526 off. But currently Zebra does detect Frame Relay or SMDS
527 interface. So all interface is set to split horizon. */
528 ri->split_horizon_default = RIP_SPLIT_HORIZON;
529 ri->split_horizon = ri->split_horizon_default;
531 ri->ri_send = RI_RIP_UNSPEC;
532 ri->ri_receive = RI_RIP_UNSPEC;
541 free (ri->key_chain);
542 ri->key_chain = NULL;
545 ri->list[RIP_FILTER_IN] = NULL;
546 ri->list[RIP_FILTER_OUT] = NULL;
548 ri->prefix[RIP_FILTER_IN] = NULL;
549 ri->prefix[RIP_FILTER_OUT] = NULL;
551 ri->recv_badpackets = 0;
552 ri->recv_badroutes = 0;
553 ri->sent_updates = 0;
557 rip_interface_clean (ri);
561 rip_interfaces_reset (void)
563 struct listnode *node;
564 struct interface *ifp;
566 for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
567 rip_interface_reset (ifp->info);
571 rip_if_down(struct interface *ifp)
573 struct route_node *rp;
574 struct rip_info *rinfo;
575 struct rip_interface *ri = NULL;
576 struct list *list = NULL;
577 struct listnode *listnode = NULL, *nextnode = NULL;
579 for (rp = route_top (rip->table); rp; rp = route_next (rp))
580 if ((list = rp->info) != NULL)
581 for (ALL_LIST_ELEMENTS (list, listnode, nextnode, rinfo))
582 if (rinfo->ifindex == ifp->ifindex)
583 rip_ecmp_delete (rinfo);
589 if (IS_RIP_DEBUG_EVENT)
590 zlog_debug ("turn off %s", ifp->name);
592 /* Leave from multicast group. */
593 rip_multicast_leave (ifp, rip->sock);
601 /* Needed for stop RIP process. */
605 struct interface *ifp;
606 struct listnode *node, *nnode;
608 for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
613 rip_apply_address_add (struct connected *ifc)
615 struct prefix_ipv4 address;
621 if (! if_is_up(ifc->ifp))
626 memset (&address, 0, sizeof (address));
627 address.family = p->family;
628 address.prefix = p->u.prefix4;
629 address.prefixlen = p->prefixlen;
630 apply_mask_ipv4(&address);
632 /* Check if this interface is RIP enabled or not
633 or Check if this address's prefix is RIP enabled */
634 if ((rip_enable_if_lookup(ifc->ifp->name) >= 0) ||
635 (rip_enable_network_lookup2(ifc) >= 0))
636 rip_redistribute_add(ZEBRA_ROUTE_CONNECT, RIP_ROUTE_INTERFACE,
637 &address, ifc->ifp->ifindex, NULL, 0, 0, 0);
642 rip_interface_address_add (int command, struct zclient *zclient,
643 zebra_size_t length, vrf_id_t vrf_id)
645 struct connected *ifc;
648 ifc = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_ADD,
649 zclient->ibuf, vrf_id);
656 if (p->family == AF_INET)
658 if (IS_RIP_DEBUG_ZEBRA)
659 zlog_debug ("connected address %s/%d is added",
660 inet_ntoa (p->u.prefix4), p->prefixlen);
662 rip_enable_apply(ifc->ifp);
663 /* Check if this prefix needs to be redistributed */
664 rip_apply_address_add(ifc);
667 rip_ifaddr_add (ifc->ifp, ifc);
668 #endif /* HAVE_SNMP */
675 rip_apply_address_del (struct connected *ifc) {
676 struct prefix_ipv4 address;
682 if (! if_is_up(ifc->ifp))
687 memset (&address, 0, sizeof (address));
688 address.family = p->family;
689 address.prefix = p->u.prefix4;
690 address.prefixlen = p->prefixlen;
691 apply_mask_ipv4(&address);
693 rip_redistribute_delete(ZEBRA_ROUTE_CONNECT, RIP_ROUTE_INTERFACE,
694 &address, ifc->ifp->ifindex);
698 rip_interface_address_delete (int command, struct zclient *zclient,
699 zebra_size_t length, vrf_id_t vrf_id)
701 struct connected *ifc;
704 ifc = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE,
705 zclient->ibuf, vrf_id);
710 if (p->family == AF_INET)
712 if (IS_RIP_DEBUG_ZEBRA)
713 zlog_debug ("connected address %s/%d is deleted",
714 inet_ntoa (p->u.prefix4), p->prefixlen);
717 rip_ifaddr_delete (ifc->ifp, ifc);
718 #endif /* HAVE_SNMP */
720 /* Chech wether this prefix needs to be removed */
721 rip_apply_address_del(ifc);
725 connected_free (ifc);
732 /* Check interface is enabled by network statement. */
733 /* Check wether the interface has at least a connected prefix that
734 * is within the ripng_enable_network table. */
736 rip_enable_network_lookup_if (struct interface *ifp)
738 struct listnode *node, *nnode;
739 struct connected *connected;
740 struct prefix_ipv4 address;
742 for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, connected))
745 struct route_node *node;
747 p = connected->address;
749 if (p->family == AF_INET)
751 address.family = AF_INET;
752 address.prefix = p->u.prefix4;
753 address.prefixlen = IPV4_MAX_BITLEN;
755 node = route_node_match (rip_enable_network,
756 (struct prefix *)&address);
759 route_unlock_node (node);
767 /* Check wether connected is within the ripng_enable_network table. */
769 rip_enable_network_lookup2 (struct connected *connected)
771 struct prefix_ipv4 address;
774 p = connected->address;
776 if (p->family == AF_INET) {
777 struct route_node *node;
779 address.family = p->family;
780 address.prefix = p->u.prefix4;
781 address.prefixlen = IPV4_MAX_BITLEN;
783 /* LPM on p->family, p->u.prefix4/IPV4_MAX_BITLEN within rip_enable_network */
784 node = route_node_match (rip_enable_network,
785 (struct prefix *)&address);
788 route_unlock_node (node);
795 /* Add RIP enable network. */
797 rip_enable_network_add (struct prefix *p)
799 struct route_node *node;
801 node = route_node_get (rip_enable_network, p);
805 route_unlock_node (node);
809 node->info = (char *) "enabled";
811 /* XXX: One should find a better solution than a generic one */
812 rip_enable_apply_all();
817 /* Delete RIP enable network. */
819 rip_enable_network_delete (struct prefix *p)
821 struct route_node *node;
823 node = route_node_lookup (rip_enable_network, p);
828 /* Unlock info lock. */
829 route_unlock_node (node);
831 /* Unlock lookup lock. */
832 route_unlock_node (node);
834 /* XXX: One should find a better solution than a generic one */
835 rip_enable_apply_all ();
842 /* Check interface is enabled by ifname statement. */
844 rip_enable_if_lookup (const char *ifname)
849 for (i = 0; i < vector_active (rip_enable_interface); i++)
850 if ((str = vector_slot (rip_enable_interface, i)) != NULL)
851 if (strcmp (str, ifname) == 0)
856 /* Add interface to rip_enable_if. */
858 rip_enable_if_add (const char *ifname)
862 ret = rip_enable_if_lookup (ifname);
866 vector_set (rip_enable_interface, strdup (ifname));
868 rip_enable_apply_all(); /* TODOVJ */
873 /* Delete interface from rip_enable_if. */
875 rip_enable_if_delete (const char *ifname)
880 index = rip_enable_if_lookup (ifname);
884 str = vector_slot (rip_enable_interface, index);
886 vector_unset (rip_enable_interface, index);
888 rip_enable_apply_all(); /* TODOVJ */
893 /* Join to multicast group and send request to the interface. */
895 rip_interface_wakeup (struct thread *t)
897 struct interface *ifp;
898 struct rip_interface *ri;
901 ifp = THREAD_ARG (t);
906 /* Join to multicast group. */
907 if (rip_multicast_join (ifp, rip->sock) < 0)
909 zlog_err ("multicast join failed, interface %s not running", ifp->name);
913 /* Set running flag. */
916 /* Send RIP request to the interface. */
917 rip_request_interface (ifp);
923 rip_connect_set (struct interface *ifp, int set)
925 struct listnode *node, *nnode;
926 struct connected *connected;
927 struct prefix_ipv4 address;
929 for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, connected))
932 p = connected->address;
934 if (p->family != AF_INET)
937 address.family = AF_INET;
938 address.prefix = p->u.prefix4;
939 address.prefixlen = p->prefixlen;
940 apply_mask_ipv4 (&address);
943 /* Check once more wether this prefix is within a "network IF_OR_PREF" one */
944 if ((rip_enable_if_lookup(connected->ifp->name) >= 0) ||
945 (rip_enable_network_lookup2(connected) >= 0))
946 rip_redistribute_add (ZEBRA_ROUTE_CONNECT, RIP_ROUTE_INTERFACE,
947 &address, connected->ifp->ifindex,
951 rip_redistribute_delete (ZEBRA_ROUTE_CONNECT, RIP_ROUTE_INTERFACE,
952 &address, connected->ifp->ifindex);
953 if (rip_redistribute_check (ZEBRA_ROUTE_CONNECT))
954 rip_redistribute_add (ZEBRA_ROUTE_CONNECT, RIP_ROUTE_REDISTRIBUTE,
955 &address, connected->ifp->ifindex,
961 /* Update interface status. */
963 rip_enable_apply (struct interface *ifp)
966 struct rip_interface *ri = NULL;
968 /* Check interface. */
969 if (! if_is_operative (ifp))
974 /* Check network configuration. */
975 ret = rip_enable_network_lookup_if (ifp);
977 /* If the interface is matched. */
979 ri->enable_network = 1;
981 ri->enable_network = 0;
983 /* Check interface name configuration. */
984 ret = rip_enable_if_lookup (ifp->name);
986 ri->enable_interface = 1;
988 ri->enable_interface = 0;
990 /* any interface MUST have an IPv4 address */
991 if ( ! rip_if_ipv4_address_check (ifp) )
993 ri->enable_network = 0;
994 ri->enable_interface = 0;
997 /* Update running status of the interface. */
998 if (ri->enable_network || ri->enable_interface)
1001 if (IS_RIP_DEBUG_EVENT)
1002 zlog_debug ("turn on %s", ifp->name);
1004 /* Add interface wake up thread. */
1006 ri->t_wakeup = thread_add_timer (master, rip_interface_wakeup,
1008 rip_connect_set (ifp, 1);
1015 /* Might as well clean up the route table as well
1016 * rip_if_down sets to 0 ri->running, and displays "turn off %s"
1020 rip_connect_set (ifp, 0);
1025 /* Apply network configuration to all interface. */
1027 rip_enable_apply_all ()
1029 struct interface *ifp;
1030 struct listnode *node, *nnode;
1032 /* Check each interface. */
1033 for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
1034 rip_enable_apply (ifp);
1038 rip_neighbor_lookup (struct sockaddr_in *from)
1040 struct prefix_ipv4 p;
1041 struct route_node *node;
1043 memset (&p, 0, sizeof (struct prefix_ipv4));
1045 p.prefix = from->sin_addr;
1046 p.prefixlen = IPV4_MAX_BITLEN;
1048 node = route_node_lookup (rip->neighbor, (struct prefix *) &p);
1051 route_unlock_node (node);
1057 /* Add new RIP neighbor to the neighbor tree. */
1059 rip_neighbor_add (struct prefix_ipv4 *p)
1061 struct route_node *node;
1063 node = route_node_get (rip->neighbor, (struct prefix *) p);
1068 node->info = rip->neighbor;
1073 /* Delete RIP neighbor from the neighbor tree. */
1075 rip_neighbor_delete (struct prefix_ipv4 *p)
1077 struct route_node *node;
1079 /* Lock for look up. */
1080 node = route_node_lookup (rip->neighbor, (struct prefix *) p);
1086 /* Unlock lookup lock. */
1087 route_unlock_node (node);
1089 /* Unlock real neighbor information lock. */
1090 route_unlock_node (node);
1095 /* Clear all network and neighbor configuration. */
1097 rip_clean_network ()
1101 struct route_node *rn;
1103 /* rip_enable_network. */
1104 for (rn = route_top (rip_enable_network); rn; rn = route_next (rn))
1108 route_unlock_node (rn);
1111 /* rip_enable_interface. */
1112 for (i = 0; i < vector_active (rip_enable_interface); i++)
1113 if ((str = vector_slot (rip_enable_interface, i)) != NULL)
1116 vector_slot (rip_enable_interface, i) = NULL;
1120 /* Utility function for looking up passive interface settings. */
1122 rip_passive_nondefault_lookup (const char *ifname)
1127 for (i = 0; i < vector_active (Vrip_passive_nondefault); i++)
1128 if ((str = vector_slot (Vrip_passive_nondefault, i)) != NULL)
1129 if (strcmp (str, ifname) == 0)
1135 rip_passive_interface_apply (struct interface *ifp)
1137 struct rip_interface *ri;
1141 ri->passive = ((rip_passive_nondefault_lookup (ifp->name) < 0) ?
1142 passive_default : !passive_default);
1144 if (IS_RIP_DEBUG_ZEBRA)
1145 zlog_debug ("interface %s: passive = %d",ifp->name,ri->passive);
1149 rip_passive_interface_apply_all (void)
1151 struct interface *ifp;
1152 struct listnode *node, *nnode;
1154 for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
1155 rip_passive_interface_apply (ifp);
1158 /* Passive interface. */
1160 rip_passive_nondefault_set (struct vty *vty, const char *ifname)
1162 if (rip_passive_nondefault_lookup (ifname) >= 0)
1165 vector_set (Vrip_passive_nondefault, strdup (ifname));
1167 rip_passive_interface_apply_all ();
1173 rip_passive_nondefault_unset (struct vty *vty, const char *ifname)
1178 i = rip_passive_nondefault_lookup (ifname);
1182 str = vector_slot (Vrip_passive_nondefault, i);
1184 vector_unset (Vrip_passive_nondefault, i);
1186 rip_passive_interface_apply_all ();
1191 /* Free all configured RIP passive-interface settings. */
1193 rip_passive_nondefault_clean (void)
1198 for (i = 0; i < vector_active (Vrip_passive_nondefault); i++)
1199 if ((str = vector_slot (Vrip_passive_nondefault, i)) != NULL)
1202 vector_slot (Vrip_passive_nondefault, i) = NULL;
1204 rip_passive_interface_apply_all ();
1207 /* RIP enable network or interface configuration. */
1210 "network (A.B.C.D/M|WORD)",
1211 "Enable routing on an IP network\n"
1212 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
1216 struct prefix_ipv4 p;
1218 ret = str2prefix_ipv4 (argv[0], &p);
1221 ret = rip_enable_network_add ((struct prefix *) &p);
1223 ret = rip_enable_if_add (argv[0]);
1227 vty_out (vty, "There is a same network configuration %s%s", argv[0],
1235 /* RIP enable network or interface configuration. */
1236 DEFUN (no_rip_network,
1238 "no network (A.B.C.D/M|WORD)",
1240 "Enable routing on an IP network\n"
1241 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
1245 struct prefix_ipv4 p;
1247 ret = str2prefix_ipv4 (argv[0], &p);
1250 ret = rip_enable_network_delete ((struct prefix *) &p);
1252 ret = rip_enable_if_delete (argv[0]);
1256 vty_out (vty, "Can't find network configuration %s%s", argv[0],
1264 /* RIP neighbor configuration set. */
1265 DEFUN (rip_neighbor,
1268 "Specify a neighbor router\n"
1269 "Neighbor address\n")
1272 struct prefix_ipv4 p;
1274 ret = str2prefix_ipv4 (argv[0], &p);
1278 vty_out (vty, "Please specify address by A.B.C.D%s", VTY_NEWLINE);
1282 rip_neighbor_add (&p);
1287 /* RIP neighbor configuration unset. */
1288 DEFUN (no_rip_neighbor,
1289 no_rip_neighbor_cmd,
1290 "no neighbor A.B.C.D",
1292 "Specify a neighbor router\n"
1293 "Neighbor address\n")
1296 struct prefix_ipv4 p;
1298 ret = str2prefix_ipv4 (argv[0], &p);
1302 vty_out (vty, "Please specify address by A.B.C.D%s", VTY_NEWLINE);
1306 rip_neighbor_delete (&p);
1311 DEFUN (ip_rip_receive_version,
1312 ip_rip_receive_version_cmd,
1313 "ip rip receive version (1|2)",
1315 "Routing Information Protocol\n"
1316 "Advertisement reception\n"
1321 struct interface *ifp;
1322 struct rip_interface *ri;
1324 ifp = (struct interface *)vty->index;
1328 if (atoi (argv[0]) == 1)
1330 ri->ri_receive = RI_RIP_VERSION_1;
1333 if (atoi (argv[0]) == 2)
1335 ri->ri_receive = RI_RIP_VERSION_2;
1341 DEFUN (ip_rip_receive_version_1,
1342 ip_rip_receive_version_1_cmd,
1343 "ip rip receive version 1 2",
1345 "Routing Information Protocol\n"
1346 "Advertisement reception\n"
1351 struct interface *ifp;
1352 struct rip_interface *ri;
1354 ifp = (struct interface *)vty->index;
1357 /* Version 1 and 2. */
1358 ri->ri_receive = RI_RIP_VERSION_1_AND_2;
1362 DEFUN (ip_rip_receive_version_2,
1363 ip_rip_receive_version_2_cmd,
1364 "ip rip receive version 2 1",
1366 "Routing Information Protocol\n"
1367 "Advertisement reception\n"
1372 struct interface *ifp;
1373 struct rip_interface *ri;
1375 ifp = (struct interface *)vty->index;
1378 /* Version 1 and 2. */
1379 ri->ri_receive = RI_RIP_VERSION_1_AND_2;
1383 DEFUN (no_ip_rip_receive_version,
1384 no_ip_rip_receive_version_cmd,
1385 "no ip rip receive version",
1388 "Routing Information Protocol\n"
1389 "Advertisement reception\n"
1390 "Version control\n")
1392 struct interface *ifp;
1393 struct rip_interface *ri;
1395 ifp = (struct interface *)vty->index;
1398 ri->ri_receive = RI_RIP_UNSPEC;
1402 ALIAS (no_ip_rip_receive_version,
1403 no_ip_rip_receive_version_num_cmd,
1404 "no ip rip receive version (1|2)",
1407 "Routing Information Protocol\n"
1408 "Advertisement reception\n"
1413 DEFUN (ip_rip_send_version,
1414 ip_rip_send_version_cmd,
1415 "ip rip send version (1|2)",
1417 "Routing Information Protocol\n"
1418 "Advertisement transmission\n"
1423 struct interface *ifp;
1424 struct rip_interface *ri;
1426 ifp = (struct interface *)vty->index;
1430 if (atoi (argv[0]) == 1)
1432 ri->ri_send = RI_RIP_VERSION_1;
1435 if (atoi (argv[0]) == 2)
1437 ri->ri_send = RI_RIP_VERSION_2;
1443 DEFUN (ip_rip_send_version_1,
1444 ip_rip_send_version_1_cmd,
1445 "ip rip send version 1 2",
1447 "Routing Information Protocol\n"
1448 "Advertisement transmission\n"
1453 struct interface *ifp;
1454 struct rip_interface *ri;
1456 ifp = (struct interface *)vty->index;
1459 /* Version 1 and 2. */
1460 ri->ri_send = RI_RIP_VERSION_1_AND_2;
1464 DEFUN (ip_rip_send_version_2,
1465 ip_rip_send_version_2_cmd,
1466 "ip rip send version 2 1",
1468 "Routing Information Protocol\n"
1469 "Advertisement transmission\n"
1474 struct interface *ifp;
1475 struct rip_interface *ri;
1477 ifp = (struct interface *)vty->index;
1480 /* Version 1 and 2. */
1481 ri->ri_send = RI_RIP_VERSION_1_AND_2;
1485 DEFUN (no_ip_rip_send_version,
1486 no_ip_rip_send_version_cmd,
1487 "no ip rip send version",
1490 "Routing Information Protocol\n"
1491 "Advertisement transmission\n"
1492 "Version control\n")
1494 struct interface *ifp;
1495 struct rip_interface *ri;
1497 ifp = (struct interface *)vty->index;
1500 ri->ri_send = RI_RIP_UNSPEC;
1504 ALIAS (no_ip_rip_send_version,
1505 no_ip_rip_send_version_num_cmd,
1506 "no ip rip send version (1|2)",
1509 "Routing Information Protocol\n"
1510 "Advertisement transmission\n"
1515 DEFUN (ip_rip_authentication_mode,
1516 ip_rip_authentication_mode_cmd,
1517 "ip rip authentication mode (md5|text)",
1519 "Routing Information Protocol\n"
1520 "Authentication control\n"
1521 "Authentication mode\n"
1522 "Keyed message digest\n"
1523 "Clear text authentication\n")
1525 struct interface *ifp;
1526 struct rip_interface *ri;
1529 ifp = (struct interface *)vty->index;
1532 if ( (argc < 1) || (argc > 2) )
1534 vty_out (vty, "incorrect argument count%s", VTY_NEWLINE);
1538 if (strncmp ("md5", argv[0], strlen (argv[0])) == 0)
1539 auth_type = RIP_AUTH_MD5;
1540 else if (strncmp ("text", argv[0], strlen (argv[0])) == 0)
1541 auth_type = RIP_AUTH_SIMPLE_PASSWORD;
1544 vty_out (vty, "mode should be md5 or text%s", VTY_NEWLINE);
1550 ri->auth_type = auth_type;
1554 if ( (argc == 2) && (auth_type != RIP_AUTH_MD5) )
1556 vty_out (vty, "auth length argument only valid for md5%s", VTY_NEWLINE);
1560 if (strncmp ("r", argv[1], 1) == 0)
1561 ri->md5_auth_len = RIP_AUTH_MD5_SIZE;
1562 else if (strncmp ("o", argv[1], 1) == 0)
1563 ri->md5_auth_len = RIP_AUTH_MD5_COMPAT_SIZE;
1567 ri->auth_type = auth_type;
1572 ALIAS (ip_rip_authentication_mode,
1573 ip_rip_authentication_mode_authlen_cmd,
1574 "ip rip authentication mode (md5|text) auth-length (rfc|old-ripd)",
1576 "Routing Information Protocol\n"
1577 "Authentication control\n"
1578 "Authentication mode\n"
1579 "Keyed message digest\n"
1580 "Clear text authentication\n"
1581 "MD5 authentication data length\n"
1583 "Old ripd compatible\n")
1585 DEFUN (no_ip_rip_authentication_mode,
1586 no_ip_rip_authentication_mode_cmd,
1587 "no ip rip authentication mode",
1590 "Routing Information Protocol\n"
1591 "Authentication control\n"
1592 "Authentication mode\n")
1594 struct interface *ifp;
1595 struct rip_interface *ri;
1597 ifp = (struct interface *)vty->index;
1600 ri->auth_type = RIP_NO_AUTH;
1601 ri->md5_auth_len = RIP_AUTH_MD5_COMPAT_SIZE;
1606 ALIAS (no_ip_rip_authentication_mode,
1607 no_ip_rip_authentication_mode_type_cmd,
1608 "no ip rip authentication mode (md5|text)",
1611 "Routing Information Protocol\n"
1612 "Authentication control\n"
1613 "Authentication mode\n"
1614 "Keyed message digest\n"
1615 "Clear text authentication\n")
1617 ALIAS (no_ip_rip_authentication_mode,
1618 no_ip_rip_authentication_mode_type_authlen_cmd,
1619 "no ip rip authentication mode (md5|text) auth-length (rfc|old-ripd)",
1622 "Routing Information Protocol\n"
1623 "Authentication control\n"
1624 "Authentication mode\n"
1625 "Keyed message digest\n"
1626 "Clear text authentication\n"
1627 "MD5 authentication data length\n"
1629 "Old ripd compatible\n")
1631 DEFUN (ip_rip_authentication_string,
1632 ip_rip_authentication_string_cmd,
1633 "ip rip authentication string LINE",
1635 "Routing Information Protocol\n"
1636 "Authentication control\n"
1637 "Authentication string\n"
1638 "Authentication string\n")
1640 struct interface *ifp;
1641 struct rip_interface *ri;
1643 ifp = (struct interface *)vty->index;
1646 if (strlen (argv[0]) > 16)
1648 vty_out (vty, "%% RIPv2 authentication string must be shorter than 16%s",
1655 vty_out (vty, "%% key-chain configuration exists%s", VTY_NEWLINE);
1660 free (ri->auth_str);
1662 ri->auth_str = strdup (argv[0]);
1667 DEFUN (no_ip_rip_authentication_string,
1668 no_ip_rip_authentication_string_cmd,
1669 "no ip rip authentication string",
1672 "Routing Information Protocol\n"
1673 "Authentication control\n"
1674 "Authentication string\n")
1676 struct interface *ifp;
1677 struct rip_interface *ri;
1679 ifp = (struct interface *)vty->index;
1683 free (ri->auth_str);
1685 ri->auth_str = NULL;
1690 ALIAS (no_ip_rip_authentication_string,
1691 no_ip_rip_authentication_string2_cmd,
1692 "no ip rip authentication string LINE",
1695 "Routing Information Protocol\n"
1696 "Authentication control\n"
1697 "Authentication string\n"
1698 "Authentication string\n")
1700 DEFUN (ip_rip_authentication_key_chain,
1701 ip_rip_authentication_key_chain_cmd,
1702 "ip rip authentication key-chain LINE",
1704 "Routing Information Protocol\n"
1705 "Authentication control\n"
1706 "Authentication key-chain\n"
1707 "name of key-chain\n")
1709 struct interface *ifp;
1710 struct rip_interface *ri;
1712 ifp = (struct interface *) vty->index;
1717 vty_out (vty, "%% authentication string configuration exists%s",
1723 free (ri->key_chain);
1725 ri->key_chain = strdup (argv[0]);
1730 DEFUN (no_ip_rip_authentication_key_chain,
1731 no_ip_rip_authentication_key_chain_cmd,
1732 "no ip rip authentication key-chain",
1735 "Routing Information Protocol\n"
1736 "Authentication control\n"
1737 "Authentication key-chain\n")
1739 struct interface *ifp;
1740 struct rip_interface *ri;
1742 ifp = (struct interface *) vty->index;
1746 free (ri->key_chain);
1748 ri->key_chain = NULL;
1753 ALIAS (no_ip_rip_authentication_key_chain,
1754 no_ip_rip_authentication_key_chain2_cmd,
1755 "no ip rip authentication key-chain LINE",
1758 "Routing Information Protocol\n"
1759 "Authentication control\n"
1760 "Authentication key-chain\n"
1761 "name of key-chain\n")
1763 /* CHANGED: ip rip split-horizon
1764 Cisco and Zebra's command is
1767 DEFUN (ip_rip_split_horizon,
1768 ip_rip_split_horizon_cmd,
1769 "ip rip split-horizon",
1771 "Routing Information Protocol\n"
1772 "Perform split horizon\n")
1774 struct interface *ifp;
1775 struct rip_interface *ri;
1780 ri->split_horizon = RIP_SPLIT_HORIZON;
1784 DEFUN (ip_rip_split_horizon_poisoned_reverse,
1785 ip_rip_split_horizon_poisoned_reverse_cmd,
1786 "ip rip split-horizon poisoned-reverse",
1788 "Routing Information Protocol\n"
1789 "Perform split horizon\n"
1790 "With poisoned-reverse\n")
1792 struct interface *ifp;
1793 struct rip_interface *ri;
1798 ri->split_horizon = RIP_SPLIT_HORIZON_POISONED_REVERSE;
1802 /* CHANGED: no ip rip split-horizon
1803 Cisco and Zebra's command is
1806 DEFUN (no_ip_rip_split_horizon,
1807 no_ip_rip_split_horizon_cmd,
1808 "no ip rip split-horizon",
1811 "Routing Information Protocol\n"
1812 "Perform split horizon\n")
1814 struct interface *ifp;
1815 struct rip_interface *ri;
1820 ri->split_horizon = RIP_NO_SPLIT_HORIZON;
1824 DEFUN (no_ip_rip_split_horizon_poisoned_reverse,
1825 no_ip_rip_split_horizon_poisoned_reverse_cmd,
1826 "no ip rip split-horizon poisoned-reverse",
1829 "Routing Information Protocol\n"
1830 "Perform split horizon\n"
1831 "With poisoned-reverse\n")
1833 struct interface *ifp;
1834 struct rip_interface *ri;
1839 switch( ri->split_horizon )
1841 case RIP_SPLIT_HORIZON_POISONED_REVERSE:
1842 ri->split_horizon = RIP_SPLIT_HORIZON;
1850 DEFUN (rip_passive_interface,
1851 rip_passive_interface_cmd,
1852 "passive-interface (IFNAME|default)",
1853 "Suppress routing updates on an interface\n"
1855 "default for all interfaces\n")
1857 const char *ifname = argv[0];
1859 if (!strcmp(ifname,"default")) {
1860 passive_default = 1;
1861 rip_passive_nondefault_clean();
1864 if (passive_default)
1865 return rip_passive_nondefault_unset (vty, ifname);
1867 return rip_passive_nondefault_set (vty, ifname);
1870 DEFUN (no_rip_passive_interface,
1871 no_rip_passive_interface_cmd,
1872 "no passive-interface (IFNAME|default)",
1874 "Suppress routing updates on an interface\n"
1876 "default for all interfaces\n")
1878 const char *ifname = argv[0];
1880 if (!strcmp(ifname,"default")) {
1881 passive_default = 0;
1882 rip_passive_nondefault_clean();
1885 if (passive_default)
1886 return rip_passive_nondefault_set (vty, ifname);
1888 return rip_passive_nondefault_unset (vty, ifname);
1891 /* Write rip configuration of each interface. */
1893 rip_interface_config_write (struct vty *vty)
1895 struct listnode *node;
1896 struct interface *ifp;
1898 for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
1900 struct rip_interface *ri;
1904 /* Do not display the interface if there is no
1905 * configuration about it.
1908 (ri->split_horizon == ri->split_horizon_default) &&
1909 (ri->ri_send == RI_RIP_UNSPEC) &&
1910 (ri->ri_receive == RI_RIP_UNSPEC) &&
1911 (ri->auth_type != RIP_AUTH_MD5) &&
1912 (ri->md5_auth_len != RIP_AUTH_MD5_SIZE) &&
1917 vty_out (vty, "interface %s%s", ifp->name,
1921 vty_out (vty, " description %s%s", ifp->desc,
1924 /* Split horizon. */
1925 if (ri->split_horizon != ri->split_horizon_default)
1927 switch (ri->split_horizon) {
1928 case RIP_SPLIT_HORIZON:
1929 vty_out (vty, " ip rip split-horizon%s", VTY_NEWLINE);
1931 case RIP_SPLIT_HORIZON_POISONED_REVERSE:
1932 vty_out (vty, " ip rip split-horizon poisoned-reverse%s",
1935 case RIP_NO_SPLIT_HORIZON:
1937 vty_out (vty, " no ip rip split-horizon%s", VTY_NEWLINE);
1942 /* RIP version setting. */
1943 if (ri->ri_send != RI_RIP_UNSPEC)
1944 vty_out (vty, " ip rip send version %s%s",
1945 lookup (ri_version_msg, ri->ri_send),
1948 if (ri->ri_receive != RI_RIP_UNSPEC)
1949 vty_out (vty, " ip rip receive version %s%s",
1950 lookup (ri_version_msg, ri->ri_receive),
1953 /* RIP authentication. */
1954 if (ri->auth_type == RIP_AUTH_SIMPLE_PASSWORD)
1955 vty_out (vty, " ip rip authentication mode text%s", VTY_NEWLINE);
1957 if (ri->auth_type == RIP_AUTH_MD5)
1959 vty_out (vty, " ip rip authentication mode md5");
1960 if (ri->md5_auth_len == RIP_AUTH_MD5_COMPAT_SIZE)
1961 vty_out (vty, " auth-length old-ripd");
1963 vty_out (vty, " auth-length rfc");
1964 vty_out (vty, "%s", VTY_NEWLINE);
1968 vty_out (vty, " ip rip authentication string %s%s",
1969 ri->auth_str, VTY_NEWLINE);
1972 vty_out (vty, " ip rip authentication key-chain %s%s",
1973 ri->key_chain, VTY_NEWLINE);
1975 vty_out (vty, "!%s", VTY_NEWLINE);
1981 config_write_rip_network (struct vty *vty, int config_mode)
1985 struct route_node *node;
1987 /* Network type RIP enable interface statement. */
1988 for (node = route_top (rip_enable_network); node; node = route_next (node))
1990 vty_out (vty, "%s%s/%d%s",
1991 config_mode ? " network " : " ",
1992 inet_ntoa (node->p.u.prefix4),
1996 /* Interface name RIP enable statement. */
1997 for (i = 0; i < vector_active (rip_enable_interface); i++)
1998 if ((ifname = vector_slot (rip_enable_interface, i)) != NULL)
1999 vty_out (vty, "%s%s%s",
2000 config_mode ? " network " : " ",
2004 /* RIP neighbors listing. */
2005 for (node = route_top (rip->neighbor); node; node = route_next (node))
2007 vty_out (vty, "%s%s%s",
2008 config_mode ? " neighbor " : " ",
2009 inet_ntoa (node->p.u.prefix4),
2012 /* RIP passive interface listing. */
2014 if (passive_default)
2015 vty_out (vty, " passive-interface default%s", VTY_NEWLINE);
2016 for (i = 0; i < vector_active (Vrip_passive_nondefault); i++)
2017 if ((ifname = vector_slot (Vrip_passive_nondefault, i)) != NULL)
2018 vty_out (vty, " %spassive-interface %s%s",
2019 (passive_default ? "no " : ""), ifname, VTY_NEWLINE);
2025 static struct cmd_node interface_node =
2032 /* Called when interface structure allocated. */
2034 rip_interface_new_hook (struct interface *ifp)
2036 ifp->info = rip_interface_new ();
2040 /* Called when interface structure deleted. */
2042 rip_interface_delete_hook (struct interface *ifp)
2044 XFREE (MTYPE_RIP_INTERFACE, ifp->info);
2049 /* Allocate and initialize interface vector. */
2053 /* Default initial size of interface vector. */
2054 if_add_hook (IF_NEW_HOOK, rip_interface_new_hook);
2055 if_add_hook (IF_DELETE_HOOK, rip_interface_delete_hook);
2057 /* RIP network init. */
2058 rip_enable_interface = vector_init (1);
2059 rip_enable_network = route_table_init ();
2061 /* RIP passive interface. */
2062 Vrip_passive_nondefault = vector_init (1);
2064 /* Install interface node. */
2065 install_node (&interface_node, rip_interface_config_write);
2067 /* Install commands. */
2068 install_element (CONFIG_NODE, &interface_cmd);
2069 install_element (CONFIG_NODE, &no_interface_cmd);
2070 install_default (INTERFACE_NODE);
2071 install_element (INTERFACE_NODE, &interface_desc_cmd);
2072 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2073 install_element (RIP_NODE, &rip_network_cmd);
2074 install_element (RIP_NODE, &no_rip_network_cmd);
2075 install_element (RIP_NODE, &rip_neighbor_cmd);
2076 install_element (RIP_NODE, &no_rip_neighbor_cmd);
2078 install_element (RIP_NODE, &rip_passive_interface_cmd);
2079 install_element (RIP_NODE, &no_rip_passive_interface_cmd);
2081 install_element (INTERFACE_NODE, &ip_rip_send_version_cmd);
2082 install_element (INTERFACE_NODE, &ip_rip_send_version_1_cmd);
2083 install_element (INTERFACE_NODE, &ip_rip_send_version_2_cmd);
2084 install_element (INTERFACE_NODE, &no_ip_rip_send_version_cmd);
2085 install_element (INTERFACE_NODE, &no_ip_rip_send_version_num_cmd);
2087 install_element (INTERFACE_NODE, &ip_rip_receive_version_cmd);
2088 install_element (INTERFACE_NODE, &ip_rip_receive_version_1_cmd);
2089 install_element (INTERFACE_NODE, &ip_rip_receive_version_2_cmd);
2090 install_element (INTERFACE_NODE, &no_ip_rip_receive_version_cmd);
2091 install_element (INTERFACE_NODE, &no_ip_rip_receive_version_num_cmd);
2093 install_element (INTERFACE_NODE, &ip_rip_authentication_mode_cmd);
2094 install_element (INTERFACE_NODE, &ip_rip_authentication_mode_authlen_cmd);
2095 install_element (INTERFACE_NODE, &no_ip_rip_authentication_mode_cmd);
2096 install_element (INTERFACE_NODE, &no_ip_rip_authentication_mode_type_cmd);
2097 install_element (INTERFACE_NODE, &no_ip_rip_authentication_mode_type_authlen_cmd);
2099 install_element (INTERFACE_NODE, &ip_rip_authentication_key_chain_cmd);
2100 install_element (INTERFACE_NODE, &no_ip_rip_authentication_key_chain_cmd);
2101 install_element (INTERFACE_NODE, &no_ip_rip_authentication_key_chain2_cmd);
2103 install_element (INTERFACE_NODE, &ip_rip_authentication_string_cmd);
2104 install_element (INTERFACE_NODE, &no_ip_rip_authentication_string_cmd);
2105 install_element (INTERFACE_NODE, &no_ip_rip_authentication_string2_cmd);
2107 install_element (INTERFACE_NODE, &ip_rip_split_horizon_cmd);
2108 install_element (INTERFACE_NODE, &ip_rip_split_horizon_poisoned_reverse_cmd);
2109 install_element (INTERFACE_NODE, &no_ip_rip_split_horizon_cmd);
2110 install_element (INTERFACE_NODE, &no_ip_rip_split_horizon_poisoned_reverse_cmd);