]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/rfp-example/librfp/rfp_example.c
*: auto-convert to SPDX License IDs
[mirror_frr.git] / bgpd / rfp-example / librfp / rfp_example.c
index 75e57a029e042f47ee481fa7a86b2312e7e6e1a4..3a512902e0276425ebd65c09736399b5b4bca05e 100644 (file)
@@ -1,23 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  *
  * Copyright 2015-2016, LabN Consulting, L.L.C.
  *
- *
- * This program 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
- * of the License, or (at your option) any later version.
- *
- * This program 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
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 /* stub rfp */
 #include "rfp_internal.h"
 #include "bgpd/rfapi/rfapi.h"
@@ -103,7 +94,7 @@ DEFUN (rfp_full_table_download,
        return CMD_SUCCESS;
 }
 
-static void rfp_vty_install()
+static void rfp_vty_install(void)
 {
        static int installed = 0;
        if (installed) /* do this only once */
@@ -251,8 +242,8 @@ static int rfp_cfg_write_cb(struct vty *vty, void *rfp_start_val)
                        rfi->rfapi_config.holddown_factor);
                write++;
        }
-       if (rfi->rfapi_config.download_type != RFAPI_RFP_DOWNLOAD_FULL) {
-               vty_out(vty, " rfp full-table-download off\n");
+       if (rfi->rfapi_config.download_type == RFAPI_RFP_DOWNLOAD_FULL) {
+               vty_out(vty, " rfp full-table-download on\n");
                write++;
        }
        return write;
@@ -283,7 +274,7 @@ static int rfp_cfg_write_cb(struct vty *vty, void *rfp_start_val)
 void *rfp_start(struct thread_master *master, struct rfapi_rfp_cfg **cfgp,
                struct rfapi_rfp_cb_methods **cbmp)
 {
-       memset(&global_rfi, 0, sizeof(struct rfp_instance_t));
+       memset(&global_rfi, 0, sizeof(global_rfi));
        global_rfi.master = master; /* for BGPD threads */
 
        /* initilize struct rfapi_rfp_cfg, see rfapi.h */