]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripngd/ripng_zebra.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / ripngd / ripng_zebra.c
index baf7f00961ee6462ea465177035671ef60d633d5..b126a15b5bf177abfc3181c743237d09bf758b87 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * RIPngd and zebra interface.
  * Copyright (C) 1998, 1999 Kunihiro Ishiguro
- *
- * 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>
@@ -234,19 +219,23 @@ static void ripng_zebra_connected(struct zclient *zclient)
        zclient_send_reg_requests(zclient, VRF_DEFAULT);
 }
 
+static zclient_handler *const ripng_handlers[] = {
+       [ZEBRA_INTERFACE_ADDRESS_ADD] = ripng_interface_address_add,
+       [ZEBRA_INTERFACE_ADDRESS_DELETE] = ripng_interface_address_delete,
+       [ZEBRA_INTERFACE_VRF_UPDATE] = ripng_interface_vrf_update,
+       [ZEBRA_REDISTRIBUTE_ROUTE_ADD] = ripng_zebra_read_route,
+       [ZEBRA_REDISTRIBUTE_ROUTE_DEL] = ripng_zebra_read_route,
+};
+
 /* Initialize zebra structure and it's commands. */
 void zebra_init(struct thread_master *master)
 {
        /* Allocate zebra structure. */
-       zclient = zclient_new(master, &zclient_options_default);
+       zclient = zclient_new(master, &zclient_options_default, ripng_handlers,
+                             array_size(ripng_handlers));
        zclient_init(zclient, ZEBRA_ROUTE_RIPNG, 0, &ripngd_privs);
 
        zclient->zebra_connected = ripng_zebra_connected;
-       zclient->interface_address_add = ripng_interface_address_add;
-       zclient->interface_address_delete = ripng_interface_address_delete;
-       zclient->interface_vrf_update = ripng_interface_vrf_update;
-       zclient->redistribute_route_add = ripng_zebra_read_route;
-       zclient->redistribute_route_del = ripng_zebra_read_route;
 }
 
 void ripng_zebra_stop(void)