diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-12-25 16:26:52 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-03-24 13:32:17 +0100 |
commit | e16d030c65ca97b1ba68b93ada93b1d4edde59d3 (patch) | |
tree | e3a57a2e2887a899cad71c0640047b2b2409b5fa /ldpd | |
parent | lib, zebra: Convert THREAD_TIMER_STRLEN to EVENT_TIMER_STRLEN (diff) | |
download | frr-e16d030c65ca97b1ba68b93ada93b1d4edde59d3.tar.xz frr-e16d030c65ca97b1ba68b93ada93b1d4edde59d3.zip |
*: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ldpd')
-rw-r--r-- | ldpd/accept.c | 8 | ||||
-rw-r--r-- | ldpd/adjacency.c | 12 | ||||
-rw-r--r-- | ldpd/control.c | 10 | ||||
-rw-r--r-- | ldpd/interface.c | 12 | ||||
-rw-r--r-- | ldpd/lde.c | 12 | ||||
-rw-r--r-- | ldpd/lde_lib.c | 4 | ||||
-rw-r--r-- | ldpd/ldpd.c | 20 | ||||
-rw-r--r-- | ldpd/ldpe.c | 20 | ||||
-rw-r--r-- | ldpd/neighbor.c | 28 | ||||
-rw-r--r-- | ldpd/packet.c | 20 |
10 files changed, 73 insertions, 73 deletions
diff --git a/ldpd/accept.c b/ldpd/accept.c index 2088ce977..8e881e78a 100644 --- a/ldpd/accept.c +++ b/ldpd/accept.c @@ -61,7 +61,7 @@ accept_del(int fd) LIST_FOREACH(av, &accept_queue.queue, entry) if (av->fd == fd) { log_debug("%s: %d removed from queue", __func__, fd); - THREAD_OFF(av->ev); + EVENT_OFF(av->ev); LIST_REMOVE(av, entry); free(av); return; @@ -81,7 +81,7 @@ accept_unpause(void) { if (accept_queue.evt != NULL) { log_debug(__func__); - THREAD_OFF(accept_queue.evt); + EVENT_OFF(accept_queue.evt); accept_arm(); } } @@ -100,12 +100,12 @@ accept_unarm(void) { struct accept_ev *av; LIST_FOREACH(av, &accept_queue.queue, entry) - THREAD_OFF(av->ev); + EVENT_OFF(av->ev); } static void accept_cb(struct event *thread) { - struct accept_ev *av = THREAD_ARG(thread); + struct accept_ev *av = EVENT_ARG(thread); event_add_read(master, accept_cb, av, av->fd, &av->ev); av->accept_cb(thread); } diff --git a/ldpd/adjacency.c b/ldpd/adjacency.c index 794bc66ce..0108af804 100644 --- a/ldpd/adjacency.c +++ b/ldpd/adjacency.c @@ -163,7 +163,7 @@ adj_get_af(const struct adj *adj) /* ARGSUSED */ static void adj_itimer(struct event *thread) { - struct adj *adj = THREAD_ARG(thread); + struct adj *adj = EVENT_ARG(thread); adj->inactivity_timer = NULL; @@ -185,7 +185,7 @@ static void adj_itimer(struct event *thread) void adj_start_itimer(struct adj *adj) { - THREAD_OFF(adj->inactivity_timer); + EVENT_OFF(adj->inactivity_timer); adj->inactivity_timer = NULL; event_add_timer(master, adj_itimer, adj, adj->holdtime, &adj->inactivity_timer); @@ -194,7 +194,7 @@ adj_start_itimer(struct adj *adj) void adj_stop_itimer(struct adj *adj) { - THREAD_OFF(adj->inactivity_timer); + EVENT_OFF(adj->inactivity_timer); } /* targeted neighbors */ @@ -333,7 +333,7 @@ tnbr_get_hello_interval(struct tnbr *tnbr) /* ARGSUSED */ static void tnbr_hello_timer(struct event *thread) { - struct tnbr *tnbr = THREAD_ARG(thread); + struct tnbr *tnbr = EVENT_ARG(thread); tnbr->hello_timer = NULL; send_hello(HELLO_TARGETED, NULL, tnbr); @@ -343,7 +343,7 @@ static void tnbr_hello_timer(struct event *thread) static void tnbr_start_hello_timer(struct tnbr *tnbr) { - THREAD_OFF(tnbr->hello_timer); + EVENT_OFF(tnbr->hello_timer); tnbr->hello_timer = NULL; event_add_timer(master, tnbr_hello_timer, tnbr, tnbr_get_hello_interval(tnbr), &tnbr->hello_timer); @@ -352,7 +352,7 @@ tnbr_start_hello_timer(struct tnbr *tnbr) static void tnbr_stop_hello_timer(struct tnbr *tnbr) { - THREAD_OFF(tnbr->hello_timer); + EVENT_OFF(tnbr->hello_timer); } struct ctl_adj * diff --git a/ldpd/control.c b/ldpd/control.c index ade50edd4..6bb5204d1 100644 --- a/ldpd/control.c +++ b/ldpd/control.c @@ -98,8 +98,8 @@ static void control_accept(struct event *thread) struct ctl_conn *c; len = sizeof(s_un); - if ((connfd = accept(THREAD_FD(thread), (struct sockaddr *)&s_un, - &len)) == -1) { + if ((connfd = accept(EVENT_FD(thread), (struct sockaddr *)&s_un, + &len)) == -1) { /* * Pause accept if we are out of file descriptors, or * libevent will haunt us here too. @@ -169,8 +169,8 @@ control_close(int fd) msgbuf_clear(&c->iev.ibuf.w); TAILQ_REMOVE(&ctl_conns, c, entry); - THREAD_OFF(c->iev.ev_read); - THREAD_OFF(c->iev.ev_write); + EVENT_OFF(c->iev.ev_read); + EVENT_OFF(c->iev.ev_write); close(c->iev.ibuf.fd); accept_unpause(); free(c); @@ -179,7 +179,7 @@ control_close(int fd) /* ARGSUSED */ static void control_dispatch_imsg(struct event *thread) { - int fd = THREAD_FD(thread); + int fd = EVENT_FD(thread); struct ctl_conn *c; struct imsg imsg; ssize_t n; diff --git a/ldpd/interface.c b/ldpd/interface.c index 32a23bf0b..ad5d853b6 100644 --- a/ldpd/interface.c +++ b/ldpd/interface.c @@ -446,7 +446,7 @@ if_get_wait_for_sync_interval(void) /* ARGSUSED */ static void if_hello_timer(struct event *thread) { - struct iface_af *ia = THREAD_ARG(thread); + struct iface_af *ia = EVENT_ARG(thread); ia->hello_timer = NULL; send_hello(HELLO_LINK, ia, NULL); @@ -456,7 +456,7 @@ static void if_hello_timer(struct event *thread) static void if_start_hello_timer(struct iface_af *ia) { - THREAD_OFF(ia->hello_timer); + EVENT_OFF(ia->hello_timer); event_add_timer(master, if_hello_timer, ia, if_get_hello_interval(ia), &ia->hello_timer); } @@ -464,7 +464,7 @@ if_start_hello_timer(struct iface_af *ia) static void if_stop_hello_timer(struct iface_af *ia) { - THREAD_OFF(ia->hello_timer); + EVENT_OFF(ia->hello_timer); } struct ctl_iface * @@ -722,7 +722,7 @@ ldp_sync_act_iface_start_sync(struct iface *iface) static void iface_wait_for_ldp_sync_timer(struct event *thread) { - struct iface *iface = THREAD_ARG(thread); + struct iface *iface = EVENT_ARG(thread); ldp_sync_fsm(iface, LDP_SYNC_EVT_LDP_SYNC_COMPLETE); } @@ -732,7 +732,7 @@ static void start_wait_for_ldp_sync_timer(struct iface *iface) if (iface->ldp_sync.wait_for_sync_timer) return; - THREAD_OFF(iface->ldp_sync.wait_for_sync_timer); + EVENT_OFF(iface->ldp_sync.wait_for_sync_timer); event_add_timer(master, iface_wait_for_ldp_sync_timer, iface, if_get_wait_for_sync_interval(), &iface->ldp_sync.wait_for_sync_timer); @@ -740,7 +740,7 @@ static void start_wait_for_ldp_sync_timer(struct iface *iface) static void stop_wait_for_ldp_sync_timer(struct iface *iface) { - THREAD_OFF(iface->ldp_sync.wait_for_sync_timer); + EVENT_OFF(iface->ldp_sync.wait_for_sync_timer); } static int diff --git a/ldpd/lde.c b/ldpd/lde.c index 78205794b..806bab6a2 100644 --- a/ldpd/lde.c +++ b/ldpd/lde.c @@ -234,7 +234,7 @@ lde_imsg_compose_ldpe(int type, uint32_t peerid, pid_t pid, void *data, /* ARGSUSED */ static void lde_dispatch_imsg(struct event *thread) { - struct imsgev *iev = THREAD_ARG(thread); + struct imsgev *iev = EVENT_ARG(thread); struct imsgbuf *ibuf = &iev->ibuf; struct imsg imsg; struct lde_nbr *ln; @@ -395,8 +395,8 @@ static void lde_dispatch_imsg(struct event *thread) imsg_event_add(iev); else { /* this pipe is dead, so remove the event handlers and exit */ - THREAD_OFF(iev->ev_read); - THREAD_OFF(iev->ev_write); + EVENT_OFF(iev->ev_read); + EVENT_OFF(iev->ev_write); lde_shutdown(); } } @@ -415,7 +415,7 @@ static void lde_dispatch_parent(struct event *thread) struct kif *kif; struct kroute *kr; int fd; - struct imsgev *iev = THREAD_ARG(thread); + struct imsgev *iev = EVENT_ARG(thread); struct imsgbuf *ibuf = &iev->ibuf; ssize_t n; int shut = 0; @@ -673,8 +673,8 @@ static void lde_dispatch_parent(struct event *thread) imsg_event_add(iev); else { /* this pipe is dead, so remove the event handlers and exit */ - THREAD_OFF(iev->ev_read); - THREAD_OFF(iev->ev_write); + EVENT_OFF(iev->ev_read); + EVENT_OFF(iev->ev_write); lde_shutdown(); } } diff --git a/ldpd/lde_lib.c b/ldpd/lde_lib.c index 721a1c11e..470580ff5 100644 --- a/ldpd/lde_lib.c +++ b/ldpd/lde_lib.c @@ -1057,12 +1057,12 @@ void lde_gc_timer(struct event *thread) void lde_gc_start_timer(void) { - THREAD_OFF(gc_timer); + EVENT_OFF(gc_timer); event_add_timer(master, lde_gc_timer, NULL, LDE_GC_INTERVAL, &gc_timer); } void lde_gc_stop_timer(void) { - THREAD_OFF(gc_timer); + EVENT_OFF(gc_timer); } diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c index 30c0472d9..8d173c608 100644 --- a/ldpd/ldpd.c +++ b/ldpd/ldpd.c @@ -559,7 +559,7 @@ start_child(enum ldpd_process p, char *argv0, int fd_async, int fd_sync) /* ARGSUSED */ static void main_dispatch_ldpe(struct event *thread) { - struct imsgev *iev = THREAD_ARG(thread); + struct imsgev *iev = EVENT_ARG(thread); struct imsgbuf *ibuf = &iev->ibuf; struct imsg imsg; int af; @@ -613,8 +613,8 @@ static void main_dispatch_ldpe(struct event *thread) imsg_event_add(iev); else { /* this pipe is dead, so remove the event handlers and exit */ - THREAD_OFF(iev->ev_read); - THREAD_OFF(iev->ev_write); + EVENT_OFF(iev->ev_read); + EVENT_OFF(iev->ev_write); ldpe_pid = 0; if (lde_pid == 0) @@ -627,7 +627,7 @@ static void main_dispatch_ldpe(struct event *thread) /* ARGSUSED */ static void main_dispatch_lde(struct event *thread) { - struct imsgev *iev = THREAD_ARG(thread); + struct imsgev *iev = EVENT_ARG(thread); struct imsgbuf *ibuf = &iev->ibuf; struct imsg imsg; ssize_t n; @@ -722,8 +722,8 @@ static void main_dispatch_lde(struct event *thread) imsg_event_add(iev); else { /* this pipe is dead, so remove the event handlers and exit */ - THREAD_OFF(iev->ev_read); - THREAD_OFF(iev->ev_write); + EVENT_OFF(iev->ev_read); + EVENT_OFF(iev->ev_write); lde_pid = 0; if (ldpe_pid == 0) ldpd_shutdown(); @@ -735,7 +735,7 @@ static void main_dispatch_lde(struct event *thread) /* ARGSUSED */ void ldp_write_handler(struct event *thread) { - struct imsgev *iev = THREAD_ARG(thread); + struct imsgev *iev = EVENT_ARG(thread); struct imsgbuf *ibuf = &iev->ibuf; ssize_t n; @@ -745,8 +745,8 @@ void ldp_write_handler(struct event *thread) fatal("msgbuf_write"); if (n == 0) { /* this pipe is dead, so remove the event handlers */ - THREAD_OFF(iev->ev_read); - THREAD_OFF(iev->ev_write); + EVENT_OFF(iev->ev_read); + EVENT_OFF(iev->ev_write); return; } @@ -835,7 +835,7 @@ void evbuf_init(struct evbuf *eb, int fd, void (*handler)(struct event *), void evbuf_clear(struct evbuf *eb) { - THREAD_OFF(eb->ev); + EVENT_OFF(eb->ev); msgbuf_clear(&eb->wbuf); eb->wbuf.fd = -1; } diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c index 2e6acd8d0..d3193b16d 100644 --- a/ldpd/ldpe.c +++ b/ldpd/ldpe.c @@ -200,7 +200,7 @@ ldpe_shutdown(void) #ifdef __OpenBSD__ if (sysdep.no_pfkey == 0) { - THREAD_OFF(pfkey_ev); + EVENT_OFF(pfkey_ev); close(global.pfkeysock); } #endif @@ -273,7 +273,7 @@ static void ldpe_dispatch_main(struct event *thread) struct l2vpn_pw *pw, *npw; struct imsg imsg; int fd; - struct imsgev *iev = THREAD_ARG(thread); + struct imsgev *iev = EVENT_ARG(thread); struct imsgbuf *ibuf = &iev->ibuf; struct iface *iface = NULL; struct kif *kif; @@ -615,8 +615,8 @@ static void ldpe_dispatch_main(struct event *thread) imsg_event_add(iev); else { /* this pipe is dead, so remove the event handlers and exit */ - THREAD_OFF(iev->ev_read); - THREAD_OFF(iev->ev_write); + EVENT_OFF(iev->ev_read); + EVENT_OFF(iev->ev_write); ldpe_shutdown(); } } @@ -624,7 +624,7 @@ static void ldpe_dispatch_main(struct event *thread) /* ARGSUSED */ static void ldpe_dispatch_lde(struct event *thread) { - struct imsgev *iev = THREAD_ARG(thread); + struct imsgev *iev = EVENT_ARG(thread); struct imsgbuf *ibuf = &iev->ibuf; struct imsg imsg; struct map *map; @@ -751,8 +751,8 @@ static void ldpe_dispatch_lde(struct event *thread) imsg_event_add(iev); else { /* this pipe is dead, so remove the event handlers and exit */ - THREAD_OFF(iev->ev_read); - THREAD_OFF(iev->ev_write); + EVENT_OFF(iev->ev_read); + EVENT_OFF(iev->ev_write); ldpe_shutdown(); } } @@ -761,7 +761,7 @@ static void ldpe_dispatch_lde(struct event *thread) /* ARGSUSED */ static void ldpe_dispatch_pfkey(struct event *thread) { - int fd = THREAD_FD(thread); + int fd = EVENT_FD(thread); event_add_read(master, ldpe_dispatch_pfkey, NULL, global.pfkeysock, &pfkey_ev); @@ -802,14 +802,14 @@ ldpe_close_sockets(int af) af_global = ldp_af_global_get(&global, af); /* discovery socket */ - THREAD_OFF(af_global->disc_ev); + EVENT_OFF(af_global->disc_ev); if (af_global->ldp_disc_socket != -1) { close(af_global->ldp_disc_socket); af_global->ldp_disc_socket = -1; } /* extended discovery socket */ - THREAD_OFF(af_global->edisc_ev); + EVENT_OFF(af_global->edisc_ev); if (af_global->ldp_edisc_socket != -1) { close(af_global->ldp_edisc_socket); af_global->ldp_edisc_socket = -1; diff --git a/ldpd/neighbor.c b/ldpd/neighbor.c index 50a35e9f6..6f9177fe8 100644 --- a/ldpd/neighbor.c +++ b/ldpd/neighbor.c @@ -296,7 +296,7 @@ nbr_del(struct nbr *nbr) nbr->auth.method = AUTH_NONE; if (nbr_pending_connect(nbr)) - THREAD_OFF(nbr->ev_connect); + EVENT_OFF(nbr->ev_connect); nbr_stop_ktimer(nbr); nbr_stop_ktimeout(nbr); nbr_stop_itimeout(nbr); @@ -409,7 +409,7 @@ nbr_session_active_role(struct nbr *nbr) static void nbr_ktimer(struct event *thread) { - struct nbr *nbr = THREAD_ARG(thread); + struct nbr *nbr = EVENT_ARG(thread); nbr->keepalive_timer = NULL; send_keepalive(nbr); @@ -423,7 +423,7 @@ nbr_start_ktimer(struct nbr *nbr) /* send three keepalives per period */ secs = nbr->keepalive / KEEPALIVE_PER_PERIOD; - THREAD_OFF(nbr->keepalive_timer); + EVENT_OFF(nbr->keepalive_timer); nbr->keepalive_timer = NULL; event_add_timer(master, nbr_ktimer, nbr, secs, &nbr->keepalive_timer); } @@ -431,14 +431,14 @@ nbr_start_ktimer(struct nbr *nbr) void nbr_stop_ktimer(struct nbr *nbr) { - THREAD_OFF(nbr->keepalive_timer); + EVENT_OFF(nbr->keepalive_timer); } /* Keepalive timeout: if the nbr hasn't sent keepalive */ static void nbr_ktimeout(struct event *thread) { - struct nbr *nbr = THREAD_ARG(thread); + struct nbr *nbr = EVENT_ARG(thread); nbr->keepalive_timeout = NULL; @@ -450,7 +450,7 @@ static void nbr_ktimeout(struct event *thread) static void nbr_start_ktimeout(struct nbr *nbr) { - THREAD_OFF(nbr->keepalive_timeout); + EVENT_OFF(nbr->keepalive_timeout); nbr->keepalive_timeout = NULL; event_add_timer(master, nbr_ktimeout, nbr, nbr->keepalive, &nbr->keepalive_timeout); @@ -459,14 +459,14 @@ nbr_start_ktimeout(struct nbr *nbr) void nbr_stop_ktimeout(struct nbr *nbr) { - THREAD_OFF(nbr->keepalive_timeout); + EVENT_OFF(nbr->keepalive_timeout); } /* Session initialization timeout: if nbr got stuck in the initialization FSM */ static void nbr_itimeout(struct event *thread) { - struct nbr *nbr = THREAD_ARG(thread); + struct nbr *nbr = EVENT_ARG(thread); log_debug("%s: lsr-id %pI4", __func__, &nbr->id); @@ -479,7 +479,7 @@ nbr_start_itimeout(struct nbr *nbr) int secs; secs = INIT_FSM_TIMEOUT; - THREAD_OFF(nbr->init_timeout); + EVENT_OFF(nbr->init_timeout); nbr->init_timeout = NULL; event_add_timer(master, nbr_itimeout, nbr, secs, &nbr->init_timeout); } @@ -487,14 +487,14 @@ nbr_start_itimeout(struct nbr *nbr) void nbr_stop_itimeout(struct nbr *nbr) { - THREAD_OFF(nbr->init_timeout); + EVENT_OFF(nbr->init_timeout); } /* Init delay timer: timer to retry to iniziatize session */ static void nbr_idtimer(struct event *thread) { - struct nbr *nbr = THREAD_ARG(thread); + struct nbr *nbr = EVENT_ARG(thread); nbr->initdelay_timer = NULL; @@ -525,7 +525,7 @@ nbr_start_idtimer(struct nbr *nbr) break; } - THREAD_OFF(nbr->initdelay_timer); + EVENT_OFF(nbr->initdelay_timer); nbr->initdelay_timer = NULL; event_add_timer(master, nbr_idtimer, nbr, secs, &nbr->initdelay_timer); } @@ -533,7 +533,7 @@ nbr_start_idtimer(struct nbr *nbr) void nbr_stop_idtimer(struct nbr *nbr) { - THREAD_OFF(nbr->initdelay_timer); + EVENT_OFF(nbr->initdelay_timer); } int @@ -550,7 +550,7 @@ nbr_pending_connect(struct nbr *nbr) static void nbr_connect_cb(struct event *thread) { - struct nbr *nbr = THREAD_ARG(thread); + struct nbr *nbr = EVENT_ARG(thread); int error; socklen_t len; diff --git a/ldpd/packet.c b/ldpd/packet.c index ef2f6e82b..71eeb1adb 100644 --- a/ldpd/packet.c +++ b/ldpd/packet.c @@ -97,8 +97,8 @@ send_packet(int fd, int af, union ldpd_addr *dst, struct iface_af *ia, /* Discovery functions */ void disc_recv_packet(struct event *thread) { - int fd = THREAD_FD(thread); - struct event **threadp = THREAD_ARG(thread); + int fd = EVENT_FD(thread); + struct event **threadp = EVENT_ARG(thread); union { struct cmsghdr hdr; @@ -292,7 +292,7 @@ disc_find_iface(unsigned int ifindex, int af, union ldpd_addr *src) void session_accept(struct event *thread) { - int fd = THREAD_FD(thread); + int fd = EVENT_FD(thread); struct sockaddr_storage src; socklen_t len = sizeof(src); int newfd; @@ -396,8 +396,8 @@ session_accept_nbr(struct nbr *nbr, int fd) static void session_read(struct event *thread) { - int fd = THREAD_FD(thread); - struct nbr *nbr = THREAD_ARG(thread); + int fd = EVENT_FD(thread); + struct nbr *nbr = EVENT_ARG(thread); struct tcp_conn *tcp = nbr->tcp; struct ldp_hdr *ldp_hdr; struct ldp_msg *msg; @@ -612,7 +612,7 @@ static void session_read(struct event *thread) static void session_write(struct event *thread) { - struct tcp_conn *tcp = THREAD_ARG(thread); + struct tcp_conn *tcp = EVENT_ARG(thread); struct nbr *nbr = tcp->nbr; tcp->wbuf.ev = NULL; @@ -640,7 +640,7 @@ session_shutdown(struct nbr *nbr, uint32_t status, uint32_t msg_id, switch (nbr->state) { case NBR_STA_PRESENT: if (nbr_pending_connect(nbr)) - THREAD_OFF(nbr->ev_connect); + EVENT_OFF(nbr->ev_connect); break; case NBR_STA_INITIAL: case NBR_STA_OPENREC: @@ -745,7 +745,7 @@ tcp_close(struct tcp_conn *tcp) evbuf_clear(&tcp->wbuf); if (tcp->nbr) { - THREAD_OFF(tcp->rev); + EVENT_OFF(tcp->rev); free(tcp->rbuf); tcp->nbr->tcp = NULL; } @@ -777,7 +777,7 @@ pending_conn_new(int fd, int af, union ldpd_addr *addr) void pending_conn_del(struct pending_conn *pconn) { - THREAD_OFF(pconn->ev_timeout); + EVENT_OFF(pconn->ev_timeout); TAILQ_REMOVE(&global.pending_conns, pconn, entry); free(pconn); } @@ -797,7 +797,7 @@ pending_conn_find(int af, union ldpd_addr *addr) static void pending_conn_timeout(struct event *thread) { - struct pending_conn *pconn = THREAD_ARG(thread); + struct pending_conn *pconn = EVENT_ARG(thread); struct tcp_conn *tcp; pconn->ev_timeout = NULL; |