version 1.1.1.1, 2012/02/21 17:26:12
|
version 1.1.1.2, 2013/07/21 23:54:38
|
Line 21 Software Foundation, Inc., 59 Temple Place - Suite 330
|
Line 21 Software Foundation, Inc., 59 Temple Place - Suite 330
|
#include <zebra.h> |
#include <zebra.h> |
|
|
#ifdef HAVE_SNMP |
#ifdef HAVE_SNMP |
#ifdef HAVE_NETSNMP |
|
#include <net-snmp/net-snmp-config.h> |
#include <net-snmp/net-snmp-config.h> |
#include <net-snmp/net-snmp-includes.h> |
#include <net-snmp/net-snmp-includes.h> |
#else |
|
#include <asn1.h> |
|
#include <snmp.h> |
|
#include <snmp_impl.h> |
|
#endif |
|
|
|
#include "if.h" |
#include "if.h" |
#include "log.h" |
#include "log.h" |
Line 124 SNMP_LOCAL_VARIABLES
|
Line 118 SNMP_LOCAL_VARIABLES
|
|
|
/* BGP-MIB instances. */ |
/* BGP-MIB instances. */ |
oid bgp_oid [] = { BGP4MIB }; |
oid bgp_oid [] = { BGP4MIB }; |
|
oid bgp_trap_oid [] = { BGP4MIB, 0 }; |
|
|
/* IP address 0.0.0.0. */ |
/* IP address 0.0.0.0. */ |
static struct in_addr bgp_empty_addr = {0}; |
static struct in_addr bgp_empty_addr = {0}; |
Line 460 bgpPeerTable (struct variable *v, oid name[], size_t *
|
Line 455 bgpPeerTable (struct variable *v, oid name[], size_t *
|
static struct in_addr addr; |
static struct in_addr addr; |
struct peer *peer; |
struct peer *peer; |
|
|
*write_method = NULL; | if (smux_header_table(v, name, length, exact, var_len, write_method) |
| == MATCH_FAILED) |
| return NULL; |
memset (&addr, 0, sizeof (struct in_addr)); |
memset (&addr, 0, sizeof (struct in_addr)); |
|
|
peer = bgpPeerTable_lookup (v, name, length, &addr, exact); |
peer = bgpPeerTable_lookup (v, name, length, &addr, exact); |
Line 770 bgp4PathAttrTable (struct variable *v, oid name[], siz
|
Line 767 bgp4PathAttrTable (struct variable *v, oid name[], siz
|
if (! bgp) |
if (! bgp) |
return NULL; |
return NULL; |
|
|
|
if (smux_header_table(v, name, length, exact, var_len, write_method) |
|
== MATCH_FAILED) |
|
return NULL; |
memset (&addr, 0, sizeof (struct prefix_ipv4)); |
memset (&addr, 0, sizeof (struct prefix_ipv4)); |
|
|
binfo = bgp4PathAttrLookup (v, name, length, bgp, &addr, exact); |
binfo = bgp4PathAttrLookup (v, name, length, bgp, &addr, exact); |
Line 839 bgp4PathAttrTable (struct variable *v, oid name[], siz
|
Line 839 bgp4PathAttrTable (struct variable *v, oid name[], siz
|
/* BGP Traps. */ |
/* BGP Traps. */ |
struct trap_object bgpTrapList[] = |
struct trap_object bgpTrapList[] = |
{ |
{ |
{bgpPeerTable, 3, {3, 1, BGPPEERLASTERROR}}, | {3, {3, 1, BGPPEERLASTERROR}}, |
{bgpPeerTable, 3, {3, 1, BGPPEERSTATE}} | {3, {3, 1, BGPPEERSTATE}} |
}; |
}; |
|
|
void |
void |
Line 856 bgpTrapEstablished (struct peer *peer)
|
Line 856 bgpTrapEstablished (struct peer *peer)
|
|
|
oid_copy_addr (index, &addr, IN_ADDR_SIZE); |
oid_copy_addr (index, &addr, IN_ADDR_SIZE); |
|
|
smux_trap (bgp_oid, sizeof bgp_oid / sizeof (oid), | smux_trap (bgp_variables, sizeof bgp_variables / sizeof (struct variable), |
| bgp_trap_oid, sizeof bgp_trap_oid / sizeof (oid), |
| bgp_oid, sizeof bgp_oid / sizeof (oid), |
index, IN_ADDR_SIZE, |
index, IN_ADDR_SIZE, |
bgpTrapList, sizeof bgpTrapList / sizeof (struct trap_object), |
bgpTrapList, sizeof bgpTrapList / sizeof (struct trap_object), |
bm->start_time - bgp_clock (), BGPESTABLISHED); | BGPESTABLISHED); |
} |
} |
|
|
void |
void |
Line 875 bgpTrapBackwardTransition (struct peer *peer)
|
Line 877 bgpTrapBackwardTransition (struct peer *peer)
|
|
|
oid_copy_addr (index, &addr, IN_ADDR_SIZE); |
oid_copy_addr (index, &addr, IN_ADDR_SIZE); |
|
|
smux_trap (bgp_oid, sizeof bgp_oid / sizeof (oid), | smux_trap (bgp_variables, sizeof bgp_variables / sizeof (struct variable), |
| bgp_trap_oid, sizeof bgp_trap_oid / sizeof (oid), |
| bgp_oid, sizeof bgp_oid / sizeof (oid), |
index, IN_ADDR_SIZE, |
index, IN_ADDR_SIZE, |
bgpTrapList, sizeof bgpTrapList / sizeof (struct trap_object), |
bgpTrapList, sizeof bgpTrapList / sizeof (struct trap_object), |
bm->start_time - bgp_clock (), BGPBACKWARDTRANSITION); | BGPBACKWARDTRANSITION); |
} |
} |
|
|
void |
void |