paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* RIPd and zebra interface. |
| 2 | * Copyright (C) 1997, 1999 Kunihiro Ishiguro <kunihiro@zebra.org> |
| 3 | * |
| 4 | * This file is part of GNU Zebra. |
| 5 | * |
| 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 |
| 9 | * later version. |
| 10 | * |
| 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. |
| 15 | * |
| 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 |
| 19 | * 02111-1307, USA. |
| 20 | */ |
| 21 | |
| 22 | #include <zebra.h> |
| 23 | |
| 24 | #include "command.h" |
| 25 | #include "prefix.h" |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 26 | #include "table.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 27 | #include "stream.h" |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 28 | #include "memory.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 29 | #include "routemap.h" |
| 30 | #include "zclient.h" |
| 31 | #include "log.h" |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 32 | #include "vrf.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 33 | #include "ripd/ripd.h" |
| 34 | #include "ripd/rip_debug.h" |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 35 | #include "ripd/rip_interface.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 36 | |
| 37 | /* All information about zebra. */ |
| 38 | struct zclient *zclient = NULL; |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 39 | |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 40 | /* Send ECMP routes to zebra. */ |
| 41 | static void |
| 42 | rip_zebra_ipv4_send (struct route_node *rp, u_char cmd) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 43 | { |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 44 | static struct in_addr **nexthops = NULL; |
| 45 | static unsigned int nexthops_len = 0; |
| 46 | |
| 47 | struct list *list = (struct list *)rp->info; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 48 | struct zapi_ipv4 api; |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 49 | struct listnode *listnode = NULL; |
| 50 | struct rip_info *rinfo = NULL; |
| 51 | int count = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 52 | |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 53 | if (vrf_bitmap_check (zclient->redist[ZEBRA_ROUTE_RIP], VRF_DEFAULT)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 54 | { |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 55 | api.vrf_id = VRF_DEFAULT; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 56 | api.type = ZEBRA_ROUTE_RIP; |
| 57 | api.flags = 0; |
| 58 | api.message = 0; |
Denis Ovsienko | b4e45f6 | 2011-12-05 16:35:14 +0400 | [diff] [blame] | 59 | api.safi = SAFI_UNICAST; |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 60 | |
| 61 | if (nexthops_len < listcount (list)) |
| 62 | { |
| 63 | nexthops_len = listcount (list); |
| 64 | nexthops = XREALLOC (MTYPE_TMP, nexthops, |
| 65 | nexthops_len * sizeof (struct in_addr *)); |
| 66 | } |
| 67 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 68 | SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 69 | for (ALL_LIST_ELEMENTS_RO (list, listnode, rinfo)) |
| 70 | { |
| 71 | nexthops[count++] = &rinfo->nexthop; |
| 72 | if (cmd == ZEBRA_IPV4_ROUTE_ADD) |
| 73 | SET_FLAG (rinfo->flags, RIP_RTF_FIB); |
| 74 | else |
| 75 | UNSET_FLAG (rinfo->flags, RIP_RTF_FIB); |
| 76 | } |
| 77 | |
| 78 | api.nexthop = nexthops; |
| 79 | api.nexthop_num = count; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 80 | api.ifindex_num = 0; |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 81 | |
| 82 | rinfo = listgetdata (listhead (list)); |
| 83 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 84 | SET_FLAG (api.message, ZAPI_MESSAGE_METRIC); |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 85 | api.metric = rinfo->metric; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 86 | |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 87 | if (rinfo->distance && rinfo->distance != ZEBRA_RIP_DISTANCE_DEFAULT) |
| 88 | { |
| 89 | SET_FLAG (api.message, ZAPI_MESSAGE_DISTANCE); |
| 90 | api.distance = rinfo->distance; |
| 91 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 92 | |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 93 | zapi_ipv4_route (cmd, zclient, |
| 94 | (struct prefix_ipv4 *)&rp->p, &api); |
| 95 | |
| 96 | if (IS_RIP_DEBUG_ZEBRA) |
Lu Feng | 0b74a0a | 2014-07-18 06:13:19 +0000 | [diff] [blame] | 97 | { |
| 98 | if (rip->ecmp) |
| 99 | zlog_debug ("%s: %s/%d nexthops %d", |
| 100 | (cmd == ZEBRA_IPV4_ROUTE_ADD) ? \ |
| 101 | "Install into zebra" : "Delete from zebra", |
| 102 | inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen, count); |
| 103 | else |
| 104 | zlog_debug ("%s: %s/%d", |
| 105 | (cmd == ZEBRA_IPV4_ROUTE_ADD) ? \ |
| 106 | "Install into zebra" : "Delete from zebra", |
| 107 | inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen); |
| 108 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 109 | |
| 110 | rip_global_route_changes++; |
| 111 | } |
| 112 | } |
| 113 | |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 114 | /* Add/update ECMP routes to zebra. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 115 | void |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 116 | rip_zebra_ipv4_add (struct route_node *rp) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 117 | { |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 118 | rip_zebra_ipv4_send (rp, ZEBRA_IPV4_ROUTE_ADD); |
| 119 | } |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 120 | |
Lu Feng | b397cf4 | 2014-07-18 06:13:18 +0000 | [diff] [blame] | 121 | /* Delete ECMP routes from zebra. */ |
| 122 | void |
| 123 | rip_zebra_ipv4_delete (struct route_node *rp) |
| 124 | { |
| 125 | rip_zebra_ipv4_send (rp, ZEBRA_IPV4_ROUTE_DELETE); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | /* Zebra route add and delete treatment. */ |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 129 | static int |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 130 | rip_zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length, |
| 131 | vrf_id_t vrf_id) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 132 | { |
| 133 | struct stream *s; |
| 134 | struct zapi_ipv4 api; |
| 135 | unsigned long ifindex; |
| 136 | struct in_addr nexthop; |
| 137 | struct prefix_ipv4 p; |
| 138 | |
| 139 | s = zclient->ibuf; |
| 140 | ifindex = 0; |
| 141 | nexthop.s_addr = 0; |
| 142 | |
| 143 | /* Type, flags, message. */ |
| 144 | api.type = stream_getc (s); |
| 145 | api.flags = stream_getc (s); |
| 146 | api.message = stream_getc (s); |
| 147 | |
| 148 | /* IPv4 prefix. */ |
| 149 | memset (&p, 0, sizeof (struct prefix_ipv4)); |
| 150 | p.family = AF_INET; |
| 151 | p.prefixlen = stream_getc (s); |
| 152 | stream_get (&p.prefix, s, PSIZE (p.prefixlen)); |
| 153 | |
| 154 | /* Nexthop, ifindex, distance, metric. */ |
| 155 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP)) |
| 156 | { |
| 157 | api.nexthop_num = stream_getc (s); |
| 158 | nexthop.s_addr = stream_get_ipv4 (s); |
| 159 | } |
| 160 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX)) |
| 161 | { |
| 162 | api.ifindex_num = stream_getc (s); |
| 163 | ifindex = stream_getl (s); |
| 164 | } |
| 165 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE)) |
| 166 | api.distance = stream_getc (s); |
vincent | fbf5d03 | 2005-09-29 11:25:50 +0000 | [diff] [blame] | 167 | else |
| 168 | api.distance = 255; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 169 | if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC)) |
| 170 | api.metric = stream_getl (s); |
vincent | fbf5d03 | 2005-09-29 11:25:50 +0000 | [diff] [blame] | 171 | else |
| 172 | api.metric = 0; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 173 | |
| 174 | /* Then fetch IPv4 prefixes. */ |
| 175 | if (command == ZEBRA_IPV4_ROUTE_ADD) |
vincent | fbf5d03 | 2005-09-29 11:25:50 +0000 | [diff] [blame] | 176 | rip_redistribute_add (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex, |
| 177 | &nexthop, api.metric, api.distance); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 178 | else |
| 179 | rip_redistribute_delete (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex); |
| 180 | |
| 181 | return 0; |
| 182 | } |
| 183 | |
| 184 | void |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 185 | rip_zclient_reset (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 186 | { |
| 187 | zclient_reset (zclient); |
| 188 | } |
| 189 | |
| 190 | /* RIP route-map set for redistribution */ |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 191 | static void |
hasso | 98b718a | 2004-10-11 12:57:57 +0000 | [diff] [blame] | 192 | rip_routemap_set (int type, const char *name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 193 | { |
| 194 | if (rip->route_map[type].name) |
| 195 | free(rip->route_map[type].name); |
| 196 | |
| 197 | rip->route_map[type].name = strdup (name); |
| 198 | rip->route_map[type].map = route_map_lookup_by_name (name); |
| 199 | } |
| 200 | |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 201 | static void |
hasso | 8a676be | 2004-10-08 06:36:38 +0000 | [diff] [blame] | 202 | rip_redistribute_metric_set (int type, unsigned int metric) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 203 | { |
| 204 | rip->route_map[type].metric_config = 1; |
| 205 | rip->route_map[type].metric = metric; |
| 206 | } |
| 207 | |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 208 | static int |
hasso | 8a676be | 2004-10-08 06:36:38 +0000 | [diff] [blame] | 209 | rip_metric_unset (int type, unsigned int metric) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 210 | { |
| 211 | #define DONT_CARE_METRIC_RIP 17 |
| 212 | if (metric != DONT_CARE_METRIC_RIP && |
| 213 | rip->route_map[type].metric != metric) |
| 214 | return 1; |
| 215 | rip->route_map[type].metric_config = 0; |
| 216 | rip->route_map[type].metric = 0; |
| 217 | return 0; |
| 218 | } |
| 219 | |
| 220 | /* RIP route-map unset for redistribution */ |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 221 | static int |
hasso | 98b718a | 2004-10-11 12:57:57 +0000 | [diff] [blame] | 222 | rip_routemap_unset (int type, const char *name) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 223 | { |
| 224 | if (! rip->route_map[type].name || |
| 225 | (name != NULL && strcmp(rip->route_map[type].name,name))) |
| 226 | return 1; |
| 227 | |
| 228 | free (rip->route_map[type].name); |
| 229 | rip->route_map[type].name = NULL; |
| 230 | rip->route_map[type].map = NULL; |
| 231 | |
| 232 | return 0; |
| 233 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 234 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 235 | /* Redistribution types */ |
| 236 | static struct { |
| 237 | int type; |
| 238 | int str_min_len; |
hasso | 8a676be | 2004-10-08 06:36:38 +0000 | [diff] [blame] | 239 | const char *str; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 240 | } redist_type[] = { |
| 241 | {ZEBRA_ROUTE_KERNEL, 1, "kernel"}, |
| 242 | {ZEBRA_ROUTE_CONNECT, 1, "connected"}, |
| 243 | {ZEBRA_ROUTE_STATIC, 1, "static"}, |
| 244 | {ZEBRA_ROUTE_OSPF, 1, "ospf"}, |
Matthieu Boutier | 9c58fbd | 2012-02-09 21:51:17 +0100 | [diff] [blame] | 245 | {ZEBRA_ROUTE_BGP, 2, "bgp"}, |
| 246 | {ZEBRA_ROUTE_BABEL, 2, "babel"}, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 247 | {0, 0, NULL} |
| 248 | }; |
| 249 | |
| 250 | DEFUN (router_zebra, |
| 251 | router_zebra_cmd, |
| 252 | "router zebra", |
| 253 | "Enable a routing process\n" |
| 254 | "Make connection to zebra daemon\n") |
| 255 | { |
| 256 | vty->node = ZEBRA_NODE; |
| 257 | zclient->enable = 1; |
| 258 | zclient_start (zclient); |
| 259 | return CMD_SUCCESS; |
| 260 | } |
| 261 | |
| 262 | DEFUN (no_router_zebra, |
| 263 | no_router_zebra_cmd, |
| 264 | "no router zebra", |
| 265 | NO_STR |
| 266 | "Enable a routing process\n" |
| 267 | "Make connection to zebra daemon\n") |
| 268 | { |
| 269 | zclient->enable = 0; |
| 270 | zclient_stop (zclient); |
| 271 | return CMD_SUCCESS; |
| 272 | } |
| 273 | |
Stephen Hemminger | 2c23970 | 2009-12-10 19:16:05 +0300 | [diff] [blame] | 274 | #if 0 |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 275 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 276 | rip_redistribute_set (int type) |
| 277 | { |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 278 | if (vrf_bitmap_check (zclient->redist[type], VRF_DEFAULT)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 279 | return CMD_SUCCESS; |
| 280 | |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 281 | vrf_bitmap_set (zclient->redist[type], VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 282 | |
| 283 | if (zclient->sock > 0) |
ajs | 634f9ea | 2005-04-11 15:51:40 +0000 | [diff] [blame] | 284 | zebra_redistribute_send (ZEBRA_REDISTRIBUTE_ADD, zclient, type); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 285 | |
| 286 | return CMD_SUCCESS; |
| 287 | } |
Stephen Hemminger | 2c23970 | 2009-12-10 19:16:05 +0300 | [diff] [blame] | 288 | #endif |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 289 | |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 290 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 291 | rip_redistribute_unset (int type) |
| 292 | { |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 293 | if (! vrf_bitmap_check (zclient->redist[type], VRF_DEFAULT)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 294 | return CMD_SUCCESS; |
| 295 | |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 296 | vrf_bitmap_unset (zclient->redist[type], VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 297 | |
| 298 | if (zclient->sock > 0) |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 299 | zebra_redistribute_send (ZEBRA_REDISTRIBUTE_DELETE, zclient, type, |
| 300 | VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 301 | |
| 302 | /* Remove the routes from RIP table. */ |
| 303 | rip_redistribute_withdraw (type); |
| 304 | |
| 305 | return CMD_SUCCESS; |
| 306 | } |
| 307 | |
| 308 | int |
| 309 | rip_redistribute_check (int type) |
| 310 | { |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 311 | return vrf_bitmap_check (zclient->redist[type], VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | void |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 315 | rip_redistribute_clean (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 316 | { |
| 317 | int i; |
| 318 | |
| 319 | for (i = 0; redist_type[i].str; i++) |
| 320 | { |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 321 | if (vrf_bitmap_check (zclient->redist[redist_type[i].type], VRF_DEFAULT)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 322 | { |
| 323 | if (zclient->sock > 0) |
| 324 | zebra_redistribute_send (ZEBRA_REDISTRIBUTE_DELETE, |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 325 | zclient, redist_type[i].type, |
| 326 | VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 327 | |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 328 | vrf_bitmap_unset (zclient->redist[redist_type[i].type], VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 329 | |
| 330 | /* Remove the routes from RIP table. */ |
| 331 | rip_redistribute_withdraw (redist_type[i].type); |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | DEFUN (rip_redistribute_rip, |
| 337 | rip_redistribute_rip_cmd, |
| 338 | "redistribute rip", |
| 339 | "Redistribute information from another routing protocol\n" |
| 340 | "Routing Information Protocol (RIP)\n") |
| 341 | { |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 342 | vrf_bitmap_set (zclient->redist[ZEBRA_ROUTE_RIP], VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 343 | return CMD_SUCCESS; |
| 344 | } |
| 345 | |
| 346 | DEFUN (no_rip_redistribute_rip, |
| 347 | no_rip_redistribute_rip_cmd, |
| 348 | "no redistribute rip", |
| 349 | NO_STR |
| 350 | "Redistribute information from another routing protocol\n" |
| 351 | "Routing Information Protocol (RIP)\n") |
| 352 | { |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 353 | vrf_bitmap_unset (zclient->redist[ZEBRA_ROUTE_RIP], VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 354 | return CMD_SUCCESS; |
| 355 | } |
| 356 | |
| 357 | DEFUN (rip_redistribute_type, |
| 358 | rip_redistribute_type_cmd, |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 359 | "redistribute " QUAGGA_REDIST_STR_RIPD, |
| 360 | REDIST_STR |
| 361 | QUAGGA_REDIST_HELP_STR_RIPD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 362 | { |
| 363 | int i; |
| 364 | |
| 365 | for(i = 0; redist_type[i].str; i++) |
| 366 | { |
| 367 | if (strncmp (redist_type[i].str, argv[0], |
| 368 | redist_type[i].str_min_len) == 0) |
| 369 | { |
paul | 0a58935 | 2004-05-08 11:48:26 +0000 | [diff] [blame] | 370 | zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 371 | redist_type[i].type, VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 372 | return CMD_SUCCESS; |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | vty_out(vty, "Invalid type %s%s", argv[0], |
| 377 | VTY_NEWLINE); |
| 378 | |
| 379 | return CMD_WARNING; |
| 380 | } |
| 381 | |
| 382 | DEFUN (no_rip_redistribute_type, |
| 383 | no_rip_redistribute_type_cmd, |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 384 | "no redistribute " QUAGGA_REDIST_STR_RIPD, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 385 | NO_STR |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 386 | REDIST_STR |
| 387 | QUAGGA_REDIST_HELP_STR_RIPD) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 388 | { |
| 389 | int i; |
| 390 | |
| 391 | for (i = 0; redist_type[i].str; i++) |
| 392 | { |
| 393 | if (strncmp(redist_type[i].str, argv[0], |
| 394 | redist_type[i].str_min_len) == 0) |
| 395 | { |
| 396 | rip_metric_unset (redist_type[i].type, DONT_CARE_METRIC_RIP); |
| 397 | rip_routemap_unset (redist_type[i].type,NULL); |
| 398 | rip_redistribute_unset (redist_type[i].type); |
| 399 | return CMD_SUCCESS; |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | vty_out(vty, "Invalid type %s%s", argv[0], |
| 404 | VTY_NEWLINE); |
| 405 | |
| 406 | return CMD_WARNING; |
| 407 | } |
| 408 | |
| 409 | DEFUN (rip_redistribute_type_routemap, |
| 410 | rip_redistribute_type_routemap_cmd, |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 411 | "redistribute " QUAGGA_REDIST_STR_RIPD " route-map WORD", |
| 412 | REDIST_STR |
| 413 | QUAGGA_REDIST_HELP_STR_RIPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 414 | "Route map reference\n" |
| 415 | "Pointer to route-map entries\n") |
| 416 | { |
| 417 | int i; |
| 418 | |
| 419 | for (i = 0; redist_type[i].str; i++) { |
| 420 | if (strncmp(redist_type[i].str, argv[0], |
| 421 | redist_type[i].str_min_len) == 0) |
| 422 | { |
| 423 | rip_routemap_set (redist_type[i].type, argv[1]); |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 424 | zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, redist_type[i].type, |
| 425 | VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 426 | return CMD_SUCCESS; |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | vty_out(vty, "Invalid type %s%s", argv[0], |
| 431 | VTY_NEWLINE); |
| 432 | |
| 433 | return CMD_WARNING; |
| 434 | } |
| 435 | |
| 436 | DEFUN (no_rip_redistribute_type_routemap, |
| 437 | no_rip_redistribute_type_routemap_cmd, |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 438 | "no redistribute " QUAGGA_REDIST_STR_RIPD " route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 439 | NO_STR |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 440 | REDIST_STR |
| 441 | QUAGGA_REDIST_HELP_STR_RIPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 442 | "Route map reference\n" |
| 443 | "Pointer to route-map entries\n") |
| 444 | { |
| 445 | int i; |
| 446 | |
| 447 | for (i = 0; redist_type[i].str; i++) |
| 448 | { |
| 449 | if (strncmp(redist_type[i].str, argv[0], |
| 450 | redist_type[i].str_min_len) == 0) |
| 451 | { |
| 452 | if (rip_routemap_unset (redist_type[i].type,argv[1])) |
| 453 | return CMD_WARNING; |
| 454 | rip_redistribute_unset (redist_type[i].type); |
| 455 | return CMD_SUCCESS; |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | vty_out(vty, "Invalid type %s%s", argv[0], |
| 460 | VTY_NEWLINE); |
| 461 | |
| 462 | return CMD_WARNING; |
| 463 | } |
| 464 | |
| 465 | DEFUN (rip_redistribute_type_metric, |
| 466 | rip_redistribute_type_metric_cmd, |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 467 | "redistribute " QUAGGA_REDIST_STR_RIPD " metric <0-16>", |
| 468 | REDIST_STR |
| 469 | QUAGGA_REDIST_HELP_STR_RIPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 470 | "Metric\n" |
| 471 | "Metric value\n") |
| 472 | { |
| 473 | int i; |
| 474 | int metric; |
| 475 | |
| 476 | metric = atoi (argv[1]); |
| 477 | |
| 478 | for (i = 0; redist_type[i].str; i++) { |
| 479 | if (strncmp(redist_type[i].str, argv[0], |
| 480 | redist_type[i].str_min_len) == 0) |
| 481 | { |
| 482 | rip_redistribute_metric_set (redist_type[i].type, metric); |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 483 | zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, redist_type[i].type, |
| 484 | VRF_DEFAULT); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 485 | return CMD_SUCCESS; |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | vty_out(vty, "Invalid type %s%s", argv[0], |
| 490 | VTY_NEWLINE); |
| 491 | |
| 492 | return CMD_WARNING; |
| 493 | } |
| 494 | |
| 495 | DEFUN (no_rip_redistribute_type_metric, |
| 496 | no_rip_redistribute_type_metric_cmd, |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 497 | "no redistribute " QUAGGA_REDIST_STR_RIPD " metric <0-16>", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 498 | NO_STR |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 499 | REDIST_STR |
| 500 | QUAGGA_REDIST_HELP_STR_RIPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 501 | "Metric\n" |
| 502 | "Metric value\n") |
| 503 | { |
| 504 | int i; |
| 505 | |
| 506 | for (i = 0; redist_type[i].str; i++) |
| 507 | { |
| 508 | if (strncmp(redist_type[i].str, argv[0], |
| 509 | redist_type[i].str_min_len) == 0) |
| 510 | { |
| 511 | if (rip_metric_unset (redist_type[i].type, atoi(argv[1]))) |
| 512 | return CMD_WARNING; |
| 513 | rip_redistribute_unset (redist_type[i].type); |
| 514 | return CMD_SUCCESS; |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | vty_out(vty, "Invalid type %s%s", argv[0], |
| 519 | VTY_NEWLINE); |
| 520 | |
| 521 | return CMD_WARNING; |
| 522 | } |
| 523 | |
hasso | 1670513 | 2003-05-25 14:49:19 +0000 | [diff] [blame] | 524 | DEFUN (rip_redistribute_type_metric_routemap, |
| 525 | rip_redistribute_type_metric_routemap_cmd, |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 526 | "redistribute " QUAGGA_REDIST_STR_RIPD " metric <0-16> route-map WORD", |
| 527 | REDIST_STR |
| 528 | QUAGGA_REDIST_HELP_STR_RIPD |
hasso | 1670513 | 2003-05-25 14:49:19 +0000 | [diff] [blame] | 529 | "Metric\n" |
| 530 | "Metric value\n" |
| 531 | "Route map reference\n" |
| 532 | "Pointer to route-map entries\n") |
| 533 | { |
| 534 | int i; |
| 535 | int metric; |
| 536 | |
| 537 | metric = atoi (argv[1]); |
| 538 | |
| 539 | for (i = 0; redist_type[i].str; i++) { |
| 540 | if (strncmp(redist_type[i].str, argv[0], |
| 541 | redist_type[i].str_min_len) == 0) |
| 542 | { |
| 543 | rip_redistribute_metric_set (redist_type[i].type, metric); |
| 544 | rip_routemap_set (redist_type[i].type, argv[2]); |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 545 | zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, redist_type[i].type, |
| 546 | VRF_DEFAULT); |
hasso | 1670513 | 2003-05-25 14:49:19 +0000 | [diff] [blame] | 547 | return CMD_SUCCESS; |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | vty_out(vty, "Invalid type %s%s", argv[0], |
| 552 | VTY_NEWLINE); |
| 553 | |
| 554 | return CMD_WARNING; |
| 555 | } |
| 556 | |
| 557 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 558 | DEFUN (no_rip_redistribute_type_metric_routemap, |
| 559 | no_rip_redistribute_type_metric_routemap_cmd, |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 560 | "no redistribute " QUAGGA_REDIST_STR_RIPD |
| 561 | " metric <0-16> route-map WORD", |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 562 | NO_STR |
Paul Jakma | 9a57dc6 | 2006-06-30 16:58:53 +0000 | [diff] [blame] | 563 | REDIST_STR |
| 564 | QUAGGA_REDIST_HELP_STR_RIPD |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 565 | "Metric\n" |
| 566 | "Metric value\n" |
| 567 | "Route map reference\n" |
| 568 | "Pointer to route-map entries\n") |
| 569 | { |
| 570 | int i; |
| 571 | |
| 572 | for (i = 0; redist_type[i].str; i++) |
| 573 | { |
| 574 | if (strncmp(redist_type[i].str, argv[0], |
| 575 | redist_type[i].str_min_len) == 0) |
| 576 | { |
| 577 | if (rip_metric_unset (redist_type[i].type, atoi(argv[1]))) |
| 578 | return CMD_WARNING; |
| 579 | if (rip_routemap_unset (redist_type[i].type, argv[2])) |
| 580 | { |
| 581 | rip_redistribute_metric_set(redist_type[i].type, atoi(argv[1])); |
| 582 | return CMD_WARNING; |
| 583 | } |
| 584 | rip_redistribute_unset (redist_type[i].type); |
| 585 | return CMD_SUCCESS; |
| 586 | } |
| 587 | } |
| 588 | |
| 589 | vty_out(vty, "Invalid type %s%s", argv[0], |
| 590 | VTY_NEWLINE); |
| 591 | |
| 592 | return CMD_WARNING; |
| 593 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 594 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 595 | /* Default information originate. */ |
| 596 | |
| 597 | DEFUN (rip_default_information_originate, |
| 598 | rip_default_information_originate_cmd, |
| 599 | "default-information originate", |
| 600 | "Control distribution of default route\n" |
| 601 | "Distribute a default route\n") |
| 602 | { |
| 603 | struct prefix_ipv4 p; |
| 604 | |
| 605 | if (! rip->default_information) |
| 606 | { |
| 607 | memset (&p, 0, sizeof (struct prefix_ipv4)); |
| 608 | p.family = AF_INET; |
| 609 | |
| 610 | rip->default_information = 1; |
| 611 | |
vincent | fbf5d03 | 2005-09-29 11:25:50 +0000 | [diff] [blame] | 612 | rip_redistribute_add (ZEBRA_ROUTE_RIP, RIP_ROUTE_DEFAULT, &p, 0, |
| 613 | NULL, 0, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 614 | } |
| 615 | |
| 616 | return CMD_SUCCESS; |
| 617 | } |
| 618 | |
| 619 | DEFUN (no_rip_default_information_originate, |
| 620 | no_rip_default_information_originate_cmd, |
| 621 | "no default-information originate", |
| 622 | NO_STR |
| 623 | "Control distribution of default route\n" |
| 624 | "Distribute a default route\n") |
| 625 | { |
| 626 | struct prefix_ipv4 p; |
| 627 | |
| 628 | if (rip->default_information) |
| 629 | { |
| 630 | memset (&p, 0, sizeof (struct prefix_ipv4)); |
| 631 | p.family = AF_INET; |
| 632 | |
| 633 | rip->default_information = 0; |
| 634 | |
hasso | 1670513 | 2003-05-25 14:49:19 +0000 | [diff] [blame] | 635 | rip_redistribute_delete (ZEBRA_ROUTE_RIP, RIP_ROUTE_DEFAULT, &p, 0); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 636 | } |
| 637 | |
| 638 | return CMD_SUCCESS; |
| 639 | } |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 640 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 641 | /* RIP configuration write function. */ |
paul | dc63bfd | 2005-10-25 23:31:05 +0000 | [diff] [blame] | 642 | static int |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 643 | config_write_zebra (struct vty *vty) |
| 644 | { |
| 645 | if (! zclient->enable) |
| 646 | { |
| 647 | vty_out (vty, "no router zebra%s", VTY_NEWLINE); |
| 648 | return 1; |
| 649 | } |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 650 | else if (! vrf_bitmap_check (zclient->redist[ZEBRA_ROUTE_RIP], VRF_DEFAULT)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 651 | { |
| 652 | vty_out (vty, "router zebra%s", VTY_NEWLINE); |
| 653 | vty_out (vty, " no redistribute rip%s", VTY_NEWLINE); |
| 654 | return 1; |
| 655 | } |
| 656 | return 0; |
| 657 | } |
| 658 | |
| 659 | int |
| 660 | config_write_rip_redistribute (struct vty *vty, int config_mode) |
| 661 | { |
| 662 | int i; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 663 | |
| 664 | for (i = 0; i < ZEBRA_ROUTE_MAX; i++) |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 665 | if (i != zclient->redist_default && |
| 666 | vrf_bitmap_check (zclient->redist[i], VRF_DEFAULT)) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 667 | { |
| 668 | if (config_mode) |
| 669 | { |
| 670 | if (rip->route_map[i].metric_config) |
| 671 | { |
| 672 | if (rip->route_map[i].name) |
| 673 | vty_out (vty, " redistribute %s metric %d route-map %s%s", |
ajs | f52d13c | 2005-10-01 17:38:06 +0000 | [diff] [blame] | 674 | zebra_route_string(i), rip->route_map[i].metric, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 675 | rip->route_map[i].name, |
| 676 | VTY_NEWLINE); |
| 677 | else |
| 678 | vty_out (vty, " redistribute %s metric %d%s", |
ajs | f52d13c | 2005-10-01 17:38:06 +0000 | [diff] [blame] | 679 | zebra_route_string(i), rip->route_map[i].metric, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 680 | VTY_NEWLINE); |
| 681 | } |
| 682 | else |
| 683 | { |
| 684 | if (rip->route_map[i].name) |
| 685 | vty_out (vty, " redistribute %s route-map %s%s", |
ajs | f52d13c | 2005-10-01 17:38:06 +0000 | [diff] [blame] | 686 | zebra_route_string(i), rip->route_map[i].name, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 687 | VTY_NEWLINE); |
| 688 | else |
ajs | f52d13c | 2005-10-01 17:38:06 +0000 | [diff] [blame] | 689 | vty_out (vty, " redistribute %s%s", zebra_route_string(i), |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 690 | VTY_NEWLINE); |
| 691 | } |
| 692 | } |
| 693 | else |
ajs | f52d13c | 2005-10-01 17:38:06 +0000 | [diff] [blame] | 694 | vty_out (vty, " %s", zebra_route_string(i)); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 695 | } |
| 696 | return 0; |
| 697 | } |
| 698 | |
| 699 | /* Zebra node structure. */ |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 700 | static struct cmd_node zebra_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 701 | { |
| 702 | ZEBRA_NODE, |
| 703 | "%s(config-router)# ", |
| 704 | }; |
| 705 | |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 706 | static void |
| 707 | rip_zebra_connected (struct zclient *zclient) |
| 708 | { |
| 709 | zclient_send_requests (zclient, VRF_DEFAULT); |
| 710 | } |
| 711 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 712 | void |
| 713 | rip_zclient_init () |
| 714 | { |
| 715 | /* Set default value to the zebra client structure. */ |
| 716 | zclient = zclient_new (); |
| 717 | zclient_init (zclient, ZEBRA_ROUTE_RIP); |
Feng Lu | c99f348 | 2014-10-16 09:52:36 +0800 | [diff] [blame] | 718 | zclient->zebra_connected = rip_zebra_connected; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 719 | zclient->interface_add = rip_interface_add; |
| 720 | zclient->interface_delete = rip_interface_delete; |
| 721 | zclient->interface_address_add = rip_interface_address_add; |
| 722 | zclient->interface_address_delete = rip_interface_address_delete; |
| 723 | zclient->ipv4_route_add = rip_zebra_read_ipv4; |
| 724 | zclient->ipv4_route_delete = rip_zebra_read_ipv4; |
| 725 | zclient->interface_up = rip_interface_up; |
| 726 | zclient->interface_down = rip_interface_down; |
| 727 | |
| 728 | /* Install zebra node. */ |
| 729 | install_node (&zebra_node, config_write_zebra); |
| 730 | |
| 731 | /* Install command elements to zebra node. */ |
| 732 | install_element (CONFIG_NODE, &router_zebra_cmd); |
| 733 | install_element (CONFIG_NODE, &no_router_zebra_cmd); |
| 734 | install_default (ZEBRA_NODE); |
| 735 | install_element (ZEBRA_NODE, &rip_redistribute_rip_cmd); |
| 736 | install_element (ZEBRA_NODE, &no_rip_redistribute_rip_cmd); |
| 737 | |
| 738 | /* Install command elements to rip node. */ |
| 739 | install_element (RIP_NODE, &rip_redistribute_type_cmd); |
| 740 | install_element (RIP_NODE, &rip_redistribute_type_routemap_cmd); |
| 741 | install_element (RIP_NODE, &rip_redistribute_type_metric_cmd); |
hasso | 1670513 | 2003-05-25 14:49:19 +0000 | [diff] [blame] | 742 | install_element (RIP_NODE, &rip_redistribute_type_metric_routemap_cmd); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 743 | install_element (RIP_NODE, &no_rip_redistribute_type_cmd); |
| 744 | install_element (RIP_NODE, &no_rip_redistribute_type_routemap_cmd); |
| 745 | install_element (RIP_NODE, &no_rip_redistribute_type_metric_cmd); |
| 746 | install_element (RIP_NODE, &no_rip_redistribute_type_metric_routemap_cmd); |
| 747 | install_element (RIP_NODE, &rip_default_information_originate_cmd); |
| 748 | install_element (RIP_NODE, &no_rip_default_information_originate_cmd); |
| 749 | } |