summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-10-01 15:55:23 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-10-01 15:55:23 +0200
commit961671c0f51693aff34bf3adf5319b35275a86d3 (patch)
tree1eae258f41d0dc67abdc45da6bc16f253a4f23dc /nest
parent0db7a1d69c80b1089f10a268ceacb059db41ced8 (diff)
Lib: Add and use ev_new_init()
Diffstat (limited to 'nest')
-rw-r--r--nest/locks.c3
-rw-r--r--nest/proto.c8
-rw-r--r--nest/rt-table.c4
3 files changed, 4 insertions, 11 deletions
diff --git a/nest/locks.c b/nest/locks.c
index 86c9ff14..812a6534 100644
--- a/nest/locks.c
+++ b/nest/locks.c
@@ -191,6 +191,5 @@ olock_init(void)
{
DBG("olock: init\n");
init_list(&olock_list);
- olock_event = ev_new(&root_pool);
- olock_event->hook = olock_run_event;
+ olock_event = ev_new_init(&root_pool, olock_run_event, NULL);
}
diff --git a/nest/proto.c b/nest/proto.c
index 8a8221a8..7905c9f2 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -291,9 +291,7 @@ channel_do_start(struct channel *c)
add_tail(&c->table->channels, &c->table_node);
c->proto->active_channels++;
- c->feed_event = ev_new(c->proto->pool);
- c->feed_event->data = c;
- c->feed_event->hook = channel_feed_loop;
+ c->feed_event = ev_new_init(c->proto->pool, channel_feed_loop, c);
channel_reset_limit(&c->rx_limit);
channel_reset_limit(&c->in_limit);
@@ -702,9 +700,7 @@ proto_init(struct proto_config *c, node *n)
p->vrf = c->vrf;
insert_node(&p->n, n);
- p->event = ev_new(proto_pool);
- p->event->hook = proto_event;
- p->event->data = p;
+ p->event = ev_new_init(proto_pool, proto_event, p);
PD(p, "Initializing%s", p->disabled ? " [disabled]" : "");
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 036b34c4..4998e292 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -1682,9 +1682,7 @@ rt_setup(pool *p, rtable *t, struct rtable_config *cf)
fib_init(&t->fib, p, t->addr_type, sizeof(net), OFFSETOF(net, n), 0, NULL);
init_list(&t->channels);
- t->rt_event = ev_new(p);
- t->rt_event->hook = rt_event;
- t->rt_event->data = t;
+ t->rt_event = ev_new_init(p, rt_event, t);
t->gc_time = current_time();
}