summaryrefslogtreecommitdiff
path: root/zebra/zebra_fpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_fpm.c')
-rw-r--r--zebra/zebra_fpm.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
index 15765b5e18..e379a5868c 100644
--- a/zebra/zebra_fpm.c
+++ b/zebra/zebra_fpm.c
@@ -11,7 +11,7 @@
#include "log.h"
#include "libfrr.h"
#include "stream.h"
-#include "thread.h"
+#include "frrevent.h"
#include "network.h"
#include "command.h"
#include "lib/version.h"
@@ -156,7 +156,7 @@ struct zfpm_glob {
*/
enum zfpm_msg_format message_format;
- struct thread_master *master;
+ struct event_loop *master;
enum zfpm_state state;
@@ -204,15 +204,15 @@ struct zfpm_glob {
/*
* Threads for I/O.
*/
- struct thread *t_connect;
- struct thread *t_write;
- struct thread *t_read;
+ struct event *t_connect;
+ struct event *t_write;
+ struct event *t_read;
/*
* Thread to clean up after the TCP connection to the FPM goes down
* and the state that belongs to it.
*/
- struct thread *t_conn_down;
+ struct event *t_conn_down;
struct {
struct zfpm_rnodes_iter iter;
@@ -222,7 +222,7 @@ struct zfpm_glob {
* Thread to take actions once the TCP conn to the FPM comes up, and
* the state that belongs to it.
*/
- struct thread *t_conn_up;
+ struct event *t_conn_up;
struct {
struct zfpm_rnodes_iter iter;
@@ -251,7 +251,7 @@ struct zfpm_glob {
/*
* Stats interval timer.
*/
- struct thread *t_stats;
+ struct event *t_stats;
/*
* If non-zero, the last time when statistics were cleared.
@@ -269,8 +269,8 @@ static struct zfpm_glob *zfpm_g = &zfpm_glob_space;
static int zfpm_trigger_update(struct route_node *rn, const char *reason);
-static void zfpm_read_cb(struct thread *thread);
-static void zfpm_write_cb(struct thread *thread);
+static void zfpm_read_cb(struct event *thread);
+static void zfpm_write_cb(struct event *thread);
static void zfpm_set_state(enum zfpm_state state, const char *reason);
static void zfpm_start_connect_timer(const char *reason);
@@ -283,9 +283,9 @@ union g_addr ipv4ll_gateway;
/*
* zfpm_thread_should_yield
*/
-static inline int zfpm_thread_should_yield(struct thread *t)
+static inline int zfpm_thread_should_yield(struct event *t)
{
- return thread_should_yield(t);
+ return event_should_yield(t);
}
/*
@@ -460,8 +460,8 @@ static inline void zfpm_read_on(void)
assert(!zfpm_g->t_read);
assert(zfpm_g->sock >= 0);
- thread_add_read(zfpm_g->master, zfpm_read_cb, 0, zfpm_g->sock,
- &zfpm_g->t_read);
+ event_add_read(zfpm_g->master, zfpm_read_cb, 0, zfpm_g->sock,
+ &zfpm_g->t_read);
}
/*
@@ -472,8 +472,8 @@ static inline void zfpm_write_on(void)
assert(!zfpm_g->t_write);
assert(zfpm_g->sock >= 0);
- thread_add_write(zfpm_g->master, zfpm_write_cb, 0, zfpm_g->sock,
- &zfpm_g->t_write);
+ event_add_write(zfpm_g->master, zfpm_write_cb, 0, zfpm_g->sock,
+ &zfpm_g->t_write);
}
/*
@@ -481,7 +481,7 @@ static inline void zfpm_write_on(void)
*/
static inline void zfpm_read_off(void)
{
- THREAD_OFF(zfpm_g->t_read);
+ EVENT_OFF(zfpm_g->t_read);
}
/*
@@ -489,12 +489,12 @@ static inline void zfpm_read_off(void)
*/
static inline void zfpm_write_off(void)
{
- THREAD_OFF(zfpm_g->t_write);
+ EVENT_OFF(zfpm_g->t_write);
}
static inline void zfpm_connect_off(void)
{
- THREAD_OFF(zfpm_g->t_connect);
+ EVENT_OFF(zfpm_g->t_connect);
}
/*
@@ -503,7 +503,7 @@ static inline void zfpm_connect_off(void)
* Callback for actions to be taken when the connection to the FPM
* comes up.
*/
-static void zfpm_conn_up_thread_cb(struct thread *thread)
+static void zfpm_conn_up_thread_cb(struct event *thread)
{
struct route_node *rnode;
struct zfpm_rnodes_iter *iter;
@@ -542,8 +542,8 @@ static void zfpm_conn_up_thread_cb(struct thread *thread)
zfpm_g->stats.t_conn_up_yields++;
zfpm_rnodes_iter_pause(iter);
- thread_add_timer_msec(zfpm_g->master, zfpm_conn_up_thread_cb,
- NULL, 0, &zfpm_g->t_conn_up);
+ event_add_timer_msec(zfpm_g->master, zfpm_conn_up_thread_cb,
+ NULL, 0, &zfpm_g->t_conn_up);
return;
}
@@ -568,15 +568,15 @@ static void zfpm_connection_up(const char *detail)
/*
* Start thread to push existing routes to the FPM.
*/
- THREAD_OFF(zfpm_g->t_conn_up);
+ EVENT_OFF(zfpm_g->t_conn_up);
zfpm_rnodes_iter_init(&zfpm_g->t_conn_up_state.iter);
zfpm_g->fpm_mac_dump_done = false;
zfpm_debug("Starting conn_up thread");
- thread_add_timer_msec(zfpm_g->master, zfpm_conn_up_thread_cb, NULL, 0,
- &zfpm_g->t_conn_up);
+ event_add_timer_msec(zfpm_g->master, zfpm_conn_up_thread_cb, NULL, 0,
+ &zfpm_g->t_conn_up);
zfpm_g->stats.t_conn_up_starts++;
}
@@ -619,7 +619,7 @@ static void zfpm_connect_check(void)
* Callback that is invoked to clean up state after the TCP connection
* to the FPM goes down.
*/
-static void zfpm_conn_down_thread_cb(struct thread *thread)
+static void zfpm_conn_down_thread_cb(struct event *thread)
{
struct route_node *rnode;
struct zfpm_rnodes_iter *iter;
@@ -668,8 +668,8 @@ static void zfpm_conn_down_thread_cb(struct thread *thread)
zfpm_g->stats.t_conn_down_yields++;
zfpm_rnodes_iter_pause(iter);
zfpm_g->t_conn_down = NULL;
- thread_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb,
- NULL, 0, &zfpm_g->t_conn_down);
+ event_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb,
+ NULL, 0, &zfpm_g->t_conn_down);
return;
}
@@ -713,8 +713,8 @@ static void zfpm_connection_down(const char *detail)
assert(!zfpm_g->t_conn_down);
zfpm_rnodes_iter_init(&zfpm_g->t_conn_down_state.iter);
zfpm_g->t_conn_down = NULL;
- thread_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb, NULL, 0,
- &zfpm_g->t_conn_down);
+ event_add_timer_msec(zfpm_g->master, zfpm_conn_down_thread_cb, NULL, 0,
+ &zfpm_g->t_conn_down);
zfpm_g->stats.t_conn_down_starts++;
zfpm_set_state(ZFPM_STATE_IDLE, detail);
@@ -723,7 +723,7 @@ static void zfpm_connection_down(const char *detail)
/*
* zfpm_read_cb
*/
-static void zfpm_read_cb(struct thread *thread)
+static void zfpm_read_cb(struct event *thread)
{
size_t already;
struct stream *ibuf;
@@ -1152,7 +1152,7 @@ static void zfpm_build_updates(void)
/*
* zfpm_write_cb
*/
-static void zfpm_write_cb(struct thread *thread)
+static void zfpm_write_cb(struct event *thread)
{
struct stream *s;
int num_writes;
@@ -1234,7 +1234,7 @@ static void zfpm_write_cb(struct thread *thread)
/*
* zfpm_connect_cb
*/
-static void zfpm_connect_cb(struct thread *t)
+static void zfpm_connect_cb(struct event *t)
{
int sock, ret;
struct sockaddr_in serv;
@@ -1388,8 +1388,8 @@ static void zfpm_start_connect_timer(const char *reason)
delay_secs = zfpm_calc_connect_delay();
zfpm_debug("scheduling connect in %ld seconds", delay_secs);
- thread_add_timer(zfpm_g->master, zfpm_connect_cb, 0, delay_secs,
- &zfpm_g->t_connect);
+ event_add_timer(zfpm_g->master, zfpm_connect_cb, 0, delay_secs,
+ &zfpm_g->t_connect);
zfpm_set_state(ZFPM_STATE_ACTIVE, reason);
}
@@ -1664,7 +1664,7 @@ static void zfpm_iterate_rmac_table(struct hash_bucket *bucket, void *args)
/*
* struct zfpm_statsimer_cb
*/
-static void zfpm_stats_timer_cb(struct thread *t)
+static void zfpm_stats_timer_cb(struct event *t)
{
zfpm_g->t_stats = NULL;
@@ -1697,7 +1697,7 @@ static void zfpm_stop_stats_timer(void)
return;
zfpm_debug("Stopping existing stats timer");
- THREAD_OFF(zfpm_g->t_stats);
+ EVENT_OFF(zfpm_g->t_stats);
}
/*
@@ -1707,8 +1707,8 @@ void zfpm_start_stats_timer(void)
{
assert(!zfpm_g->t_stats);
- thread_add_timer(zfpm_g->master, zfpm_stats_timer_cb, 0,
- ZFPM_STATS_IVL_SECS, &zfpm_g->t_stats);
+ event_add_timer(zfpm_g->master, zfpm_stats_timer_cb, 0,
+ ZFPM_STATS_IVL_SECS, &zfpm_g->t_stats);
}
/*
@@ -1978,7 +1978,7 @@ static struct cmd_node zebra_node = {
*
* Returns true on success.
*/
-static int zfpm_init(struct thread_master *master)
+static int zfpm_init(struct event_loop *master)
{
int enable = 1;
uint16_t port = 0;