summaryrefslogtreecommitdiff
path: root/ospfd/ospf_apiserver.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_apiserver.c')
-rw-r--r--ospfd/ospf_apiserver.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c
index 086b5660b1..1aacc341aa 100644
--- a/ospfd/ospf_apiserver.c
+++ b/ospfd/ospf_apiserver.c
@@ -18,14 +18,14 @@
#include "vty.h"
#include "stream.h"
#include "log.h"
-#include "thread.h"
+#include "frrevent.h"
#include "hash.h"
#include "sockunion.h" /* for inet_aton() */
#include "buffer.h"
#include <sys/types.h>
-#include "ospfd/ospfd.h" /* for "struct thread_master" */
+#include "ospfd/ospfd.h" /* for "struct event_loop" */
#include "ospfd/ospf_interface.h"
#include "ospfd/ospf_ism.h"
#include "ospfd/ospf_asbr.h"
@@ -278,28 +278,28 @@ void ospf_apiserver_event(enum ospf_apiserver_event event, int fd,
{
switch (event) {
case OSPF_APISERVER_ACCEPT:
- (void)thread_add_read(master, ospf_apiserver_accept, apiserv,
- fd, NULL);
+ (void)event_add_read(master, ospf_apiserver_accept, apiserv, fd,
+ NULL);
break;
case OSPF_APISERVER_SYNC_READ:
apiserv->t_sync_read = NULL;
- thread_add_read(master, ospf_apiserver_read, apiserv, fd,
- &apiserv->t_sync_read);
+ event_add_read(master, ospf_apiserver_read, apiserv, fd,
+ &apiserv->t_sync_read);
break;
#ifdef USE_ASYNC_READ
case OSPF_APISERVER_ASYNC_READ:
apiserv->t_async_read = NULL;
- thread_add_read(master, ospf_apiserver_read, apiserv, fd,
- &apiserv->t_async_read);
+ event_add_read(master, ospf_apiserver_read, apiserv, fd,
+ &apiserv->t_async_read);
break;
#endif /* USE_ASYNC_READ */
case OSPF_APISERVER_SYNC_WRITE:
- thread_add_write(master, ospf_apiserver_sync_write, apiserv, fd,
- &apiserv->t_sync_write);
+ event_add_write(master, ospf_apiserver_sync_write, apiserv, fd,
+ &apiserv->t_sync_write);
break;
case OSPF_APISERVER_ASYNC_WRITE:
- thread_add_write(master, ospf_apiserver_async_write, apiserv,
- fd, &apiserv->t_async_write);
+ event_add_write(master, ospf_apiserver_async_write, apiserv, fd,
+ &apiserv->t_async_write);
break;
}
}
@@ -312,12 +312,12 @@ void ospf_apiserver_free(struct ospf_apiserver *apiserv)
struct listnode *node;
/* Cancel read and write threads. */
- THREAD_OFF(apiserv->t_sync_read);
+ EVENT_OFF(apiserv->t_sync_read);
#ifdef USE_ASYNC_READ
- THREAD_OFF(apiserv->t_async_read);
+ EVENT_OFF(apiserv->t_async_read);
#endif /* USE_ASYNC_READ */
- THREAD_OFF(apiserv->t_sync_write);
- THREAD_OFF(apiserv->t_async_write);
+ EVENT_OFF(apiserv->t_sync_write);
+ EVENT_OFF(apiserv->t_async_write);
/* Unregister all opaque types that application registered
and flush opaque LSAs if still in LSDB. */
@@ -360,15 +360,15 @@ void ospf_apiserver_free(struct ospf_apiserver *apiserv)
XFREE(MTYPE_APISERVER, apiserv);
}
-void ospf_apiserver_read(struct thread *thread)
+void ospf_apiserver_read(struct event *thread)
{
struct ospf_apiserver *apiserv;
struct msg *msg;
int fd;
enum ospf_apiserver_event event;
- apiserv = THREAD_ARG(thread);
- fd = THREAD_FD(thread);
+ apiserv = EVENT_ARG(thread);
+ fd = EVENT_FD(thread);
if (fd == apiserv->fd_sync) {
event = OSPF_APISERVER_SYNC_READ;
@@ -419,16 +419,16 @@ void ospf_apiserver_read(struct thread *thread)
msg_free(msg);
}
-void ospf_apiserver_sync_write(struct thread *thread)
+void ospf_apiserver_sync_write(struct event *thread)
{
struct ospf_apiserver *apiserv;
struct msg *msg;
int fd;
int rc = -1;
- apiserv = THREAD_ARG(thread);
+ apiserv = EVENT_ARG(thread);
assert(apiserv);
- fd = THREAD_FD(thread);
+ fd = EVENT_FD(thread);
apiserv->t_sync_write = NULL;
@@ -479,16 +479,16 @@ out:
}
-void ospf_apiserver_async_write(struct thread *thread)
+void ospf_apiserver_async_write(struct event *thread)
{
struct ospf_apiserver *apiserv;
struct msg *msg;
int fd;
int rc = -1;
- apiserv = THREAD_ARG(thread);
+ apiserv = EVENT_ARG(thread);
assert(apiserv);
- fd = THREAD_FD(thread);
+ fd = EVENT_FD(thread);
apiserv->t_async_write = NULL;
@@ -577,7 +577,7 @@ int ospf_apiserver_serv_sock_family(unsigned short port, int family)
/* Accept connection request from external applications. For each
accepted connection allocate own connection instance. */
-void ospf_apiserver_accept(struct thread *thread)
+void ospf_apiserver_accept(struct event *thread)
{
int accept_sock;
int new_sync_sock;
@@ -589,8 +589,8 @@ void ospf_apiserver_accept(struct thread *thread)
unsigned int peerlen;
int ret;
- /* THREAD_ARG (thread) is NULL */
- accept_sock = THREAD_FD(thread);
+ /* EVENT_ARG (thread) is NULL */
+ accept_sock = EVENT_FD(thread);
/* Keep hearing on socket for further connections. */
ospf_apiserver_event(OSPF_APISERVER_ACCEPT, accept_sock, NULL);