+// SPDX-License-Identifier: GPL-2.0-or-later
/* Interface related function for RIP.
* Copyright (C) 1997, 98 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 "table.h"
#include "log.h"
#include "stream.h"
-#include "thread.h"
+#include "frrevent.h"
#include "zclient.h"
#include "filter.h"
#include "sockopt.h"
return 0;
}
-/* Inteface link down message processing. */
+/* Interface link down message processing. */
static int rip_ifp_down(struct interface *ifp)
{
rip_interface_sync(ifp);
return 0;
}
-/* Inteface link up message processing */
+/* Interface link up message processing */
static int rip_ifp_up(struct interface *ifp)
{
if (IS_RIP_DEBUG_ZEBRA)
return 0;
}
-/* Inteface addition message from zebra. */
+/* Interface addition message from zebra. */
static int rip_ifp_create(struct interface *ifp)
{
rip_interface_sync(ifp);
ri->enable_interface = 0;
ri->running = 0;
- thread_cancel(&ri->t_wakeup);
+ EVENT_OFF(ri->t_wakeup);
}
void rip_interfaces_clean(struct rip *rip)
ri = ifp->info;
- THREAD_OFF(ri->t_wakeup);
+ EVENT_OFF(ri->t_wakeup);
rip = ri->rip;
if (rip) {
hook_call(rip_ifaddr_del, ifc);
- /* Chech wether this prefix needs to be removed */
+ /* Chech whether this prefix needs to be removed */
rip_apply_address_del(ifc);
}
}
/* Check interface is enabled by network statement. */
-/* Check wether the interface has at least a connected prefix that
+/* Check whether the interface has at least a connected prefix that
* is within the ripng_enable_network table. */
static int rip_enable_network_lookup_if(struct interface *ifp)
{
return -1;
}
-/* Check wether connected is within the ripng_enable_network table. */
+/* Check whether connected is within the ripng_enable_network table. */
static int rip_enable_network_lookup2(struct connected *connected)
{
struct rip_interface *ri = connected->ifp->info;
}
/* Join to multicast group and send request to the interface. */
-static void rip_interface_wakeup(struct thread *t)
+static void rip_interface_wakeup(struct event *t)
{
struct interface *ifp;
struct rip_interface *ri;
/* Get interface. */
- ifp = THREAD_ARG(t);
+ ifp = EVENT_ARG(t);
ri = ifp->info;
nh.ifindex = connected->ifp->ifindex;
nh.type = NEXTHOP_TYPE_IFINDEX;
if (set) {
- /* Check once more wether this prefix is within a
+ /* Check once more whether this prefix is within a
* "network IF_OR_PREF" one */
if ((rip_enable_if_lookup(rip, connected->ifp->name)
>= 0)
zlog_debug("turn on %s", ifp->name);
/* Add interface wake up thread. */
- thread_add_timer(master, rip_interface_wakeup, ifp, 1,
- &ri->t_wakeup);
+ event_add_timer(master, rip_interface_wakeup, ifp, 1,
+ &ri->t_wakeup);
rip_connect_set(ifp, 1);
} else if (ri->running) {
/* Might as well clean up the route table as well
struct prefix_ipv4 p;
struct route_node *node;
- memset(&p, 0, sizeof(struct prefix_ipv4));
+ memset(&p, 0, sizeof(p));
p.family = AF_INET;
p.prefix = from->sin_addr;
p.prefixlen = IPV4_MAX_BITLEN;