diff options
author | Avneesh Sachdev <avneesh@opensourcerouting.org> | 2012-08-17 17:19:47 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2012-09-26 21:48:48 +0200 |
commit | 3eb8ef37bc463f88bfa36bd26fd43f7f6ad36c20 (patch) | |
tree | 6238a10b945d98b5b06f5bf4620406579d687aa6 /lib/table.h | |
parent | build: fix extract.pl for cross compilation (diff) | |
download | frr-3eb8ef37bc463f88bfa36bd26fd43f7f6ad36c20.tar.xz frr-3eb8ef37bc463f88bfa36bd26fd43f7f6ad36c20.zip |
lib: bring some changes over from bgp_table to table
* lib/table.c
- Maintain table node count. Expose it via the route_table_count()
function (from revision cbdfbaa5).
- route_unlock_node(): Add assertion (from revision 228da428).
- route_table_free(): Make static and fix up cleanup code (from
revision 228da428).
- route_node_delete(): Change to be static.
- Add 'const' qualifier in a couple places.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/table.h')
-rw-r--r-- | lib/table.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/table.h b/lib/table.h index 41d1fa708..1e8df46d5 100644 --- a/lib/table.h +++ b/lib/table.h @@ -27,6 +27,8 @@ struct route_table { struct route_node *top; + + unsigned long count; }; /* Each routing entry. */ @@ -56,14 +58,13 @@ struct route_node extern struct route_table *route_table_init (void); extern void route_table_finish (struct route_table *); extern void route_unlock_node (struct route_node *node); -extern void route_node_delete (struct route_node *node); extern struct route_node *route_top (struct route_table *); extern struct route_node *route_next (struct route_node *); extern struct route_node *route_next_until (struct route_node *, struct route_node *); -extern struct route_node *route_node_get (struct route_table *, +extern struct route_node *route_node_get (struct route_table *const, struct prefix *); -extern struct route_node *route_node_lookup (struct route_table *, +extern struct route_node *route_node_lookup (const struct route_table *, struct prefix *); extern struct route_node *route_lock_node (struct route_node *node); extern struct route_node *route_node_match (const struct route_table *, @@ -75,4 +76,5 @@ extern struct route_node *route_node_match_ipv6 (const struct route_table *, const struct in6_addr *); #endif /* HAVE_IPV6 */ +extern unsigned long route_table_count (const struct route_table *); #endif /* _ZEBRA_TABLE_H */ |