[bgpd] Trim memory usage of BGP routes
2007-05-03 Paul Jakma <paul.jakma@sun.com>
* bgp_route.h: (struct info) Move less frequently used
fields to a lazily allocated struct info_extra.
Export bgp_info_extra_get
* bgp_route.c: (bgp_info_extra_new) allocate extra
(bgp_info_extra_free) Free damp info and the info_extra.
(bgp_info_extra_get) Retrieve the info_extra of a struct
info, allocating as required.
(generally) adjust to use info->extra
* bgp_damp.c: (generally) use bgp_info_extra_get to access
dampinfo
* bgp_attr.h: Move rarely allocated attributes from struct attr
to a struct attr_extra, for a substantial saving in size of
struct attr.
* bgp_attr.c: (bgp_attr_extra_{new,free}), new, self-explanatory.
(bgp_attr_extra_get) Get the attr_extra for a given struct
attr, allocating it if needs be.
(bgp_attr_dup) Shallow copy the struct attr and its attr_extra.
(generally) adjust to know about attr->extra.
* bgp_debug.c: (bgp_dump_attr) ditto
* bgp_vty.c: (show_bgp_memory) print attr and info extra sizes.
* bgp_nexthop.c: (generally) adjust to know about attr->extra
and info->extra.
* bgp_{packet,routemap,snmp,zebra}.c: ditto
* lib/memtypes.c: Add MTYPE_ATTR_EXTRA and MTYPE_BGP_ROUTE_EXTRA
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 3787b68..5666cba 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-03 Paul Jakma <paul.jakma@sun.com>
+
+ * memtypes.c: Add MTYPE_ATTR_EXTRA and MTYPE_BGP_ROUTE_EXTRA
+
2007-05-01 David L Stevens <dlstevens@us.ibm.com>
* (general) These changes collectively add route-map and
diff --git a/lib/memtypes.c b/lib/memtypes.c
index 5a685e0..f1b10e7 100644
--- a/lib/memtypes.c
+++ b/lib/memtypes.c
@@ -6,7 +6,7 @@
* The script is sensitive to the format (though not whitespace), see
* the top of memtypes.awk for more details.
*
- * $Id: memtypes.c,v 1.11 2006/03/30 14:09:38 paul Exp $
+ * $Id$
*/
#include "zebra.h"
@@ -96,6 +96,7 @@
{ MTYPE_PEER_GROUP, "Peer group" },
{ MTYPE_PEER_DESC, "Peer description" },
{ MTYPE_ATTR, "BGP attribute" },
+ { MTYPE_ATTR_EXTRA, "BGP extra attributes" },
{ MTYPE_AS_PATH, "BGP aspath" },
{ MTYPE_AS_SEG, "BGP aspath seg" },
{ MTYPE_AS_SEG_DATA, "BGP aspath segment data" },
@@ -104,6 +105,7 @@
{ MTYPE_BGP_TABLE, "BGP table" },
{ MTYPE_BGP_NODE, "BGP node" },
{ MTYPE_BGP_ROUTE, "BGP route" },
+ { MTYPE_BGP_ROUTE_EXTRA, "BGP ancillary route info" },
{ MTYPE_BGP_STATIC, "BGP static" },
{ MTYPE_BGP_ADVERTISE_ATTR, "BGP adv attr" },
{ MTYPE_BGP_ADVERTISE, "BGP adv" },