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"
44 void rip_enable_apply (struct interface
*);
45 void rip_passive_interface_apply (struct interface
*);
46 int rip_if_down(struct interface
*ifp
);
47 int rip_enable_if_lookup (char *ifname
);
48 int rip_enable_network_lookup2 (struct connected
*connected
);
49 void rip_enable_apply_all ();
52 struct message ri_version_msg
[] =
54 {RI_RIP_VERSION_1
, "1"},
55 {RI_RIP_VERSION_2
, "2"},
56 {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 vector Vrip_passive_interface
;
71 /* Join to the RIP version 2 multicast group. */
73 ipv4_multicast_join (int sock
,
80 ret
= setsockopt_multicast_ipv4 (sock
,
87 zlog (NULL
, LOG_INFO
, "can't setsockopt IP_ADD_MEMBERSHIP %s",
93 /* Leave from the RIP version 2 multicast group. */
95 ipv4_multicast_leave (int sock
,
102 ret
= setsockopt_multicast_ipv4 (sock
,
109 zlog (NULL
, LOG_INFO
, "can't setsockopt IP_DROP_MEMBERSHIP");
114 /* Allocate new RIP's interface configuration. */
115 struct rip_interface
*
118 struct rip_interface
*ri
;
120 ri
= XMALLOC (MTYPE_RIP_INTERFACE
, sizeof (struct rip_interface
));
121 memset (ri
, 0, sizeof (struct rip_interface
));
123 /* Default authentication type is simple password for Cisco
125 /* ri->auth_type = RIP_NO_AUTH; */
126 ri
->auth_type
= RIP_AUTH_SIMPLE_PASSWORD
;
128 /* Set default split-horizon behavior. If the interface is Frame
129 Relay or SMDS is enabled, the default value for split-horizon is
130 off. But currently Zebra does detect Frame Relay or SMDS
131 interface. So all interface is set to split horizon. */
132 ri
->split_horizon_default
= RIP_SPLIT_HORIZON
;
133 ri
->split_horizon
= ri
->split_horizon_default
;
139 rip_interface_multicast_set (int sock
, struct interface
*ifp
)
144 struct sockaddr_in from
;
146 for (node
= listhead (ifp
->connected
); node
; nextnode (node
))
148 struct prefix_ipv4
*p
;
149 struct connected
*connected
;
152 connected
= getdata (node
);
153 p
= (struct prefix_ipv4
*) connected
->address
;
155 if (p
->family
== AF_INET
)
159 if (setsockopt_multicast_ipv4 (sock
, IP_MULTICAST_IF
,
160 addr
, 0, ifp
->ifindex
) < 0)
162 zlog_warn ("Can't setsockopt IP_MULTICAST_IF to fd %d", sock
);
167 memset (&from
, 0, sizeof (struct sockaddr_in
));
170 sp
= getservbyname ("router", "udp");
172 from
.sin_port
= sp
->s_port
;
174 from
.sin_port
= htons (RIP_PORT_DEFAULT
);
176 /* Address shoud be any address. */
177 from
.sin_family
= AF_INET
;
178 from
.sin_addr
= addr
;
180 from
.sin_len
= sizeof (struct sockaddr_in
);
181 #endif /* HAVE_SIN_LEN */
183 if (ripd_privs
.change (ZPRIVS_RAISE
))
184 zlog_err ("rip_interface_multicast_set: could not raise privs");
186 ret
= bind (sock
, (struct sockaddr
*) & from
,
187 sizeof (struct sockaddr_in
));
190 zlog_warn ("Can't bind socket: %s", strerror (errno
));
194 if (ripd_privs
.change (ZPRIVS_LOWER
))
195 zlog_err ("rip_interface_multicast_set: could not lower privs");
203 /* Send RIP request packet to specified interface. */
205 rip_request_interface_send (struct interface
*ifp
, u_char version
)
207 struct sockaddr_in to
;
209 /* RIPv2 support multicast. */
210 if (version
== RIPv2
&& if_is_multicast (ifp
))
213 if (IS_RIP_DEBUG_EVENT
)
214 zlog_info ("multicast request on %s", ifp
->name
);
216 rip_request_send (NULL
, ifp
, version
);
220 /* RIPv1 and non multicast interface. */
221 if (if_is_pointopoint (ifp
) || if_is_broadcast (ifp
))
225 if (IS_RIP_DEBUG_EVENT
)
226 zlog_info ("broadcast request to %s", ifp
->name
);
228 for (cnode
= listhead (ifp
->connected
); cnode
; nextnode (cnode
))
230 struct prefix_ipv4
*p
;
231 struct connected
*connected
;
233 connected
= getdata (cnode
);
234 p
= (struct prefix_ipv4
*) connected
->destination
;
236 if (p
->family
== AF_INET
)
238 memset (&to
, 0, sizeof (struct sockaddr_in
));
239 to
.sin_port
= htons (RIP_PORT_DEFAULT
);
240 to
.sin_addr
= p
->prefix
;
242 if (IS_RIP_DEBUG_EVENT
)
243 zlog_info ("SEND request to %s", inet_ntoa (to
.sin_addr
));
245 rip_request_send (&to
, ifp
, version
);
251 /* This will be executed when interface goes up. */
253 rip_request_interface (struct interface
*ifp
)
255 struct rip_interface
*ri
;
257 /* In default ripd doesn't send RIP_REQUEST to the loopback interface. */
258 if (if_is_loopback (ifp
))
261 /* If interface is down, don't send RIP packet. */
262 if (! if_is_operative (ifp
))
265 /* Fetch RIP interface information. */
269 /* If there is no version configuration in the interface,
270 use rip's version setting. */
271 if (ri
->ri_send
== RI_RIP_UNSPEC
)
273 if (rip
->version
== RIPv1
)
274 rip_request_interface_send (ifp
, RIPv1
);
276 rip_request_interface_send (ifp
, RIPv2
);
278 /* If interface has RIP version configuration use it. */
281 if (ri
->ri_send
& RIPv1
)
282 rip_request_interface_send (ifp
, RIPv1
);
283 if (ri
->ri_send
& RIPv2
)
284 rip_request_interface_send (ifp
, RIPv2
);
288 /* Send RIP request to the neighbor. */
290 rip_request_neighbor (struct in_addr addr
)
292 struct sockaddr_in to
;
294 memset (&to
, 0, sizeof (struct sockaddr_in
));
295 to
.sin_port
= htons (RIP_PORT_DEFAULT
);
298 rip_request_send (&to
, NULL
, rip
->version
);
301 /* Request routes at all interfaces. */
303 rip_request_neighbor_all ()
305 struct route_node
*rp
;
310 if (IS_RIP_DEBUG_EVENT
)
311 zlog_info ("request to the all neighbor");
313 /* Send request to all neighbor. */
314 for (rp
= route_top (rip
->neighbor
); rp
; rp
= route_next (rp
))
316 rip_request_neighbor (rp
->p
.u
.prefix4
);
319 /* Multicast packet receive socket. */
321 rip_multicast_join (struct interface
*ifp
, int sock
)
325 if (if_is_operative (ifp
) && if_is_multicast (ifp
))
327 if (IS_RIP_DEBUG_EVENT
)
328 zlog_info ("multicast join at %s", ifp
->name
);
330 for (cnode
= listhead (ifp
->connected
); cnode
; nextnode (cnode
))
332 struct prefix_ipv4
*p
;
333 struct connected
*connected
;
334 struct in_addr group
;
336 connected
= getdata (cnode
);
337 p
= (struct prefix_ipv4
*) connected
->address
;
339 if (p
->family
!= AF_INET
)
342 group
.s_addr
= htonl (INADDR_RIP_GROUP
);
343 if (ipv4_multicast_join (sock
, group
, p
->prefix
, ifp
->ifindex
) < 0)
352 /* Leave from multicast group. */
354 rip_multicast_leave (struct interface
*ifp
, int sock
)
358 if (if_is_up (ifp
) && if_is_multicast (ifp
))
360 if (IS_RIP_DEBUG_EVENT
)
361 zlog_info ("multicast leave from %s", ifp
->name
);
363 for (cnode
= listhead (ifp
->connected
); cnode
; nextnode (cnode
))
365 struct prefix_ipv4
*p
;
366 struct connected
*connected
;
367 struct in_addr group
;
369 connected
= getdata (cnode
);
370 p
= (struct prefix_ipv4
*) connected
->address
;
372 if (p
->family
!= AF_INET
)
375 group
.s_addr
= htonl (INADDR_RIP_GROUP
);
376 if (ipv4_multicast_leave (sock
, group
, p
->prefix
, ifp
->ifindex
) == 0)
382 /* Is there and address on interface that I could use ? */
384 rip_if_ipv4_address_check (struct interface
*ifp
)
387 struct connected
*connected
;
390 for (nn
= listhead (ifp
->connected
); nn
; nextnode (nn
))
391 if ((connected
= getdata (nn
)) != NULL
)
395 p
= connected
->address
;
397 if (p
->family
== AF_INET
)
406 /* Inteface link down message processing. */
408 rip_interface_down (int command
, struct zclient
*zclient
, zebra_size_t length
)
410 struct interface
*ifp
;
415 /* zebra_interface_state_read() updates interface structure in
417 ifp
= zebra_interface_state_read(s
);
424 if (IS_RIP_DEBUG_ZEBRA
)
425 zlog_info ("interface %s index %d flags %ld metric %d mtu %d is down",
426 ifp
->name
, ifp
->ifindex
, ifp
->flags
, ifp
->metric
, ifp
->mtu
);
431 /* Inteface link up message processing */
433 rip_interface_up (int command
, struct zclient
*zclient
, zebra_size_t length
)
435 struct interface
*ifp
;
437 /* zebra_interface_state_read () updates interface structure in
439 ifp
= zebra_interface_state_read (zclient
->ibuf
);
444 if (IS_RIP_DEBUG_ZEBRA
)
445 zlog_info ("interface %s index %d flags %ld metric %d mtu %d is up",
446 ifp
->name
, ifp
->ifindex
, ifp
->flags
, ifp
->metric
, ifp
->mtu
);
448 /* Check if this interface is RIP enabled or not.*/
449 rip_enable_apply (ifp
);
451 /* Check for a passive interface */
452 rip_passive_interface_apply (ifp
);
454 /* Apply distribute list to the all interface. */
455 rip_distribute_update_interface (ifp
);
460 /* Inteface addition message from zebra. */
462 rip_interface_add (int command
, struct zclient
*zclient
, zebra_size_t length
)
464 struct interface
*ifp
;
466 ifp
= zebra_interface_add_read (zclient
->ibuf
);
468 if (IS_RIP_DEBUG_ZEBRA
)
469 zlog_info ("interface add %s index %d flags %ld metric %d mtu %d",
470 ifp
->name
, ifp
->ifindex
, ifp
->flags
, ifp
->metric
, ifp
->mtu
);
472 /* Check if this interface is RIP enabled or not.*/
473 rip_enable_apply (ifp
);
475 /* Apply distribute list to the all interface. */
476 rip_distribute_update_interface (ifp
);
478 /* rip_request_neighbor_all (); */
480 /* Check interface routemap. */
481 rip_if_rmap_update_interface (ifp
);
487 rip_interface_delete (int command
, struct zclient
*zclient
,
490 struct interface
*ifp
;
495 /* zebra_interface_state_read() updates interface structure in iflist */
496 ifp
= zebra_interface_state_read(s
);
501 if (if_is_up (ifp
)) {
505 zlog_info("interface delete %s index %d flags %ld metric %d mtu %d",
506 ifp
->name
, ifp
->ifindex
, ifp
->flags
, ifp
->metric
, ifp
->mtu
);
508 /* To support pseudo interface do not free interface structure. */
509 /* if_delete(ifp); */
515 rip_interface_clean ()
518 struct interface
*ifp
;
519 struct rip_interface
*ri
;
521 for (node
= listhead (iflist
); node
; nextnode (node
))
523 ifp
= getdata (node
);
526 ri
->enable_network
= 0;
527 ri
->enable_interface
= 0;
532 thread_cancel (ri
->t_wakeup
);
539 rip_interface_reset ()
542 struct interface
*ifp
;
543 struct rip_interface
*ri
;
545 for (node
= listhead (iflist
); node
; nextnode (node
))
547 ifp
= getdata (node
);
550 ri
->enable_network
= 0;
551 ri
->enable_interface
= 0;
554 ri
->ri_send
= RI_RIP_UNSPEC
;
555 ri
->ri_receive
= RI_RIP_UNSPEC
;
557 /* ri->auth_type = RIP_NO_AUTH; */
558 ri
->auth_type
= RIP_AUTH_SIMPLE_PASSWORD
;
567 free (ri
->key_chain
);
568 ri
->key_chain
= NULL
;
571 ri
->split_horizon
= RIP_NO_SPLIT_HORIZON
;
572 ri
->split_horizon_default
= RIP_NO_SPLIT_HORIZON
;
574 ri
->list
[RIP_FILTER_IN
] = NULL
;
575 ri
->list
[RIP_FILTER_OUT
] = NULL
;
577 ri
->prefix
[RIP_FILTER_IN
] = NULL
;
578 ri
->prefix
[RIP_FILTER_OUT
] = NULL
;
582 thread_cancel (ri
->t_wakeup
);
586 ri
->recv_badpackets
= 0;
587 ri
->recv_badroutes
= 0;
588 ri
->sent_updates
= 0;
595 rip_if_down(struct interface
*ifp
)
597 struct route_node
*rp
;
598 struct rip_info
*rinfo
;
599 struct rip_interface
*ri
= NULL
;
602 for (rp
= route_top (rip
->table
); rp
; rp
= route_next (rp
))
603 if ((rinfo
= rp
->info
) != NULL
)
605 /* Routes got through this interface. */
606 if (rinfo
->ifindex
== ifp
->ifindex
&&
607 rinfo
->type
== ZEBRA_ROUTE_RIP
&&
608 rinfo
->sub_type
== RIP_ROUTE_RTE
)
610 rip_zebra_ipv4_delete ((struct prefix_ipv4
*) &rp
->p
,
614 rip_redistribute_delete (rinfo
->type
,rinfo
->sub_type
,
615 (struct prefix_ipv4
*)&rp
->p
,
620 /* All redistributed routes but static and system */
621 if ((rinfo
->ifindex
== ifp
->ifindex
) &&
622 /* (rinfo->type != ZEBRA_ROUTE_STATIC) && */
623 (rinfo
->type
!= ZEBRA_ROUTE_SYSTEM
))
624 rip_redistribute_delete (rinfo
->type
,rinfo
->sub_type
,
625 (struct prefix_ipv4
*)&rp
->p
,
635 if (IS_RIP_DEBUG_EVENT
)
636 zlog_info ("turn off %s", ifp
->name
);
638 /* Leave from multicast group. */
639 rip_multicast_leave (ifp
, rip
->sock
);
647 /* Needed for stop RIP process. */
651 struct interface
*ifp
;
654 for (node
= listhead (iflist
); node
; nextnode (node
))
656 ifp
= getdata (node
);
662 rip_apply_address_add (struct connected
*ifc
) {
663 struct prefix_ipv4 address
;
669 if (! if_is_up(ifc
->ifp
))
674 memset (&address
, 0, sizeof (address
));
675 address
.family
= p
->family
;
676 address
.prefix
= p
->u
.prefix4
;
677 address
.prefixlen
= p
->prefixlen
;
678 apply_mask_ipv4(&address
);
680 /* Check if this interface is RIP enabled or not
681 or Check if this address's prefix is RIP enabled */
682 if ((rip_enable_if_lookup(ifc
->ifp
->name
) >= 0) ||
683 (rip_enable_network_lookup2(ifc
) >= 0))
684 rip_redistribute_add(ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
685 &address
, ifc
->ifp
->ifindex
, NULL
);
690 rip_interface_address_add (int command
, struct zclient
*zclient
,
693 struct connected
*ifc
;
696 ifc
= zebra_interface_address_add_read (zclient
->ibuf
);
703 if (p
->family
== AF_INET
)
705 if (IS_RIP_DEBUG_ZEBRA
)
706 zlog_info ("connected address %s/%d is added",
707 inet_ntoa (p
->u
.prefix4
), p
->prefixlen
);
709 /* Check if this prefix needs to be redistributed */
710 rip_apply_address_add(ifc
);
713 rip_ifaddr_add (ifc
->ifp
, ifc
);
714 #endif /* HAVE_SNMP */
721 rip_apply_address_del (struct connected
*ifc
) {
722 struct prefix_ipv4 address
;
728 if (! if_is_up(ifc
->ifp
))
733 memset (&address
, 0, sizeof (address
));
734 address
.family
= p
->family
;
735 address
.prefix
= p
->u
.prefix4
;
736 address
.prefixlen
= p
->prefixlen
;
737 apply_mask_ipv4(&address
);
739 rip_redistribute_delete(ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
740 &address
, ifc
->ifp
->ifindex
);
744 rip_interface_address_delete (int command
, struct zclient
*zclient
,
747 struct connected
*ifc
;
750 ifc
= zebra_interface_address_delete_read (zclient
->ibuf
);
755 if (p
->family
== AF_INET
)
757 if (IS_RIP_DEBUG_ZEBRA
)
759 zlog_info ("connected address %s/%d is deleted",
760 inet_ntoa (p
->u
.prefix4
), p
->prefixlen
);
763 rip_ifaddr_delete (ifc
->ifp
, ifc
);
764 #endif /* HAVE_SNMP */
766 /* Chech wether this prefix needs to be removed */
767 rip_apply_address_del(ifc
);
771 connected_free (ifc
);
778 /* Check interface is enabled by network statement. */
779 /* Check wether the interface has at least a connected prefix that
780 * is within the ripng_enable_network table. */
782 rip_enable_network_lookup_if (struct interface
*ifp
)
785 struct connected
*connected
;
786 struct prefix_ipv4 address
;
788 for (nn
= listhead (ifp
->connected
); nn
; nextnode (nn
))
789 if ((connected
= getdata (nn
)) != NULL
)
792 struct route_node
*node
;
794 p
= connected
->address
;
796 if (p
->family
== AF_INET
)
798 address
.family
= AF_INET
;
799 address
.prefix
= p
->u
.prefix4
;
800 address
.prefixlen
= IPV4_MAX_BITLEN
;
802 node
= route_node_match (rip_enable_network
,
803 (struct prefix
*)&address
);
806 route_unlock_node (node
);
814 /* Check wether connected is within the ripng_enable_network table. */
816 rip_enable_network_lookup2 (struct connected
*connected
)
818 struct prefix_ipv4 address
;
821 p
= connected
->address
;
823 if (p
->family
== AF_INET
) {
824 struct route_node
*node
;
826 address
.family
= p
->family
;
827 address
.prefix
= p
->u
.prefix4
;
828 address
.prefixlen
= IPV4_MAX_BITLEN
;
830 /* LPM on p->family, p->u.prefix4/IPV4_MAX_BITLEN within rip_enable_network */
831 node
= route_node_match (rip_enable_network
,
832 (struct prefix
*)&address
);
835 route_unlock_node (node
);
842 /* Add RIP enable network. */
844 rip_enable_network_add (struct prefix
*p
)
846 struct route_node
*node
;
848 node
= route_node_get (rip_enable_network
, p
);
852 route_unlock_node (node
);
856 node
->info
= "enabled";
858 /* XXX: One should find a better solution than a generic one */
859 rip_enable_apply_all();
864 /* Delete RIP enable network. */
866 rip_enable_network_delete (struct prefix
*p
)
868 struct route_node
*node
;
870 node
= route_node_lookup (rip_enable_network
, p
);
875 /* Unlock info lock. */
876 route_unlock_node (node
);
878 /* Unlock lookup lock. */
879 route_unlock_node (node
);
881 /* XXX: One should find a better solution than a generic one */
882 rip_enable_apply_all ();
889 /* Check interface is enabled by ifname statement. */
891 rip_enable_if_lookup (char *ifname
)
896 for (i
= 0; i
< vector_max (rip_enable_interface
); i
++)
897 if ((str
= vector_slot (rip_enable_interface
, i
)) != NULL
)
898 if (strcmp (str
, ifname
) == 0)
903 /* Add interface to rip_enable_if. */
905 rip_enable_if_add (char *ifname
)
909 ret
= rip_enable_if_lookup (ifname
);
913 vector_set (rip_enable_interface
, strdup (ifname
));
915 rip_enable_apply_all(); /* TODOVJ */
920 /* Delete interface from rip_enable_if. */
922 rip_enable_if_delete (char *ifname
)
927 index
= rip_enable_if_lookup (ifname
);
931 str
= vector_slot (rip_enable_interface
, index
);
933 vector_unset (rip_enable_interface
, index
);
935 rip_enable_apply_all(); /* TODOVJ */
940 /* Join to multicast group and send request to the interface. */
942 rip_interface_wakeup (struct thread
*t
)
944 struct interface
*ifp
;
945 struct rip_interface
*ri
;
948 ifp
= THREAD_ARG (t
);
953 /* Join to multicast group. */
954 if (rip_multicast_join (ifp
, rip
->sock
) < 0)
956 zlog_err ("multicast join failed, interface %s not running", ifp
->name
);
960 /* Set running flag. */
963 /* Send RIP request to the interface. */
964 rip_request_interface (ifp
);
969 int rip_redistribute_check (int);
972 rip_connect_set (struct interface
*ifp
, int set
)
975 struct connected
*connected
;
976 struct prefix_ipv4 address
;
978 for (nn
= listhead (ifp
->connected
); nn
; nextnode (nn
))
979 if ((connected
= getdata (nn
)) != NULL
)
982 p
= connected
->address
;
984 if (p
->family
!= AF_INET
)
987 address
.family
= AF_INET
;
988 address
.prefix
= p
->u
.prefix4
;
989 address
.prefixlen
= p
->prefixlen
;
990 apply_mask_ipv4 (&address
);
993 /* Check once more wether this prefix is within a "network IF_OR_PREF" one */
994 if ((rip_enable_if_lookup(connected
->ifp
->name
) >= 0) ||
995 (rip_enable_network_lookup2(connected
) >= 0))
996 rip_redistribute_add (ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
997 &address
, connected
->ifp
->ifindex
, NULL
);
1000 rip_redistribute_delete (ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
1001 &address
, connected
->ifp
->ifindex
);
1002 if (rip_redistribute_check (ZEBRA_ROUTE_CONNECT
))
1003 rip_redistribute_add (ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_REDISTRIBUTE
,
1004 &address
, connected
->ifp
->ifindex
, NULL
);
1009 /* Update interface status. */
1011 rip_enable_apply (struct interface
*ifp
)
1014 struct rip_interface
*ri
= NULL
;
1016 /* Check interface. */
1017 if (! if_is_operative (ifp
))
1022 /* Check network configuration. */
1023 ret
= rip_enable_network_lookup_if (ifp
);
1025 /* If the interface is matched. */
1027 ri
->enable_network
= 1;
1029 ri
->enable_network
= 0;
1031 /* Check interface name configuration. */
1032 ret
= rip_enable_if_lookup (ifp
->name
);
1034 ri
->enable_interface
= 1;
1036 ri
->enable_interface
= 0;
1038 /* any interface MUST have an IPv4 address */
1039 if ( ! rip_if_ipv4_address_check (ifp
) )
1041 ri
->enable_network
= 0;
1042 ri
->enable_interface
= 0;
1045 /* Update running status of the interface. */
1046 if (ri
->enable_network
|| ri
->enable_interface
)
1049 if (IS_RIP_DEBUG_EVENT
)
1050 zlog_info ("turn on %s", ifp
->name
);
1052 /* Add interface wake up thread. */
1054 ri
->t_wakeup
= thread_add_timer (master
, rip_interface_wakeup
,
1056 rip_connect_set (ifp
, 1);
1063 /* Might as well clean up the route table as well
1064 * rip_if_down sets to 0 ri->running, and displays "turn off %s"
1068 rip_connect_set (ifp
, 0);
1073 /* Apply network configuration to all interface. */
1075 rip_enable_apply_all ()
1077 struct interface
*ifp
;
1080 /* Check each interface. */
1081 for (node
= listhead (iflist
); node
; nextnode (node
))
1083 ifp
= getdata (node
);
1084 rip_enable_apply (ifp
);
1089 rip_neighbor_lookup (struct sockaddr_in
*from
)
1091 struct prefix_ipv4 p
;
1092 struct route_node
*node
;
1094 memset (&p
, 0, sizeof (struct prefix_ipv4
));
1096 p
.prefix
= from
->sin_addr
;
1097 p
.prefixlen
= IPV4_MAX_BITLEN
;
1099 node
= route_node_lookup (rip
->neighbor
, (struct prefix
*) &p
);
1102 route_unlock_node (node
);
1108 /* Add new RIP neighbor to the neighbor tree. */
1110 rip_neighbor_add (struct prefix_ipv4
*p
)
1112 struct route_node
*node
;
1114 node
= route_node_get (rip
->neighbor
, (struct prefix
*) p
);
1119 node
->info
= rip
->neighbor
;
1124 /* Delete RIP neighbor from the neighbor tree. */
1126 rip_neighbor_delete (struct prefix_ipv4
*p
)
1128 struct route_node
*node
;
1130 /* Lock for look up. */
1131 node
= route_node_lookup (rip
->neighbor
, (struct prefix
*) p
);
1137 /* Unlock lookup lock. */
1138 route_unlock_node (node
);
1140 /* Unlock real neighbor information lock. */
1141 route_unlock_node (node
);
1146 /* Clear all network and neighbor configuration. */
1148 rip_clean_network ()
1152 struct route_node
*rn
;
1154 /* rip_enable_network. */
1155 for (rn
= route_top (rip_enable_network
); rn
; rn
= route_next (rn
))
1159 route_unlock_node (rn
);
1162 /* rip_enable_interface. */
1163 for (i
= 0; i
< vector_max (rip_enable_interface
); i
++)
1164 if ((str
= vector_slot (rip_enable_interface
, i
)) != NULL
)
1167 vector_slot (rip_enable_interface
, i
) = NULL
;
1171 /* Utility function for looking up passive interface settings. */
1173 rip_passive_interface_lookup (char *ifname
)
1178 for (i
= 0; i
< vector_max (Vrip_passive_interface
); i
++)
1179 if ((str
= vector_slot (Vrip_passive_interface
, i
)) != NULL
)
1180 if (strcmp (str
, ifname
) == 0)
1186 rip_passive_interface_apply (struct interface
*ifp
)
1189 struct rip_interface
*ri
;
1193 ret
= rip_passive_interface_lookup (ifp
->name
);
1201 rip_passive_interface_apply_all ()
1203 struct interface
*ifp
;
1206 for (node
= listhead (iflist
); node
; nextnode (node
))
1208 ifp
= getdata (node
);
1209 rip_passive_interface_apply (ifp
);
1213 /* Passive interface. */
1215 rip_passive_interface_set (struct vty
*vty
, char *ifname
)
1217 if (rip_passive_interface_lookup (ifname
) >= 0)
1220 vector_set (Vrip_passive_interface
, strdup (ifname
));
1222 rip_passive_interface_apply_all ();
1228 rip_passive_interface_unset (struct vty
*vty
, char *ifname
)
1233 i
= rip_passive_interface_lookup (ifname
);
1237 str
= vector_slot (Vrip_passive_interface
, i
);
1239 vector_unset (Vrip_passive_interface
, i
);
1241 rip_passive_interface_apply_all ();
1246 /* Free all configured RIP passive-interface settings. */
1248 rip_passive_interface_clean ()
1253 for (i
= 0; i
< vector_max (Vrip_passive_interface
); i
++)
1254 if ((str
= vector_slot (Vrip_passive_interface
, i
)) != NULL
)
1257 vector_slot (Vrip_passive_interface
, i
) = NULL
;
1259 rip_passive_interface_apply_all ();
1262 /* RIP enable network or interface configuration. */
1265 "network (A.B.C.D/M|WORD)",
1266 "Enable routing on an IP network\n"
1267 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
1271 struct prefix_ipv4 p
;
1273 ret
= str2prefix_ipv4 (argv
[0], &p
);
1276 ret
= rip_enable_network_add ((struct prefix
*) &p
);
1278 ret
= rip_enable_if_add (argv
[0]);
1282 vty_out (vty
, "There is a same network configuration %s%s", argv
[0],
1290 /* RIP enable network or interface configuration. */
1291 DEFUN (no_rip_network
,
1293 "no network (A.B.C.D/M|WORD)",
1295 "Enable routing on an IP network\n"
1296 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
1300 struct prefix_ipv4 p
;
1302 ret
= str2prefix_ipv4 (argv
[0], &p
);
1305 ret
= rip_enable_network_delete ((struct prefix
*) &p
);
1307 ret
= rip_enable_if_delete (argv
[0]);
1311 vty_out (vty
, "Can't find network configuration %s%s", argv
[0],
1319 /* RIP neighbor configuration set. */
1320 DEFUN (rip_neighbor
,
1323 "Specify a neighbor router\n"
1324 "Neighbor address\n")
1327 struct prefix_ipv4 p
;
1329 ret
= str2prefix_ipv4 (argv
[0], &p
);
1333 vty_out (vty
, "Please specify address by A.B.C.D%s", VTY_NEWLINE
);
1337 rip_neighbor_add (&p
);
1342 /* RIP neighbor configuration unset. */
1343 DEFUN (no_rip_neighbor
,
1344 no_rip_neighbor_cmd
,
1345 "no neighbor A.B.C.D",
1347 "Specify a neighbor router\n"
1348 "Neighbor address\n")
1351 struct prefix_ipv4 p
;
1353 ret
= str2prefix_ipv4 (argv
[0], &p
);
1357 vty_out (vty
, "Please specify address by A.B.C.D%s", VTY_NEWLINE
);
1361 rip_neighbor_delete (&p
);
1366 DEFUN (ip_rip_receive_version
,
1367 ip_rip_receive_version_cmd
,
1368 "ip rip receive version (1|2)",
1370 "Routing Information Protocol\n"
1371 "Advertisement reception\n"
1376 struct interface
*ifp
;
1377 struct rip_interface
*ri
;
1379 ifp
= (struct interface
*)vty
->index
;
1383 if (atoi (argv
[0]) == 1)
1385 ri
->ri_receive
= RI_RIP_VERSION_1
;
1388 if (atoi (argv
[0]) == 2)
1390 ri
->ri_receive
= RI_RIP_VERSION_2
;
1396 DEFUN (ip_rip_receive_version_1
,
1397 ip_rip_receive_version_1_cmd
,
1398 "ip rip receive version 1 2",
1400 "Routing Information Protocol\n"
1401 "Advertisement reception\n"
1406 struct interface
*ifp
;
1407 struct rip_interface
*ri
;
1409 ifp
= (struct interface
*)vty
->index
;
1412 /* Version 1 and 2. */
1413 ri
->ri_receive
= RI_RIP_VERSION_1_AND_2
;
1417 DEFUN (ip_rip_receive_version_2
,
1418 ip_rip_receive_version_2_cmd
,
1419 "ip rip receive version 2 1",
1421 "Routing Information Protocol\n"
1422 "Advertisement reception\n"
1427 struct interface
*ifp
;
1428 struct rip_interface
*ri
;
1430 ifp
= (struct interface
*)vty
->index
;
1433 /* Version 1 and 2. */
1434 ri
->ri_receive
= RI_RIP_VERSION_1_AND_2
;
1438 DEFUN (no_ip_rip_receive_version
,
1439 no_ip_rip_receive_version_cmd
,
1440 "no ip rip receive version",
1443 "Routing Information Protocol\n"
1444 "Advertisement reception\n"
1445 "Version control\n")
1447 struct interface
*ifp
;
1448 struct rip_interface
*ri
;
1450 ifp
= (struct interface
*)vty
->index
;
1453 ri
->ri_receive
= RI_RIP_UNSPEC
;
1457 ALIAS (no_ip_rip_receive_version
,
1458 no_ip_rip_receive_version_num_cmd
,
1459 "no ip rip receive version (1|2)",
1462 "Routing Information Protocol\n"
1463 "Advertisement reception\n"
1468 DEFUN (ip_rip_send_version
,
1469 ip_rip_send_version_cmd
,
1470 "ip rip send version (1|2)",
1472 "Routing Information Protocol\n"
1473 "Advertisement transmission\n"
1478 struct interface
*ifp
;
1479 struct rip_interface
*ri
;
1481 ifp
= (struct interface
*)vty
->index
;
1485 if (atoi (argv
[0]) == 1)
1487 ri
->ri_send
= RI_RIP_VERSION_1
;
1490 if (atoi (argv
[0]) == 2)
1492 ri
->ri_send
= RI_RIP_VERSION_2
;
1498 DEFUN (ip_rip_send_version_1
,
1499 ip_rip_send_version_1_cmd
,
1500 "ip rip send version 1 2",
1502 "Routing Information Protocol\n"
1503 "Advertisement transmission\n"
1508 struct interface
*ifp
;
1509 struct rip_interface
*ri
;
1511 ifp
= (struct interface
*)vty
->index
;
1514 /* Version 1 and 2. */
1515 ri
->ri_send
= RI_RIP_VERSION_1_AND_2
;
1519 DEFUN (ip_rip_send_version_2
,
1520 ip_rip_send_version_2_cmd
,
1521 "ip rip send version 2 1",
1523 "Routing Information Protocol\n"
1524 "Advertisement transmission\n"
1529 struct interface
*ifp
;
1530 struct rip_interface
*ri
;
1532 ifp
= (struct interface
*)vty
->index
;
1535 /* Version 1 and 2. */
1536 ri
->ri_send
= RI_RIP_VERSION_1_AND_2
;
1540 DEFUN (no_ip_rip_send_version
,
1541 no_ip_rip_send_version_cmd
,
1542 "no ip rip send version",
1545 "Routing Information Protocol\n"
1546 "Advertisement transmission\n"
1547 "Version control\n")
1549 struct interface
*ifp
;
1550 struct rip_interface
*ri
;
1552 ifp
= (struct interface
*)vty
->index
;
1555 ri
->ri_send
= RI_RIP_UNSPEC
;
1559 ALIAS (no_ip_rip_send_version
,
1560 no_ip_rip_send_version_num_cmd
,
1561 "no ip rip send version (1|2)",
1564 "Routing Information Protocol\n"
1565 "Advertisement transmission\n"
1570 DEFUN (ip_rip_authentication_mode
,
1571 ip_rip_authentication_mode_cmd
,
1572 "ip rip authentication mode (md5|text)",
1574 "Routing Information Protocol\n"
1575 "Authentication control\n"
1576 "Authentication mode\n"
1577 "Keyed message digest\n"
1578 "Clear text authentication\n")
1580 struct interface
*ifp
;
1581 struct rip_interface
*ri
;
1583 ifp
= (struct interface
*)vty
->index
;
1586 if (strncmp ("md5", argv
[0], strlen (argv
[0])) == 0)
1587 ri
->auth_type
= RIP_AUTH_MD5
;
1588 else if (strncmp ("text", argv
[0], strlen (argv
[0])) == 0)
1589 ri
->auth_type
= RIP_AUTH_SIMPLE_PASSWORD
;
1592 vty_out (vty
, "mode should be md5 or text%s", VTY_NEWLINE
);
1599 DEFUN (no_ip_rip_authentication_mode
,
1600 no_ip_rip_authentication_mode_cmd
,
1601 "no ip rip authentication mode",
1604 "Routing Information Protocol\n"
1605 "Authentication control\n"
1606 "Authentication mode\n")
1608 struct interface
*ifp
;
1609 struct rip_interface
*ri
;
1611 ifp
= (struct interface
*)vty
->index
;
1614 /* ri->auth_type = RIP_NO_AUTH; */
1615 ri
->auth_type
= RIP_AUTH_SIMPLE_PASSWORD
;
1620 ALIAS (no_ip_rip_authentication_mode
,
1621 no_ip_rip_authentication_mode_type_cmd
,
1622 "no ip rip authentication mode (md5|text)",
1625 "Routing Information Protocol\n"
1626 "Authentication control\n"
1627 "Authentication mode\n"
1628 "Keyed message digest\n"
1629 "Clear text authentication\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 ALIAS (no_ip_rip_split_horizon
,
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 DEFUN (rip_passive_interface
,
1834 rip_passive_interface_cmd
,
1835 "passive-interface IFNAME",
1836 "Suppress routing updates on an interface\n"
1839 return rip_passive_interface_set (vty
, argv
[0]);
1842 DEFUN (no_rip_passive_interface
,
1843 no_rip_passive_interface_cmd
,
1844 "no passive-interface IFNAME",
1846 "Suppress routing updates on an interface\n"
1849 return rip_passive_interface_unset (vty
, argv
[0]);
1852 /* Write rip configuration of each interface. */
1854 rip_interface_config_write (struct vty
*vty
)
1857 struct interface
*ifp
;
1859 for (node
= listhead (iflist
); node
; nextnode (node
))
1861 struct rip_interface
*ri
;
1863 ifp
= getdata (node
);
1866 /* Do not display the interface if there is no
1867 * configuration about it.
1870 (ri
->split_horizon
== ri
->split_horizon_default
) &&
1871 (ri
->ri_send
== RI_RIP_UNSPEC
) &&
1872 (ri
->ri_receive
== RI_RIP_UNSPEC
) &&
1873 (ri
->auth_type
!= RIP_AUTH_MD5
) &&
1878 vty_out (vty
, "interface %s%s", ifp
->name
,
1882 vty_out (vty
, " description %s%s", ifp
->desc
,
1885 /* Split horizon. */
1886 if (ri
->split_horizon
!= ri
->split_horizon_default
)
1888 switch (ri
->split_horizon
) {
1889 case RIP_SPLIT_HORIZON
:
1890 vty_out (vty
, " ip rip split-horizon%s", VTY_NEWLINE
);
1892 case RIP_SPLIT_HORIZON_POISONED_REVERSE
:
1893 vty_out (vty
, " ip rip split-horizon poisoned-reverse%s",
1896 case RIP_NO_SPLIT_HORIZON
:
1898 vty_out (vty
, " no ip rip split-horizon%s", VTY_NEWLINE
);
1903 /* RIP version setting. */
1904 if (ri
->ri_send
!= RI_RIP_UNSPEC
)
1905 vty_out (vty
, " ip rip send version %s%s",
1906 lookup (ri_version_msg
, ri
->ri_send
),
1909 if (ri
->ri_receive
!= RI_RIP_UNSPEC
)
1910 vty_out (vty
, " ip rip receive version %s%s",
1911 lookup (ri_version_msg
, ri
->ri_receive
),
1914 /* RIP authentication. */
1916 /* RIP_AUTH_SIMPLE_PASSWORD becomes default mode. */
1917 if (ri
->auth_type
== RIP_AUTH_SIMPLE_PASSWORD
)
1918 vty_out (vty
, " ip rip authentication mode text%s", VTY_NEWLINE
);
1920 if (ri
->auth_type
== RIP_AUTH_MD5
)
1921 vty_out (vty
, " ip rip authentication mode md5%s", VTY_NEWLINE
);
1924 vty_out (vty
, " ip rip authentication string %s%s",
1925 ri
->auth_str
, VTY_NEWLINE
);
1928 vty_out (vty
, " ip rip authentication key-chain %s%s",
1929 ri
->key_chain
, VTY_NEWLINE
);
1931 vty_out (vty
, "!%s", VTY_NEWLINE
);
1937 config_write_rip_network (struct vty
*vty
, int config_mode
)
1941 struct route_node
*node
;
1943 /* Network type RIP enable interface statement. */
1944 for (node
= route_top (rip_enable_network
); node
; node
= route_next (node
))
1946 vty_out (vty
, "%s%s/%d%s",
1947 config_mode
? " network " : " ",
1948 inet_ntoa (node
->p
.u
.prefix4
),
1952 /* Interface name RIP enable statement. */
1953 for (i
= 0; i
< vector_max (rip_enable_interface
); i
++)
1954 if ((ifname
= vector_slot (rip_enable_interface
, i
)) != NULL
)
1955 vty_out (vty
, "%s%s%s",
1956 config_mode
? " network " : " ",
1960 /* RIP neighbors listing. */
1961 for (node
= route_top (rip
->neighbor
); node
; node
= route_next (node
))
1963 vty_out (vty
, "%s%s%s",
1964 config_mode
? " neighbor " : " ",
1965 inet_ntoa (node
->p
.u
.prefix4
),
1968 /* RIP passive interface listing. */
1970 for (i
= 0; i
< vector_max (Vrip_passive_interface
); i
++)
1971 if ((ifname
= vector_slot (Vrip_passive_interface
, i
)) != NULL
)
1972 vty_out (vty
, " passive-interface %s%s", ifname
, VTY_NEWLINE
);
1977 struct cmd_node interface_node
=
1984 /* Called when interface structure allocated. */
1986 rip_interface_new_hook (struct interface
*ifp
)
1988 ifp
->info
= rip_interface_new ();
1992 /* Called when interface structure deleted. */
1994 rip_interface_delete_hook (struct interface
*ifp
)
1996 XFREE (MTYPE_RIP_INTERFACE
, ifp
->info
);
2001 /* Allocate and initialize interface vector. */
2005 /* Default initial size of interface vector. */
2007 if_add_hook (IF_NEW_HOOK
, rip_interface_new_hook
);
2008 if_add_hook (IF_DELETE_HOOK
, rip_interface_delete_hook
);
2010 /* RIP network init. */
2011 rip_enable_interface
= vector_init (1);
2012 rip_enable_network
= route_table_init ();
2014 /* RIP passive interface. */
2015 Vrip_passive_interface
= vector_init (1);
2017 /* Install interface node. */
2018 install_node (&interface_node
, rip_interface_config_write
);
2020 /* Install commands. */
2021 install_element (CONFIG_NODE
, &interface_cmd
);
2022 install_element (CONFIG_NODE
, &no_interface_cmd
);
2023 install_default (INTERFACE_NODE
);
2024 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
2025 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
2026 install_element (RIP_NODE
, &rip_network_cmd
);
2027 install_element (RIP_NODE
, &no_rip_network_cmd
);
2028 install_element (RIP_NODE
, &rip_neighbor_cmd
);
2029 install_element (RIP_NODE
, &no_rip_neighbor_cmd
);
2031 install_element (RIP_NODE
, &rip_passive_interface_cmd
);
2032 install_element (RIP_NODE
, &no_rip_passive_interface_cmd
);
2034 install_element (INTERFACE_NODE
, &ip_rip_send_version_cmd
);
2035 install_element (INTERFACE_NODE
, &ip_rip_send_version_1_cmd
);
2036 install_element (INTERFACE_NODE
, &ip_rip_send_version_2_cmd
);
2037 install_element (INTERFACE_NODE
, &no_ip_rip_send_version_cmd
);
2038 install_element (INTERFACE_NODE
, &no_ip_rip_send_version_num_cmd
);
2040 install_element (INTERFACE_NODE
, &ip_rip_receive_version_cmd
);
2041 install_element (INTERFACE_NODE
, &ip_rip_receive_version_1_cmd
);
2042 install_element (INTERFACE_NODE
, &ip_rip_receive_version_2_cmd
);
2043 install_element (INTERFACE_NODE
, &no_ip_rip_receive_version_cmd
);
2044 install_element (INTERFACE_NODE
, &no_ip_rip_receive_version_num_cmd
);
2046 install_element (INTERFACE_NODE
, &ip_rip_authentication_mode_cmd
);
2047 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_mode_cmd
);
2048 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_mode_type_cmd
);
2050 install_element (INTERFACE_NODE
, &ip_rip_authentication_key_chain_cmd
);
2051 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_key_chain_cmd
);
2052 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_key_chain2_cmd
);
2054 install_element (INTERFACE_NODE
, &ip_rip_authentication_string_cmd
);
2055 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_string_cmd
);
2056 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_string2_cmd
);
2058 install_element (INTERFACE_NODE
, &ip_rip_split_horizon_cmd
);
2059 install_element (INTERFACE_NODE
, &ip_rip_split_horizon_poisoned_reverse_cmd
);
2060 install_element (INTERFACE_NODE
, &no_ip_rip_split_horizon_cmd
);
2061 install_element (INTERFACE_NODE
, &no_ip_rip_split_horizon_poisoned_reverse_cmd
);