]> git.proxmox.com Git - mirror_frr.git/blobdiff - eigrpd/eigrp_interface.c
*: Convert thread_cancelXXX to event_cancelXXX
[mirror_frr.git] / eigrpd / eigrp_interface.c
index 28987b4af65e303f0c303afedf35e1e16a0b188f..297a312a67f49b108ce936adfd9e3dd8aba6e824 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * EIGRP Interface Functions.
  * 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>
 
-#include "thread.h"
+#include "event.h"
 #include "linklist.h"
 #include "prefix.h"
 #include "if.h"
 #include "table.h"
 #include "memory.h"
+#include "network.h"
 #include "command.h"
 #include "stream.h"
 #include "log.h"
@@ -83,7 +69,7 @@ struct eigrp_interface *eigrp_if_new(struct eigrp *eigrp, struct interface *ifp,
        /* Initialize neighbor list. */
        ei->nbrs = list_new();
 
-       ei->crypt_seqnum = time(NULL);
+       ei->crypt_seqnum = frr_sequence32_next();
 
        /* Initialize lists */
        for (i = 0; i < EIGRP_FILTER_MAX; i++) {
@@ -265,7 +251,7 @@ int eigrp_if_up(struct eigrp_interface *ei)
        /* Set multicast memberships appropriately for new state. */
        eigrp_if_set_multicast(ei);
 
-       thread_add_event(master, eigrp_hello_timer, ei, (1), &ei->t_hello);
+       event_add_event(master, eigrp_hello_timer, ei, (1), &ei->t_hello);
 
        /*Prepare metrics*/
        metric.bandwidth = eigrp_bandwidth_to_scaled(ei->params.bandwidth);
@@ -374,7 +360,7 @@ void eigrp_if_stream_unset(struct eigrp_interface *ei)
        if (ei->on_write_q) {
                listnode_delete(eigrp->oi_write_q, ei);
                if (list_isempty(eigrp->oi_write_q))
-                       thread_cancel(&(eigrp->t_write));
+                       event_cancel(&(eigrp->t_write));
                ei->on_write_q = 0;
        }
 }
@@ -436,7 +422,7 @@ void eigrp_if_free(struct eigrp_interface *ei, int source)
        struct eigrp *eigrp = ei->eigrp;
 
        if (source == INTERFACE_DOWN_BY_VTY) {
-               thread_cancel(&ei->t_hello);
+               event_cancel(&ei->t_hello);
                eigrp_hello_send(ei, EIGRP_HELLO_GRACEFUL_SHUTDOWN, NULL);
        }