diff options
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim6_mld.c | 56 | ||||
-rw-r--r-- | pimd/pim_assert.c | 4 | ||||
-rw-r--r-- | pimd/pim_bsm.c | 18 | ||||
-rw-r--r-- | pimd/pim_ifchannel.c | 40 | ||||
-rw-r--r-- | pimd/pim_igmp.c | 20 | ||||
-rw-r--r-- | pimd/pim_igmpv3.c | 6 | ||||
-rw-r--r-- | pimd/pim_join.c | 5 | ||||
-rw-r--r-- | pimd/pim_mroute.c | 4 | ||||
-rw-r--r-- | pimd/pim_msdp.c | 20 | ||||
-rw-r--r-- | pimd/pim_msdp_packet.c | 4 | ||||
-rw-r--r-- | pimd/pim_msdp_socket.c | 4 | ||||
-rw-r--r-- | pimd/pim_neighbor.c | 12 | ||||
-rw-r--r-- | pimd/pim_pim.c | 14 | ||||
-rw-r--r-- | pimd/pim_register.c | 2 | ||||
-rw-r--r-- | pimd/pim_ssmpingd.c | 4 | ||||
-rw-r--r-- | pimd/pim_upstream.c | 32 | ||||
-rw-r--r-- | pimd/pim_vxlan.c | 4 | ||||
-rw-r--r-- | pimd/pim_zebra.c | 2 | ||||
-rw-r--r-- | pimd/pim_zlookup.c | 6 |
19 files changed, 128 insertions, 129 deletions
diff --git a/pimd/pim6_mld.c b/pimd/pim6_mld.c index 5a33fdb26..7d3b084f3 100644 --- a/pimd/pim6_mld.c +++ b/pimd/pim6_mld.c @@ -329,7 +329,7 @@ static void gm_expiry_calc(struct gm_query_timers *timers) static void gm_sg_free(struct gm_sg *sg) { /* t_sg_expiry is handled before this is reached */ - THREAD_OFF(sg->t_sg_query); + EVENT_OFF(sg->t_sg_query); gm_packet_sg_subs_fini(sg->subs_negative); gm_packet_sg_subs_fini(sg->subs_positive); XFREE(MTYPE_GM_SG, sg); @@ -404,7 +404,7 @@ static void gm_sg_update(struct gm_sg *sg, bool has_expired) gm_expiry_calc(&timers); gm_sg_timer_start(gm_ifp, sg, timers.expire_wait); - THREAD_OFF(sg->t_sg_query); + EVENT_OFF(sg->t_sg_query); sg->n_query = gm_ifp->cur_lmqc; sg->query_sbit = false; gm_trigger_specific(sg); @@ -443,7 +443,7 @@ static void gm_sg_update(struct gm_sg *sg, bool has_expired) * another path. */ if (has_expired) - THREAD_OFF(sg->t_sg_expire); + EVENT_OFF(sg->t_sg_expire); assertf((!sg->t_sg_expire && !gm_packet_sg_subs_count(sg->subs_positive) && @@ -582,7 +582,7 @@ static void gm_sg_expiry_cancel(struct gm_sg *sg) { if (sg->t_sg_expire && PIM_DEBUG_GM_TRACE) zlog_debug(log_sg(sg, "alive, cancelling expiry timer")); - THREAD_OFF(sg->t_sg_expire); + EVENT_OFF(sg->t_sg_expire); sg->query_sbit = true; } @@ -1031,7 +1031,7 @@ static void gm_handle_v1_leave(struct gm_if *gm_ifp, */ static void gm_t_expire(struct event *t) { - struct gm_if *gm_ifp = THREAD_ARG(t); + struct gm_if *gm_ifp = EVENT_ARG(t); struct gm_packet_state *pkt; zlog_info(log_ifp("general expiry timer")); @@ -1103,7 +1103,7 @@ static void gm_handle_q_general(struct gm_if *gm_ifp, gm_ifp->n_pending--; if (!gm_ifp->n_pending) - THREAD_OFF(gm_ifp->t_expire); + EVENT_OFF(gm_ifp->t_expire); } /* people might be messing with their configs or something */ @@ -1128,7 +1128,7 @@ static void gm_handle_q_general(struct gm_if *gm_ifp, static void gm_t_sg_expire(struct event *t) { - struct gm_sg *sg = THREAD_ARG(t); + struct gm_sg *sg = EVENT_ARG(t); struct gm_if *gm_ifp = sg->iface; struct gm_packet_sg *item; @@ -1212,7 +1212,7 @@ static void gm_sg_timer_start(struct gm_if *gm_ifp, struct gm_sg *sg, if (timercmp(&remain, &expire_wait, <=)) return; - THREAD_OFF(sg->t_sg_expire); + EVENT_OFF(sg->t_sg_expire); } event_add_timer_tv(router->master, gm_t_sg_expire, sg, &expire_wait, @@ -1240,7 +1240,7 @@ static void gm_t_grp_expire(struct event *t) * receive a report, so that work is left to gm_t_sg_expire and we * shouldn't worry about it here. */ - struct gm_grp_pending *pend = THREAD_ARG(t); + struct gm_grp_pending *pend = EVENT_ARG(t); struct gm_if *gm_ifp = pend->iface; struct gm_sg *sg, *sg_start, sg_ref = {}; @@ -1269,7 +1269,7 @@ static void gm_t_grp_expire(struct event *t) * parallel. But if we received nothing for the *,G query, * the S,G query is kinda irrelevant. */ - THREAD_OFF(sg->t_sg_expire); + EVENT_OFF(sg->t_sg_expire); frr_each_safe (gm_packet_sg_subs, sg->subs_positive, item) /* this will also drop the EXCLUDE S,G lists */ @@ -1320,7 +1320,7 @@ static void gm_handle_q_group(struct gm_if *gm_ifp, if (timercmp(&remain, &timers->expire_wait, <=)) return; - THREAD_OFF(pend->t_expire); + EVENT_OFF(pend->t_expire); } else { pend = XCALLOC(MTYPE_GM_GRP_PENDING, sizeof(*pend)); pend->grp = grp; @@ -1341,7 +1341,7 @@ static void gm_bump_querier(struct gm_if *gm_ifp) { struct pim_interface *pim_ifp = gm_ifp->ifp->info; - THREAD_OFF(gm_ifp->t_query); + EVENT_OFF(gm_ifp->t_query); if (pim_addr_is_any(pim_ifp->ll_lowest)) return; @@ -1355,7 +1355,7 @@ static void gm_bump_querier(struct gm_if *gm_ifp) static void gm_t_other_querier(struct event *t) { - struct gm_if *gm_ifp = THREAD_ARG(t); + struct gm_if *gm_ifp = EVENT_ARG(t); struct pim_interface *pim_ifp = gm_ifp->ifp->info; zlog_info(log_ifp("other querier timer expired")); @@ -1466,8 +1466,8 @@ static void gm_handle_query(struct gm_if *gm_ifp, if (IPV6_ADDR_CMP(&pkt_src->sin6_addr, &pim_ifp->ll_lowest) < 0) { unsigned int other_ms; - THREAD_OFF(gm_ifp->t_query); - THREAD_OFF(gm_ifp->t_other_querier); + EVENT_OFF(gm_ifp->t_query); + EVENT_OFF(gm_ifp->t_other_querier); other_ms = timers.qrv * timers.qqic_ms + timers.max_resp_ms / 2; event_add_timer_msec(router->master, gm_t_other_querier, gm_ifp, @@ -1587,7 +1587,7 @@ static bool ip6_check_hopopts_ra(uint8_t *hopopts, size_t hopopt_len, static void gm_t_recv(struct event *t) { - struct pim_instance *pim = THREAD_ARG(t); + struct pim_instance *pim = EVENT_ARG(t); union { char buf[CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(256) /* hop options */ + @@ -1859,7 +1859,7 @@ static void gm_send_query(struct gm_if *gm_ifp, pim_addr grp, static void gm_t_query(struct event *t) { - struct gm_if *gm_ifp = THREAD_ARG(t); + struct gm_if *gm_ifp = EVENT_ARG(t); unsigned int timer_ms = gm_ifp->cur_query_intv; if (gm_ifp->n_startup) { @@ -1875,7 +1875,7 @@ static void gm_t_query(struct event *t) static void gm_t_sg_query(struct event *t) { - struct gm_sg *sg = THREAD_ARG(t); + struct gm_sg *sg = EVENT_ARG(t); gm_trigger_specific(sg); } @@ -1896,7 +1896,7 @@ static void gm_send_specific(struct gm_gsq_pending *pend_gsq) static void gm_t_gsq_pend(struct event *t) { - struct gm_gsq_pending *pend_gsq = THREAD_ARG(t); + struct gm_gsq_pending *pend_gsq = EVENT_ARG(t); gm_send_specific(pend_gsq); } @@ -1947,7 +1947,7 @@ static void gm_trigger_specific(struct gm_sg *sg) pend_gsq->n_src++; if (pend_gsq->n_src == array_size(pend_gsq->srcs)) { - THREAD_OFF(pend_gsq->t_send); + EVENT_OFF(pend_gsq->t_send); gm_send_specific(pend_gsq); pend_gsq = NULL; } @@ -2053,7 +2053,7 @@ static void gm_vrf_socket_decref(struct pim_instance *pim) if (--pim->gm_socket_if_count) return; - THREAD_OFF(pim->t_gm_recv); + EVENT_OFF(pim->t_gm_recv); close(pim->gm_socket); pim->gm_socket = -1; } @@ -2126,17 +2126,17 @@ void gm_group_delete(struct gm_if *gm_ifp) gm_packet_drop(pkt, false); while ((pend_grp = gm_grp_pends_pop(gm_ifp->grp_pends))) { - THREAD_OFF(pend_grp->t_expire); + EVENT_OFF(pend_grp->t_expire); XFREE(MTYPE_GM_GRP_PENDING, pend_grp); } while ((pend_gsq = gm_gsq_pends_pop(gm_ifp->gsq_pends))) { - THREAD_OFF(pend_gsq->t_send); + EVENT_OFF(pend_gsq->t_send); XFREE(MTYPE_GM_GSQ_PENDING, pend_gsq); } while ((sg = gm_sgs_pop(gm_ifp->sgs))) { - THREAD_OFF(sg->t_sg_expire); + EVENT_OFF(sg->t_sg_expire); assertf(!gm_packet_sg_subs_count(sg->subs_negative), "%pSG", &sg->sgaddr); assertf(!gm_packet_sg_subs_count(sg->subs_positive), "%pSG", @@ -2164,9 +2164,9 @@ void gm_ifp_teardown(struct interface *ifp) if (PIM_DEBUG_GM_EVENTS) zlog_debug(log_ifp("MLD stop")); - THREAD_OFF(gm_ifp->t_query); - THREAD_OFF(gm_ifp->t_other_querier); - THREAD_OFF(gm_ifp->t_expire); + EVENT_OFF(gm_ifp->t_query); + EVENT_OFF(gm_ifp->t_other_querier); + EVENT_OFF(gm_ifp->t_expire); frr_with_privs (&pimd_privs) { struct ipv6_mreq mreq; @@ -2209,7 +2209,7 @@ static void gm_update_ll(struct interface *ifp) gm_ifp->cur_ll_lowest = pim_ifp->ll_lowest; if (was_querier) gm_ifp->querier = pim_ifp->ll_lowest; - THREAD_OFF(gm_ifp->t_query); + EVENT_OFF(gm_ifp->t_query); if (pim_addr_is_any(gm_ifp->cur_ll_lowest)) { if (was_querier) diff --git a/pimd/pim_assert.c b/pimd/pim_assert.c index 6478d539a..86d9a745e 100644 --- a/pimd/pim_assert.c +++ b/pimd/pim_assert.c @@ -498,7 +498,7 @@ static void on_assert_timer(struct event *t) struct pim_ifchannel *ch; struct interface *ifp; - ch = THREAD_ARG(t); + ch = EVENT_ARG(t); ifp = ch->interface; @@ -535,7 +535,7 @@ static void assert_timer_off(struct pim_ifchannel *ch) __func__, ch->sg_str, ch->interface->name); } } - THREAD_OFF(ch->t_ifassert_timer); + EVENT_OFF(ch->t_ifassert_timer); } static void pim_assert_timer_set(struct pim_ifchannel *ch, int interval) diff --git a/pimd/pim_bsm.c b/pimd/pim_bsm.c index ec2bfdcb2..b36e00631 100644 --- a/pimd/pim_bsm.c +++ b/pimd/pim_bsm.c @@ -54,7 +54,7 @@ void pim_bsm_write_config(struct vty *vty, struct interface *ifp) static void pim_bsm_rpinfo_free(struct bsm_rpinfo *bsrp_info) { - THREAD_OFF(bsrp_info->g2rp_timer); + EVENT_OFF(bsrp_info->g2rp_timer); XFREE(MTYPE_PIM_BSRP_INFO, bsrp_info); } @@ -147,8 +147,8 @@ static void pim_on_bs_timer(struct event *t) struct bsgrp_node *bsgrp_node; struct bsm_rpinfo *bsrp; - scope = THREAD_ARG(t); - THREAD_OFF(scope->bs_timer); + scope = EVENT_ARG(t); + EVENT_OFF(scope->bs_timer); if (PIM_DEBUG_BSM) zlog_debug("%s: Bootstrap Timer expired for scope: %d", @@ -189,7 +189,7 @@ static void pim_bs_timer_stop(struct bsm_scope *scope) if (PIM_DEBUG_BSM) zlog_debug("%s : BS timer being stopped of sz: %d", __func__, scope->sz_id); - THREAD_OFF(scope->bs_timer); + EVENT_OFF(scope->bs_timer); } static void pim_bs_timer_start(struct bsm_scope *scope, int bs_timeout) @@ -199,7 +199,7 @@ static void pim_bs_timer_start(struct bsm_scope *scope, int bs_timeout) zlog_debug("%s : Invalid scope(NULL).", __func__); return; } - THREAD_OFF(scope->bs_timer); + EVENT_OFF(scope->bs_timer); if (PIM_DEBUG_BSM) zlog_debug( "%s : starting bs timer for scope %d with timeout %d secs", @@ -268,8 +268,8 @@ static void pim_on_g2rp_timer(struct event *t) uint16_t elapse; pim_addr bsrp_addr; - bsrp = THREAD_ARG(t); - THREAD_OFF(bsrp->g2rp_timer); + bsrp = EVENT_ARG(t); + EVENT_OFF(bsrp->g2rp_timer); bsgrp_node = bsrp->bsgrp_node; /* elapse time is the hold time of expired node */ @@ -331,7 +331,7 @@ static void pim_g2rp_timer_start(struct bsm_rpinfo *bsrp, int hold_time) zlog_debug("%s : Invalid brsp(NULL).", __func__); return; } - THREAD_OFF(bsrp->g2rp_timer); + EVENT_OFF(bsrp->g2rp_timer); if (PIM_DEBUG_BSM) zlog_debug( "%s : starting g2rp timer for grp: %pFX - rp: %pPAs with timeout %d secs(Actual Hold time : %d secs)", @@ -358,7 +358,7 @@ static void pim_g2rp_timer_stop(struct bsm_rpinfo *bsrp) __func__, &bsrp->bsgrp_node->group, &bsrp->rp_address); - THREAD_OFF(bsrp->g2rp_timer); + EVENT_OFF(bsrp->g2rp_timer); } static bool is_hold_time_zero(void *data) diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c index 41b093ab5..15c337901 100644 --- a/pimd/pim_ifchannel.c +++ b/pimd/pim_ifchannel.c @@ -193,9 +193,9 @@ void pim_ifchannel_delete(struct pim_ifchannel *ch) ch->upstream = NULL; - THREAD_OFF(ch->t_ifjoin_expiry_timer); - THREAD_OFF(ch->t_ifjoin_prune_pending_timer); - THREAD_OFF(ch->t_ifassert_timer); + EVENT_OFF(ch->t_ifjoin_expiry_timer); + EVENT_OFF(ch->t_ifjoin_prune_pending_timer); + EVENT_OFF(ch->t_ifassert_timer); if (ch->parent) { listnode_delete(ch->parent->sources, ch); @@ -411,7 +411,7 @@ const char *pim_ifchannel_ifassert_name(enum pim_ifassert_state ifassert_state) */ void reset_ifassert_state(struct pim_ifchannel *ch) { - THREAD_OFF(ch->t_ifassert_timer); + EVENT_OFF(ch->t_ifassert_timer); pim_ifassert_winner_set(ch, PIM_IFASSERT_NOINFO, PIMADDR_ANY, router->infinite_assert_metric); @@ -632,7 +632,7 @@ static void on_ifjoin_expiry_timer(struct event *t) { struct pim_ifchannel *ch; - ch = THREAD_ARG(t); + ch = EVENT_ARG(t); if (PIM_DEBUG_PIM_TRACE) zlog_debug("%s: ifchannel %s expiry timer", __func__, @@ -649,7 +649,7 @@ static void on_ifjoin_prune_pending_timer(struct event *t) struct interface *ifp; struct pim_interface *pim_ifp; - ch = THREAD_ARG(t); + ch = EVENT_ARG(t); if (PIM_DEBUG_PIM_TRACE) zlog_debug("%s: IFCHANNEL%pSG %s Prune Pending Timer Popped", @@ -920,13 +920,13 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr, return; } } - THREAD_OFF(ch->t_ifjoin_expiry_timer); + EVENT_OFF(ch->t_ifjoin_expiry_timer); break; case PIM_IFJOIN_PRUNE: if (source_flags & PIM_ENCODE_RPT_BIT) { pim_ifchannel_ifjoin_switch(__func__, ch, PIM_IFJOIN_NOINFO); - THREAD_OFF(ch->t_ifjoin_expiry_timer); + EVENT_OFF(ch->t_ifjoin_expiry_timer); delete_on_noinfo(ch); return; } else @@ -943,7 +943,7 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr, * maximum of its current value and the HoldTime from the * triggering Join/Prune message. */ - THREAD_OFF(ch->t_ifjoin_prune_pending_timer); + EVENT_OFF(ch->t_ifjoin_prune_pending_timer); /* Check if SGRpt join Received */ if ((source_flags & PIM_ENCODE_RPT_BIT) && @@ -955,7 +955,7 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr, * I transitions to the NoInfo state.The ET and PPT are * cancelled. */ - THREAD_OFF(ch->t_ifjoin_expiry_timer); + EVENT_OFF(ch->t_ifjoin_expiry_timer); pim_ifchannel_ifjoin_switch(__func__, ch, PIM_IFJOIN_NOINFO); return; @@ -970,7 +970,7 @@ void pim_ifchannel_join_add(struct interface *ifp, pim_addr neigh_addr, if (remain > holdtime) return; } - THREAD_OFF(ch->t_ifjoin_expiry_timer); + EVENT_OFF(ch->t_ifjoin_expiry_timer); break; case PIM_IFJOIN_PRUNE_TMP: @@ -1030,8 +1030,8 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream, be taken not to use "ch" afterwards since it would be deleted. */ - THREAD_OFF(ch->t_ifjoin_prune_pending_timer); - THREAD_OFF(ch->t_ifjoin_expiry_timer); + EVENT_OFF(ch->t_ifjoin_prune_pending_timer); + EVENT_OFF(ch->t_ifjoin_expiry_timer); event_add_timer_msec(router->master, on_ifjoin_prune_pending_timer, ch, jp_override_interval_msec, @@ -1068,7 +1068,7 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream, /* If we called ifjoin_prune() directly instead, care should be taken not to use "ch" afterwards since it would be deleted. */ - THREAD_OFF(ch->t_ifjoin_prune_pending_timer); + EVENT_OFF(ch->t_ifjoin_prune_pending_timer); event_add_timer_msec(router->master, on_ifjoin_prune_pending_timer, ch, jp_override_interval_msec, @@ -1076,7 +1076,7 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream, break; case PIM_IFJOIN_PRUNE: if (source_flags & PIM_ENCODE_RPT_BIT) { - THREAD_OFF(ch->t_ifjoin_prune_pending_timer); + EVENT_OFF(ch->t_ifjoin_prune_pending_timer); /* * While in Prune State, Receive SGRpt Prune. * RFC 7761 Sec 4.5.3: @@ -1092,7 +1092,7 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream, if (rem > holdtime) return; - THREAD_OFF(ch->t_ifjoin_expiry_timer); + EVENT_OFF(ch->t_ifjoin_expiry_timer); } event_add_timer(router->master, on_ifjoin_expiry_timer, @@ -1103,7 +1103,7 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream, case PIM_IFJOIN_PRUNE_TMP: if (source_flags & PIM_ENCODE_RPT_BIT) { ch->ifjoin_state = PIM_IFJOIN_PRUNE; - THREAD_OFF(ch->t_ifjoin_expiry_timer); + EVENT_OFF(ch->t_ifjoin_expiry_timer); event_add_timer(router->master, on_ifjoin_expiry_timer, ch, holdtime, &ch->t_ifjoin_expiry_timer); @@ -1112,7 +1112,7 @@ void pim_ifchannel_prune(struct interface *ifp, pim_addr upstream, case PIM_IFJOIN_PRUNE_PENDING_TMP: if (source_flags & PIM_ENCODE_RPT_BIT) { ch->ifjoin_state = PIM_IFJOIN_PRUNE_PENDING; - THREAD_OFF(ch->t_ifjoin_expiry_timer); + EVENT_OFF(ch->t_ifjoin_expiry_timer); event_add_timer(router->master, on_ifjoin_expiry_timer, ch, holdtime, &ch->t_ifjoin_expiry_timer); @@ -1466,8 +1466,8 @@ void pim_ifchannel_set_star_g_join_state(struct pim_ifchannel *ch, int eom, break; if (child->ifjoin_state == PIM_IFJOIN_PRUNE_PENDING_TMP) - THREAD_OFF(child->t_ifjoin_prune_pending_timer); - THREAD_OFF(child->t_ifjoin_expiry_timer); + EVENT_OFF(child->t_ifjoin_prune_pending_timer); + EVENT_OFF(child->t_ifjoin_expiry_timer); PIM_IF_FLAG_UNSET_S_G_RPT(child->flags); child->ifjoin_state = PIM_IFJOIN_NOINFO; diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index a8c125df2..063ba6edd 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -329,7 +329,7 @@ static void pim_igmp_other_querier_expire(struct event *t) { struct gm_sock *igmp; - igmp = THREAD_ARG(t); + igmp = EVENT_ARG(t); assert(!igmp->t_igmp_query_timer); @@ -377,7 +377,7 @@ void pim_igmp_other_querier_timer_on(struct gm_sock *igmp) "Querier %s resetting TIMER event for Other-Querier-Present", ifaddr_str); } - THREAD_OFF(igmp->t_other_querier_timer); + EVENT_OFF(igmp->t_other_querier_timer); } else { /* We are the current querier, then stop sending general queries: @@ -439,7 +439,7 @@ void pim_igmp_other_querier_timer_off(struct gm_sock *igmp) ifaddr_str, igmp->fd, igmp->interface->name); } } - THREAD_OFF(igmp->t_other_querier_timer); + EVENT_OFF(igmp->t_other_querier_timer); } int igmp_validate_checksum(char *igmp_msg, int igmp_msg_len) @@ -883,7 +883,7 @@ void pim_igmp_general_query_off(struct gm_sock *igmp) ifaddr_str, igmp->fd, igmp->interface->name); } } - THREAD_OFF(igmp->t_igmp_query_timer); + EVENT_OFF(igmp->t_igmp_query_timer); } /* Issue IGMP general query */ @@ -895,7 +895,7 @@ static void pim_igmp_general_query(struct event *t) struct pim_interface *pim_ifp; int query_buf_size; - igmp = THREAD_ARG(t); + igmp = EVENT_ARG(t); assert(igmp->interface); assert(igmp->interface->info); @@ -953,7 +953,7 @@ static void sock_close(struct gm_sock *igmp) igmp->interface->name); } } - THREAD_OFF(igmp->t_igmp_read); + EVENT_OFF(igmp->t_igmp_read); if (close(igmp->fd)) { flog_err( @@ -1045,7 +1045,7 @@ void igmp_group_delete(struct gm_group *group) igmp_source_delete(src); } - THREAD_OFF(group->t_group_query_retransmit_timer); + EVENT_OFF(group->t_group_query_retransmit_timer); group_timer_off(group); igmp_group_count_decr(pim_ifp); @@ -1211,7 +1211,7 @@ static void igmp_read_on(struct gm_sock *igmp); static void pim_igmp_read(struct event *t) { uint8_t buf[10000]; - struct gm_sock *igmp = (struct gm_sock *)THREAD_ARG(t); + struct gm_sock *igmp = (struct gm_sock *)EVENT_ARG(t); struct sockaddr_storage from; struct sockaddr_storage to; socklen_t fromlen = sizeof(from); @@ -1304,7 +1304,7 @@ static void igmp_group_timer(struct event *t) { struct gm_group *group; - group = THREAD_ARG(t); + group = EVENT_ARG(t); if (PIM_DEBUG_GM_TRACE) { char group_str[INET_ADDRSTRLEN]; @@ -1348,7 +1348,7 @@ static void group_timer_off(struct gm_group *group) zlog_debug("Cancelling TIMER event for group %s on %s", group_str, group->interface->name); } - THREAD_OFF(group->t_group_timer); + EVENT_OFF(group->t_group_timer); } void igmp_group_timer_on(struct gm_group *group, long interval_msec, diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index 1906516a9..15078dd1e 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -112,7 +112,7 @@ static void igmp_source_timer(struct event *t) struct gm_source *source; struct gm_group *group; - source = THREAD_ARG(t); + source = EVENT_ARG(t); group = source->source_group; @@ -187,7 +187,7 @@ static void source_timer_off(struct gm_group *group, struct gm_source *source) group_str, source_str, group->interface->name); } - THREAD_OFF(source->t_source_timer); + EVENT_OFF(source->t_source_timer); } static void igmp_source_timer_on(struct gm_group *group, @@ -1206,7 +1206,7 @@ static void igmp_group_retransmit(struct event *t) int num_retransmit_sources_left; int send_with_sflag_set; /* boolean */ - group = THREAD_ARG(t); + group = EVENT_ARG(t); if (PIM_DEBUG_GM_TRACE) { char group_str[INET_ADDRSTRLEN]; diff --git a/pimd/pim_join.c b/pimd/pim_join.c index 20821d58b..671f7a37a 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.c @@ -326,10 +326,9 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh, if (PIM_IF_FLAG_TEST_S_G_RPT(child->flags)) { if (child->ifjoin_state == PIM_IFJOIN_PRUNE_PENDING_TMP) - THREAD_OFF( + EVENT_OFF( child->t_ifjoin_prune_pending_timer); - THREAD_OFF( - child->t_ifjoin_expiry_timer); + EVENT_OFF(child->t_ifjoin_expiry_timer); PIM_IF_FLAG_UNSET_S_G_RPT(child->flags); child->ifjoin_state = PIM_IFJOIN_NOINFO; delete_on_noinfo(child); diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index f3c6ef650..4d5da3182 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -775,7 +775,7 @@ static void mroute_read(struct event *t) int cont = 1; int rd; ifindex_t ifindex; - pim = THREAD_ARG(t); + pim = EVENT_ARG(t); while (cont) { rd = pim_socket_recvfromto(pim->mroute_socket, (uint8_t *)buf, @@ -815,7 +815,7 @@ static void mroute_read_on(struct pim_instance *pim) static void mroute_read_off(struct pim_instance *pim) { - THREAD_OFF(pim->thread); + EVENT_OFF(pim->thread); } int pim_mroute_socket_enable(struct pim_instance *pim) diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c index 9726da544..18146db52 100644 --- a/pimd/pim_msdp.c +++ b/pimd/pim_msdp.c @@ -56,7 +56,7 @@ static void pim_msdp_sa_timer_expiry_log(struct pim_msdp_sa *sa, /* RFC-3618:Sec-5.1 - global active source advertisement timer */ static void pim_msdp_sa_adv_timer_cb(struct event *t) { - struct pim_instance *pim = THREAD_ARG(t); + struct pim_instance *pim = EVENT_ARG(t); if (PIM_DEBUG_MSDP_EVENTS) { zlog_debug("MSDP SA advertisement timer expired"); @@ -68,7 +68,7 @@ static void pim_msdp_sa_adv_timer_cb(struct event *t) static void pim_msdp_sa_adv_timer_setup(struct pim_instance *pim, bool start) { - THREAD_OFF(pim->msdp.sa_adv_timer); + EVENT_OFF(pim->msdp.sa_adv_timer); if (start) { event_add_timer(pim->msdp.master, pim_msdp_sa_adv_timer_cb, pim, PIM_MSDP_SA_ADVERTISMENT_TIME, @@ -81,7 +81,7 @@ static void pim_msdp_sa_state_timer_cb(struct event *t) { struct pim_msdp_sa *sa; - sa = THREAD_ARG(t); + sa = EVENT_ARG(t); if (PIM_DEBUG_MSDP_EVENTS) { pim_msdp_sa_timer_expiry_log(sa, "state"); @@ -92,7 +92,7 @@ static void pim_msdp_sa_state_timer_cb(struct event *t) static void pim_msdp_sa_state_timer_setup(struct pim_msdp_sa *sa, bool start) { - THREAD_OFF(sa->sa_state_timer); + EVENT_OFF(sa->sa_state_timer); if (start) { event_add_timer(sa->pim->msdp.master, pim_msdp_sa_state_timer_cb, sa, @@ -865,7 +865,7 @@ static void pim_msdp_peer_hold_timer_cb(struct event *t) { struct pim_msdp_peer *mp; - mp = THREAD_ARG(t); + mp = EVENT_ARG(t); if (PIM_DEBUG_MSDP_EVENTS) { pim_msdp_peer_timer_expiry_log(mp, "hold"); @@ -884,7 +884,7 @@ static void pim_msdp_peer_hold_timer_cb(struct event *t) static void pim_msdp_peer_hold_timer_setup(struct pim_msdp_peer *mp, bool start) { struct pim_instance *pim = mp->pim; - THREAD_OFF(mp->hold_timer); + EVENT_OFF(mp->hold_timer); if (start) { event_add_timer(pim->msdp.master, pim_msdp_peer_hold_timer_cb, mp, pim->msdp.hold_time, &mp->hold_timer); @@ -897,7 +897,7 @@ static void pim_msdp_peer_ka_timer_cb(struct event *t) { struct pim_msdp_peer *mp; - mp = THREAD_ARG(t); + mp = EVENT_ARG(t); if (PIM_DEBUG_MSDP_EVENTS) { pim_msdp_peer_timer_expiry_log(mp, "ka"); @@ -909,7 +909,7 @@ static void pim_msdp_peer_ka_timer_cb(struct event *t) static void pim_msdp_peer_ka_timer_setup(struct pim_msdp_peer *mp, bool start) { - THREAD_OFF(mp->ka_timer); + EVENT_OFF(mp->ka_timer); if (start) { event_add_timer(mp->pim->msdp.master, pim_msdp_peer_ka_timer_cb, mp, mp->pim->msdp.keep_alive, &mp->ka_timer); @@ -957,7 +957,7 @@ static void pim_msdp_peer_cr_timer_cb(struct event *t) { struct pim_msdp_peer *mp; - mp = THREAD_ARG(t); + mp = EVENT_ARG(t); if (PIM_DEBUG_MSDP_EVENTS) { pim_msdp_peer_timer_expiry_log(mp, "connect-retry"); @@ -972,7 +972,7 @@ static void pim_msdp_peer_cr_timer_cb(struct event *t) static void pim_msdp_peer_cr_timer_setup(struct pim_msdp_peer *mp, bool start) { - THREAD_OFF(mp->cr_timer); + EVENT_OFF(mp->cr_timer); if (start) { event_add_timer(mp->pim->msdp.master, pim_msdp_peer_cr_timer_cb, mp, mp->pim->msdp.connection_retry, diff --git a/pimd/pim_msdp_packet.c b/pimd/pim_msdp_packet.c index 959aec0c7..0ec7aa77f 100644 --- a/pimd/pim_msdp_packet.c +++ b/pimd/pim_msdp_packet.c @@ -200,7 +200,7 @@ void pim_msdp_write(struct event *thread) int work_cnt = 0; int work_max_cnt = 100; - mp = THREAD_ARG(thread); + mp = EVENT_ARG(thread); mp->t_write = NULL; if (PIM_DEBUG_MSDP_INTERNAL) { @@ -692,7 +692,7 @@ void pim_msdp_read(struct event *thread) int rc; uint32_t len; - mp = THREAD_ARG(thread); + mp = EVENT_ARG(thread); mp->t_read = NULL; if (PIM_DEBUG_MSDP_INTERNAL) { diff --git a/pimd/pim_msdp_socket.c b/pimd/pim_msdp_socket.c index ff70cb8ca..57b313489 100644 --- a/pimd/pim_msdp_socket.c +++ b/pimd/pim_msdp_socket.c @@ -53,7 +53,7 @@ static void pim_msdp_update_sock_send_buffer_size(int fd) static void pim_msdp_sock_accept(struct event *thread) { union sockunion su; - struct pim_instance *pim = THREAD_ARG(thread); + struct pim_instance *pim = EVENT_ARG(thread); int accept_sock; int msdp_sock; struct pim_msdp_peer *mp; @@ -61,7 +61,7 @@ static void pim_msdp_sock_accept(struct event *thread) sockunion_init(&su); /* re-register accept thread */ - accept_sock = THREAD_FD(thread); + accept_sock = EVENT_FD(thread); if (accept_sock < 0) { flog_err(EC_LIB_DEVELOPMENT, "accept_sock is negative value %d", accept_sock); diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c index dbe2cbaf9..3d0ecb1bf 100644 --- a/pimd/pim_neighbor.c +++ b/pimd/pim_neighbor.c @@ -194,7 +194,7 @@ static void on_neighbor_timer(struct event *t) struct interface *ifp; char msg[100]; - neigh = THREAD_ARG(t); + neigh = EVENT_ARG(t); ifp = neigh->interface; @@ -220,7 +220,7 @@ void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime) { neigh->holdtime = holdtime; - THREAD_OFF(neigh->t_expire_timer); + EVENT_OFF(neigh->t_expire_timer); /* 0xFFFF is request for no holdtime @@ -240,7 +240,7 @@ void pim_neighbor_timer_reset(struct pim_neighbor *neigh, uint16_t holdtime) static void on_neighbor_jp_timer(struct event *t) { - struct pim_neighbor *neigh = THREAD_ARG(t); + struct pim_neighbor *neigh = EVENT_ARG(t); struct pim_rpf rpf; if (PIM_DEBUG_PIM_TRACE) @@ -259,7 +259,7 @@ static void on_neighbor_jp_timer(struct event *t) static void pim_neighbor_start_jp_timer(struct pim_neighbor *neigh) { - THREAD_OFF(neigh->jp_timer); + EVENT_OFF(neigh->jp_timer); event_add_timer(router->master, on_neighbor_jp_timer, neigh, router->t_periodic, &neigh->jp_timer); } @@ -375,7 +375,7 @@ void pim_neighbor_free(struct pim_neighbor *neigh) delete_prefix_list(neigh); list_delete(&neigh->upstream_jp_agg); - THREAD_OFF(neigh->jp_timer); + EVENT_OFF(neigh->jp_timer); bfd_sess_free(&neigh->bfd_session); @@ -579,7 +579,7 @@ void pim_neighbor_delete(struct interface *ifp, struct pim_neighbor *neigh, zlog_notice("PIM NEIGHBOR DOWN: neighbor %pPA on interface %s: %s", &neigh->source_addr, ifp->name, delete_message); - THREAD_OFF(neigh->t_expire_timer); + EVENT_OFF(neigh->t_expire_timer); pim_if_assert_on_neighbor_down(ifp, neigh->source_addr); diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index bbe00aae6..ffd2d4283 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -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", @@ -350,8 +350,8 @@ static void pim_sock_read(struct event *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; @@ -821,7 +821,7 @@ 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); + 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); } @@ -834,7 +834,7 @@ 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; /* @@ -923,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; diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 522381737..be8b4c400 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -743,7 +743,7 @@ void pim_reg_del_on_couldreg_fail(struct interface *ifp) && (up->reg_state != PIM_REG_NOINFO)) { pim_channel_del_oif(up->channel_oil, pim->regiface, PIM_OIF_FLAG_PROTO_PIM, __func__); - THREAD_OFF(up->t_rs_timer); + EVENT_OFF(up->t_rs_timer); up->reg_state = PIM_REG_NOINFO; } } diff --git a/pimd/pim_ssmpingd.c b/pimd/pim_ssmpingd.c index 2073b4cb0..dadf29f53 100644 --- a/pimd/pim_ssmpingd.c +++ b/pimd/pim_ssmpingd.c @@ -196,7 +196,7 @@ static void ssmpingd_delete(struct ssmpingd_sock *ss) { assert(ss); - THREAD_OFF(ss->t_sock_read); + EVENT_OFF(ss->t_sock_read); if (close(ss->sock_fd)) { zlog_warn( @@ -290,7 +290,7 @@ static void ssmpingd_sock_read(struct event *t) { struct ssmpingd_sock *ss; - ss = THREAD_ARG(t); + ss = EVENT_ARG(t); ssmpingd_read_msg(ss); diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index b08c36326..283fdfc19 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -166,10 +166,10 @@ static void upstream_channel_oil_detach(struct pim_upstream *up) static void pim_upstream_timers_stop(struct pim_upstream *up) { - THREAD_OFF(up->t_ka_timer); - THREAD_OFF(up->t_rs_timer); - THREAD_OFF(up->t_msdp_reg_timer); - THREAD_OFF(up->t_join_timer); + EVENT_OFF(up->t_ka_timer); + EVENT_OFF(up->t_rs_timer); + EVENT_OFF(up->t_msdp_reg_timer); + EVENT_OFF(up->t_join_timer); } struct pim_upstream *pim_upstream_del(struct pim_instance *pim, @@ -293,7 +293,7 @@ static void on_join_timer(struct event *t) { struct pim_upstream *up; - up = THREAD_ARG(t); + up = EVENT_ARG(t); if (!up->rpf.source_nexthop.interface) { if (PIM_DEBUG_PIM_TRACE) @@ -323,7 +323,7 @@ static void join_timer_stop(struct pim_upstream *up) { struct pim_neighbor *nbr = NULL; - THREAD_OFF(up->t_join_timer); + EVENT_OFF(up->t_join_timer); if (up->rpf.source_nexthop.interface) nbr = pim_neighbor_find(up->rpf.source_nexthop.interface, @@ -353,7 +353,7 @@ void join_timer_start(struct pim_upstream *up) if (nbr) pim_jp_agg_add_group(nbr->upstream_jp_agg, up, 1, nbr); else { - THREAD_OFF(up->t_join_timer); + EVENT_OFF(up->t_join_timer); event_add_timer(router->master, on_join_timer, up, router->t_periodic, &up->t_join_timer); } @@ -370,7 +370,7 @@ void join_timer_start(struct pim_upstream *up) void pim_upstream_join_timer_restart(struct pim_upstream *up, struct pim_rpf *old) { - // THREAD_OFF(up->t_join_timer); + // EVENT_OFF(up->t_join_timer); join_timer_start(up); } @@ -382,7 +382,7 @@ static void pim_upstream_join_timer_restart_msec(struct pim_upstream *up, __func__, interval_msec, up->sg_str); } - THREAD_OFF(up->t_join_timer); + EVENT_OFF(up->t_join_timer); event_add_timer_msec(router->master, on_join_timer, up, interval_msec, &up->t_join_timer); } @@ -1361,7 +1361,7 @@ static void pim_upstream_fhr_kat_expiry(struct pim_instance *pim, up->sg_str); /* stop reg-stop timer */ - THREAD_OFF(up->t_rs_timer); + EVENT_OFF(up->t_rs_timer); /* remove regiface from the OIL if it is there*/ pim_channel_del_oif(up->channel_oil, pim->regiface, PIM_OIF_FLAG_PROTO_PIM, __func__); @@ -1465,7 +1465,7 @@ static void pim_upstream_keep_alive_timer(struct event *t) { struct pim_upstream *up; - up = THREAD_ARG(t); + up = EVENT_ARG(t); /* pull the stats and re-check */ if (pim_upstream_sg_running_proc(up)) @@ -1482,7 +1482,7 @@ void pim_upstream_keep_alive_timer_start(struct pim_upstream *up, uint32_t time) zlog_debug("kat start on %s with no stream reference", up->sg_str); } - THREAD_OFF(up->t_ka_timer); + EVENT_OFF(up->t_ka_timer); event_add_timer(router->master, pim_upstream_keep_alive_timer, up, time, &up->t_ka_timer); @@ -1496,7 +1496,7 @@ void pim_upstream_keep_alive_timer_start(struct pim_upstream *up, uint32_t time) /* MSDP on RP needs to know if a source is registerable to this RP */ static void pim_upstream_msdp_reg_timer(struct event *t) { - struct pim_upstream *up = THREAD_ARG(t); + struct pim_upstream *up = EVENT_ARG(t); struct pim_instance *pim = up->channel_oil->pim; /* source is no longer active - pull the SA from MSDP's cache */ @@ -1505,7 +1505,7 @@ static void pim_upstream_msdp_reg_timer(struct event *t) void pim_upstream_msdp_reg_timer_start(struct pim_upstream *up) { - THREAD_OFF(up->t_msdp_reg_timer); + EVENT_OFF(up->t_msdp_reg_timer); event_add_timer(router->master, pim_upstream_msdp_reg_timer, up, PIM_MSDP_REG_RXED_PERIOD, &up->t_msdp_reg_timer); @@ -1685,7 +1685,7 @@ static void pim_upstream_register_stop_timer(struct event *t) struct pim_interface *pim_ifp; struct pim_instance *pim; struct pim_upstream *up; - up = THREAD_ARG(t); + up = EVENT_ARG(t); pim = up->channel_oil->pim; if (PIM_DEBUG_PIM_TRACE) { @@ -1749,7 +1749,7 @@ void pim_upstream_start_register_stop_timer(struct pim_upstream *up, { uint32_t time; - THREAD_OFF(up->t_rs_timer); + EVENT_OFF(up->t_rs_timer); if (!null_register) { uint32_t lower = (0.5 * router->register_suppress_time); diff --git a/pimd/pim_vxlan.c b/pimd/pim_vxlan.c index 56a88babd..8df3c90f0 100644 --- a/pimd/pim_vxlan.c +++ b/pimd/pim_vxlan.c @@ -178,7 +178,7 @@ static void pim_vxlan_work_timer_cb(struct event *t) /* global 1second timer used for periodic processing */ static void pim_vxlan_work_timer_setup(bool start) { - THREAD_OFF(vxlan_info.work_timer); + EVENT_OFF(vxlan_info.work_timer); if (start) event_add_timer(router->master, pim_vxlan_work_timer_cb, NULL, PIM_VXLAN_WORK_TIME, &vxlan_info.work_timer); @@ -225,7 +225,7 @@ static void pim_vxlan_orig_mr_up_del(struct pim_vxlan_sg *vxlan_sg) * if there are no other references. */ if (PIM_UPSTREAM_FLAG_TEST_SRC_STREAM(up->flags)) { - THREAD_OFF(up->t_ka_timer); + EVENT_OFF(up->t_ka_timer); up = pim_upstream_keep_alive_timer_proc(up); } else { /* this is really unexpected as we force vxlan diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index 502dd7c8e..69635e72b 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -387,7 +387,7 @@ void pim_scan_oil(struct pim_instance *pim) static void on_rpf_cache_refresh(struct event *t) { - struct pim_instance *pim = THREAD_ARG(t); + struct pim_instance *pim = EVENT_ARG(t); /* update kernel multicast forwarding cache (MFC) */ pim_scan_oil(pim); diff --git a/pimd/pim_zlookup.c b/pimd/pim_zlookup.c index fa5cbac47..0a994809b 100644 --- a/pimd/pim_zlookup.c +++ b/pimd/pim_zlookup.c @@ -37,7 +37,7 @@ static void zclient_lookup_connect(struct event *t) { struct zclient *zlookup; - zlookup = THREAD_ARG(t); + zlookup = EVENT_ARG(t); if (zlookup->sock >= 0) { return; @@ -114,7 +114,7 @@ static void zclient_lookup_failed(struct zclient *zlookup) void zclient_lookup_free(void) { - THREAD_OFF(zlookup_read); + EVENT_OFF(zlookup_read); zclient_stop(zlookup); zclient_free(zlookup); zlookup = NULL; @@ -366,7 +366,7 @@ static int zclient_lookup_nexthop_once(struct pim_instance *pim, void zclient_lookup_read_pipe(struct event *thread) { - struct zclient *zlookup = THREAD_ARG(thread); + struct zclient *zlookup = EVENT_ARG(thread); struct pim_instance *pim = pim_get_pim_instance(VRF_DEFAULT); struct pim_zlookup_nexthop nexthop_tab[10]; pim_addr l = PIMADDR_ANY; |