]> git.proxmox.com Git - mirror_frr.git/blobdiff - ripd/rip_peer.c
Merge pull request #13287 from anlancs/bgpd-cleanup-9
[mirror_frr.git] / ripd / rip_peer.c
index 12c4edd43611c44299e29739249f27b25642f90e..9410ef380ecc723de5beafb65a415fe2ee67d175 100644 (file)
@@ -1,21 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* RIP peer support
  * Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org>
- *
- * 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>
@@ -24,7 +9,7 @@
 #include "prefix.h"
 #include "command.h"
 #include "linklist.h"
-#include "thread.h"
+#include "frrevent.h"
 #include "memory.h"
 
 #include "ripd/ripd.h"
@@ -38,7 +23,7 @@ static struct rip_peer *rip_peer_new(void)
 
 static void rip_peer_free(struct rip_peer *peer)
 {
-       RIP_TIMER_OFF(peer->t_timeout);
+       EVENT_OFF(peer->t_timeout);
        XFREE(MTYPE_RIP_PEER, peer);
 }
 
@@ -67,15 +52,13 @@ struct rip_peer *rip_peer_lookup_next(struct rip *rip, struct in_addr *addr)
 }
 
 /* RIP peer is timeout. */
-static int rip_peer_timeout(struct thread *t)
+static void rip_peer_timeout(struct event *t)
 {
        struct rip_peer *peer;
 
-       peer = THREAD_ARG(t);
+       peer = EVENT_ARG(t);
        listnode_delete(peer->rip->peer_list, peer);
        rip_peer_free(peer);
-
-       return 0;
 }
 
 /* Get RIP peer.  At the same time update timeout thread. */
@@ -86,7 +69,7 @@ static struct rip_peer *rip_peer_get(struct rip *rip, struct in_addr *addr)
        peer = rip_peer_lookup(rip, addr);
 
        if (peer) {
-               thread_cancel(&peer->t_timeout);
+               EVENT_OFF(peer->t_timeout);
        } else {
                peer = rip_peer_new();
                peer->rip = rip;
@@ -95,8 +78,8 @@ static struct rip_peer *rip_peer_get(struct rip *rip, struct in_addr *addr)
        }
 
        /* Update timeout thread. */
-       thread_add_timer(master, rip_peer_timeout, peer, RIP_PEER_TIMER_DEFAULT,
-                        &peer->t_timeout);
+       event_add_timer(master, rip_peer_timeout, peer, RIP_PEER_TIMER_DEFAULT,
+                       &peer->t_timeout);
 
        /* Last update time set. */
        time(&peer->uptime);