]> git.proxmox.com Git - mirror_frr.git/blobdiff - eigrpd/eigrp_neighbor.c
*: Convert thread_cancelXXX to event_cancelXXX
[mirror_frr.git] / eigrpd / eigrp_neighbor.c
index f2d5217eb0d68cedbfaf80bd6a289fc883e473ae..05d1b12f13f66bcae4f157e0ea162fe1f86af80a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Neighbor Handling.
  * Copyright (C) 2013-2016
  *   Tomas Hvorkovy
  *   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>
@@ -35,7 +20,7 @@
 #include "prefix.h"
 #include "memory.h"
 #include "command.h"
-#include "thread.h"
+#include "event.h"
 #include "stream.h"
 #include "table.h"
 #include "log.h"
@@ -179,7 +164,7 @@ void eigrp_nbr_delete(struct eigrp_neighbor *nbr)
                eigrp_topology_neighbor_down(nbr->ei->eigrp, nbr);
 
        /* Cancel all events. */ /* Thread lookup cost would be negligible. */
-       thread_cancel_event(master, nbr);
+       event_cancel_event(master, nbr);
        eigrp_fifo_free(nbr->multicast_queue);
        eigrp_fifo_free(nbr->retrans_queue);
        THREAD_OFF(nbr->t_holddown);
@@ -189,7 +174,7 @@ void eigrp_nbr_delete(struct eigrp_neighbor *nbr)
        XFREE(MTYPE_EIGRP_NEIGHBOR, nbr);
 }
 
-int holddown_timer_expired(struct thread *thread)
+void holddown_timer_expired(struct event *thread)
 {
        struct eigrp_neighbor *nbr = THREAD_ARG(thread);
        struct eigrp *eigrp = nbr->ei->eigrp;
@@ -198,8 +183,6 @@ int holddown_timer_expired(struct thread *thread)
                  ifindex2ifname(nbr->ei->ifp->ifindex, eigrp->vrf_id));
        nbr->state = EIGRP_NEIGHBOR_DOWN;
        eigrp_nbr_delete(nbr);
-
-       return 0;
 }
 
 uint8_t eigrp_nbr_state_get(struct eigrp_neighbor *nbr)
@@ -278,15 +261,15 @@ void eigrp_nbr_state_update(struct eigrp_neighbor *nbr)
        case EIGRP_NEIGHBOR_PENDING: {
                /*Reset Hold Down Timer for neighbor*/
                THREAD_OFF(nbr->t_holddown);
-               thread_add_timer(master, holddown_timer_expired, nbr,
-                                nbr->v_holddown, &nbr->t_holddown);
+               event_add_timer(master, holddown_timer_expired, nbr,
+                               nbr->v_holddown, &nbr->t_holddown);
                break;
        }
        case EIGRP_NEIGHBOR_UP: {
                /*Reset Hold Down Timer for neighbor*/
                THREAD_OFF(nbr->t_holddown);
-               thread_add_timer(master, holddown_timer_expired, nbr,
-                                nbr->v_holddown, &nbr->t_holddown);
+               event_add_timer(master, holddown_timer_expired, nbr,
+                               nbr->v_holddown, &nbr->t_holddown);
                break;
        }
        }