From: Christian Franke Date: Wed, 18 Jan 2017 22:46:43 +0000 (+0100) Subject: lib: add cleanup hook to route table X-Git-Tag: frr-3.0-branchpoint~59^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a27428eb7164b47b6b227e1be16a87d6e84c551b;p=mirror%2Ffrr.git lib: add cleanup hook to route table --- diff --git a/lib/table.c b/lib/table.c index 075c5584a8..7f789dd3cd 100644 --- a/lib/table.c +++ b/lib/table.c @@ -78,6 +78,8 @@ route_node_set (struct route_table *table, const struct prefix *prefix) static void route_node_free (struct route_table *table, struct route_node *node) { + if (table->cleanup) + table->cleanup(table, node); table->delegate->destroy_node (table->delegate, table, node); } diff --git a/lib/table.h b/lib/table.h index 6997b6bdd5..1691a8e20a 100644 --- a/lib/table.h +++ b/lib/table.h @@ -62,6 +62,7 @@ struct route_table * Delegate that performs certain functions for this table. */ route_table_delegate_t *delegate; + void (*cleanup)(struct route_table *, struct route_node *); unsigned long count;