+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Zebra connect library for EIGRP.
* Copyright (C) 2013-2014
* Matej Perina
* Peter Orsag
* Peter Paluch
- *
- * 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 this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
#include "log.h"
#include "nexthop.h"
+#include "eigrpd/eigrp_types.h"
#include "eigrpd/eigrp_structs.h"
#include "eigrpd/eigrpd.h"
#include "eigrpd/eigrp_interface.h"
#include "eigrpd/eigrp_network.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
+#include "eigrpd/eigrp_metric.h"
static int eigrp_interface_address_add(ZAPI_CALLBACK_ARGS);
static int eigrp_interface_address_delete(ZAPI_CALLBACK_ARGS);
enum zapi_route_notify_owner note;
uint32_t table;
- if (!zapi_route_notify_decode(zclient->ibuf, &p, &table, ¬e))
+ if (!zapi_route_notify_decode(zclient->ibuf, &p, &table, ¬e, NULL,
+ NULL))
return -1;
return 0;
zclient_send_reg_requests(zclient, VRF_DEFAULT);
}
+static zclient_handler *const eigrp_handlers[] = {
+ [ZEBRA_ROUTER_ID_UPDATE] = eigrp_router_id_update_zebra,
+ [ZEBRA_INTERFACE_ADDRESS_ADD] = eigrp_interface_address_add,
+ [ZEBRA_INTERFACE_ADDRESS_DELETE] = eigrp_interface_address_delete,
+ [ZEBRA_REDISTRIBUTE_ROUTE_ADD] = eigrp_zebra_read_route,
+ [ZEBRA_REDISTRIBUTE_ROUTE_DEL] = eigrp_zebra_read_route,
+ [ZEBRA_ROUTE_NOTIFY_OWNER] = eigrp_zebra_route_notify_owner,
+};
+
void eigrp_zebra_init(void)
{
struct zclient_options opt = {.receive_notify = false};
- zclient = zclient_new(master, &opt);
+ zclient = zclient_new(master, &opt, eigrp_handlers,
+ array_size(eigrp_handlers));
zclient_init(zclient, ZEBRA_ROUTE_EIGRP, 0, &eigrpd_privs);
zclient->zebra_connected = eigrp_zebra_connected;
- zclient->router_id_update = eigrp_router_id_update_zebra;
- zclient->interface_address_add = eigrp_interface_address_add;
- zclient->interface_address_delete = eigrp_interface_address_delete;
- zclient->redistribute_route_add = eigrp_zebra_read_route;
- zclient->redistribute_route_del = eigrp_zebra_read_route;
- zclient->route_notify_owner = eigrp_zebra_route_notify_owner;
}
{
struct zapi_route api;
struct zapi_nexthop *api_nh;
- struct eigrp_nexthop_entry *te;
+ struct eigrp_route_descriptor *te;
struct listnode *node;
int count = 0;
api.nexthop_num = count;
if (IS_DEBUG_EIGRP(zebra, ZEBRA_REDISTRIBUTE)) {
- char buf[PREFIX_STRLEN];
- zlog_debug("Zebra: Route add %pFX nexthop %s", p,
- inet_ntop(AF_INET, 0, buf, PREFIX_STRLEN));
+ zlog_debug("Zebra: Route add %pFX", p);
}
zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api);