summaryrefslogtreecommitdiff
path: root/pimd/pim_pim.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_pim.c')
-rw-r--r--pimd/pim_pim.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index a7a8b05753..4a272a4802 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -7,7 +7,7 @@
#include <zebra.h>
#include "log.h"
-#include "thread.h"
+#include "frrevent.h"
#include "memory.h"
#include "if.h"
#include "network.h"
@@ -31,7 +31,7 @@
#include "pim_bsm.h"
#include <lib/lib_errors.h>
-static void on_pim_hello_send(struct thread *t);
+static void on_pim_hello_send(struct event *t);
static const char *pim_pim_msgtype2str(enum pim_msg_type type)
{
@@ -70,7 +70,7 @@ static void sock_close(struct interface *ifp)
pim_ifp->pim_sock_fd, ifp->name);
}
}
- THREAD_OFF(pim_ifp->t_pim_sock_read);
+ EVENT_OFF(pim_ifp->t_pim_sock_read);
if (PIM_DEBUG_PIM_TRACE) {
if (pim_ifp->t_pim_hello_timer) {
@@ -79,7 +79,7 @@ static void sock_close(struct interface *ifp)
ifp->name);
}
}
- THREAD_OFF(pim_ifp->t_pim_hello_timer);
+ EVENT_OFF(pim_ifp->t_pim_hello_timer);
if (PIM_DEBUG_PIM_TRACE) {
zlog_debug("Deleting PIM socket fd=%d on interface %s",
@@ -289,7 +289,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len,
pim_msg_len - PIM_MSG_HEADER_LEN);
break;
case PIM_MSG_TYPE_JOIN_PRUNE:
- neigh = pim_neighbor_find(ifp, sg.src);
+ neigh = pim_neighbor_find(ifp, sg.src, false);
if (!neigh) {
if (PIM_DEBUG_PIM_PACKETS)
zlog_debug(
@@ -304,7 +304,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len,
pim_msg_len - PIM_MSG_HEADER_LEN);
break;
case PIM_MSG_TYPE_ASSERT:
- neigh = pim_neighbor_find(ifp, sg.src);
+ neigh = pim_neighbor_find(ifp, sg.src, false);
if (!neigh) {
if (PIM_DEBUG_PIM_PACKETS)
zlog_debug(
@@ -334,7 +334,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len,
static void pim_sock_read_on(struct interface *ifp);
-static void pim_sock_read(struct thread *t)
+static void pim_sock_read(struct event *t)
{
struct interface *ifp, *orig_ifp;
struct pim_interface *pim_ifp;
@@ -350,8 +350,8 @@ static void pim_sock_read(struct thread *t)
static long long count = 0;
int cont = 1;
- orig_ifp = ifp = THREAD_ARG(t);
- fd = THREAD_FD(t);
+ orig_ifp = ifp = EVENT_ARG(t);
+ fd = EVENT_FD(t);
pim_ifp = ifp->info;
@@ -431,8 +431,8 @@ static void pim_sock_read_on(struct interface *ifp)
zlog_debug("Scheduling READ event on PIM socket fd=%d",
pim_ifp->pim_sock_fd);
}
- thread_add_read(router->master, pim_sock_read, ifp,
- pim_ifp->pim_sock_fd, &pim_ifp->t_pim_sock_read);
+ event_add_read(router->master, pim_sock_read, ifp, pim_ifp->pim_sock_fd,
+ &pim_ifp->t_pim_sock_read);
}
static int pim_sock_open(struct interface *ifp)
@@ -821,21 +821,20 @@ static void hello_resched(struct interface *ifp)
zlog_debug("Rescheduling %d sec hello on interface %s",
pim_ifp->pim_hello_period, ifp->name);
}
- THREAD_OFF(pim_ifp->t_pim_hello_timer);
- thread_add_timer(router->master, on_pim_hello_send, ifp,
- pim_ifp->pim_hello_period,
- &pim_ifp->t_pim_hello_timer);
+ EVENT_OFF(pim_ifp->t_pim_hello_timer);
+ event_add_timer(router->master, on_pim_hello_send, ifp,
+ pim_ifp->pim_hello_period, &pim_ifp->t_pim_hello_timer);
}
/*
Periodic hello timer
*/
-static void on_pim_hello_send(struct thread *t)
+static void on_pim_hello_send(struct event *t)
{
struct pim_interface *pim_ifp;
struct interface *ifp;
- ifp = THREAD_ARG(t);
+ ifp = EVENT_ARG(t);
pim_ifp = ifp->info;
/*
@@ -924,7 +923,7 @@ void pim_hello_restart_triggered(struct interface *ifp)
return;
}
- THREAD_OFF(pim_ifp->t_pim_hello_timer);
+ EVENT_OFF(pim_ifp->t_pim_hello_timer);
}
random_msec = triggered_hello_delay_msec;
@@ -935,8 +934,8 @@ void pim_hello_restart_triggered(struct interface *ifp)
random_msec, ifp->name);
}
- thread_add_timer_msec(router->master, on_pim_hello_send, ifp,
- random_msec, &pim_ifp->t_pim_hello_timer);
+ event_add_timer_msec(router->master, on_pim_hello_send, ifp,
+ random_msec, &pim_ifp->t_pim_hello_timer);
}
int pim_sock_add(struct interface *ifp)