diff options
Diffstat (limited to 'isisd/fabricd.c')
| -rw-r--r-- | isisd/fabricd.c | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/isisd/fabricd.c b/isisd/fabricd.c index d8b9c10075..0be36e175a 100644 --- a/isisd/fabricd.c +++ b/isisd/fabricd.c @@ -40,7 +40,7 @@ struct fabricd { enum fabricd_sync_state initial_sync_state; time_t initial_sync_start; struct isis_circuit *initial_sync_circuit; - struct thread *initial_sync_timeout; + struct event *initial_sync_timeout; struct isis_spftree *spftree; struct skiplist *neighbors; @@ -49,8 +49,8 @@ struct fabricd { uint8_t tier; uint8_t tier_config; uint8_t tier_pending; - struct thread *tier_calculation_timer; - struct thread *tier_set_timer; + struct event *tier_calculation_timer; + struct event *tier_set_timer; int csnp_delay; bool always_send_csnp; @@ -225,11 +225,11 @@ struct fabricd *fabricd_new(struct isis_area *area) void fabricd_finish(struct fabricd *f) { - THREAD_OFF(f->initial_sync_timeout); + EVENT_OFF(f->initial_sync_timeout); - THREAD_OFF(f->tier_calculation_timer); + EVENT_OFF(f->tier_calculation_timer); - THREAD_OFF(f->tier_set_timer); + EVENT_OFF(f->tier_set_timer); isis_spftree_del(f->spftree); neighbor_lists_clear(f); @@ -237,9 +237,9 @@ void fabricd_finish(struct fabricd *f) hash_free(f->neighbors_neighbors); } -static void fabricd_initial_sync_timeout(struct thread *thread) +static void fabricd_initial_sync_timeout(struct event *thread) { - struct fabricd *f = THREAD_ARG(thread); + struct fabricd *f = EVENT_ARG(thread); if (IS_DEBUG_ADJ_PACKETS) zlog_debug( @@ -267,8 +267,8 @@ void fabricd_initial_sync_hello(struct isis_circuit *circuit) if (f->initial_sync_timeout) return; - thread_add_timer(master, fabricd_initial_sync_timeout, f, - timeout, &f->initial_sync_timeout); + event_add_timer(master, fabricd_initial_sync_timeout, f, timeout, + &f->initial_sync_timeout); f->initial_sync_start = monotime(NULL); if (IS_DEBUG_ADJ_PACKETS) @@ -325,7 +325,7 @@ void fabricd_initial_sync_finish(struct isis_area *area) f->initial_sync_circuit->interface->name); f->initial_sync_state = FABRICD_SYNC_COMPLETE; f->initial_sync_circuit = NULL; - THREAD_OFF(f->initial_sync_timeout); + EVENT_OFF(f->initial_sync_timeout); } static void fabricd_bump_tier_calculation_timer(struct fabricd *f); @@ -392,16 +392,16 @@ static uint8_t fabricd_calculate_fabric_tier(struct isis_area *area) return tier; } -static void fabricd_tier_set_timer(struct thread *thread) +static void fabricd_tier_set_timer(struct event *thread) { - struct fabricd *f = THREAD_ARG(thread); + struct fabricd *f = EVENT_ARG(thread); fabricd_set_tier(f, f->tier_pending); } -static void fabricd_tier_calculation_cb(struct thread *thread) +static void fabricd_tier_calculation_cb(struct event *thread) { - struct fabricd *f = THREAD_ARG(thread); + struct fabricd *f = EVENT_ARG(thread); uint8_t tier = ISIS_TIER_UNDEFINED; tier = fabricd_calculate_fabric_tier(f->area); @@ -411,28 +411,27 @@ static void fabricd_tier_calculation_cb(struct thread *thread) zlog_info("OpenFabric: Got tier %hhu from algorithm. Arming timer.", tier); f->tier_pending = tier; - thread_add_timer(master, fabricd_tier_set_timer, f, - f->area->lsp_gen_interval[ISIS_LEVEL2 - 1], - &f->tier_set_timer); - + event_add_timer(master, fabricd_tier_set_timer, f, + f->area->lsp_gen_interval[ISIS_LEVEL2 - 1], + &f->tier_set_timer); } static void fabricd_bump_tier_calculation_timer(struct fabricd *f) { /* Cancel timer if we already know our tier */ if (f->tier != ISIS_TIER_UNDEFINED || f->tier_set_timer) { - THREAD_OFF(f->tier_calculation_timer); + EVENT_OFF(f->tier_calculation_timer); return; } /* If we need to calculate the tier, wait some * time for the topology to settle before running * the calculation */ - THREAD_OFF(f->tier_calculation_timer); + EVENT_OFF(f->tier_calculation_timer); - thread_add_timer(master, fabricd_tier_calculation_cb, f, - 2 * f->area->lsp_gen_interval[ISIS_LEVEL2 - 1], - &f->tier_calculation_timer); + event_add_timer(master, fabricd_tier_calculation_cb, f, + 2 * f->area->lsp_gen_interval[ISIS_LEVEL2 - 1], + &f->tier_calculation_timer); } static void fabricd_set_tier(struct fabricd *f, uint8_t tier) @@ -713,10 +712,10 @@ void fabricd_trigger_csnp(struct isis_area *area, bool circuit_scoped) if (!circuit->t_send_csnp[1]) continue; - THREAD_OFF(circuit->t_send_csnp[ISIS_LEVEL2 - 1]); - thread_add_timer_msec(master, send_l2_csnp, circuit, - isis_jitter(f->csnp_delay, CSNP_JITTER), - &circuit->t_send_csnp[ISIS_LEVEL2 - 1]); + EVENT_OFF(circuit->t_send_csnp[ISIS_LEVEL2 - 1]); + event_add_timer_msec(master, send_l2_csnp, circuit, + isis_jitter(f->csnp_delay, CSNP_JITTER), + &circuit->t_send_csnp[ISIS_LEVEL2 - 1]); } } |
