+// 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>
#include "prefix.h"
#include "command.h"
#include "linklist.h"
-#include "thread.h"
+#include "frrevent.h"
#include "memory.h"
#include "ripd/ripd.h"
static void rip_peer_free(struct rip_peer *peer)
{
- THREAD_OFF(peer->t_timeout);
+ EVENT_OFF(peer->t_timeout);
XFREE(MTYPE_RIP_PEER, peer);
}
}
/* RIP peer is timeout. */
-static void 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);
}
peer = rip_peer_lookup(rip, addr);
if (peer) {
- THREAD_OFF(peer->t_timeout);
+ EVENT_OFF(peer->t_timeout);
} else {
peer = rip_peer_new();
peer->rip = rip;
}
/* 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);