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"
38 #include "zebra/connected.h"
40 #include "ripd/ripd.h"
41 #include "ripd/rip_debug.h"
43 void rip_enable_apply (struct interface
*);
44 void rip_passive_interface_apply (struct interface
*);
45 int rip_if_down(struct interface
*ifp
);
46 int rip_enable_if_lookup (char *ifname
);
47 int rip_enable_network_lookup2 (struct connected
*connected
);
48 void rip_enable_apply_all ();
51 struct message ri_version_msg
[] =
53 {RI_RIP_VERSION_1
, "1"},
54 {RI_RIP_VERSION_2
, "2"},
55 {RI_RIP_VERSION_1_AND_2
, "1 2"},
59 /* RIP enabled network vector. */
60 vector rip_enable_interface
;
62 /* RIP enabled interface table. */
63 struct route_table
*rip_enable_network
;
65 /* Vector to store passive-interface name. */
66 vector Vrip_passive_interface
;
68 /* Join to the RIP version 2 multicast group. */
70 ipv4_multicast_join (int sock
,
77 ret
= setsockopt_multicast_ipv4 (sock
,
84 zlog (NULL
, LOG_INFO
, "can't setsockopt IP_ADD_MEMBERSHIP %s",
90 /* Leave from the RIP version 2 multicast group. */
92 ipv4_multicast_leave (int sock
,
99 ret
= setsockopt_multicast_ipv4 (sock
,
106 zlog (NULL
, LOG_INFO
, "can't setsockopt IP_DROP_MEMBERSHIP");
111 /* Allocate new RIP's interface configuration. */
112 struct rip_interface
*
115 struct rip_interface
*ri
;
117 ri
= XMALLOC (MTYPE_RIP_INTERFACE
, sizeof (struct rip_interface
));
118 memset (ri
, 0, sizeof (struct rip_interface
));
120 /* Default authentication type is simple password for Cisco
122 /* ri->auth_type = RIP_NO_AUTH; */
123 ri
->auth_type
= RIP_AUTH_SIMPLE_PASSWORD
;
125 /* Set default split-horizon behavior. If the interface is Frame
126 Relay or SMDS is enabled, the default value for split-horizon is
127 off. But currently Zebra does detect Frame Relay or SMDS
128 interface. So all interface is set to split horizon. */
129 ri
->split_horizon_default
= RIP_SPLIT_HORIZON
;
130 ri
->split_horizon
= ri
->split_horizon_default
;
136 rip_interface_multicast_set (int sock
, struct interface
*ifp
)
141 struct sockaddr_in from
;
143 for (node
= listhead (ifp
->connected
); node
; nextnode (node
))
145 struct prefix_ipv4
*p
;
146 struct connected
*connected
;
149 connected
= getdata (node
);
150 p
= (struct prefix_ipv4
*) connected
->address
;
152 if (p
->family
== AF_INET
)
156 if (setsockopt_multicast_ipv4 (sock
, IP_MULTICAST_IF
,
157 addr
, 0, ifp
->ifindex
) < 0)
159 zlog_warn ("Can't setsockopt IP_MULTICAST_IF to fd %d", sock
);
164 memset (&from
, 0, sizeof (struct sockaddr_in
));
167 sp
= getservbyname ("router", "udp");
169 from
.sin_port
= sp
->s_port
;
171 from
.sin_port
= htons (RIP_PORT_DEFAULT
);
173 /* Address shoud be any address. */
174 from
.sin_family
= AF_INET
;
175 from
.sin_addr
= addr
;
177 from
.sin_len
= sizeof (struct sockaddr_in
);
178 #endif /* HAVE_SIN_LEN */
180 ret
= bind (sock
, (struct sockaddr
*) & from
,
181 sizeof (struct sockaddr_in
));
184 zlog_warn ("Can't bind socket: %s", strerror (errno
));
194 /* Send RIP request packet to specified interface. */
196 rip_request_interface_send (struct interface
*ifp
, u_char version
)
198 struct sockaddr_in to
;
200 /* RIPv2 support multicast. */
201 if (version
== RIPv2
&& if_is_multicast (ifp
))
204 if (IS_RIP_DEBUG_EVENT
)
205 zlog_info ("multicast request on %s", ifp
->name
);
207 rip_request_send (NULL
, ifp
, version
);
211 /* RIPv1 and non multicast interface. */
212 if (if_is_pointopoint (ifp
) || if_is_broadcast (ifp
))
216 if (IS_RIP_DEBUG_EVENT
)
217 zlog_info ("broadcast request to %s", ifp
->name
);
219 for (cnode
= listhead (ifp
->connected
); cnode
; nextnode (cnode
))
221 struct prefix_ipv4
*p
;
222 struct connected
*connected
;
224 connected
= getdata (cnode
);
225 p
= (struct prefix_ipv4
*) connected
->destination
;
227 if (p
->family
== AF_INET
)
229 memset (&to
, 0, sizeof (struct sockaddr_in
));
230 to
.sin_port
= htons (RIP_PORT_DEFAULT
);
231 to
.sin_addr
= p
->prefix
;
233 if (IS_RIP_DEBUG_EVENT
)
234 zlog_info ("SEND request to %s", inet_ntoa (to
.sin_addr
));
236 rip_request_send (&to
, ifp
, version
);
242 /* This will be executed when interface goes up. */
244 rip_request_interface (struct interface
*ifp
)
246 struct rip_interface
*ri
;
248 /* In default ripd doesn't send RIP_REQUEST to the loopback interface. */
249 if (if_is_loopback (ifp
))
252 /* If interface is down, don't send RIP packet. */
253 if (! if_is_operative (ifp
))
256 /* Fetch RIP interface information. */
260 /* If there is no version configuration in the interface,
261 use rip's version setting. */
262 if (ri
->ri_send
== RI_RIP_UNSPEC
)
264 if (rip
->version
== RIPv1
)
265 rip_request_interface_send (ifp
, RIPv1
);
267 rip_request_interface_send (ifp
, RIPv2
);
269 /* If interface has RIP version configuration use it. */
272 if (ri
->ri_send
& RIPv1
)
273 rip_request_interface_send (ifp
, RIPv1
);
274 if (ri
->ri_send
& RIPv2
)
275 rip_request_interface_send (ifp
, RIPv2
);
279 /* Send RIP request to the neighbor. */
281 rip_request_neighbor (struct in_addr addr
)
283 struct sockaddr_in to
;
285 memset (&to
, 0, sizeof (struct sockaddr_in
));
286 to
.sin_port
= htons (RIP_PORT_DEFAULT
);
289 rip_request_send (&to
, NULL
, rip
->version
);
292 /* Request routes at all interfaces. */
294 rip_request_neighbor_all ()
296 struct route_node
*rp
;
301 if (IS_RIP_DEBUG_EVENT
)
302 zlog_info ("request to the all neighbor");
304 /* Send request to all neighbor. */
305 for (rp
= route_top (rip
->neighbor
); rp
; rp
= route_next (rp
))
307 rip_request_neighbor (rp
->p
.u
.prefix4
);
310 /* Multicast packet receive socket. */
312 rip_multicast_join (struct interface
*ifp
, int sock
)
316 if (if_is_operative (ifp
) && if_is_multicast (ifp
))
318 if (IS_RIP_DEBUG_EVENT
)
319 zlog_info ("multicast join at %s", ifp
->name
);
321 for (cnode
= listhead (ifp
->connected
); cnode
; nextnode (cnode
))
323 struct prefix_ipv4
*p
;
324 struct connected
*connected
;
325 struct in_addr group
;
327 connected
= getdata (cnode
);
328 p
= (struct prefix_ipv4
*) connected
->address
;
330 if (p
->family
!= AF_INET
)
333 group
.s_addr
= htonl (INADDR_RIP_GROUP
);
334 if (ipv4_multicast_join (sock
, group
, p
->prefix
, ifp
->ifindex
) < 0)
343 /* Leave from multicast group. */
345 rip_multicast_leave (struct interface
*ifp
, int sock
)
349 if (if_is_up (ifp
) && if_is_multicast (ifp
))
351 if (IS_RIP_DEBUG_EVENT
)
352 zlog_info ("multicast leave from %s", ifp
->name
);
354 for (cnode
= listhead (ifp
->connected
); cnode
; nextnode (cnode
))
356 struct prefix_ipv4
*p
;
357 struct connected
*connected
;
358 struct in_addr group
;
360 connected
= getdata (cnode
);
361 p
= (struct prefix_ipv4
*) connected
->address
;
363 if (p
->family
!= AF_INET
)
366 group
.s_addr
= htonl (INADDR_RIP_GROUP
);
367 if (ipv4_multicast_leave (sock
, group
, p
->prefix
, ifp
->ifindex
) == 0)
373 /* Is there and address on interface that I could use ? */
375 rip_if_ipv4_address_check (struct interface
*ifp
)
378 struct connected
*connected
;
381 for (nn
= listhead (ifp
->connected
); nn
; nextnode (nn
))
382 if ((connected
= getdata (nn
)) != NULL
)
386 p
= connected
->address
;
388 if (p
->family
== AF_INET
)
397 /* Inteface link down message processing. */
399 rip_interface_down (int command
, struct zclient
*zclient
, zebra_size_t length
)
401 struct interface
*ifp
;
406 /* zebra_interface_state_read() updates interface structure in
408 ifp
= zebra_interface_state_read(s
);
415 if (IS_RIP_DEBUG_ZEBRA
)
416 zlog_info ("interface %s index %d flags %ld metric %d mtu %d is down",
417 ifp
->name
, ifp
->ifindex
, ifp
->flags
, ifp
->metric
, ifp
->mtu
);
422 /* Inteface link up message processing */
424 rip_interface_up (int command
, struct zclient
*zclient
, zebra_size_t length
)
426 struct interface
*ifp
;
428 /* zebra_interface_state_read () updates interface structure in
430 ifp
= zebra_interface_state_read (zclient
->ibuf
);
435 if (IS_RIP_DEBUG_ZEBRA
)
436 zlog_info ("interface %s index %d flags %ld metric %d mtu %d is up",
437 ifp
->name
, ifp
->ifindex
, ifp
->flags
, ifp
->metric
, ifp
->mtu
);
439 /* Check if this interface is RIP enabled or not.*/
440 rip_enable_apply (ifp
);
442 /* Check for a passive interface */
443 rip_passive_interface_apply (ifp
);
445 /* Apply distribute list to the all interface. */
446 rip_distribute_update_interface (ifp
);
451 /* Inteface addition message from zebra. */
453 rip_interface_add (int command
, struct zclient
*zclient
, zebra_size_t length
)
455 struct interface
*ifp
;
457 ifp
= zebra_interface_add_read (zclient
->ibuf
);
459 if (IS_RIP_DEBUG_ZEBRA
)
460 zlog_info ("interface add %s index %d flags %ld metric %d mtu %d",
461 ifp
->name
, ifp
->ifindex
, ifp
->flags
, ifp
->metric
, ifp
->mtu
);
463 /* Check if this interface is RIP enabled or not.*/
464 rip_enable_apply (ifp
);
466 /* Apply distribute list to the all interface. */
467 rip_distribute_update_interface (ifp
);
469 /* rip_request_neighbor_all (); */
471 /* Check interface routemap. */
472 rip_if_rmap_update_interface (ifp
);
478 rip_interface_delete (int command
, struct zclient
*zclient
,
481 struct interface
*ifp
;
486 /* zebra_interface_state_read() updates interface structure in iflist */
487 ifp
= zebra_interface_state_read(s
);
492 if (if_is_up (ifp
)) {
496 zlog_info("interface delete %s index %d flags %ld metric %d mtu %d",
497 ifp
->name
, ifp
->ifindex
, ifp
->flags
, ifp
->metric
, ifp
->mtu
);
499 /* To support pseudo interface do not free interface structure. */
500 /* if_delete(ifp); */
506 rip_interface_clean ()
509 struct interface
*ifp
;
510 struct rip_interface
*ri
;
512 for (node
= listhead (iflist
); node
; nextnode (node
))
514 ifp
= getdata (node
);
517 ri
->enable_network
= 0;
518 ri
->enable_interface
= 0;
523 thread_cancel (ri
->t_wakeup
);
530 rip_interface_reset ()
533 struct interface
*ifp
;
534 struct rip_interface
*ri
;
536 for (node
= listhead (iflist
); node
; nextnode (node
))
538 ifp
= getdata (node
);
541 ri
->enable_network
= 0;
542 ri
->enable_interface
= 0;
545 ri
->ri_send
= RI_RIP_UNSPEC
;
546 ri
->ri_receive
= RI_RIP_UNSPEC
;
548 /* ri->auth_type = RIP_NO_AUTH; */
549 ri
->auth_type
= RIP_AUTH_SIMPLE_PASSWORD
;
558 free (ri
->key_chain
);
559 ri
->key_chain
= NULL
;
562 ri
->split_horizon
= RIP_NO_SPLIT_HORIZON
;
563 ri
->split_horizon_default
= RIP_NO_SPLIT_HORIZON
;
565 ri
->list
[RIP_FILTER_IN
] = NULL
;
566 ri
->list
[RIP_FILTER_OUT
] = NULL
;
568 ri
->prefix
[RIP_FILTER_IN
] = NULL
;
569 ri
->prefix
[RIP_FILTER_OUT
] = NULL
;
573 thread_cancel (ri
->t_wakeup
);
577 ri
->recv_badpackets
= 0;
578 ri
->recv_badroutes
= 0;
579 ri
->sent_updates
= 0;
586 rip_if_down(struct interface
*ifp
)
588 struct route_node
*rp
;
589 struct rip_info
*rinfo
;
590 struct rip_interface
*ri
= NULL
;
593 for (rp
= route_top (rip
->table
); rp
; rp
= route_next (rp
))
594 if ((rinfo
= rp
->info
) != NULL
)
596 /* Routes got through this interface. */
597 if (rinfo
->ifindex
== ifp
->ifindex
&&
598 rinfo
->type
== ZEBRA_ROUTE_RIP
&&
599 rinfo
->sub_type
== RIP_ROUTE_RTE
)
601 rip_zebra_ipv4_delete ((struct prefix_ipv4
*) &rp
->p
,
605 rip_redistribute_delete (rinfo
->type
,rinfo
->sub_type
,
606 (struct prefix_ipv4
*)&rp
->p
,
611 /* All redistributed routes but static and system */
612 if ((rinfo
->ifindex
== ifp
->ifindex
) &&
613 /* (rinfo->type != ZEBRA_ROUTE_STATIC) && */
614 (rinfo
->type
!= ZEBRA_ROUTE_SYSTEM
))
615 rip_redistribute_delete (rinfo
->type
,rinfo
->sub_type
,
616 (struct prefix_ipv4
*)&rp
->p
,
626 if (IS_RIP_DEBUG_EVENT
)
627 zlog_info ("turn off %s", ifp
->name
);
629 /* Leave from multicast group. */
630 rip_multicast_leave (ifp
, rip
->sock
);
638 /* Needed for stop RIP process. */
642 struct interface
*ifp
;
645 for (node
= listhead (iflist
); node
; nextnode (node
))
647 ifp
= getdata (node
);
653 rip_apply_address_add (struct connected
*ifc
) {
654 struct prefix_ipv4 address
;
660 if (! if_is_up(ifc
->ifp
))
665 memset (&address
, 0, sizeof (address
));
666 address
.family
= p
->family
;
667 address
.prefix
= p
->u
.prefix4
;
668 address
.prefixlen
= p
->prefixlen
;
669 apply_mask_ipv4(&address
);
671 /* Check if this interface is RIP enabled or not
672 or Check if this address's prefix is RIP enabled */
673 if ((rip_enable_if_lookup(ifc
->ifp
->name
) >= 0) ||
674 (rip_enable_network_lookup2(ifc
) >= 0))
675 rip_redistribute_add(ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
676 &address
, ifc
->ifp
->ifindex
, NULL
);
681 rip_interface_address_add (int command
, struct zclient
*zclient
,
684 struct connected
*ifc
;
687 ifc
= zebra_interface_address_add_read (zclient
->ibuf
);
694 if (p
->family
== AF_INET
)
696 if (IS_RIP_DEBUG_ZEBRA
)
697 zlog_info ("connected address %s/%d is added",
698 inet_ntoa (p
->u
.prefix4
), p
->prefixlen
);
700 /* Check if this prefix needs to be redistributed */
701 rip_apply_address_add(ifc
);
704 rip_ifaddr_add (ifc
->ifp
, ifc
);
705 #endif /* HAVE_SNMP */
712 rip_apply_address_del (struct connected
*ifc
) {
713 struct prefix_ipv4 address
;
719 if (! if_is_up(ifc
->ifp
))
724 memset (&address
, 0, sizeof (address
));
725 address
.family
= p
->family
;
726 address
.prefix
= p
->u
.prefix4
;
727 address
.prefixlen
= p
->prefixlen
;
728 apply_mask_ipv4(&address
);
730 rip_redistribute_delete(ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
731 &address
, ifc
->ifp
->ifindex
);
735 rip_interface_address_delete (int command
, struct zclient
*zclient
,
738 struct connected
*ifc
;
741 ifc
= zebra_interface_address_delete_read (zclient
->ibuf
);
746 if (p
->family
== AF_INET
)
748 if (IS_RIP_DEBUG_ZEBRA
)
750 zlog_info ("connected address %s/%d is deleted",
751 inet_ntoa (p
->u
.prefix4
), p
->prefixlen
);
754 rip_ifaddr_delete (ifc
->ifp
, ifc
);
755 #endif /* HAVE_SNMP */
757 /* Chech wether this prefix needs to be removed */
758 rip_apply_address_del(ifc
);
762 connected_free (ifc
);
769 /* Check interface is enabled by network statement. */
770 /* Check wether the interface has at least a connected prefix that
771 * is within the ripng_enable_network table. */
773 rip_enable_network_lookup_if (struct interface
*ifp
)
776 struct connected
*connected
;
777 struct prefix_ipv4 address
;
779 for (nn
= listhead (ifp
->connected
); nn
; nextnode (nn
))
780 if ((connected
= getdata (nn
)) != NULL
)
783 struct route_node
*node
;
785 p
= connected
->address
;
787 if (p
->family
== AF_INET
)
789 address
.family
= AF_INET
;
790 address
.prefix
= p
->u
.prefix4
;
791 address
.prefixlen
= IPV4_MAX_BITLEN
;
793 node
= route_node_match (rip_enable_network
,
794 (struct prefix
*)&address
);
797 route_unlock_node (node
);
805 /* Check wether connected is within the ripng_enable_network table. */
807 rip_enable_network_lookup2 (struct connected
*connected
)
809 struct prefix_ipv4 address
;
812 p
= connected
->address
;
814 if (p
->family
== AF_INET
) {
815 struct route_node
*node
;
817 address
.family
= p
->family
;
818 address
.prefix
= p
->u
.prefix4
;
819 address
.prefixlen
= IPV4_MAX_BITLEN
;
821 /* LPM on p->family, p->u.prefix4/IPV4_MAX_BITLEN within rip_enable_network */
822 node
= route_node_match (rip_enable_network
,
823 (struct prefix
*)&address
);
826 route_unlock_node (node
);
833 /* Add RIP enable network. */
835 rip_enable_network_add (struct prefix
*p
)
837 struct route_node
*node
;
839 node
= route_node_get (rip_enable_network
, p
);
843 route_unlock_node (node
);
847 node
->info
= "enabled";
849 /* XXX: One should find a better solution than a generic one */
850 rip_enable_apply_all();
855 /* Delete RIP enable network. */
857 rip_enable_network_delete (struct prefix
*p
)
859 struct route_node
*node
;
861 node
= route_node_lookup (rip_enable_network
, p
);
866 /* Unlock info lock. */
867 route_unlock_node (node
);
869 /* Unlock lookup lock. */
870 route_unlock_node (node
);
872 /* XXX: One should find a better solution than a generic one */
873 rip_enable_apply_all ();
880 /* Check interface is enabled by ifname statement. */
882 rip_enable_if_lookup (char *ifname
)
887 for (i
= 0; i
< vector_max (rip_enable_interface
); i
++)
888 if ((str
= vector_slot (rip_enable_interface
, i
)) != NULL
)
889 if (strcmp (str
, ifname
) == 0)
894 /* Add interface to rip_enable_if. */
896 rip_enable_if_add (char *ifname
)
900 ret
= rip_enable_if_lookup (ifname
);
904 vector_set (rip_enable_interface
, strdup (ifname
));
906 rip_enable_apply_all(); /* TODOVJ */
911 /* Delete interface from rip_enable_if. */
913 rip_enable_if_delete (char *ifname
)
918 index
= rip_enable_if_lookup (ifname
);
922 str
= vector_slot (rip_enable_interface
, index
);
924 vector_unset (rip_enable_interface
, index
);
926 rip_enable_apply_all(); /* TODOVJ */
931 /* Join to multicast group and send request to the interface. */
933 rip_interface_wakeup (struct thread
*t
)
935 struct interface
*ifp
;
936 struct rip_interface
*ri
;
939 ifp
= THREAD_ARG (t
);
944 /* Join to multicast group. */
945 if (rip_multicast_join (ifp
, rip
->sock
) < 0)
947 zlog_err ("multicast join failed, interface %s not running", ifp
->name
);
951 /* Set running flag. */
954 /* Send RIP request to the interface. */
955 rip_request_interface (ifp
);
960 int rip_redistribute_check (int);
963 rip_connect_set (struct interface
*ifp
, int set
)
966 struct connected
*connected
;
967 struct prefix_ipv4 address
;
969 for (nn
= listhead (ifp
->connected
); nn
; nextnode (nn
))
970 if ((connected
= getdata (nn
)) != NULL
)
973 p
= connected
->address
;
975 if (p
->family
!= AF_INET
)
978 address
.family
= AF_INET
;
979 address
.prefix
= p
->u
.prefix4
;
980 address
.prefixlen
= p
->prefixlen
;
981 apply_mask_ipv4 (&address
);
984 /* Check once more wether this prefix is within a "network IF_OR_PREF" one */
985 if ((rip_enable_if_lookup(connected
->ifp
->name
) >= 0) ||
986 (rip_enable_network_lookup2(connected
) >= 0))
987 rip_redistribute_add (ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
988 &address
, connected
->ifp
->ifindex
, NULL
);
991 rip_redistribute_delete (ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_INTERFACE
,
992 &address
, connected
->ifp
->ifindex
);
993 if (rip_redistribute_check (ZEBRA_ROUTE_CONNECT
))
994 rip_redistribute_add (ZEBRA_ROUTE_CONNECT
, RIP_ROUTE_REDISTRIBUTE
,
995 &address
, connected
->ifp
->ifindex
, NULL
);
1000 /* Update interface status. */
1002 rip_enable_apply (struct interface
*ifp
)
1005 struct rip_interface
*ri
= NULL
;
1007 /* Check interface. */
1008 if (! if_is_operative (ifp
))
1013 /* Check network configuration. */
1014 ret
= rip_enable_network_lookup_if (ifp
);
1016 /* If the interface is matched. */
1018 ri
->enable_network
= 1;
1020 ri
->enable_network
= 0;
1022 /* Check interface name configuration. */
1023 ret
= rip_enable_if_lookup (ifp
->name
);
1025 ri
->enable_interface
= 1;
1027 ri
->enable_interface
= 0;
1029 /* any interface MUST have an IPv4 address */
1030 if ( ! rip_if_ipv4_address_check (ifp
) )
1032 ri
->enable_network
= 0;
1033 ri
->enable_interface
= 0;
1036 /* Update running status of the interface. */
1037 if (ri
->enable_network
|| ri
->enable_interface
)
1040 if (IS_RIP_DEBUG_EVENT
)
1041 zlog_info ("turn on %s", ifp
->name
);
1043 /* Add interface wake up thread. */
1045 ri
->t_wakeup
= thread_add_timer (master
, rip_interface_wakeup
,
1047 rip_connect_set (ifp
, 1);
1054 /* Might as well clean up the route table as well
1055 * rip_if_down sets to 0 ri->running, and displays "turn off %s"
1059 rip_connect_set (ifp
, 0);
1064 /* Apply network configuration to all interface. */
1066 rip_enable_apply_all ()
1068 struct interface
*ifp
;
1071 /* Check each interface. */
1072 for (node
= listhead (iflist
); node
; nextnode (node
))
1074 ifp
= getdata (node
);
1075 rip_enable_apply (ifp
);
1080 rip_neighbor_lookup (struct sockaddr_in
*from
)
1082 struct prefix_ipv4 p
;
1083 struct route_node
*node
;
1085 memset (&p
, 0, sizeof (struct prefix_ipv4
));
1087 p
.prefix
= from
->sin_addr
;
1088 p
.prefixlen
= IPV4_MAX_BITLEN
;
1090 node
= route_node_lookup (rip
->neighbor
, (struct prefix
*) &p
);
1093 route_unlock_node (node
);
1099 /* Add new RIP neighbor to the neighbor tree. */
1101 rip_neighbor_add (struct prefix_ipv4
*p
)
1103 struct route_node
*node
;
1105 node
= route_node_get (rip
->neighbor
, (struct prefix
*) p
);
1110 node
->info
= rip
->neighbor
;
1115 /* Delete RIP neighbor from the neighbor tree. */
1117 rip_neighbor_delete (struct prefix_ipv4
*p
)
1119 struct route_node
*node
;
1121 /* Lock for look up. */
1122 node
= route_node_lookup (rip
->neighbor
, (struct prefix
*) p
);
1128 /* Unlock lookup lock. */
1129 route_unlock_node (node
);
1131 /* Unlock real neighbor information lock. */
1132 route_unlock_node (node
);
1137 /* Clear all network and neighbor configuration. */
1139 rip_clean_network ()
1143 struct route_node
*rn
;
1145 /* rip_enable_network. */
1146 for (rn
= route_top (rip_enable_network
); rn
; rn
= route_next (rn
))
1150 route_unlock_node (rn
);
1153 /* rip_enable_interface. */
1154 for (i
= 0; i
< vector_max (rip_enable_interface
); i
++)
1155 if ((str
= vector_slot (rip_enable_interface
, i
)) != NULL
)
1158 vector_slot (rip_enable_interface
, i
) = NULL
;
1162 /* Utility function for looking up passive interface settings. */
1164 rip_passive_interface_lookup (char *ifname
)
1169 for (i
= 0; i
< vector_max (Vrip_passive_interface
); i
++)
1170 if ((str
= vector_slot (Vrip_passive_interface
, i
)) != NULL
)
1171 if (strcmp (str
, ifname
) == 0)
1177 rip_passive_interface_apply (struct interface
*ifp
)
1180 struct rip_interface
*ri
;
1184 ret
= rip_passive_interface_lookup (ifp
->name
);
1192 rip_passive_interface_apply_all ()
1194 struct interface
*ifp
;
1197 for (node
= listhead (iflist
); node
; nextnode (node
))
1199 ifp
= getdata (node
);
1200 rip_passive_interface_apply (ifp
);
1204 /* Passive interface. */
1206 rip_passive_interface_set (struct vty
*vty
, char *ifname
)
1208 if (rip_passive_interface_lookup (ifname
) >= 0)
1211 vector_set (Vrip_passive_interface
, strdup (ifname
));
1213 rip_passive_interface_apply_all ();
1219 rip_passive_interface_unset (struct vty
*vty
, char *ifname
)
1224 i
= rip_passive_interface_lookup (ifname
);
1228 str
= vector_slot (Vrip_passive_interface
, i
);
1230 vector_unset (Vrip_passive_interface
, i
);
1232 rip_passive_interface_apply_all ();
1237 /* Free all configured RIP passive-interface settings. */
1239 rip_passive_interface_clean ()
1244 for (i
= 0; i
< vector_max (Vrip_passive_interface
); i
++)
1245 if ((str
= vector_slot (Vrip_passive_interface
, i
)) != NULL
)
1248 vector_slot (Vrip_passive_interface
, i
) = NULL
;
1250 rip_passive_interface_apply_all ();
1253 /* RIP enable network or interface configuration. */
1256 "network (A.B.C.D/M|WORD)",
1257 "Enable routing on an IP network\n"
1258 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
1262 struct prefix_ipv4 p
;
1264 ret
= str2prefix_ipv4 (argv
[0], &p
);
1267 ret
= rip_enable_network_add ((struct prefix
*) &p
);
1269 ret
= rip_enable_if_add (argv
[0]);
1273 vty_out (vty
, "There is a same network configuration %s%s", argv
[0],
1281 /* RIP enable network or interface configuration. */
1282 DEFUN (no_rip_network
,
1284 "no network (A.B.C.D/M|WORD)",
1286 "Enable routing on an IP network\n"
1287 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
1291 struct prefix_ipv4 p
;
1293 ret
= str2prefix_ipv4 (argv
[0], &p
);
1296 ret
= rip_enable_network_delete ((struct prefix
*) &p
);
1298 ret
= rip_enable_if_delete (argv
[0]);
1302 vty_out (vty
, "Can't find network configuration %s%s", argv
[0],
1310 /* RIP neighbor configuration set. */
1311 DEFUN (rip_neighbor
,
1314 "Specify a neighbor router\n"
1315 "Neighbor address\n")
1318 struct prefix_ipv4 p
;
1320 ret
= str2prefix_ipv4 (argv
[0], &p
);
1324 vty_out (vty
, "Please specify address by A.B.C.D%s", VTY_NEWLINE
);
1328 rip_neighbor_add (&p
);
1333 /* RIP neighbor configuration unset. */
1334 DEFUN (no_rip_neighbor
,
1335 no_rip_neighbor_cmd
,
1336 "no neighbor A.B.C.D",
1338 "Specify a neighbor router\n"
1339 "Neighbor address\n")
1342 struct prefix_ipv4 p
;
1344 ret
= str2prefix_ipv4 (argv
[0], &p
);
1348 vty_out (vty
, "Please specify address by A.B.C.D%s", VTY_NEWLINE
);
1352 rip_neighbor_delete (&p
);
1357 DEFUN (ip_rip_receive_version
,
1358 ip_rip_receive_version_cmd
,
1359 "ip rip receive version (1|2)",
1361 "Routing Information Protocol\n"
1362 "Advertisement reception\n"
1367 struct interface
*ifp
;
1368 struct rip_interface
*ri
;
1370 ifp
= (struct interface
*)vty
->index
;
1374 if (atoi (argv
[0]) == 1)
1376 ri
->ri_receive
= RI_RIP_VERSION_1
;
1379 if (atoi (argv
[0]) == 2)
1381 ri
->ri_receive
= RI_RIP_VERSION_2
;
1387 DEFUN (ip_rip_receive_version_1
,
1388 ip_rip_receive_version_1_cmd
,
1389 "ip rip receive version 1 2",
1391 "Routing Information Protocol\n"
1392 "Advertisement reception\n"
1397 struct interface
*ifp
;
1398 struct rip_interface
*ri
;
1400 ifp
= (struct interface
*)vty
->index
;
1403 /* Version 1 and 2. */
1404 ri
->ri_receive
= RI_RIP_VERSION_1_AND_2
;
1408 DEFUN (ip_rip_receive_version_2
,
1409 ip_rip_receive_version_2_cmd
,
1410 "ip rip receive version 2 1",
1412 "Routing Information Protocol\n"
1413 "Advertisement reception\n"
1418 struct interface
*ifp
;
1419 struct rip_interface
*ri
;
1421 ifp
= (struct interface
*)vty
->index
;
1424 /* Version 1 and 2. */
1425 ri
->ri_receive
= RI_RIP_VERSION_1_AND_2
;
1429 DEFUN (no_ip_rip_receive_version
,
1430 no_ip_rip_receive_version_cmd
,
1431 "no ip rip receive version",
1434 "Routing Information Protocol\n"
1435 "Advertisement reception\n"
1436 "Version control\n")
1438 struct interface
*ifp
;
1439 struct rip_interface
*ri
;
1441 ifp
= (struct interface
*)vty
->index
;
1444 ri
->ri_receive
= RI_RIP_UNSPEC
;
1448 ALIAS (no_ip_rip_receive_version
,
1449 no_ip_rip_receive_version_num_cmd
,
1450 "no ip rip receive version (1|2)",
1453 "Routing Information Protocol\n"
1454 "Advertisement reception\n"
1459 DEFUN (ip_rip_send_version
,
1460 ip_rip_send_version_cmd
,
1461 "ip rip send version (1|2)",
1463 "Routing Information Protocol\n"
1464 "Advertisement transmission\n"
1469 struct interface
*ifp
;
1470 struct rip_interface
*ri
;
1472 ifp
= (struct interface
*)vty
->index
;
1476 if (atoi (argv
[0]) == 1)
1478 ri
->ri_send
= RI_RIP_VERSION_1
;
1481 if (atoi (argv
[0]) == 2)
1483 ri
->ri_send
= RI_RIP_VERSION_2
;
1489 DEFUN (ip_rip_send_version_1
,
1490 ip_rip_send_version_1_cmd
,
1491 "ip rip send version 1 2",
1493 "Routing Information Protocol\n"
1494 "Advertisement transmission\n"
1499 struct interface
*ifp
;
1500 struct rip_interface
*ri
;
1502 ifp
= (struct interface
*)vty
->index
;
1505 /* Version 1 and 2. */
1506 ri
->ri_send
= RI_RIP_VERSION_1_AND_2
;
1510 DEFUN (ip_rip_send_version_2
,
1511 ip_rip_send_version_2_cmd
,
1512 "ip rip send version 2 1",
1514 "Routing Information Protocol\n"
1515 "Advertisement transmission\n"
1520 struct interface
*ifp
;
1521 struct rip_interface
*ri
;
1523 ifp
= (struct interface
*)vty
->index
;
1526 /* Version 1 and 2. */
1527 ri
->ri_send
= RI_RIP_VERSION_1_AND_2
;
1531 DEFUN (no_ip_rip_send_version
,
1532 no_ip_rip_send_version_cmd
,
1533 "no ip rip send version",
1536 "Routing Information Protocol\n"
1537 "Advertisement transmission\n"
1538 "Version control\n")
1540 struct interface
*ifp
;
1541 struct rip_interface
*ri
;
1543 ifp
= (struct interface
*)vty
->index
;
1546 ri
->ri_send
= RI_RIP_UNSPEC
;
1550 ALIAS (no_ip_rip_send_version
,
1551 no_ip_rip_send_version_num_cmd
,
1552 "no ip rip send version (1|2)",
1555 "Routing Information Protocol\n"
1556 "Advertisement transmission\n"
1561 DEFUN (ip_rip_authentication_mode
,
1562 ip_rip_authentication_mode_cmd
,
1563 "ip rip authentication mode (md5|text)",
1565 "Routing Information Protocol\n"
1566 "Authentication control\n"
1567 "Authentication mode\n"
1568 "Keyed message digest\n"
1569 "Clear text authentication\n")
1571 struct interface
*ifp
;
1572 struct rip_interface
*ri
;
1574 ifp
= (struct interface
*)vty
->index
;
1577 if (strncmp ("md5", argv
[0], strlen (argv
[0])) == 0)
1578 ri
->auth_type
= RIP_AUTH_MD5
;
1579 else if (strncmp ("text", argv
[0], strlen (argv
[0])) == 0)
1580 ri
->auth_type
= RIP_AUTH_SIMPLE_PASSWORD
;
1583 vty_out (vty
, "mode should be md5 or text%s", VTY_NEWLINE
);
1590 DEFUN (no_ip_rip_authentication_mode
,
1591 no_ip_rip_authentication_mode_cmd
,
1592 "no ip rip authentication mode",
1595 "Routing Information Protocol\n"
1596 "Authentication control\n"
1597 "Authentication mode\n")
1599 struct interface
*ifp
;
1600 struct rip_interface
*ri
;
1602 ifp
= (struct interface
*)vty
->index
;
1605 /* ri->auth_type = RIP_NO_AUTH; */
1606 ri
->auth_type
= RIP_AUTH_SIMPLE_PASSWORD
;
1611 ALIAS (no_ip_rip_authentication_mode
,
1612 no_ip_rip_authentication_mode_type_cmd
,
1613 "no ip rip authentication mode (md5|text)",
1616 "Routing Information Protocol\n"
1617 "Authentication control\n"
1618 "Authentication mode\n"
1619 "Keyed message digest\n"
1620 "Clear text authentication\n")
1622 DEFUN (ip_rip_authentication_string
,
1623 ip_rip_authentication_string_cmd
,
1624 "ip rip authentication string LINE",
1626 "Routing Information Protocol\n"
1627 "Authentication control\n"
1628 "Authentication string\n"
1629 "Authentication string\n")
1631 struct interface
*ifp
;
1632 struct rip_interface
*ri
;
1634 ifp
= (struct interface
*)vty
->index
;
1637 if (strlen (argv
[0]) > 16)
1639 vty_out (vty
, "%% RIPv2 authentication string must be shorter than 16%s",
1646 vty_out (vty
, "%% key-chain configuration exists%s", VTY_NEWLINE
);
1651 free (ri
->auth_str
);
1653 ri
->auth_str
= strdup (argv
[0]);
1658 DEFUN (no_ip_rip_authentication_string
,
1659 no_ip_rip_authentication_string_cmd
,
1660 "no ip rip authentication string",
1663 "Routing Information Protocol\n"
1664 "Authentication control\n"
1665 "Authentication string\n")
1667 struct interface
*ifp
;
1668 struct rip_interface
*ri
;
1670 ifp
= (struct interface
*)vty
->index
;
1674 free (ri
->auth_str
);
1676 ri
->auth_str
= NULL
;
1681 ALIAS (no_ip_rip_authentication_string
,
1682 no_ip_rip_authentication_string2_cmd
,
1683 "no ip rip authentication string LINE",
1686 "Routing Information Protocol\n"
1687 "Authentication control\n"
1688 "Authentication string\n"
1689 "Authentication string\n")
1691 DEFUN (ip_rip_authentication_key_chain
,
1692 ip_rip_authentication_key_chain_cmd
,
1693 "ip rip authentication key-chain LINE",
1695 "Routing Information Protocol\n"
1696 "Authentication control\n"
1697 "Authentication key-chain\n"
1698 "name of key-chain\n")
1700 struct interface
*ifp
;
1701 struct rip_interface
*ri
;
1703 ifp
= (struct interface
*) vty
->index
;
1708 vty_out (vty
, "%% authentication string configuration exists%s",
1714 free (ri
->key_chain
);
1716 ri
->key_chain
= strdup (argv
[0]);
1721 DEFUN (no_ip_rip_authentication_key_chain
,
1722 no_ip_rip_authentication_key_chain_cmd
,
1723 "no ip rip authentication key-chain",
1726 "Routing Information Protocol\n"
1727 "Authentication control\n"
1728 "Authentication key-chain\n")
1730 struct interface
*ifp
;
1731 struct rip_interface
*ri
;
1733 ifp
= (struct interface
*) vty
->index
;
1737 free (ri
->key_chain
);
1739 ri
->key_chain
= NULL
;
1744 ALIAS (no_ip_rip_authentication_key_chain
,
1745 no_ip_rip_authentication_key_chain2_cmd
,
1746 "no ip rip authentication key-chain LINE",
1749 "Routing Information Protocol\n"
1750 "Authentication control\n"
1751 "Authentication key-chain\n"
1752 "name of key-chain\n")
1754 /* CHANGED: ip rip split-horizon
1755 Cisco and Zebra's command is
1758 DEFUN (ip_rip_split_horizon
,
1759 ip_rip_split_horizon_cmd
,
1760 "ip rip split-horizon",
1762 "Routing Information Protocol\n"
1763 "Perform split horizon\n")
1765 struct interface
*ifp
;
1766 struct rip_interface
*ri
;
1771 ri
->split_horizon
= RIP_SPLIT_HORIZON
;
1775 DEFUN (ip_rip_split_horizon_poisoned_reverse
,
1776 ip_rip_split_horizon_poisoned_reverse_cmd
,
1777 "ip rip split-horizon poisoned-reverse",
1779 "Routing Information Protocol\n"
1780 "Perform split horizon\n"
1781 "With poisoned-reverse\n")
1783 struct interface
*ifp
;
1784 struct rip_interface
*ri
;
1789 ri
->split_horizon
= RIP_SPLIT_HORIZON_POISONED_REVERSE
;
1793 /* CHANGED: no ip rip split-horizon
1794 Cisco and Zebra's command is
1797 DEFUN (no_ip_rip_split_horizon
,
1798 no_ip_rip_split_horizon_cmd
,
1799 "no ip rip split-horizon",
1802 "Routing Information Protocol\n"
1803 "Perform split horizon\n")
1805 struct interface
*ifp
;
1806 struct rip_interface
*ri
;
1811 ri
->split_horizon
= RIP_NO_SPLIT_HORIZON
;
1815 ALIAS (no_ip_rip_split_horizon
,
1816 no_ip_rip_split_horizon_poisoned_reverse_cmd
,
1817 "no ip rip split-horizon poisoned-reverse",
1820 "Routing Information Protocol\n"
1821 "Perform split horizon\n"
1822 "With poisoned-reverse\n")
1824 DEFUN (rip_passive_interface
,
1825 rip_passive_interface_cmd
,
1826 "passive-interface IFNAME",
1827 "Suppress routing updates on an interface\n"
1830 return rip_passive_interface_set (vty
, argv
[0]);
1833 DEFUN (no_rip_passive_interface
,
1834 no_rip_passive_interface_cmd
,
1835 "no passive-interface IFNAME",
1837 "Suppress routing updates on an interface\n"
1840 return rip_passive_interface_unset (vty
, argv
[0]);
1843 /* Write rip configuration of each interface. */
1845 rip_interface_config_write (struct vty
*vty
)
1848 struct interface
*ifp
;
1850 for (node
= listhead (iflist
); node
; nextnode (node
))
1852 struct rip_interface
*ri
;
1854 ifp
= getdata (node
);
1857 /* Do not display the interface if there is no
1858 * configuration about it.
1861 (ri
->split_horizon
== ri
->split_horizon_default
) &&
1862 (ri
->ri_send
== RI_RIP_UNSPEC
) &&
1863 (ri
->ri_receive
== RI_RIP_UNSPEC
) &&
1864 (ri
->auth_type
!= RIP_AUTH_MD5
) &&
1869 vty_out (vty
, "interface %s%s", ifp
->name
,
1873 vty_out (vty
, " description %s%s", ifp
->desc
,
1876 /* Split horizon. */
1877 if (ri
->split_horizon
!= ri
->split_horizon_default
)
1879 switch (ri
->split_horizon
) {
1880 case RIP_SPLIT_HORIZON
:
1881 vty_out (vty
, " ip rip split-horizon%s", VTY_NEWLINE
);
1883 case RIP_SPLIT_HORIZON_POISONED_REVERSE
:
1884 vty_out (vty
, " ip rip split-horizon poisoned-reverse%s",
1887 case RIP_NO_SPLIT_HORIZON
:
1889 vty_out (vty
, " no ip rip split-horizon%s", VTY_NEWLINE
);
1894 /* RIP version setting. */
1895 if (ri
->ri_send
!= RI_RIP_UNSPEC
)
1896 vty_out (vty
, " ip rip send version %s%s",
1897 lookup (ri_version_msg
, ri
->ri_send
),
1900 if (ri
->ri_receive
!= RI_RIP_UNSPEC
)
1901 vty_out (vty
, " ip rip receive version %s%s",
1902 lookup (ri_version_msg
, ri
->ri_receive
),
1905 /* RIP authentication. */
1907 /* RIP_AUTH_SIMPLE_PASSWORD becomes default mode. */
1908 if (ri
->auth_type
== RIP_AUTH_SIMPLE_PASSWORD
)
1909 vty_out (vty
, " ip rip authentication mode text%s", VTY_NEWLINE
);
1911 if (ri
->auth_type
== RIP_AUTH_MD5
)
1912 vty_out (vty
, " ip rip authentication mode md5%s", VTY_NEWLINE
);
1915 vty_out (vty
, " ip rip authentication string %s%s",
1916 ri
->auth_str
, VTY_NEWLINE
);
1919 vty_out (vty
, " ip rip authentication key-chain %s%s",
1920 ri
->key_chain
, VTY_NEWLINE
);
1922 vty_out (vty
, "!%s", VTY_NEWLINE
);
1928 config_write_rip_network (struct vty
*vty
, int config_mode
)
1932 struct route_node
*node
;
1934 /* Network type RIP enable interface statement. */
1935 for (node
= route_top (rip_enable_network
); node
; node
= route_next (node
))
1937 vty_out (vty
, "%s%s/%d%s",
1938 config_mode
? " network " : " ",
1939 inet_ntoa (node
->p
.u
.prefix4
),
1943 /* Interface name RIP enable statement. */
1944 for (i
= 0; i
< vector_max (rip_enable_interface
); i
++)
1945 if ((ifname
= vector_slot (rip_enable_interface
, i
)) != NULL
)
1946 vty_out (vty
, "%s%s%s",
1947 config_mode
? " network " : " ",
1951 /* RIP neighbors listing. */
1952 for (node
= route_top (rip
->neighbor
); node
; node
= route_next (node
))
1954 vty_out (vty
, "%s%s%s",
1955 config_mode
? " neighbor " : " ",
1956 inet_ntoa (node
->p
.u
.prefix4
),
1959 /* RIP passive interface listing. */
1961 for (i
= 0; i
< vector_max (Vrip_passive_interface
); i
++)
1962 if ((ifname
= vector_slot (Vrip_passive_interface
, i
)) != NULL
)
1963 vty_out (vty
, " passive-interface %s%s", ifname
, VTY_NEWLINE
);
1968 struct cmd_node interface_node
=
1975 /* Called when interface structure allocated. */
1977 rip_interface_new_hook (struct interface
*ifp
)
1979 ifp
->info
= rip_interface_new ();
1983 /* Called when interface structure deleted. */
1985 rip_interface_delete_hook (struct interface
*ifp
)
1987 XFREE (MTYPE_RIP_INTERFACE
, ifp
->info
);
1992 /* Allocate and initialize interface vector. */
1996 /* Default initial size of interface vector. */
1998 if_add_hook (IF_NEW_HOOK
, rip_interface_new_hook
);
1999 if_add_hook (IF_DELETE_HOOK
, rip_interface_delete_hook
);
2001 /* RIP network init. */
2002 rip_enable_interface
= vector_init (1);
2003 rip_enable_network
= route_table_init ();
2005 /* RIP passive interface. */
2006 Vrip_passive_interface
= vector_init (1);
2008 /* Install interface node. */
2009 install_node (&interface_node
, rip_interface_config_write
);
2011 /* Install commands. */
2012 install_element (CONFIG_NODE
, &interface_cmd
);
2013 install_element (CONFIG_NODE
, &no_interface_cmd
);
2014 install_default (INTERFACE_NODE
);
2015 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
2016 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
2017 install_element (RIP_NODE
, &rip_network_cmd
);
2018 install_element (RIP_NODE
, &no_rip_network_cmd
);
2019 install_element (RIP_NODE
, &rip_neighbor_cmd
);
2020 install_element (RIP_NODE
, &no_rip_neighbor_cmd
);
2022 install_element (RIP_NODE
, &rip_passive_interface_cmd
);
2023 install_element (RIP_NODE
, &no_rip_passive_interface_cmd
);
2025 install_element (INTERFACE_NODE
, &ip_rip_send_version_cmd
);
2026 install_element (INTERFACE_NODE
, &ip_rip_send_version_1_cmd
);
2027 install_element (INTERFACE_NODE
, &ip_rip_send_version_2_cmd
);
2028 install_element (INTERFACE_NODE
, &no_ip_rip_send_version_cmd
);
2029 install_element (INTERFACE_NODE
, &no_ip_rip_send_version_num_cmd
);
2031 install_element (INTERFACE_NODE
, &ip_rip_receive_version_cmd
);
2032 install_element (INTERFACE_NODE
, &ip_rip_receive_version_1_cmd
);
2033 install_element (INTERFACE_NODE
, &ip_rip_receive_version_2_cmd
);
2034 install_element (INTERFACE_NODE
, &no_ip_rip_receive_version_cmd
);
2035 install_element (INTERFACE_NODE
, &no_ip_rip_receive_version_num_cmd
);
2037 install_element (INTERFACE_NODE
, &ip_rip_authentication_mode_cmd
);
2038 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_mode_cmd
);
2039 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_mode_type_cmd
);
2041 install_element (INTERFACE_NODE
, &ip_rip_authentication_key_chain_cmd
);
2042 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_key_chain_cmd
);
2043 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_key_chain2_cmd
);
2045 install_element (INTERFACE_NODE
, &ip_rip_authentication_string_cmd
);
2046 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_string_cmd
);
2047 install_element (INTERFACE_NODE
, &no_ip_rip_authentication_string2_cmd
);
2049 install_element (INTERFACE_NODE
, &ip_rip_split_horizon_cmd
);
2050 install_element (INTERFACE_NODE
, &ip_rip_split_horizon_poisoned_reverse_cmd
);
2051 install_element (INTERFACE_NODE
, &no_ip_rip_split_horizon_cmd
);
2052 install_element (INTERFACE_NODE
, &no_ip_rip_split_horizon_poisoned_reverse_cmd
);