123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762 |
- /* RIPd and zebra interface.
- * Copyright (C) 1997, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING. If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
- #include <zebra.h>
- #include "command.h"
- #include "prefix.h"
- #include "table.h"
- #include "stream.h"
- #include "memory.h"
- #include "routemap.h"
- #include "zclient.h"
- #include "log.h"
- #include "vrf.h"
- #include "ripd/ripd.h"
- #include "ripd/rip_debug.h"
- #include "ripd/rip_interface.h"
- /* All information about zebra. */
- struct zclient *zclient = NULL;
- /* Send ECMP routes to zebra. */
- static void
- rip_zebra_ipv4_send (struct route_node *rp, u_char cmd)
- {
- static struct in_addr **nexthops = NULL;
- static unsigned int nexthops_len = 0;
- struct list *list = (struct list *)rp->info;
- struct zapi_ipv4 api;
- struct listnode *listnode = NULL;
- struct rip_info *rinfo = NULL;
- int count = 0;
- if (vrf_bitmap_check (zclient->redist[ZEBRA_ROUTE_RIP], VRF_DEFAULT))
- {
- api.vrf_id = VRF_DEFAULT;
- api.type = ZEBRA_ROUTE_RIP;
- api.flags = 0;
- api.message = 0;
- api.safi = SAFI_UNICAST;
- if (nexthops_len < listcount (list))
- {
- nexthops_len = listcount (list);
- nexthops = XREALLOC (MTYPE_TMP, nexthops,
- nexthops_len * sizeof (struct in_addr *));
- }
- SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
- for (ALL_LIST_ELEMENTS_RO (list, listnode, rinfo))
- {
- nexthops[count++] = &rinfo->nexthop;
- if (cmd == ZEBRA_IPV4_ROUTE_ADD)
- SET_FLAG (rinfo->flags, RIP_RTF_FIB);
- else
- UNSET_FLAG (rinfo->flags, RIP_RTF_FIB);
- }
- api.nexthop = nexthops;
- api.nexthop_num = count;
- api.ifindex_num = 0;
- rinfo = listgetdata (listhead (list));
- SET_FLAG (api.message, ZAPI_MESSAGE_METRIC);
- api.metric = rinfo->metric;
- if (rinfo->distance && rinfo->distance != ZEBRA_RIP_DISTANCE_DEFAULT)
- {
- SET_FLAG (api.message, ZAPI_MESSAGE_DISTANCE);
- api.distance = rinfo->distance;
- }
- if (rinfo->tag)
- {
- SET_FLAG (api.message, ZAPI_MESSAGE_TAG);
- api.tag = rinfo->tag;
- }
- zapi_ipv4_route (cmd, zclient,
- (struct prefix_ipv4 *)&rp->p, &api);
- if (IS_RIP_DEBUG_ZEBRA)
- {
- if (rip->ecmp)
- zlog_debug ("%s: %s/%d nexthops %d",
- (cmd == ZEBRA_IPV4_ROUTE_ADD) ? \
- "Install into zebra" : "Delete from zebra",
- inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen, count);
- else
- zlog_debug ("%s: %s/%d",
- (cmd == ZEBRA_IPV4_ROUTE_ADD) ? \
- "Install into zebra" : "Delete from zebra",
- inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen);
- }
- rip_global_route_changes++;
- }
- }
- /* Add/update ECMP routes to zebra. */
- void
- rip_zebra_ipv4_add (struct route_node *rp)
- {
- rip_zebra_ipv4_send (rp, ZEBRA_IPV4_ROUTE_ADD);
- }
- /* Delete ECMP routes from zebra. */
- void
- rip_zebra_ipv4_delete (struct route_node *rp)
- {
- rip_zebra_ipv4_send (rp, ZEBRA_IPV4_ROUTE_DELETE);
- }
- /* Zebra route add and delete treatment. */
- static int
- rip_zebra_read_ipv4 (int command, struct zclient *zclient, zebra_size_t length,
- vrf_id_t vrf_id)
- {
- struct stream *s;
- struct zapi_ipv4 api;
- unsigned long ifindex;
- struct in_addr nexthop;
- struct prefix_ipv4 p;
- unsigned char plength = 0;
- s = zclient->ibuf;
- ifindex = 0;
- nexthop.s_addr = 0;
- /* Type, flags, message. */
- api.type = stream_getc (s);
- api.flags = stream_getc (s);
- api.message = stream_getc (s);
- /* IPv4 prefix. */
- memset (&p, 0, sizeof (struct prefix_ipv4));
- p.family = AF_INET;
- plength = stream_getc (s);
- p.prefixlen = MIN(IPV4_MAX_PREFIXLEN, plength);
- stream_get (&p.prefix, s, PSIZE (p.prefixlen));
- /* Nexthop, ifindex, distance, metric. */
- if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP))
- {
- api.nexthop_num = stream_getc (s);
- nexthop.s_addr = stream_get_ipv4 (s);
- }
- if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX))
- {
- api.ifindex_num = stream_getc (s);
- ifindex = stream_getl (s);
- }
- if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE))
- api.distance = stream_getc (s);
- else
- api.distance = 255;
- if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC))
- api.metric = stream_getl (s);
- else
- api.metric = 0;
- if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
- api.tag = stream_getl (s);
- else
- api.tag = 0;
- /* Then fetch IPv4 prefixes. */
- if (command == ZEBRA_IPV4_ROUTE_ADD)
- rip_redistribute_add (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex,
- &nexthop, api.metric, api.distance, api.tag);
- else
- rip_redistribute_delete (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex);
- return 0;
- }
- void
- rip_zclient_reset (void)
- {
- zclient_reset (zclient);
- }
- /* RIP route-map set for redistribution */
- static void
- rip_routemap_set (int type, const char *name)
- {
- if (rip->route_map[type].name)
- free(rip->route_map[type].name);
- rip->route_map[type].name = strdup (name);
- rip->route_map[type].map = route_map_lookup_by_name (name);
- }
- static void
- rip_redistribute_metric_set (int type, unsigned int metric)
- {
- rip->route_map[type].metric_config = 1;
- rip->route_map[type].metric = metric;
- }
- static int
- rip_metric_unset (int type, unsigned int metric)
- {
- #define DONT_CARE_METRIC_RIP 17
- if (metric != DONT_CARE_METRIC_RIP &&
- rip->route_map[type].metric != metric)
- return 1;
- rip->route_map[type].metric_config = 0;
- rip->route_map[type].metric = 0;
- return 0;
- }
- /* RIP route-map unset for redistribution */
- static int
- rip_routemap_unset (int type, const char *name)
- {
- if (! rip->route_map[type].name ||
- (name != NULL && strcmp(rip->route_map[type].name,name)))
- return 1;
- free (rip->route_map[type].name);
- rip->route_map[type].name = NULL;
- rip->route_map[type].map = NULL;
- return 0;
- }
- /* Redistribution types */
- static struct {
- int type;
- int str_min_len;
- const char *str;
- } redist_type[] = {
- {ZEBRA_ROUTE_KERNEL, 1, "kernel"},
- {ZEBRA_ROUTE_CONNECT, 1, "connected"},
- {ZEBRA_ROUTE_STATIC, 1, "static"},
- {ZEBRA_ROUTE_OSPF, 1, "ospf"},
- {ZEBRA_ROUTE_BGP, 2, "bgp"},
- {ZEBRA_ROUTE_BABEL, 2, "babel"},
- {0, 0, NULL}
- };
- DEFUN (router_zebra,
- router_zebra_cmd,
- "router zebra",
- "Enable a routing process\n"
- "Make connection to zebra daemon\n")
- {
- vty->node = ZEBRA_NODE;
- zclient->enable = 1;
- zclient_start (zclient);
- return CMD_SUCCESS;
- }
- DEFUN (no_router_zebra,
- no_router_zebra_cmd,
- "no router zebra",
- NO_STR
- "Enable a routing process\n"
- "Make connection to zebra daemon\n")
- {
- zclient->enable = 0;
- zclient_stop (zclient);
- return CMD_SUCCESS;
- }
- #if 0
- static int
- rip_redistribute_set (int type)
- {
- if (vrf_bitmap_check (zclient->redist[type], VRF_DEFAULT))
- return CMD_SUCCESS;
- vrf_bitmap_set (zclient->redist[type], VRF_DEFAULT);
- if (zclient->sock > 0)
- zebra_redistribute_send (ZEBRA_REDISTRIBUTE_ADD, zclient, type);
- return CMD_SUCCESS;
- }
- #endif
- static int
- rip_redistribute_unset (int type)
- {
- if (! vrf_bitmap_check (zclient->redist[type], VRF_DEFAULT))
- return CMD_SUCCESS;
- vrf_bitmap_unset (zclient->redist[type], VRF_DEFAULT);
- if (zclient->sock > 0)
- zebra_redistribute_send (ZEBRA_REDISTRIBUTE_DELETE, zclient, type,
- VRF_DEFAULT);
- /* Remove the routes from RIP table. */
- rip_redistribute_withdraw (type);
- return CMD_SUCCESS;
- }
- int
- rip_redistribute_check (int type)
- {
- return vrf_bitmap_check (zclient->redist[type], VRF_DEFAULT);
- }
- void
- rip_redistribute_clean (void)
- {
- int i;
- for (i = 0; redist_type[i].str; i++)
- {
- if (vrf_bitmap_check (zclient->redist[redist_type[i].type], VRF_DEFAULT))
- {
- if (zclient->sock > 0)
- zebra_redistribute_send (ZEBRA_REDISTRIBUTE_DELETE,
- zclient, redist_type[i].type,
- VRF_DEFAULT);
- vrf_bitmap_unset (zclient->redist[redist_type[i].type], VRF_DEFAULT);
- /* Remove the routes from RIP table. */
- rip_redistribute_withdraw (redist_type[i].type);
- }
- }
- }
- DEFUN (rip_redistribute_rip,
- rip_redistribute_rip_cmd,
- "redistribute rip",
- "Redistribute information from another routing protocol\n"
- "Routing Information Protocol (RIP)\n")
- {
- vrf_bitmap_set (zclient->redist[ZEBRA_ROUTE_RIP], VRF_DEFAULT);
- return CMD_SUCCESS;
- }
- DEFUN (no_rip_redistribute_rip,
- no_rip_redistribute_rip_cmd,
- "no redistribute rip",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Routing Information Protocol (RIP)\n")
- {
- vrf_bitmap_unset (zclient->redist[ZEBRA_ROUTE_RIP], VRF_DEFAULT);
- return CMD_SUCCESS;
- }
- DEFUN (rip_redistribute_type,
- rip_redistribute_type_cmd,
- "redistribute " QUAGGA_REDIST_STR_RIPD,
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_RIPD)
- {
- int i;
- for(i = 0; redist_type[i].str; i++)
- {
- if (strncmp (redist_type[i].str, argv[0],
- redist_type[i].str_min_len) == 0)
- {
- zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient,
- redist_type[i].type, VRF_DEFAULT);
- return CMD_SUCCESS;
- }
- }
- vty_out(vty, "Invalid type %s%s", argv[0],
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- DEFUN (no_rip_redistribute_type,
- no_rip_redistribute_type_cmd,
- "no redistribute " QUAGGA_REDIST_STR_RIPD,
- NO_STR
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_RIPD)
- {
- int i;
- for (i = 0; redist_type[i].str; i++)
- {
- if (strncmp(redist_type[i].str, argv[0],
- redist_type[i].str_min_len) == 0)
- {
- rip_metric_unset (redist_type[i].type, DONT_CARE_METRIC_RIP);
- rip_routemap_unset (redist_type[i].type,NULL);
- rip_redistribute_unset (redist_type[i].type);
- return CMD_SUCCESS;
- }
- }
- vty_out(vty, "Invalid type %s%s", argv[0],
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- DEFUN (rip_redistribute_type_routemap,
- rip_redistribute_type_routemap_cmd,
- "redistribute " QUAGGA_REDIST_STR_RIPD " route-map WORD",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_RIPD
- "Route map reference\n"
- "Pointer to route-map entries\n")
- {
- int i;
- for (i = 0; redist_type[i].str; i++) {
- if (strncmp(redist_type[i].str, argv[0],
- redist_type[i].str_min_len) == 0)
- {
- rip_routemap_set (redist_type[i].type, argv[1]);
- zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, redist_type[i].type,
- VRF_DEFAULT);
- return CMD_SUCCESS;
- }
- }
- vty_out(vty, "Invalid type %s%s", argv[0],
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- DEFUN (no_rip_redistribute_type_routemap,
- no_rip_redistribute_type_routemap_cmd,
- "no redistribute " QUAGGA_REDIST_STR_RIPD " route-map WORD",
- NO_STR
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_RIPD
- "Route map reference\n"
- "Pointer to route-map entries\n")
- {
- int i;
- for (i = 0; redist_type[i].str; i++)
- {
- if (strncmp(redist_type[i].str, argv[0],
- redist_type[i].str_min_len) == 0)
- {
- if (rip_routemap_unset (redist_type[i].type,argv[1]))
- return CMD_WARNING;
- rip_redistribute_unset (redist_type[i].type);
- return CMD_SUCCESS;
- }
- }
- vty_out(vty, "Invalid type %s%s", argv[0],
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- DEFUN (rip_redistribute_type_metric,
- rip_redistribute_type_metric_cmd,
- "redistribute " QUAGGA_REDIST_STR_RIPD " metric <0-16>",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_RIPD
- "Metric\n"
- "Metric value\n")
- {
- int i;
- int metric;
- metric = atoi (argv[1]);
- for (i = 0; redist_type[i].str; i++) {
- if (strncmp(redist_type[i].str, argv[0],
- redist_type[i].str_min_len) == 0)
- {
- rip_redistribute_metric_set (redist_type[i].type, metric);
- zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, redist_type[i].type,
- VRF_DEFAULT);
- return CMD_SUCCESS;
- }
- }
- vty_out(vty, "Invalid type %s%s", argv[0],
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- DEFUN (no_rip_redistribute_type_metric,
- no_rip_redistribute_type_metric_cmd,
- "no redistribute " QUAGGA_REDIST_STR_RIPD " metric <0-16>",
- NO_STR
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_RIPD
- "Metric\n"
- "Metric value\n")
- {
- int i;
- for (i = 0; redist_type[i].str; i++)
- {
- if (strncmp(redist_type[i].str, argv[0],
- redist_type[i].str_min_len) == 0)
- {
- if (rip_metric_unset (redist_type[i].type, atoi(argv[1])))
- return CMD_WARNING;
- rip_redistribute_unset (redist_type[i].type);
- return CMD_SUCCESS;
- }
- }
- vty_out(vty, "Invalid type %s%s", argv[0],
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- DEFUN (rip_redistribute_type_metric_routemap,
- rip_redistribute_type_metric_routemap_cmd,
- "redistribute " QUAGGA_REDIST_STR_RIPD " metric <0-16> route-map WORD",
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_RIPD
- "Metric\n"
- "Metric value\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
- {
- int i;
- int metric;
- metric = atoi (argv[1]);
- for (i = 0; redist_type[i].str; i++) {
- if (strncmp(redist_type[i].str, argv[0],
- redist_type[i].str_min_len) == 0)
- {
- rip_redistribute_metric_set (redist_type[i].type, metric);
- rip_routemap_set (redist_type[i].type, argv[2]);
- zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, redist_type[i].type,
- VRF_DEFAULT);
- return CMD_SUCCESS;
- }
- }
- vty_out(vty, "Invalid type %s%s", argv[0],
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- DEFUN (no_rip_redistribute_type_metric_routemap,
- no_rip_redistribute_type_metric_routemap_cmd,
- "no redistribute " QUAGGA_REDIST_STR_RIPD
- " metric <0-16> route-map WORD",
- NO_STR
- REDIST_STR
- QUAGGA_REDIST_HELP_STR_RIPD
- "Metric\n"
- "Metric value\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
- {
- int i;
- for (i = 0; redist_type[i].str; i++)
- {
- if (strncmp(redist_type[i].str, argv[0],
- redist_type[i].str_min_len) == 0)
- {
- if (rip_metric_unset (redist_type[i].type, atoi(argv[1])))
- return CMD_WARNING;
- if (rip_routemap_unset (redist_type[i].type, argv[2]))
- {
- rip_redistribute_metric_set(redist_type[i].type, atoi(argv[1]));
- return CMD_WARNING;
- }
- rip_redistribute_unset (redist_type[i].type);
- return CMD_SUCCESS;
- }
- }
- vty_out(vty, "Invalid type %s%s", argv[0],
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- /* Default information originate. */
- DEFUN (rip_default_information_originate,
- rip_default_information_originate_cmd,
- "default-information originate",
- "Control distribution of default route\n"
- "Distribute a default route\n")
- {
- struct prefix_ipv4 p;
- if (! rip->default_information)
- {
- memset (&p, 0, sizeof (struct prefix_ipv4));
- p.family = AF_INET;
- rip->default_information = 1;
-
- rip_redistribute_add (ZEBRA_ROUTE_RIP, RIP_ROUTE_DEFAULT, &p, 0,
- NULL, 0, 0, 0);
- }
- return CMD_SUCCESS;
- }
- DEFUN (no_rip_default_information_originate,
- no_rip_default_information_originate_cmd,
- "no default-information originate",
- NO_STR
- "Control distribution of default route\n"
- "Distribute a default route\n")
- {
- struct prefix_ipv4 p;
- if (rip->default_information)
- {
- memset (&p, 0, sizeof (struct prefix_ipv4));
- p.family = AF_INET;
- rip->default_information = 0;
-
- rip_redistribute_delete (ZEBRA_ROUTE_RIP, RIP_ROUTE_DEFAULT, &p, 0);
- }
- return CMD_SUCCESS;
- }
- /* RIP configuration write function. */
- static int
- config_write_zebra (struct vty *vty)
- {
- if (! zclient->enable)
- {
- vty_out (vty, "no router zebra%s", VTY_NEWLINE);
- return 1;
- }
- else if (! vrf_bitmap_check (zclient->redist[ZEBRA_ROUTE_RIP], VRF_DEFAULT))
- {
- vty_out (vty, "router zebra%s", VTY_NEWLINE);
- vty_out (vty, " no redistribute rip%s", VTY_NEWLINE);
- return 1;
- }
- return 0;
- }
- int
- config_write_rip_redistribute (struct vty *vty, int config_mode)
- {
- int i;
- for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
- if (i != zclient->redist_default &&
- vrf_bitmap_check (zclient->redist[i], VRF_DEFAULT))
- {
- if (config_mode)
- {
- if (rip->route_map[i].metric_config)
- {
- if (rip->route_map[i].name)
- vty_out (vty, " redistribute %s metric %d route-map %s%s",
- zebra_route_string(i), rip->route_map[i].metric,
- rip->route_map[i].name,
- VTY_NEWLINE);
- else
- vty_out (vty, " redistribute %s metric %d%s",
- zebra_route_string(i), rip->route_map[i].metric,
- VTY_NEWLINE);
- }
- else
- {
- if (rip->route_map[i].name)
- vty_out (vty, " redistribute %s route-map %s%s",
- zebra_route_string(i), rip->route_map[i].name,
- VTY_NEWLINE);
- else
- vty_out (vty, " redistribute %s%s", zebra_route_string(i),
- VTY_NEWLINE);
- }
- }
- else
- vty_out (vty, " %s", zebra_route_string(i));
- }
- return 0;
- }
- /* Zebra node structure. */
- static struct cmd_node zebra_node =
- {
- ZEBRA_NODE,
- "%s(config-router)# ",
- };
- static void
- rip_zebra_connected (struct zclient *zclient)
- {
- zclient_send_requests (zclient, VRF_DEFAULT);
- }
- void
- rip_zclient_init (struct thread_master *master)
- {
- /* Set default value to the zebra client structure. */
- zclient = zclient_new (master);
- zclient_init (zclient, ZEBRA_ROUTE_RIP);
- zclient->zebra_connected = rip_zebra_connected;
- zclient->interface_add = rip_interface_add;
- zclient->interface_delete = rip_interface_delete;
- zclient->interface_address_add = rip_interface_address_add;
- zclient->interface_address_delete = rip_interface_address_delete;
- zclient->ipv4_route_add = rip_zebra_read_ipv4;
- zclient->ipv4_route_delete = rip_zebra_read_ipv4;
- zclient->interface_up = rip_interface_up;
- zclient->interface_down = rip_interface_down;
-
- /* Install zebra node. */
- install_node (&zebra_node, config_write_zebra);
- /* Install command elements to zebra node. */
- install_element (CONFIG_NODE, &router_zebra_cmd);
- install_element (CONFIG_NODE, &no_router_zebra_cmd);
- install_default (ZEBRA_NODE);
- install_element (ZEBRA_NODE, &rip_redistribute_rip_cmd);
- install_element (ZEBRA_NODE, &no_rip_redistribute_rip_cmd);
- /* Install command elements to rip node. */
- install_element (RIP_NODE, &rip_redistribute_type_cmd);
- install_element (RIP_NODE, &rip_redistribute_type_routemap_cmd);
- install_element (RIP_NODE, &rip_redistribute_type_metric_cmd);
- install_element (RIP_NODE, &rip_redistribute_type_metric_routemap_cmd);
- install_element (RIP_NODE, &no_rip_redistribute_type_cmd);
- install_element (RIP_NODE, &no_rip_redistribute_type_routemap_cmd);
- install_element (RIP_NODE, &no_rip_redistribute_type_metric_cmd);
- install_element (RIP_NODE, &no_rip_redistribute_type_metric_routemap_cmd);
- install_element (RIP_NODE, &rip_default_information_originate_cmd);
- install_element (RIP_NODE, &no_rip_default_information_originate_cmd);
- }
|