From fb982c25aa771b7c7425a3c3cce0a2cda0a715de Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Fri, 4 May 2007 20:15:47 +0000 Subject: [bgpd] Trim memory usage of BGP routes 2007-05-03 Paul Jakma * 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 --- bgpd/bgp_snmp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bgpd/bgp_snmp.c') diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index 430521f1..3d26890e 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -797,10 +797,16 @@ bgp4PathAttrTable (struct variable *v, oid name[], size_t *length, return SNMP_INTEGER (1); break; case BGP4PATHATTRAGGREGATORAS: /* 10 */ - return SNMP_INTEGER (binfo->attr->aggregator_as); + if (binfo->attr->extra) + return SNMP_INTEGER (binfo->attr->extra->aggregator_as); + else + return SNMP_INTEGER (0); break; case BGP4PATHATTRAGGREGATORADDR: /* 11 */ - return SNMP_IPADDRESS (binfo->attr->aggregator_addr); + if (binfo->attr->extra) + return SNMP_IPADDRESS (binfo->attr->extra->aggregator_addr); + else + return SNMP_INTEGER (0); break; case BGP4PATHATTRCALCLOCALPREF: /* 12 */ return SNMP_INTEGER (-1); -- cgit v1.2.3 From fb62a3cef5960885119f9e87c833520ddf2a9b49 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Tue, 13 May 2008 20:03:32 +0200 Subject: Make --enable-snmp cross compile and make libcrypto optional with --without-crypto Autoconfig work by me, the rest was done by "Kirill K. Smirnov" --- bgpd/bgp_snmp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bgpd/bgp_snmp.c') diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index 3d26890e..576e3e09 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -23,10 +23,12 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #ifdef HAVE_SNMP #ifdef HAVE_NETSNMP #include -#endif +#include +#else #include #include #include +#endif #include "if.h" #include "log.h" -- cgit v1.2.3