+2004-02-11 Hasso Tepper <hasso@estpak.ee>
+ * many *.c files: Replace thread_add_xxx() and thread_cancel() with
+ THREAD_XXX_ON and THREAD_XXX_OFF macros.
+
2004-01-27 Hasso Tepper <hasso@estpak.ee>
* isis_circuit.c: Commented out "(no) ip address" commands so it doesn't
confuse vtysh.
/* 8.4.1 d) */
/* dr election will commence in... */
if (circuit->circuit_is_type & IS_LEVEL_1)
- circuit->u.bc.t_run_dr[0] =
- thread_add_timer (master, isis_run_dr_l1, circuit,
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
+ circuit,
2 * circuit->hello_multiplier[0] * circuit->hello_interval[0]);
if (circuit->circuit_is_type & IS_LEVEL_2)
- circuit->u.bc.t_run_dr[1] =
- thread_add_timer (master, isis_run_dr_l2, circuit,
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
+ circuit,
2 * circuit->hello_multiplier[1] * circuit->hello_interval[1]);
} else {
/* initializing the hello send threads
/* initializing PSNP timers */
if (circuit->circuit_is_type & IS_LEVEL_1) {
- circuit->t_send_psnp[0] = thread_add_timer (master,
- send_l1_psnp,
- circuit,
- isis_jitter
- (circuit->psnp_interval[0],
- PSNP_JITTER));
+ THREAD_TIMER_ON(master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
+ isis_jitter(circuit->psnp_interval[0], PSNP_JITTER));
}
if (circuit->circuit_is_type & IS_LEVEL_2) {
- circuit->t_send_psnp[1] = thread_add_timer (master,
- send_l2_psnp,
- circuit,
- isis_jitter
- (circuit->psnp_interval[1],
- PSNP_JITTER));
-
+ THREAD_TIMER_ON(master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
+ isis_jitter(circuit->psnp_interval[1], PSNP_JITTER));
}
/* initialize the circuit streams */
isis_sock_init (circuit);
#ifdef GNU_LINUX
- circuit->t_read = thread_add_read (master, isis_receive, circuit,
+ THREAD_READ_ON(master, circuit->t_read, isis_receive, circuit,
circuit->fd);
#else
- circuit->t_read = thread_add_timer (master, isis_receive, circuit,
+ THREAD_TIMER_ON(master, circuit->t_read, isis_receive, circuit,
circuit->fd);
#endif
return;
isis_circuit_down (struct isis_circuit *circuit)
{
/* Cancel all active threads -- FIXME: wrong place*/
- if (circuit->t_read)
- thread_cancel (circuit->t_read);
+ /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
+ THREAD_OFF(circuit->t_read);
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
- if (circuit->u.bc.t_send_lan_hello[0])
- thread_cancel (circuit->u.bc.t_send_lan_hello[0]);
- if (circuit->u.bc.t_send_lan_hello[1])
- thread_cancel (circuit->u.bc.t_send_lan_hello[1]);
+ THREAD_TIMER_OFF(circuit->u.bc.t_send_lan_hello[0]);
+ THREAD_TIMER_OFF(circuit->u.bc.t_send_lan_hello[1]);
} else if (circuit->circ_type == CIRCUIT_T_P2P) {
- if (circuit->u.p2p.t_send_p2p_hello)
- thread_cancel (circuit->u.p2p.t_send_p2p_hello);
+ THREAD_TIMER_OFF(circuit->u.p2p.t_send_p2p_hello);
}
/* close the socket */
close (circuit->fd);
circuit->u.bc.is_dr[level - 1] = 0;
circuit->u.bc.run_dr_elect[level - 1] = 0;
- if (circuit->u.bc.t_run_dr[level - 1]) {
- thread_cancel (circuit->u.bc.t_run_dr[level - 1]);
- circuit->u.bc.t_run_dr[level - 1] = NULL;
- }
- if (circuit->u.bc.t_refresh_pseudo_lsp[level - 1]) {
- thread_cancel (circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
- circuit->u.bc.t_refresh_pseudo_lsp[level - 1] = NULL;
- }
+ THREAD_TIMER_OFF(circuit->u.bc.t_run_dr[level - 1]);
+ THREAD_TIMER_OFF(circuit->u.bc.t_refresh_pseudo_lsp[level - 1]);
memcpy (id, isis->sysid, ISIS_SYS_ID_LEN);
LSP_PSEUDO_ID(id) = circuit->circuit_id;
if (level == 1) {
memset (circuit->u.bc.l1_desig_is, 0, ISIS_SYS_ID_LEN + 1);
- if (circuit->t_send_csnp[0])
- thread_cancel (circuit->t_send_csnp[0]);
+ THREAD_TIMER_OFF(circuit->t_send_csnp[0]);
+
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
+ circuit, 2 * circuit->hello_interval[1]);
- circuit->u.bc.t_run_dr[0] =
- thread_add_timer (master, isis_run_dr_l1, circuit,
- 2 * circuit->hello_interval[1]);
-
- circuit->t_send_psnp[0] =
- thread_add_timer (master,
- send_l1_psnp,
- circuit,
- isis_jitter (circuit->psnp_interval[level - 1],
- PSNP_JITTER));
+ THREAD_TIMER_ON(master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
+ isis_jitter (circuit->psnp_interval[level - 1], PSNP_JITTER));
} else {
memset (circuit->u.bc.l2_desig_is, 0, ISIS_SYS_ID_LEN + 1);
- if (circuit->t_send_csnp[1])
- thread_cancel (circuit->t_send_csnp[1]);
-
- circuit->u.bc.t_run_dr[1] =
- thread_add_timer (master, isis_run_dr_l2, circuit,
- 2 * circuit->hello_interval[1]);
- circuit->t_send_psnp[1] =
- thread_add_timer (master,
- send_l2_psnp,
- circuit,
- isis_jitter (circuit->psnp_interval[level - 1],
- PSNP_JITTER));
+ THREAD_TIMER_OFF(circuit->t_send_csnp[1]);
+
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
+ circuit, 2 * circuit->hello_interval[1]);
+
+ THREAD_TIMER_ON(master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
+ isis_jitter (circuit->psnp_interval[level - 1], PSNP_JITTER));
}
thread_add_event (master, isis_event_dis_status_change, circuit, 0);
/* Lets keep a pause in DR election */
circuit->u.bc.run_dr_elect[level - 1] = 0;
if (level == 1)
- circuit->u.bc.t_run_dr[0] =
- thread_add_timer (master, isis_run_dr_l1, circuit,
- 2 * circuit->hello_multiplier[0] *
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
+ circuit, 2 * circuit->hello_multiplier[0] *
circuit->hello_interval[0]);
else
- circuit->u.bc.t_run_dr[1] =
- thread_add_timer (master, isis_run_dr_l2, circuit,
- 2 * circuit->hello_multiplier[1] *
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
+ circuit, 2 * circuit->hello_multiplier[1] *
circuit->hello_interval[1]);
circuit->u.bc.is_dr[level - 1] = 1;
thread_cancel (circuit->t_send_l1_psnp); */
lsp_l1_pseudo_generate (circuit);
- circuit->u.bc.t_run_dr[0] =
- thread_add_timer (master, isis_run_dr_l1, circuit,
- 2 * circuit->hello_interval[0]);
-
- circuit->t_send_csnp[0] = thread_add_timer (master,
- send_l1_csnp,
- circuit,
- isis_jitter
- (circuit->csnp_interval[level-1],
- CSNP_JITTER));
+ THREAD_TIMER_OFF(circuit->u.bc.t_run_dr[0]);
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
+ circuit, 2 * circuit->hello_interval[0]);
+
+ THREAD_TIMER_ON(master, circuit->t_send_csnp[0], send_l1_csnp, circuit,
+ isis_jitter(circuit->csnp_interval[level-1], CSNP_JITTER));
+
} else {
memcpy (old_dr, circuit->u.bc.l2_desig_is, ISIS_SYS_ID_LEN + 1);
LSP_FRAGMENT (old_dr) = 0;
thread_cancel (circuit->t_send_l1_psnp); */
lsp_l2_pseudo_generate (circuit);
- circuit->u.bc.t_run_dr[1] =
- thread_add_timer (master, isis_run_dr_l2, circuit,
- 2 * circuit->hello_interval[1]);
-
- circuit->t_send_csnp[1] =
- thread_add_timer (master,
- send_l2_csnp,
- circuit,
- isis_jitter (circuit->csnp_interval[level-1],
- CSNP_JITTER));
+ THREAD_TIMER_OFF(circuit->u.bc.t_run_dr[1]);
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
+ circuit, 2 * circuit->hello_interval[1]);
+ THREAD_TIMER_ON(master, circuit->t_send_csnp[1], send_l2_csnp, circuit,
+ isis_jitter (circuit->csnp_interval[level-1], CSNP_JITTER));
}
thread_add_event (master, isis_event_dis_status_change, circuit, 0);
uint32_t interval;
if (level == 1) {
- circuit->t_send_psnp[0] = thread_add_timer (master, send_l1_psnp,
- circuit,
- isis_jitter
- (circuit->psnp_interval[0],
- PSNP_JITTER));
+ THREAD_TIMER_ON(master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
+ isis_jitter(circuit->psnp_interval[0], PSNP_JITTER));
+
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
interval = circuit->hello_multiplier[0] * (circuit->hello_interval[0]);
- circuit->u.bc.t_run_dr[0] = thread_add_timer (master, isis_run_dr_l1,
+
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
circuit, interval);
- circuit->u.bc.t_send_lan_hello[0] =
- thread_add_timer (master,
- send_lan_l1_hello,
- circuit,
- isis_jitter
- (circuit->hello_interval[0], IIH_JITTER));
+ THREAD_TIMER_ON(master, circuit->u.bc.t_send_lan_hello[0],
+ send_lan_l1_hello, circuit,
+ isis_jitter(circuit->hello_interval[0], IIH_JITTER));
+
circuit->u.bc.lan_neighs[0] = list_new ();
}
} else {
- circuit->t_send_psnp[1] = thread_add_timer (master, send_l2_psnp,
- circuit,
- isis_jitter
- (circuit->psnp_interval[1],
- PSNP_JITTER));
+ THREAD_TIMER_ON(master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
+ isis_jitter(circuit->psnp_interval[1], PSNP_JITTER));
+
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
interval = circuit->hello_multiplier[1] * (circuit->hello_interval[1]);
- circuit->u.bc.t_run_dr[1] = thread_add_timer (master, isis_run_dr_l2,
+
+ THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
circuit, interval);
- circuit->u.bc.t_send_lan_hello[1] =
- thread_add_timer (master,
- send_lan_l2_hello,
- circuit,
- isis_jitter
- (circuit->hello_interval[1], IIH_JITTER));
+ THREAD_TIMER_ON(master, circuit->u.bc.t_send_lan_hello[1],
+ send_lan_l2_hello, circuit,
+ isis_jitter(circuit->hello_interval[1], IIH_JITTER));
+
circuit->u.bc.lan_neighs[1] = list_new ();
}
}
{
int idx = level - 1;
- if (circuit->t_send_csnp[idx])
- thread_cancel (circuit->t_send_csnp[idx]);
- circuit->t_send_csnp[idx] = NULL;
-
- if (circuit->t_send_psnp[idx])
- thread_cancel (circuit->t_send_psnp[idx]);
- circuit->t_send_psnp[level - 1] = NULL;
+ THREAD_TIMER_OFF(circuit->t_send_csnp[idx]);
+ THREAD_TIMER_OFF(circuit->t_send_psnp[idx]);
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
- if (circuit->u.bc.t_send_lan_hello[idx])
- thread_cancel (circuit->u.bc.t_send_lan_hello[idx]);
- circuit->u.bc.t_send_lan_hello[idx] = NULL;
- if (circuit->u.bc.t_run_dr[idx])
- thread_cancel (circuit->u.bc.t_run_dr[idx]);
- circuit->u.bc.t_run_dr[idx] = NULL;
+ THREAD_TIMER_OFF(circuit->u.bc.t_send_lan_hello[idx]);
+ THREAD_TIMER_OFF(circuit->u.bc.t_run_dr[idx]);
circuit->u.bc.run_dr_elect[idx] = 0;
}
int
lsp_l1_generate (struct isis_area *area)
{
-
- area->t_lsp_refresh[0] = thread_add_timer (master, lsp_refresh_l1, area,
+ THREAD_TIMER_ON(master, area->t_lsp_refresh[0], lsp_refresh_l1, area,
MAX_LSP_GEN_INTERVAL);
return lsp_generate_non_pseudo (area, 1);
int
lsp_l2_generate (struct isis_area *area)
{
-
- area->t_lsp_refresh[1] = thread_add_timer (master, lsp_refresh_l2, area,
+ THREAD_TIMER_ON(master, area->t_lsp_refresh[1], lsp_refresh_l2, area,
MAX_LSP_GEN_INTERVAL);
return lsp_generate_non_pseudo (area, 2);
ref_time = area->lsp_refresh[0] > MAX_LSP_GEN_INTERVAL ?
MAX_LSP_GEN_INTERVAL : area->lsp_refresh[0];
- area->t_lsp_refresh[0] = thread_add_timer (master, lsp_refresh_l1, area,
- isis_jitter (ref_time,
- MAX_AGE_JITTER));
+ THREAD_TIMER_ON(master, area->t_lsp_refresh[0], lsp_refresh_l1, area,
+ isis_jitter(ref_time, MAX_AGE_JITTER));
+
return ISIS_OK;
}
ref_time = area->lsp_refresh[1] > MAX_LSP_GEN_INTERVAL ?
MAX_LSP_GEN_INTERVAL : area->lsp_refresh[1];
+ THREAD_TIMER_ON(master, area->t_lsp_refresh[1], lsp_refresh_l2, area,
+ isis_jitter(ref_time, MAX_AGE_JITTER));
- area->t_lsp_refresh[1] = thread_add_timer (master, lsp_refresh_l2, area,
- isis_jitter (ref_time,
- MAX_AGE_JITTER));
return ISIS_OK;
}
ref_time = circuit->area->lsp_refresh[0] > MAX_LSP_GEN_INTERVAL ?
MAX_LSP_GEN_INTERVAL : circuit->area->lsp_refresh[0];
- circuit->u.bc.t_refresh_pseudo_lsp[0] =
- thread_add_timer (master, lsp_l1_refresh_pseudo, circuit,
- isis_jitter (ref_time,
- MAX_AGE_JITTER));
+ THREAD_TIMER_ON(master, circuit->u.bc.t_refresh_pseudo_lsp[0],
+ lsp_l1_refresh_pseudo, circuit, isis_jitter (ref_time, MAX_AGE_JITTER));
+
return retval;
}
ref_time = circuit->area->lsp_refresh[0] > MAX_LSP_GEN_INTERVAL ?
MAX_LSP_GEN_INTERVAL : circuit->area->lsp_refresh[0];
-
- circuit->u.bc.t_refresh_pseudo_lsp[0] =
- thread_add_timer (master, lsp_l1_refresh_pseudo, circuit,
- isis_jitter (ref_time,
- MAX_AGE_JITTER));
+ THREAD_TIMER_ON(master, circuit->u.bc.t_refresh_pseudo_lsp[0],
+ lsp_l1_refresh_pseudo, circuit, isis_jitter (ref_time, MAX_AGE_JITTER));
return lsp_regenerate_schedule (circuit->area);
}
ref_time = circuit->area->lsp_refresh[1] > MAX_LSP_GEN_INTERVAL ?
MAX_LSP_GEN_INTERVAL : circuit->area->lsp_refresh[1];
+ THREAD_TIMER_ON(master, circuit->u.bc.t_refresh_pseudo_lsp[1],
+ lsp_l2_refresh_pseudo, circuit, isis_jitter (ref_time, MAX_AGE_JITTER));
- circuit->u.bc.t_refresh_pseudo_lsp[1] =
- thread_add_timer (master, lsp_l2_refresh_pseudo, circuit,
- isis_jitter (ref_time,
- MAX_AGE_JITTER));
return retval;
}
lsp_insert (lsp, circuit->area->lspdb[1]);
ISIS_FLAGS_SET_ALL (lsp->SRMflags);
- circuit->u.bc.t_refresh_pseudo_lsp[1] =
- thread_add_timer (master, lsp_l2_refresh_pseudo, circuit,
- isis_jitter (ref_time,
- MAX_AGE_JITTER));
+ THREAD_TIMER_ON(master, circuit->u.bc.t_refresh_pseudo_lsp[1],
+ lsp_l2_refresh_pseudo, circuit, isis_jitter (ref_time, MAX_AGE_JITTER));
return lsp_regenerate_schedule (circuit->area);
}
area = THREAD_ARG (thread);
assert (area);
- area->t_tick = thread_add_timer (master, lsp_tick, area, 1);
+ THREAD_TIMER_ON(master, area->t_tick, lsp_tick, area, 1);
/*
* Build a list of LSPs with (any) SRMflag set
/* time to calculate our checksum */
iso_csum_create (STREAM_DATA (lsp->pdu) + 12,
ntohs(lsp->lsp_header->pdu_len) - 12, 12);
-
- lsp->t_lsp_top_ref = thread_add_timer (master, top_lsp_refresh, lsp,
- isis_jitter (MAX_LSP_GEN_INTERVAL,
- MAX_LSP_GEN_JITTER));
+ THREAD_TIMER_ON(master, lsp->t_lsp_top_ref, top_lsp_refresh, lsp,
+ isis_jitter (MAX_LSP_GEN_INTERVAL, MAX_LSP_GEN_JITTER));
return ISIS_OK;
}
/* time to calculate our checksum */
iso_csum_create (STREAM_DATA (lsp->pdu) + 12,
ntohs(lsp->lsp_header->pdu_len) - 12, 12);
- lsp->t_lsp_top_ref = thread_add_timer (master, top_lsp_refresh, lsp,
- isis_jitter(MAX_LSP_GEN_INTERVAL,
- MAX_LSP_GEN_JITTER));
+ THREAD_TIMER_ON(master, lsp->t_lsp_top_ref, top_lsp_refresh, lsp,
+ isis_jitter(MAX_LSP_GEN_INTERVAL, MAX_LSP_GEN_JITTER));
ISIS_FLAGS_SET_ALL(lsp->SRMflags);
lsp_insert (lsp,area->lspdb[0]);
dnode_next = dict_next (area->lspdb[0], dnode);
lsp = dnode_get (dnode);
if (lsp->from_topology) {
- thread_cancel(lsp->t_lsp_top_ref);
+ THREAD_TIMER_OFF(lsp->t_lsp_top_ref);
lsp_destroy (lsp);
dict_delete (area->lspdb[0], dnode);
}
#endif /* HAVE_IPV6 */
/* lets take care of the expiry */
- if(adj->t_expire) {
- thread_cancel (adj->t_expire);
- }
- adj->t_expire = thread_add_timer (master, isis_adj_expire, adj,
+ THREAD_TIMER_OFF(adj->t_expire);
+ THREAD_TIMER_ON(master, adj->t_expire, isis_adj_expire, adj,
(long)adj->hold_time);
/* 8.2.5.2 a) a match was detected */
adj->circuit_t = hdr.circuit_t;
/* lets take care of the expiry */
- if (adj->t_expire) {
- thread_cancel (adj->t_expire);
- }
- adj->t_expire = thread_add_timer (master, isis_adj_expire, adj,
+ THREAD_TIMER_OFF(adj->t_expire);
+ THREAD_TIMER_ON(master, adj->t_expire, isis_adj_expire, adj,
(long)adj->hold_time);
/*
/*
* prepare for next packet.
*/
- circuit->t_read = thread_add_read (master, isis_receive, circuit,
- circuit->fd);
+ THREAD_READ_ON(master, circuit->t_read, isis_receive, circuit, circuit->fd);
return retval;
}
retval = send_lan_hello (circuit, 1);
/* set next timer thread */
- circuit->u.bc.t_send_lan_hello[0] =
- thread_add_timer (master, send_lan_l1_hello, circuit,
- isis_jitter (circuit->hello_interval[0], IIH_JITTER));
+ THREAD_TIMER_ON(master, circuit->u.bc.t_send_lan_hello[0], send_lan_l1_hello,
+ circuit, isis_jitter (circuit->hello_interval[0], IIH_JITTER));
return retval;
}
retval = send_lan_hello (circuit, 2);
/* set next timer thread*/
- circuit->u.bc.t_send_lan_hello[1] =
- thread_add_timer (master, send_lan_l2_hello, circuit,
- isis_jitter (circuit->hello_interval[1], IIH_JITTER));
+ THREAD_TIMER_ON(master, circuit->u.bc.t_send_lan_hello[1], send_lan_l2_hello,
+ circuit, isis_jitter (circuit->hello_interval[1], IIH_JITTER));
return retval;
}
send_hello(circuit,1);
/* set next timer thread*/
- circuit->u.p2p.t_send_p2p_hello = thread_add_timer
- (master, send_p2p_hello, circuit, isis_jitter (circuit->hello_interval[1],
- IIH_JITTER));
+ THREAD_TIMER_ON(master, circuit->u.p2p.t_send_p2p_hello, send_p2p_hello,
+ circuit, isis_jitter (circuit->hello_interval[1], IIH_JITTER));
return ISIS_OK;
}
send_csnp(circuit,1);
}
/* set next timer thread */
- circuit->t_send_csnp[0] = thread_add_timer (master,
- send_l1_csnp,
- circuit,
- isis_jitter
- (circuit->csnp_interval[0],
- CSNP_JITTER));
+ THREAD_TIMER_ON(master, circuit->t_send_csnp[0], send_l1_csnp, circuit,
+ isis_jitter(circuit->csnp_interval[0], CSNP_JITTER));
return retval;
}
send_csnp(circuit,2);
}
/* set next timer thread */
- circuit->t_send_csnp[1] = thread_add_timer (master,
- send_l2_csnp,
- circuit,
- isis_jitter
- (circuit->csnp_interval[1],
- CSNP_JITTER));
+ THREAD_TIMER_ON(master, circuit->t_send_csnp[1], send_l2_csnp, circuit,
+ isis_jitter(circuit->csnp_interval[1], CSNP_JITTER));
+
return retval;
}
send_psnp (1, circuit);
/* set next timer thread */
- circuit->t_send_psnp[0] = thread_add_timer (master,
- send_l1_psnp,
- circuit,
- isis_jitter
- (circuit->psnp_interval[0],
- PSNP_JITTER));
+ THREAD_TIMER_ON(master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
+ isis_jitter(circuit->psnp_interval[0], PSNP_JITTER));
return retval;
}
send_psnp (2, circuit);
/* set next timer thread */
- circuit->t_send_psnp[1] = thread_add_timer (master,
- send_l2_psnp,
- circuit,
- isis_jitter
- (circuit->psnp_interval[1],
- PSNP_JITTER));
+ THREAD_TIMER_ON(master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
+ isis_jitter(circuit->psnp_interval[1], PSNP_JITTER));
return retval;
}
spftree->pending = 0;
if (level == 1)
- spftree->t_spf_periodic = thread_add_timer (master,
- isis_run_spf_l1, area,
- isis_jitter
- (PERIODIC_SPF_INTERVAL, 10));
+ THREAD_TIMER_ON(master, spftree->t_spf_periodic, isis_run_spf_l1, area,
+ isis_jitter(PERIODIC_SPF_INTERVAL, 10));
else
- spftree->t_spf_periodic = thread_add_timer (master,
- isis_run_spf_l2, area,
- isis_jitter
- (PERIODIC_SPF_INTERVAL, 10));
+ THREAD_TIMER_ON(master, spftree->t_spf_periodic, isis_run_spf_l2, area,
+ isis_jitter(PERIODIC_SPF_INTERVAL, 10));
return retval;
}
spftree->pending = 1;
return retval;
}
- if (spftree->t_spf_periodic)
- thread_cancel (spftree->t_spf_periodic);
+ THREAD_TIMER_OFF(spftree->t_spf_periodic);
if (diff < MINIMUM_SPF_INTERVAL) {
if (level == 1)
diff = now - spftree->lastrun;
- if (spftree->t_spf_periodic)
- thread_cancel (spftree->t_spf_periodic);
+ THREAD_TIMER_OFF(spftree->t_spf_periodic);
/* FIXME: let's wait a minute before doing the SPF */
if (now - isis->uptime < 60 || isis->uptime == 0) {
#endif /* HAVE_IPV6 */
area->circuit_list = list_new ();
area->area_addrs = list_new ();
- area->t_tick = thread_add_timer (master, lsp_tick, area, 1);
+ THREAD_TIMER_ON(master, area->t_tick, lsp_tick, area, 1);
area->flags.maxindex = -1;
/*
* Default values
list_delete (area->circuit_list);
}
listnode_delete (isis->area_list, area);
- if (area->t_tick)
- thread_cancel (area->t_tick);
+ THREAD_TIMER_OFF(area->t_tick);
if (area->t_remove_aged)
thread_cancel (area->t_remove_aged);
- if (area->t_lsp_refresh[0])
- thread_cancel (area->t_lsp_refresh[0]);
- if (area->t_lsp_refresh[1])
- thread_cancel (area->t_lsp_refresh[1]);
+ THREAD_TIMER_OFF(area->t_lsp_refresh[0]);
+ THREAD_TIMER_OFF(area->t_lsp_refresh[1]);
XFREE (MTYPE_ISIS_AREA, area);