From cbdfbaa51b600c7b217968b99a9b5a8fbf04bec4 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Thu, 30 Mar 2006 13:20:48 +0000 Subject: [bgpd] rearrange some structs for less padding, stats for table/attrs. 2006-03-12 Paul Jakma * bgp_attr.h: (struct attr) rearrange fields to avoid wasted padding between them as much as possible. (attr_count,attr_unknown_count) export new functions to return number of counts of cached attributes. * bgp_attr.c: (attr_count,attr_unknown_count) new functions to return number of counts of cached attributes. * bgp_route.h: (struct bgp_info) rearrange fields to avoid wasted padding. * bgp_table.h: (struct bgp_table) Add a count field, of number of nodes in the table. (struct bgp_node) rearrange fields to avoid wasted padding between them, though I don't think there was any in this case. * bgp_table.c: (bgp_node_{delete,get}) Maintain the table node count. (bgp_table_count) new function to access the table count. --- bgpd/bgp_attr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bgpd/bgp_attr.c') diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 3b27517d..27ddab11 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -274,6 +274,18 @@ transit_init () struct hash *attrhash; +unsigned long int +attr_count (void) +{ + return attrhash->count; +} + +unsigned long int +attr_unknown_count (void) +{ + return transit_hash->count; +} + unsigned int attrhash_key_make (struct attr *attr) { -- cgit v1.2.1