diff options
author | Paul Jakma <paul.jakma@sun.com> | 2006-03-30 13:20:48 +0000 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2006-03-30 13:20:48 +0000 |
commit | cbdfbaa51b600c7b217968b99a9b5a8fbf04bec4 (patch) | |
tree | bb8ce6ac1da775d34796315b1c5ac82e477bbd13 /bgpd/bgp_attr.h | |
parent | 478ccfd61bd61fd6925c84811c2c0e893a38a38b (diff) |
[bgpd] rearrange some structs for less padding, stats for table/attrs.
2006-03-12 Paul Jakma <paul.jakma@sun.com>
* 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.
Diffstat (limited to 'bgpd/bgp_attr.h')
-rw-r--r-- | bgpd/bgp_attr.h | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h index ad0302d8..a018256f 100644 --- a/bgpd/bgp_attr.h +++ b/bgpd/bgp_attr.h @@ -48,30 +48,11 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA /* BGP attribute structure. */ struct attr { - /* Reference count of this attribute. */ - unsigned long refcnt; - - /* Flag of attribute is set or not. */ - u_int32_t flag; - /* Attributes. */ - u_char origin; - struct in_addr nexthop; - u_int32_t med; - u_int32_t local_pref; - as_t aggregator_as; - struct in_addr aggregator_addr; - u_int32_t weight; - struct in_addr originator_id; - struct cluster_list *cluster; - - u_char mp_nexthop_len; #ifdef HAVE_IPV6 struct in6_addr mp_nexthop_global; struct in6_addr mp_nexthop_local; #endif /* HAVE_IPV6 */ - struct in_addr mp_nexthop_global_in; - struct in_addr mp_nexthop_local_in; /* AS Path structure */ struct aspath *aspath; @@ -81,9 +62,31 @@ struct attr /* Extended Communities attribute. */ struct ecommunity *ecommunity; - + + /* Route-Reflector Cluster attribute */ + struct cluster_list *cluster; + /* Unknown transitive attribute. */ struct transit *transit; + + /* Reference count of this attribute. */ + unsigned long refcnt; + + /* Flag of attribute is set or not. */ + u_int32_t flag; + + /* Apart from in6_addr, the remaining static attributes */ + struct in_addr nexthop; + u_int32_t med; + u_int32_t local_pref; + struct in_addr aggregator_addr; + struct in_addr originator_id; + struct in_addr mp_nexthop_global_in; + struct in_addr mp_nexthop_local_in; + u_int32_t weight; + as_t aggregator_as; + u_char origin; + u_char mp_nexthop_len; }; /* Router Reflector related structure. */ @@ -129,6 +132,8 @@ extern void bgp_dump_routes_attr (struct stream *, struct attr *, extern unsigned int attrhash_key_make (struct attr *); extern int attrhash_cmp (struct attr *, struct attr *); extern void attr_show_all (struct vty *); +extern unsigned long int attr_count (void); +extern unsigned long int attr_unknown_count (void); /* Cluster list prototypes. */ extern int cluster_loop_check (struct cluster_list *, struct in_addr); |