ospf_iface_start:
{
+ this_proto->loop_order = DOMAIN_ORDER(proto);
this_ipatt = cfg_allocz(sizeof(struct ospf_iface_patt));
add_tail(&this_area->patt_list, NODE this_ipatt);
init_list(&this_ipatt->ipn_list);
req->lsa_body = LSA_BODY_DUMMY;
if (!tm_active(n->lsrq_timer))
- tm_start(n->lsrq_timer, 0);
+ tm_start_in(n->lsrq_timer, 0, p->p.loop);
}
}
}
ospf_send_dbdes(p, n);
- tm_start(n->dbdes_timer, n->ifa->rxmtint S);
+ tm_start_in(n->dbdes_timer, n->ifa->rxmtint S, p->p.loop);
}
else
{
if (!(n->myimms & DBDES_M) && !(n->imms & DBDES_M))
{
/* Use dbdes timer to postpone freeing of Last DBDES packet buffer */
- tm_start(n->dbdes_timer, n->ifa->deadint S);
+ tm_start_in(n->dbdes_timer, n->ifa->deadint S, p->p.loop);
ospf_neigh_sm(n, INM_EXDONE);
}
}
case ISM_UP:
if (ifa->state <= OSPF_IS_LOOP)
{
+ struct ospf_proto *p = ifa->oa->po;
/* Now, nothing should be adjacent */
if ((ifa->type == OSPF_IT_PTP) ||
(ifa->type == OSPF_IT_PTMP) ||
{
ospf_iface_chstate(ifa, OSPF_IS_WAITING);
if (ifa->wait_timer)
- tm_start(ifa->wait_timer, ifa->waitint S);
+ tm_start_in(ifa->wait_timer, ifa->waitint S, p->p.loop);
}
}
if (ifa->hello_timer)
- tm_start(ifa->hello_timer, ifa->helloint S);
+ tm_start_in(ifa->hello_timer, ifa->helloint S, p->p.loop);
if (ifa->poll_timer)
- tm_start(ifa->poll_timer, ifa->pollint S);
+ tm_start_in(ifa->poll_timer, ifa->pollint S, p->p.loop);
ospf_send_hello(ifa, OHS_HELLO, NULL);
}
.hook = ospf_iface_add,
.data = ifa,
};
- lock->target = &global_event_list;
+ lock->target = proto_event_list(&p->p);
olock_acquire(lock);
}
}
static void
-ospf_iface_change_timer(timer *tm, uint val)
+ospf_iface_change_timer(timer *tm, uint val, struct birdloop *loop)
{
if (!tm)
return;
tm->recurrent = val S;
if (tm_active(tm))
- tm_start(tm, val S);
+ tm_start_in(tm, val S, loop);
}
static inline void
ifname, ifa->helloint, new->helloint);
ifa->helloint = new->helloint;
- ospf_iface_change_timer(ifa->hello_timer, ifa->helloint);
+ ospf_iface_change_timer(ifa->hello_timer, ifa->helloint, p->p.loop);
}
/* RXMT TIMER */
ifname, ifa->pollint, new->pollint);
ifa->pollint = new->pollint;
- ospf_iface_change_timer(ifa->poll_timer, ifa->pollint);
+ ospf_iface_change_timer(ifa->poll_timer, ifa->pollint, p->p.loop);
}
/* WAIT TIMER */
ifa->waitint = new->waitint;
if (ifa->wait_timer && tm_active(ifa->wait_timer))
- tm_start(ifa->wait_timer, ifa->waitint S);
+ tm_start_in(ifa->wait_timer, ifa->waitint S, p->p.loop);
}
/* DEAD TIMER */
ret->lsa_body = LSA_BODY_DUMMY;
if (!tm_active(n->lsrt_timer))
- tm_start(n->lsrt_timer, n->ifa->rxmtint S);
+ {
+ struct ospf_proto *p = n->ifa->oa->po;
+ tm_start_in(n->lsrt_timer, n->ifa->rxmtint S, p->p.loop);
+ }
}
void
/* If we found any flushed LSA, we send them ASAP */
if (tm_active(n->lsrt_timer))
- tm_start(n->lsrt_timer, 0);
+ tm_start_in(n->lsrt_timer, 0, p->p.loop);
}
static int ospf_flood_lsupd(struct ospf_proto *p, struct top_hash_entry **lsa_list, uint lsa_count, uint lsa_min_count, struct ospf_iface *ifa);
static void
ospf_enqueue_lsa(struct ospf_proto *p, struct top_hash_entry *en, struct ospf_iface *ifa)
{
+ ASSERT_DIE(birdloop_inside(p->p.loop));
+
/* Exception for local Grace-LSA, they are flooded synchronously */
if ((en->lsa_type == LSA_T_GR) && (en->lsa.rt == p->router_id))
{
ifa->flood_queue_used++;
if (!ev_active(p->flood_event))
- ev_schedule(p->flood_event);
+ ev_send(proto_event_list(&p->p), p->flood_event);
}
void
if (!EMPTY_SLIST(n->lsrql) && (n->lsrqi == SHEAD(n->lsrql)))
{
ospf_send_lsreq(p, n);
- tm_start(n->lsrq_timer, n->ifa->rxmtint S);
+ tm_start_in(n->lsrq_timer, n->ifa->rxmtint S, p->p.loop);
}
return;
n->myimms = DBDES_IMMS;
n->got_my_rt_lsa = 0;
- tm_start(n->dbdes_timer, 0);
- tm_start(n->ackd_timer, ifa->rxmtint S / 2);
+ tm_start_in(n->dbdes_timer, 0, p->p.loop);
+ tm_start_in(n->ackd_timer, ifa->rxmtint S / 2, p->p.loop);
}
if (state > NEIGHBOR_EXSTART)
ospf_neigh_chstate(n, NEIGHBOR_INIT);
/* Restart inactivity timer */
- tm_start(n->inactim, n->ifa->deadint S);
+ tm_start_in(n->inactim, n->ifa->deadint S, p->p.loop);
break;
case INM_2WAYREC:
p->gr_count++;
n->gr_timer = tm_new_init(n->pool, graceful_restart_timeout, n, 0, 0);
- tm_start(n->gr_timer, gr_time S);
+ tm_start_in(n->gr_timer, gr_time S, p->p.loop);
}
static void
/* Exception for updating grace period */
if (n->gr_active)
{
- tm_start(n->gr_timer, (period S) - (en->lsa.age S));
+ tm_start_in(n->gr_timer, (period S) - (en->lsa.age S), p->p.loop);
return;
}
p->gr_time = c->gr_time;
p->tick = c->tick;
p->disp_timer = tm_new_init(P->pool_up, ospf_disp, p, p->tick S, 0);
- tm_start(p->disp_timer, 100 MS);
+ tm_start_in(p->disp_timer, 100 MS, P->loop);
p->lsab_size = 256;
p->lsab_used = 0;
p->lsab = mb_alloc(P->pool, p->lsab_size);
p->gr_time = new->gr_time;
p->tick = new->tick;
p->disp_timer->recurrent = p->tick S;
- tm_start(p->disp_timer, 10 MS);
+ tm_start_in(p->disp_timer, 10 MS, P->loop);
/* Mark all areas and ifaces */
WALK_LIST(oa, p->area_list)
oa->translator_timer = tm_new_init(p->p.pool, translator_timer_hook, oa, 0, 0);
/* Schedule the end of translation */
- tm_start(oa->translator_timer, oa->ac->transint S);
+ tm_start_in(oa->translator_timer, oa->ac->transint S, p->p.loop);
oa->translate = TRANS_WAIT;
}
}