From 5b22683d2f27fcc5954cc9d4d58e55e539414d53 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 18 Oct 1998 11:13:16 +0000 Subject: After contemplating about RIP route timeouts for a long time, I've implemented protocol callbacks for route insertion and deletion from the central table. RIP should maintain its own per-protocol queue of existing routes, scan it periodically and call rte_discard() for routes that have timed out. --- nest/rt-table.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'nest/rt-table.c') diff --git a/nest/rt-table.c b/nest/rt-table.c index e04d599..0b8b793 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -198,8 +198,20 @@ rte_update(net *net, struct proto *p, rte *new) } } if (old) - rte_free(old); + { + if (p->rte_remove) + p->rte_remove(net, old); + rte_free(old); + } new->lastmod = now; + if (p->rte_insert) + p->rte_insert(net, new); +} + +void +rte_discard(net *net, rte *old) /* Non-filtered route deletion, used during garbage collection */ +{ + rte_update(net, old->attrs->proto, NULL); } void -- cgit v1.2.3