]> git.proxmox.com Git - mirror_frr.git/blobdiff - eigrpd/eigrp_filter.c
*: Convert thread_cancelXXX to event_cancelXXX
[mirror_frr.git] / eigrpd / eigrp_filter.c
index bb0cf51bd8f32ac473b5ce71cf64ccc9a7a9dc7d..cfa4b22af698f37d00a931547700471c5256cf51 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Filter Functions.
  * Copyright (C) 2013-2015
  *   Martin Kontsek
  *   Lukas Koribsky
  *
- *
- * 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>
@@ -36,7 +21,7 @@
 #include "command.h"
 #include "prefix.h"
 #include "table.h"
-#include "thread.h"
+#include "event.h"
 #include "memory.h"
 #include "log.h"
 #include "stream.h"
@@ -126,11 +111,11 @@ void eigrp_distribute_update(struct distribute_ctx *ctx,
                // TODO: check Graceful restart after 10sec
 
                /* cancel GR scheduled */
-               thread_cancel(&(e->t_distribute));
+               event_cancel(&(e->t_distribute));
 
                /* schedule Graceful restart for whole process in 10sec */
-               thread_add_timer(master, eigrp_distribute_timer_process, e,
-                                (10), &e->t_distribute);
+               event_add_timer(master, eigrp_distribute_timer_process, e, (10),
+                               &e->t_distribute);
 
                return;
        }
@@ -201,10 +186,10 @@ void eigrp_distribute_update(struct distribute_ctx *ctx,
        // TODO: check Graceful restart after 10sec
 
        /* Cancel GR scheduled */
-       thread_cancel(&(ei->t_distribute));
+       event_cancel(&(ei->t_distribute));
        /* schedule Graceful restart for interface in 10sec */
-       thread_add_timer(master, eigrp_distribute_timer_interface, ei, 10,
-                        &ei->t_distribute);
+       event_add_timer(master, eigrp_distribute_timer_interface, ei, 10,
+                       &ei->t_distribute);
 }
 
 /*
@@ -215,7 +200,7 @@ void eigrp_distribute_update_interface(struct interface *ifp)
        struct distribute *dist;
        struct eigrp *eigrp;
 
-       eigrp = eigrp_lookup(ifp->vrf_id);
+       eigrp = eigrp_lookup(ifp->vrf->vrf_id);
        if (!eigrp)
                return;
        dist = distribute_lookup(eigrp->distribute_ctx, ifp->name);
@@ -251,13 +236,13 @@ void eigrp_distribute_update_all_wrapper(struct access_list *notused)
  *
  * @param[in]   thread  current execution thread timer is associated with
  *
- * @return int  always returns 0
+ * @return void
  *
  * @par
  * Called when 10sec waiting time expire and
  * executes Graceful restart for whole process
  */
-int eigrp_distribute_timer_process(struct thread *thread)
+void eigrp_distribute_timer_process(struct event *thread)
 {
        struct eigrp *eigrp;
 
@@ -265,8 +250,6 @@ int eigrp_distribute_timer_process(struct thread *thread)
 
        /* execute GR for whole process */
        eigrp_update_send_process_GR(eigrp, EIGRP_GR_FILTER, NULL);
-
-       return 0;
 }
 
 /*
@@ -274,13 +257,13 @@ int eigrp_distribute_timer_process(struct thread *thread)
  *
  * @param[in]   thread  current execution thread timer is associated with
  *
- * @return int  always returns 0
+ * @return void
  *
  * @par
  * Called when 10sec waiting time expire and
  * executes Graceful restart for interface
  */
-int eigrp_distribute_timer_interface(struct thread *thread)
+void eigrp_distribute_timer_interface(struct event *thread)
 {
        struct eigrp_interface *ei;
 
@@ -289,6 +272,4 @@ int eigrp_distribute_timer_interface(struct thread *thread)
 
        /* execute GR for interface */
        eigrp_update_send_interface_GR(ei, EIGRP_GR_FILTER, NULL);
-
-       return 0;
 }