]> git.proxmox.com Git - mirror_frr.git/blobdiff - eigrpd/eigrp_zebra.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / eigrpd / eigrp_zebra.c
index 7c765248c6a39a4c47de15644a6c031046ed4f3f..179c2d0f2aa88bdc9e58c4464e8c1610a6692081 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Zebra connect library for EIGRP.
  * Copyright (C) 2013-2014
@@ -7,22 +8,6 @@
  *   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>
@@ -102,20 +87,24 @@ static void eigrp_zebra_connected(struct zclient *zclient)
        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;
 }